/* --- NAV MASTER CSS - DRA. ANDREA CARDONA --- */
/* Navegación Premium con efecto Glassmorphism y "Clase Oro" */

:root {
    --nav-bg: rgba(23, 18, 22, 0.85);
    /* Fondo oscuro semitransparente */
    --nav-gold: #c9a66b;
    --nav-cyan: #16c4e0;
    --nav-height: 80px;
    --nav-height-sticky: 70px;
}

/* HEADER PRINCIPAL */
.header-master {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    padding: 0 5%;
    background: rgba(255, 255, 255, 0.03);
    /* Tinte de luz para efecto vidrio */
    backdrop-filter: blur(40px);
    /* Desenfoque mucho más agresivo */
    -webkit-backdrop-filter: blur(40px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.header-master.sticky {
    height: var(--nav-height-sticky);
    background: rgba(23, 18, 22, 0.6);
    /* Transparencia equilibrada para el scroll */
    backdrop-filter: blur(40px);
    /* Mantiene el desenfoque agresivo */
    -webkit-backdrop-filter: blur(40px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(201, 166, 107, 0.3);
    /* Un toque de oro en el borde */
}

/* LOGO */
.nav-logo {
    height: 50px;
    transition: all 0.4s ease;
}

.header-master.sticky .nav-logo {
    height: 40px;
}

.nav-logo img {
    height: 100%;
    width: auto;
    filter: brightness(1.1);
}

/* NAVEGACIÓN DESKTOP */
.nav-menu {
    position: fixed;
    /* Ahora que es hermano del header, debe ser fijo para superponerse */
    top: 0;
    left: 0;
    /* Empieza desde la izquierda */
    width: 100%;
    /* Ocupa todo el ancho */
    height: var(--nav-height);
    display: flex;
    justify-content: flex-end;
    /* Empuja los links a la derecha */
    padding-right: 5%;
    /* Alinea con el CTA y el logo */
    gap: 35px;
    align-items: center;
    z-index: 1001;
    transition: all 0.4s ease;
    pointer-events: none;
    /* Deja pasar clicks al header si no es un link */
}

.nav-menu * {
    pointer-events: auto;
}

/* Reactiva clicks en los links */

.header-master.sticky+.nav-menu {
    height: var(--nav-height-sticky);
}

.nav-link {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Inter', sans-serif;
}

.nav-link:hover {
    color: var(--nav-cyan);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--nav-cyan);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active,
.dropdown-link.active {
    color: var(--nav-cyan) !important;
}

/* BOTÓN CTA MENÚ */
.nav-cta {
    background: var(--nav-cyan);
    color: white !important;
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(22, 196, 224, 0.3);
}

.nav-cta::after {
    display: none;
}

.nav-cta:hover {
    transform: translateY(-2px);
    background: white;
    color: var(--nav-cyan) !important;
    box-shadow: 0 8px 25px rgba(22, 196, 224, 0.5);
}

/* CLASE PARA OCULTAR EN SCROLL */
.header-master.nav-hidden,
.nav-menu.nav-hidden {
    transform: translateY(-100%) !important;
    pointer-events: none;
    /* Evita clics invisibles */
}

/* MEGA-MENÚ SERVICIOS (DESKTOP) */
.nav-dropdown {
    position: static;
}

.dropdown-content {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background: rgba(23, 18, 22, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-bottom: 2px solid var(--nav-cyan);
    padding: 60px 8%;
    /* Espacio generoso lateral */
    display: flex;
    justify-content: center;
    /* Centra las columnas en pantallas grandes */
    gap: 60px;
    /* Mayor separación entre categorías */
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
}

.header-master.sticky .dropdown-content {
    top: var(--nav-height-sticky);
}

.nav-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-col {
    flex: 1;
    max-width: 300px;
    /* Ancho base para las columnas */
}

/* COLUMNA FACIAL ESPECIAL (Ancho doble con 2 sub-columnas de CATEGORÍAS solamente) */
#colFacial {
    max-width: 550px;
    flex: 1.5;
}

#colFacial>.mega-sub-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
}

/* El grupo de "Regeneración" en la segunda columna, debajo de "Cuidado" */
#colFacial .mega-sub-group:nth-child(2),
#colFacial .mega-sub-group:nth-child(3) {
    grid-column: 2;
}

#colFacial .mega-sub-group:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / span 3;
    /* Ocupa toda la altura de la izquierda */
}

