/* ===== RESET BÁSICO SOLO NAV ===== */
.nav * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== NAVBAR ===== */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
    padding: 0 40px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    font-family: Arial, Helvetica, sans-serif;
    position: sticky;
    top: 0;
    z-index: 10000; /* Asegura que esté por encima de todo */
}

/* ===== LOGO ===== */
.nav-logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-logo img {
    height: 50px;
    cursor: pointer;
}

/* ===== MENÚ DESKTOP ===== */
.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
}

/* ===== LINKS ===== */
.nav-menu a {
    text-decoration: none;
    color: #111;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 2px;
    transition: color 0.2s ease;
}

.nav-menu a:hover {
    color: #0b2fbf;
}

.nav-menu a.active {
    color: #0b2fbf;
    border-bottom: 3px solid #0b2fbf;
}

/* ===== SEPARADORES ===== */
.separator {
    color: #cfcfcf;
    font-size: 16px;
    user-select: none;
}

/* ===== BOTÓN HAMBURGUESA ===== */
.nav-toggle {
    display: none;
    cursor: pointer;
    z-index: 10001;
}

.nav-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #111;
    transition: all 0.3s ease-in-out;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    /* Animación del botón a X cuando está activo */
    .nav-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .nav-toggle.is-active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .nav-toggle.is-active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .nav-menu {
        display: none; /* Se mantiene oculto */
        flex-direction: column;
        position: absolute;
        top: 90px;
        left: 0;
        width: 100%;
        background-color: #ffffff; /* Fondo blanco explícito */
        border-bottom: 2px solid #0b2fbf;
        padding: 20px 0;
        z-index: 9999;
        height: auto; /* IMPORTANTE: Para que el fondo baje con el contenido */
    }

    /* Regla crítica para que el JS funcione */
    .nav-menu.is-active {
        display: flex !important;
    }

    .nav-menu a {
        height: 50px; /* Altura fija en móvil */
        justify-content: center;
        width: 100%;
        padding: 10px 0;
    }

    .nav-menu a.active {
        border-bottom: none; /* Evita que el borde azul se vea raro en vertical */
        background-color: #f9f9f9; /* Sutil destaque */
    }

    .separator {
        display: none;
    }
}
