/* --- 2. NAVEGACIÓN (NAVBAR REPARADA) --- */
.navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0 8%;
    display: flex;
    justify-content: space-between;
    align-items: center; 
    position: fixed;
    width: 100%;
    height: 85px;
    z-index: 2000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

/* Contenedor del Logo */
.logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo img { 
    height: 120px; 
    width: auto;
    object-fit: contain;
    display: block;
    transition: var(--transition);
}

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

.nav-links a {
    text-decoration: none;
    color: var(--secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    position: relative; 
}

.nav-links a:hover { 
    color: var(--primary); 
}

/* --- ESTILO ACTIVO REFORZADO --- */
.nav-links a.active {
    color: var(--primary) !important;
    font-weight: 800 !important;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent);
    border-radius: 2px;
    animation: underlineIn 0.3s ease forwards;
}

/* Botones Especiales en Nav */
.btn-nav {
    background: var(--grad);
    color: white !important;
    padding: 12px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(29, 132, 207, 0.2);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.8rem;
    color: var(--secondary);
    z-index: 2100;
}

@keyframes underlineIn {
    from { width: 0; left: 50%; }
    to { width: 100%; left: 0; }
}

/* --- 3. AJUSTES RESPONSIVE (MENÚ FLOTANTE DERECHA) --- */
@media (max-width: 1024px) {
    .navbar:not(.moviles) {
        display: none !important;
    }

    .navbar.moviles {
        display: flex !important;
        padding: 0 5%;
    }

    .logo img {
        height: 70px;
    }

    .menu-toggle {
        display: block !important;
    }

    .navbar.moviles .nav-links {
        display: flex; 
        flex-direction: column;
        position: fixed;
        
        /* POSICIÓN A LA DERECHA */
        top: 90px;           
        right: 5%;           /* Ajustado para el lado derecho */
        left: auto;          /* Asegura que no se estire desde la izquierda */
        width: 260px;        
        height: auto;        
        padding: 30px 15px;
        
        background: rgba(255, 255, 255, 0.98);
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        gap: 15px;
        z-index: 1999;

        /* --- ANIMACIÓN DESDE LA DERECHA --- */
        opacity: 0;
        visibility: hidden;
        transform: translate(20px, -10px); /* Viene un poco desde la derecha y arriba */
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none; 
    }

    .navbar.moviles .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translate(0, 0); /* Vuelve a su sitio */
        pointer-events: auto;
    }

    .nav-links a {
        font-size: 1rem;
        width: 100%;
        justify-content: center;
        padding: 10px;
    }

    .nav-links a.active::after {
        display: none; 
    }
}