.mega-col h4 {
    color: var(--nav-cyan);
    font-family: 'Nexa', sans-serif;
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(22, 196, 224, 0.2);
}

.mega-sub-group {
    margin-bottom: 35px;
}

.mega-list {
    list-style: none;
}

.mega-sub-group h5 {
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 15px;
    opacity: 0.5;
    letter-spacing: 1.5px;
}

.dropdown-link {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 0;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.dropdown-link:hover {
    color: var(--nav-cyan);
    transform: translateX(10px);
}

/* --- SISTEMA DE ACTIVACIÓN MÓVIL (HAMBURGUESA) --- */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
    position: relative;
    margin-left: auto;
    /* Fuerza el icono a la derecha */
}

.mobile-toggle span {
    width: 30px;
    height: 2px;
    background: white;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

@media (max-width: 900px) {
    .header-master {
        width: 100% !important;
        /* Cambiado de 100vw para evitar saltos */
        left: 0 !important;
        z-index: 10001 !important;
        transition: background 0.3s ease;
    }

    /* Cuando el menú está abierto, el header es transparente para no tapar el vidrio del menú */
    .header-master.menu-open {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-bottom: none !important;
        box-shadow: none !important;
    }

    .mobile-toggle {
        display: flex;
        z-index: 10002 !important;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100vh !important;
        /* Forzado para ignorar reglas de escritorio */
        height: 100dvh !important;
        background: rgba(23, 18, 22, 0.85);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 100px 8%;
        transform: translateX(100%);
        visibility: hidden;
        /* Evita que ocupe espacio mientras está oculto */
        transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1), visibility 0.6s;
        overflow-y: auto;
        text-align: left;
        z-index: 9999 !important;
        border-left: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-menu.active {
        transform: translateX(0);
        visibility: visible;
    }

    .nav-dropdown {
        width: 100% !important;
        /* Crítico para que el has-sub use space-between */
    }

    .nav-link {
        font-size: 1.2rem;
        padding: 18px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        text-align: left !important;
        flex-wrap: nowrap !important;
        /* Prohíbe el salto de línea */
    }

    .nav-link.has-sub::after {
        content: '+';
        position: static !important;
        /* Rompe la posición absoluta del subrayado */
        bottom: auto !important;
        left: auto !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        font-family: 'Inter', sans-serif;
        font-size: 1.4rem;
        font-weight: 200;
        transition: transform 0.3s;
        margin-left: 15px;
        display: inline-flex !important;
    }

    .nav-dropdown.active>.nav-link.has-sub::after {
        transform: rotate(45deg);
    }

    /* Reset de Columnas Faciales para Móvil */
    #colFacial>.mega-sub-list {
        display: none;
        /* Forzar el ocultamiento inicial (anula el grid de desktop) */
        padding-left: 15px;
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    /* Mostrar cuando la columna esté activa */
    #colFacial.active>.mega-sub-list {
        display: flex !important;
        flex-direction: column !important;
    }

    #colFacial .mega-sub-group:nth-child(n) {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    /* Contenedores de Acordeón */
    .dropdown-content,
    .mega-sub-list {
        display: none;
        flex-direction: column;
        gap: 0;
        padding: 0;
        position: static;
        background: rgba(255, 255, 255, 0.02);
        box-shadow: none;
        border: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        width: 100%;
    }

    .nav-dropdown.active>.dropdown-content {
        display: flex;
    }

    .mega-col.active>.mega-sub-list {
        display: flex;
    }

    /* REGLA CRÍTICA NIVE 2 */
    .mega-sub-group.active>.mega-sub-list {
        display: flex;
    }

    .mega-col {
        width: 100% !important;
        max-width: none !important;
        padding: 0 5%;
    }

    .mega-col h4,
    .mega-sub-group h5 {
        font-size: 0.95rem;
        padding: 15px 0;
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
        display: flex !important;
        /* Refuerzo Flex */
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        cursor: pointer;
        opacity: 0.9;
        color: white;
        width: 100%;
        text-align: left;
    }

    .mega-col h4::after,
    .mega-sub-group h5::after {
        content: '›';
        font-family: 'Inter', sans-serif;
        font-size: 1.4rem;
        color: var(--nav-cyan);
        transition: transform 0.3s;
        margin-left: 10px;
        display: block;
    }

    .mega-col.active h4::after,
    .mega-sub-group.active h5::after {
        transform: rotate(90deg);
    }

    .dropdown-link {
        padding: 12px 15px;
        font-size: 0.9rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.02);
        color: rgba(255, 255, 255, 0.6);
        display: block;
        width: 100%;
    }

    .nav-cta {
        margin: 40px 0;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center;
        width: 100% !important;
        padding: 18px !important;
        border-radius: 100px !important;
        font-size: 1.1rem !important;
        letter-spacing: 1px;
    }
}

