/* ==========================================================================
MODALES Y FORMULARIOS
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 15px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: #ffffff;
    color: #170101;
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #3a0c0c;
    transition: color 0.2s;
    font-weight: bold;
}

.close-modal:hover {
    color: #c5a059;
}

.btn-social-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white !important;
    text-decoration: none;
    padding: 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    transition: opacity 0.2s;
}

.btn-social-contact:hover {
    opacity: 0.9;
}

/* Estilo específico para WhatsApp (verde y moderno) */
.btn-social-contact.btn-whatsapp {
    background: linear-gradient(180deg, #25D366 0%, #1DA851 100%);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.18);
}

.btn-social-contact.btn-whatsapp i {
    transform: translateY(1px);
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #170101;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3a0c0c;
}

.btn-submit-form {
    width: 100%;
    background: #3a0c0c;
    color: white;
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.3s;
}

.btn-submit-form:hover {
    background: #c5a059;
}

@media (max-width: 480px) {
    .modal-box h2 {
        font-size: 1.35rem !important;
    }

    .btn-social-contact {
        font-size: 0.85rem !important;
        padding: 10px;
    }
}

/* ==========================================================================
   TELÉFONO INTERNACIONAL + DESCRIPCIÓN DEL NEGOCIO
   ========================================================================== */
.phone-container {
    display: grid;
    grid-template-columns: minmax(145px, .75fr) minmax(0, 1.45fr);
    gap: 14px;
    align-items: start;
}

.phone-container .form-group {
    min-width: 0;
}

#form-telefono-local {
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}

.phone-help {
    display: block;
    color: #777;
    font-size: .76rem;
    line-height: 1.4;
    margin-top: 6px;
}

.phone-help.error {
    color: #9e2a2b;
    font-weight: 600;
}

.form-group textarea {
    display: block;
    min-height: 135px;
    resize: vertical;
    padding: 13px 14px;
    border: 1px solid #c9c2bc;
    border-radius: 9px;
    background: #fbfaf8;
    color: #241b1b;
    font-size: .95rem;
    line-height: 1.55;
    font-family: 'Segoe UI', Tahoma, Verdana, sans-serif;
    box-sizing: border-box;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.form-group textarea::placeholder {
    color: #8f8882;
    opacity: 1;
}

.form-group textarea:focus {
    background: #ffffff;
    border-color: #6b1426;
    box-shadow: 0 0 0 3px rgba(107, 20, 38, .10);
}

.description-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
    color: #777;
    font-size: .75rem;
}

@media (max-width: 560px) {
    .phone-container {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-group textarea {
        min-height: 120px;
    }
}


/* ==========================================================================
   COMPATIBILIDAD ENTRE NAVEGADORES — CHROME / EDGE / OPERA GX
   ========================================================================== */
#modalForm,
#modalForm * {
    box-sizing: border-box;
}

#modalForm input,
#modalForm select,
#modalForm textarea,
#modalForm button {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

#modalForm input,
#modalForm select,
#modalForm textarea {
    -webkit-appearance: none;
    appearance: none;
}

#modalForm .modal-box {
    overflow-x: hidden;
}

#modalForm .form-group {
    width: 100%;
    min-width: 0;
}

#modalForm .form-group input,
#modalForm .form-group select,
#modalForm .form-group textarea {
    width: 100% !important;
    max-width: 100% !important;
}

#modalForm .form-group textarea {
    min-height: 145px !important;
    height: 145px;
    background: #fbfaf8 !important;
    color: #241b1b !important;
    border: 1px solid #c9c2bc !important;
    border-radius: 10px !important;
    padding: 14px 16px !important;
    line-height: 1.55 !important;
    font-size: 0.96rem !important;
    font-weight: 400 !important;
    letter-spacing: normal !important;
    white-space: pre-wrap;
    resize: vertical;
    outline: none !important;
    caret-color: #6b1426;
    scrollbar-width: thin;
}

#modalForm .form-group textarea::placeholder {
    color: #8d847d !important;
    opacity: 1 !important;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif !important;
    font-weight: 400 !important;
}

#modalForm .form-group textarea:focus {
    background: #ffffff !important;
    border-color: #6b1426 !important;
    box-shadow: 0 0 0 3px rgba(107, 20, 38, 0.12) !important;
}

#modalForm .phone-container {
    grid-template-columns: minmax(150px, 0.75fr) minmax(260px, 1.45fr);
    gap: 18px;
}

#modalForm #form-telefono-local {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif !important;
    font-variant-numeric: tabular-nums;
    font-size: 1rem;
}

#modalForm .phone-help {
    display: block;
    width: 100%;
    margin-top: 7px;
    line-height: 1.35;
    white-space: normal;
}

#modalForm .description-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
}

#modalForm .description-meta span:first-child {
    min-width: 0;
    line-height: 1.4;
}

#modalForm #description-counter {
    white-space: nowrap;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

@supports (-webkit-touch-callout: none) {
    #modalForm .form-group textarea {
        -webkit-text-fill-color: #241b1b;
    }
}

@media (prefers-color-scheme: dark) {
    #modalForm .form-group textarea {
        color-scheme: light;
    }
}

@media (max-width: 680px) {
    #modalForm .phone-container {
        grid-template-columns: 1fr;
        gap: 0;
    }

    #modalForm .description-meta {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    #modalForm #description-counter {
        text-align: left;
    }
}
