/* ============================================
   ESTILOS DEL NAVBAR
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* Estado inicial: completamente transparente */
    background: transparent;
    backdrop-filter: blur(0px);
    border-bottom: 1px solid transparent;
    z-index: 1000;
    padding: 15px 0;
    /* Transición suave para todos los cambios */
    transition: background 0.3s ease, backdrop-filter 0.3s ease, border-bottom 0.3s ease;
}

/* Estado cuando se hace scroll: fondo visible */
.navbar.scrolled {
    background: rgba(11, 13, 16, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(30, 158, 106, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo a {
    display: inline-block;
    text-decoration: none;
}

.logo a:hover .logo-img {
    transform: scale(1.05);
}

.logo-text {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
    align-items: center;
}

.nav-link {
    color: var(--color-text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    transition: color 0.3s ease;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text);
}

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

.nav-cta {
    padding: 10px 20px !important;
    font-size: 0.9rem !important;
    margin-left: 20px;
    white-space: nowrap;
}

/* Tablet */
@media (max-width: 1024px) {
    .nav-menu {
        gap: 25px;
    }
    
    .nav-link {
        font-size: 0.95rem;
    }
}

/* Botón hamburguesa */
.menu-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    gap: 5px;
    z-index: 1001;
    position: relative;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--color-text);
    border-radius: 3px;
    transition: all 0.3s ease;
}

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

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

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

/* Móvil */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(11, 13, 16, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 80px 30px 30px;
        gap: 0;
        transition: right 0.3s ease;
        z-index: 1001;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        pointer-events: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        width: 100%;
        margin-bottom: 10px;
        position: relative;
        z-index: 1002;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 15px 0;
        display: block;
        width: 100%;
        border-bottom: 1px solid rgba(30, 158, 106, 0.1);
        position: relative;
        z-index: 1002;
        pointer-events: auto;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .nav-cta {
        display: block;
        width: 100%;
        margin-left: 0;
        margin-top: 20px;
        text-align: center;
        position: relative;
        z-index: 1002;
        pointer-events: auto;
        background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%) !important;
        color: #000000 !important;
        opacity: 1 !important;
        cursor: pointer;
    }
    
    .nav-cta:hover,
    .nav-cta:active {
        opacity: 0.9 !important;
        transform: translateY(-2px);
    }

    .logo-text {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }
    
    .navbar {
        padding: 12px 0;
    }
}

/* Overlay cuando el menú está abierto */
@media (max-width: 768px) {
    body.menu-open {
        overflow: hidden;
    }
    
    /* Overlay separado que no bloquea los clics del menú */
    .nav-menu.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1000;
        animation: fadeIn 0.3s ease;
        pointer-events: auto;
    }
    
    /* Asegurar que el contenido del menú esté por encima del overlay */
    .nav-menu.active {
        z-index: 1001;
    }
    
    .nav-menu.active li,
    .nav-menu.active .nav-link,
    .nav-menu.active .nav-cta {
        position: relative;
        z-index: 1002;
        pointer-events: auto;
    }
    
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
}