/* --- ESTILOS COMPLEMENTARIOS FORMULARIO INTELIGENTE --- */
.contact-form input,
.contact-form select,
.contact-form textarea {
    transition: all 0.3s ease;
    outline: none;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    border-color: var(--nav-cyan) !important;
    background: rgba(22, 196, 224, 0.05) !important;
    box-shadow: 0 0 15px rgba(22, 196, 224, 0.2);
}

.contact-form select option {
    background: #171216;
    color: white;
}

.contact-form optgroup {
    background: #0f0c0e;
    color: var(--nav-cyan);
    font-weight: bold;
    font-style: normal;
    padding: 10px;
}

.contact-form select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- FOOTER MAESTRO RESPONSIVO --- */
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 50px !important;
        text-align: center !important;
    }

    /* Orden solicitado: Logo, Síguenos, Contacto, Menú, Legal */
    .footer-col-logo {
        order: 1;
    }

    .footer-col-social {
        order: 2;
    }

    .footer-col-contact {
        order: 3;
    }

    .footer-col-menu {
        order: 4;
    }

    .footer-col-legal {
        order: 5;
    }

    .footer-grid>div {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-grid img {
        margin: 0 auto 15px !important;
    }

    /* Ajuste para iconos sociales centrados */
    .footer-grid .social-links {
        justify-content: center !important;
    }
}

/* --- FORMULARIO MAESTRO PREMIUM --- */
.form-container-master {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(24, 20, 24, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 60px;
    border-radius: 30px;
    border: 1px solid rgba(22, 196, 224, 0.2);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.form-master .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-master input,
.form-master select,
.form-master textarea {
    width: 100%;
    padding: 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.form-master select option {
    background-color: #171216;
    color: white;
}

.form-master input:focus,
.form-master select:focus,
.form-master textarea:focus {
    border-color: var(--nav-cyan) !important;
    background: rgba(22, 196, 224, 0.05) !important;
    outline: none;
    box-shadow: 0 0 20px rgba(22, 196, 224, 0.15);
}

.btn-standard-cta, .btn-premium-cta {
    display: inline-block;
    text-decoration: none;
    width: 100%;
    padding: 22px;
    font-size: 1.1rem;
    font-weight: 900;
    font-family: 'Nexa', sans-serif;
    color: white;
    background: var(--nav-cyan);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(22, 196, 224, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.btn-standard-cta:hover, .btn-premium-cta:hover {
    transform: translateY(-5px);
    background: white;
    color: var(--nav-cyan);
    box-shadow: 0 20px 40px rgba(22, 196, 224, 0.5);
}

/* Responsive Form */
@media (max-width: 600px) {
    .form-container-master {
        padding: 30px 20px;
    }

    .form-master .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .btn-standard-cta, .btn-premium-cta {
        padding: 18px;
        font-size: 1rem;
    }
}