/**
 * ==========================================================================
 * LE COMPTOIR DES ESSENCES — MODAL DE CONTACTO (#contacto-modal)
 * Atención al Cliente de la Maison — Colorimetría Canónica (#D4AF37 / #F4F0EC)
 * ==========================================================================
 */

/* 1. TELÓN DE FONDO CON DESENFOQUE CINEMÁTICO */
.contacto-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(5, 5, 5, 0.75);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

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

/* Bloqueo del scroll del body cuando el modal está activo */
body.contacto-modal-open {
    overflow: hidden !important;
}

/* 2. CONTENEDOR GLASSMORPHIC Y BORDE ÁUREO CANÓNICO */
.contacto-modal-container {
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.8), 0 0 15px rgba(212, 175, 55, 0.1);
    width: 100%;
    max-width: 540px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 36px 32px;
    border-radius: 4px;
    position: relative;
    box-sizing: border-box;
    transform: translateY(15px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.contacto-modal-container::-webkit-scrollbar {
    width: 5px;
}

.contacto-modal-container::-webkit-scrollbar-track {
    background: rgba(15, 15, 15, 0.5);
}

.contacto-modal-container::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 2px;
}

.contacto-modal-container::-webkit-scrollbar-thumb:hover {
    background: #D4AF37;
}

.contacto-modal-overlay.is-active .contacto-modal-container {
    transform: translateY(0) scale(1);
}

/* 3. BOTÓN CERRAR */
.contacto-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 24px;
    color: rgba(212, 175, 55, 0.6);
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    padding: 4px 8px;
    transition: color 0.3s ease, transform 0.2s ease;
    z-index: 2;
}

.contacto-modal-close:hover {
    color: #D4AF37;
    transform: scale(1.15);
}

/* 4. CABECERA Y TIPOGRAFÍAS */
.contacto-modal-header {
    text-align: center;
    margin-bottom: 0;
}

.contacto-title {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    letter-spacing: 0.12em;
    color: #D4AF37;
    margin: 0 28px 8px 28px;
    text-align: center;
    line-height: 1.3;
}

.contacto-badge {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: #D4AF37;
    text-transform: uppercase;
    display: block;
    white-space: nowrap;
    margin: 0 auto 12px auto;
}

.contacto-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: #F4F0EC;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 24px;
}

/* 5. FORMULARIO Y CAMPOS DE ENTRADA */
.contacto-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contacto-field-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.contacto-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: #F4F0EC;
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.contacto-input,
.contacto-select,
.contacto-textarea {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: #F4F0EC;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 2px;
    padding: 10px 14px;
    width: 100%;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contacto-input::placeholder,
.contacto-textarea::placeholder {
    color: rgba(244, 240, 236, 0.4);
}

.contacto-input:focus,
.contacto-select:focus,
.contacto-textarea:focus {
    border-color: #D4AF37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}

.contacto-select {
    cursor: pointer;
}

.contacto-select option {
    background: #121212;
    color: #F4F0EC;
    font-family: 'Montserrat', sans-serif;
    padding: 8px;
}

.contacto-textarea {
    resize: vertical;
    min-height: 85px;
}

/* Casillas de consentimiento RGPD y Newsletter */
.contacto-newsletter-consent,
.contacto-legal-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 11px;
    line-height: 1.45;
    font-family: 'Montserrat', sans-serif;
    text-align: left;
}

.contacto-newsletter-consent {
    margin: 12px 0 6px;
    color: #E5E1D8;
}

.contacto-legal-consent {
    margin: 6px 0 16px;
    color: #C8C4BA;
}

.contacto-newsletter-consent input[type="checkbox"],
.contacto-legal-consent input[type="checkbox"] {
    accent-color: #D4AF37;
    margin-top: 2px;
    cursor: pointer;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.contacto-newsletter-consent label,
.contacto-legal-consent label {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.contacto-legal-consent a {
    color: #D4AF37;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.contacto-legal-consent a:hover {
    color: #F4F0EC;
}

/* 6. BOTÓN DE ENVÍO Y RETROALIMENTACIÓN */
.contacto-btn-submit {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    letter-spacing: 0.16em;
    background: rgba(212, 175, 55, 0.1);
    color: #D4AF37;
    border: 1px solid #D4AF37;
    padding: 13px 20px;
    width: 100%;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    margin-top: 10px;
    box-sizing: border-box;
    text-transform: uppercase;
}

.contacto-btn-submit:hover:not(:disabled) {
    background: #D4AF37;
    color: #0A0A0A;
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
}

.contacto-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.contacto-feedback {
    display: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 12.5px;
    color: #D4AF37;
    text-align: center;
    margin-top: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

.contacto-feedback.is-visible {
    display: block;
    animation: contactoFeedbackFade 0.3s ease-out forwards;
}

@keyframes contactoFeedbackFade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 7. ADAPTACIONES RESPONSIVE */
@media (max-width: 640px) {
    .contacto-modal-container {
        padding: 30px 18px 20px;
        max-height: calc(100dvh - 20px);
    }
    .contacto-modal-close {
        top: 10px;
        right: 12px;
        font-size: 24px;
    }
    .contacto-title {
        font-size: 16.5px;
        margin: 2px 24px 6px 24px;
        line-height: 1.25;
    }
    .contacto-badge {
        font-size: 9.5px;
        letter-spacing: 0.15em;
        white-space: nowrap;
        margin: 0 auto 10px auto;
    }
    .contacto-subtitle {
        font-size: 12px;
        line-height: 1.45;
        margin-bottom: 16px;
    }
}

/* Adaptación para pantallas de baja altura (móvil en horizontal / landscape) */
@media (max-height: 550px) {
    .contacto-modal-overlay {
        padding: 8px;
    }
    .contacto-modal-container {
        padding: 20px 24px 16px;
        max-height: calc(100dvh - 16px);
    }
    .contacto-title {
        font-size: 15px;
        margin: 0 24px 4px 24px;
    }
    .contacto-badge {
        font-size: 9px;
        margin: 0 auto 6px auto;
    }
    .contacto-subtitle {
        font-size: 11px;
        line-height: 1.35;
        margin-bottom: 10px;
    }
    .contacto-form {
        gap: 10px;
    }
    .contacto-input,
    .contacto-select,
    .contacto-textarea {
        padding: 7px 10px;
        font-size: 12px;
    }
    .contacto-textarea {
        min-height: 48px;
    }
    .contacto-btn-submit {
        padding: 10px 16px;
        margin-top: 6px;
    }
}
