/* =========================================================
   NAV V2 — MORPHING PILL NAVIGATION
   ========================================================= */

.nav-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px 60px;
    transition: all 0.4s cubic-bezier(.645, .045, .355, 1);
}

/* La barra de links (la cápsula) */
.nav-bar {
    display: flex;
    align-items: center;
    background: var(--liquid-glass-bg);
    border: 1px solid var(--liquid-glass-border);
    backdrop-filter: blur(var(--liquid-glass-blur));
    -webkit-backdrop-filter: blur(var(--liquid-glass-blur));
    box-shadow: var(--liquid-glass-shadow);
    padding: 8px;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(.645, .045, .355, 1);
    
    /* Estado inicial: visible */
    max-width: 1000px;
    opacity: 1;
}

.nav-links-left, .nav-links-right {
    display: flex;
    gap: 4px;
    transition: 
        max-width 400ms cubic-bezier(.645, .045, .355, 1),
        opacity 300ms cubic-bezier(.645, .045, .355, 1),
        gap 400ms cubic-bezier(.645, .045, .355, 1);
    max-width: 400px;
    opacity: 1;
}

.nav-logo-gap {
    width: 65px; /* Espacio para el logo que flota encima */
    transition: width 400ms cubic-bezier(.645, .045, .355, 1);
}

.nav-bar a {
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 50px;
    transition: all .3s ease;
    white-space: nowrap;
}

.nav-bar a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, .1);
}

.nav-bar a.nav-active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, .12);
}

/* --- ESTADO SCROLLED (Colapsado) --- */
.nav-fixed.nav-scrolled .nav-bar {
    padding: 8px 0;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.nav-fixed.nav-scrolled .nav-links-left,
.nav-fixed.nav-scrolled .nav-links-right {
    max-width: 0;
    opacity: 0;
    gap: 0;
    pointer-events: none;
}

.nav-fixed.nav-scrolled .nav-logo-gap {
    width: 0;
}

/* --- LOGO --- */
.nav-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    transition: all 0.4s cubic-bezier(.645, .045, .355, 1);
}

.nav-logo-img {
    height: 48px;
    width: auto;
    transition: all 0.4s ease;
    display: block;
}

/* Efecto hover: Pulso rápido (abrevia y vuelve) */
.nav-logo:hover {
    transform: translateX(-50%); /* Mantiene el logo centrado sin desplazarse */
}

.nav-logo:hover .nav-logo-img {
    transform: scale(1.12);
}



.nav-fixed.nav-scrolled .nav-logo-img {
    height: 40px;
}

/* --- HAMBURGER --- */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 100;
}

.nav-hamburger span {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--text-primary);
    transition: 0.3s;
}

.nav-hamburger.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* --- MOBILE MENU --- */
.nav-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 25px;
    z-index: 990;
    transition: all 0.5s cubic-bezier(.645, .045, .355, 1);
}

.nav-mobile-menu.active,
.nav-mobile-menu.open {
    right: 0;
}

.nav-mobile-menu a {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'Syne', sans-serif;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .nav-fixed {
        justify-content: space-between;
        padding: 15px 20px;
    }

    .nav-bar {
        display: none !important;
    }

    .nav-hamburger {
        display: flex;
    }

    .nav-logo {
        position: static;
        transform: none;
    }
    
    .nav-logo:hover {
        transform: none;
    }
    
    .nav-fixed.nav-scrolled .nav-logo {
        transform: none;
    }
}
