/*
Theme Name: Divi Child - Custom Navigation
Description: Child theme de Divi con menú de navegación personalizado
Template: Divi
Version: 1.0.0
*/

/* Importar estilos del tema padre */
@import url("../Divi/style.css");

/* ==========================================================================
   MENÚ NAVEGACIÓN PERSONALIZADO
   ========================================================================== */

/* NAVEGACIÓN DESKTOP */
.custom-floating-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 12px 30px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    max-width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    font-family: inherit;
}

.custom-floating-nav.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    transform: translateX(-50%) translateY(-5px);
}

.custom-floating-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 12px;
    position: relative;
}

.custom-floating-nav a:hover {
    color: #000;
    background: rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

/* NAVEGACIÓN MOBILE */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
}

.hamburger-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    padding: 12px;
    cursor: pointer;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.98);
    transform: scale(1.05);
}

.hamburger-icon {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 5px 0;
    transition: 0.3s;
    border-radius: 2px;
    display: block;
}

.hamburger-btn.active .hamburger-icon:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger-btn.active .hamburger-icon:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-icon:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-overlay a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 28px;
    padding: 20px 40px;
    border-radius: 15px;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 200px;
}

.mobile-menu-overlay a:hover {
    background: rgba(0,0,0,0.05);
    color: #000;
    transform: scale(1.05);
}

/* Bloquear scroll cuando menú mobile está activo */
body.mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .custom-floating-nav {
        display: none;
    }
    
    .mobile-nav-toggle {
        display: block;
    }
}

/* Ajustes para elementos de Divi */
.et_pb_section .custom-floating-nav,
.et_pb_row .custom-floating-nav {
    position: fixed !important;
    z-index: 999999 !important;
}

/* Espaciado superior para compensar menú fijo */
.custom-nav-spacing {
    height: 80px;
}

/* ==========================================================================
   CLASES FORCE - MÁXIMA PRIORIDAD
   ========================================================================== */

/* Clase force-top: Máxima prioridad sobre todo */
.custom-floating-nav.force-top {
    position: fixed !important;
    z-index: 2147483647 !important;
    transform: translateX(-50%) translateZ(9999px) !important;
    isolation: isolate !important;
    will-change: transform !important;
    contain: layout style paint !important;
}

.custom-floating-nav.force-top.scrolled {
    transform: translateX(-50%) translateY(-5px) translateZ(9999px) !important;
}

.mobile-nav-toggle.force-top {
    z-index: 2147483647 !important;
    isolation: isolate !important;
}

.mobile-menu-overlay.force-top {
    z-index: 2147483646 !important;
    isolation: isolate !important;
    contain: layout style paint !important;
}

/* Clase nuclear: Destruye todos los z-index de Divi */
.custom-floating-nav.nuclear {
    position: fixed !important;
    z-index: 2147483647 !important;
    transform: translateX(-50%) translate3d(0, 0, 9999px) !important;
    isolation: isolate !important;
    will-change: transform !important;
    contain: layout style paint !important;
    /* Crear nuevo contexto de apilamiento */
    opacity: 0.999 !important;
    filter: none !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

.custom-floating-nav.nuclear.scrolled {
    transform: translateX(-50%) translateY(-5px) translate3d(0, 0, 9999px) !important;
}

.mobile-nav-toggle.nuclear,
.mobile-menu-overlay.nuclear {
    z-index: 2147483647 !important;
    isolation: isolate !important;
    contain: layout style paint !important;
    opacity: 0.999 !important;
}

/* Clase overlay-shield: Crea barrera invisible */
.custom-floating-nav.overlay-shield::before {
    content: '' !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100px !important;
    z-index: 2147483646 !important;
    pointer-events: none !important;
    background: transparent !important;
}

/* Reset completo de Divi para estas clases */
.custom-floating-nav.force-top,
.custom-floating-nav.nuclear,
.custom-floating-nav.overlay-shield {
    /* Anular todos los estilos posibles de Divi */
    margin: 0 !important;
    padding: 12px 30px !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    outline: none !important;
    box-sizing: border-box !important;
    /* Forzar display y posición */
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    /* Anular transforms de Divi */
    transform-origin: center !important;
    backface-visibility: visible !important;
    perspective: none !important;
}

/* Override específicos para elementos problemáticos de Divi */
.et_pb_section *:not(.custom-floating-nav):not(.mobile-nav-toggle):not(.mobile-menu-overlay),
.et_pb_row *:not(.custom-floating-nav):not(.mobile-nav-toggle):not(.mobile-menu-overlay),
.et_pb_column *:not(.custom-floating-nav):not(.mobile-nav-toggle):not(.mobile-menu-overlay) {
    z-index: auto !important;
}

/* Clase mega-force: La opción nuclear final */
.custom-floating-nav.mega-force {
    position: fixed !important;
    z-index: 2147483647 !important;
    transform: translateX(-50%) translate3d(0, 0, 10000px) !important;
    isolation: isolate !important;
    will-change: transform !important;
    contain: layout style paint !important;
    opacity: 0.999 !important;
    filter: none !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    /* Crear stacking context completamente nuevo */
    -webkit-transform-style: preserve-3d !important;
    transform-style: preserve-3d !important;
    /* Forzar aceleración hardware */
    -webkit-transform: translateX(-50%) translate3d(0, 0, 10000px) !important;
    /* Bloquear interferencias */
    pointer-events: auto !important;
}

.mobile-nav-toggle.mega-force,
.mobile-menu-overlay.mega-force {
    z-index: 2147483647 !important;
    isolation: isolate !important;
    contain: layout style paint !important;
    opacity: 0.999 !important;
    transform-style: preserve-3d !important;
    -webkit-transform-style: preserve-3d !important;
}

/* ==========================================================================
   ANIMACIONES Y EFECTOS
   ========================================================================== */

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.custom-floating-nav {
    animation: fadeInDown 0.6s ease;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.mobile-nav-toggle {
    animation: slideInFromRight 0.5s ease;
}

/* Clase force-top: Opción conservadora pero efectiva */
.custom-floating-nav.force-top {
    z-index: 2147483647 !important;
    isolation: isolate !important;
    will-change: transform !important;
}

.custom-floating-nav.force-top.scrolled {
    transform: translateX(-50%) translateY(-5px) !important;
    z-index: 2147483647 !important;
}

.mobile-nav-toggle.force-top {
    z-index: 2147483647 !important;
    isolation: isolate !important;
}

.mobile-menu-overlay.force-top {
    z-index: 2147483646 !important;
    isolation: isolate !important;
}
