nav {
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 15px 5%;
    background-color: rgba(2, 12, 27, 0.95); /* Más opaco para mejor lectura */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 127, 255, 0.2);
    position: sticky;
    top: 0;
    width: 100%;
    max-width: 100vw;
    z-index: 1000;
    box-sizing: border-box;
    height: 70px; /* Altura fija para cálculos */
}

nav .logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 1002;
    gap: 12px;
}

nav .logo img {
    height: 40px; /* Ajustado para móvil/desktop */
    width: auto;
    transition: transform 0.4s ease;
}

nav .logo h1 {
    display: block;
    font-size: 1.5rem;
    color: #FFFFFF;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1;
}

nav .logo h1 .highlight {
    color: #FF6B6B;
}

.nav-links {
    display: flex;
    align-items: center;
    margin-left: auto; 
    gap: 20px;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 5px;
    position: relative;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

nav a::after {
    content: '';
    position: absolute;
    width: 100%; height: 2px;
    bottom: 0; left: 0;
    background: linear-gradient(90deg, #007FFF, #FF6B6B);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

nav a:hover { color: #FF6B6B; }

nav a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* --- ELEMENTOS MÓVILES --- */
.hamburger-menu {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px; /* Aumentar área de toque */
    z-index: 1005; /* Encima de todo */
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.hamburger-menu .bar {
    display: block;
    width: 25px; 
    height: 2px;
    background-color: #FFFFFF;
    transition: all 0.3s ease-in-out;
    border-radius: 2px;
}

.mobile-nav {
    display: flex; /* Siempre flex, controlado por transform */
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100vh; /* Pantalla completa */
    background-color: rgba(2, 12, 27, 0.98);
    backdrop-filter: blur(15px);
    flex-direction: column;
    justify-content: flex-start; /* Empezar desde arriba */
    align-items: center;
    padding-top: 100px; /* Espacio para no chocar con header */
    z-index: 1001;
    transform: translateX(100%); /* Oculto a la derecha */
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    opacity: 0;
    pointer-events: none;
}

.mobile-nav.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
}

.mobile-nav ul {
    flex-direction: column;
    text-align: center;
    gap: 40px; /* Más espacio entre enlaces */
    width: 100%;
}

.mobile-nav a { 
    font-size: 1.8rem; /* Texto grande para móvil */
    display: block;
    padding: 10px;
}

@media (max-width: 900px) {
    .nav-links { display: none; }
    .hamburger-menu { display: flex; }
    
    .hamburger-menu.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger-menu.active .bar:nth-child(2) { opacity: 0; }
    .hamburger-menu.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    
    nav .logo h1 { font-size: 1.4rem; }
    nav .logo img { height: 35px; }
}