
/* --- RESET BÁSICO --- */
.main-header {
    background: #fff;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 5px solid #CCCCCC;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    /* Empuja elementos a los extremos */
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- BOTÓN HAMBURGUESA --- */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 0;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
}

/* --- LOGO --- */
.logo-img {
    height: 35px;
    display: block;
}

/* --- MENÚ LATERAL --- */
.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 50vw;
    /* Mitad de la pantalla */
    height: 100vh;
    background: #fff;
    z-index: 2000;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);

    /* Estado inicial: Escondido */
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Clase que se añade con JS */
.side-menu.is-active {
    transform: translateX(0);
}

/* BOTÓN CERRAR (X) */
.close-menu {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 35px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}

/* LISTA DE ENLACES */
.menu-list {
    list-style: none;
    padding: 60px 0 0 0;
    margin: 0;
}

.menu-list li {
    border-bottom: 1px solid #f0f0f0;
    /* Línea tenue gris */
}

.menu-list li a {
    display: block;
    padding: 18px 25px;
    text-decoration: none;
    color: #333;
    font-weight: 400;
    font-size: 14px;
    transition: background 0.2s;
}

.menu-list li a:hover {
    background: #f9f9f9;
}

/* OVERLAY (Fondo oscuro) */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
    z-index: 1500;
}

.menu-overlay.is-active {
    visibility: visible;
    opacity: 1;
}

/* --- CONFIGURACIÓN GENERAL PARA ESCRITORIO --- */
@media (min-width: 992px) {

    .nav-container {
        display: flex;
        flex-direction: row;        /* Cambiado a fila (horizontal) */
        justify-content: space-between; /* Logo a la izquierda, menú a la derecha */
        align-items: center;
        gap: 20px;
        padding: 20px 15px;         /* Ajusta el padding lateral según tu diseño */
    }

    /* Ajuste del Logo */
    .logo-link {
        order: 0;                   /* Asegura que vaya a la izquierda */
    }

    .logo-img {
        height: 60px;               /* Ajusta el tamaño según prefieras */
    }

    /* Ajuste del Menú */
    .side-menu {
        order: 1;                   /* Asegura que vaya a la derecha del logo */
        position: static;
        transform: none;
        width: auto;
        height: auto;
        box-shadow: none;
        background: transparent;
        display: block;             /* Asegura que sea visible */
    }

    .menu-list {
        display: flex;              /* Mantiene los botones en fila */
        padding: 0;
        gap: 5px;                   /* Espacio entre botones */
    }

    /* Estilos de los enlaces en escritorio */
    .menu-list li a {
        position: relative;
        text-decoration: none;
        color: #111;
        padding: 10px 15px;         /* Ajustado para mejor apariencia horizontal */
        margin: 0;
        display: inline-block;
        font-size: 16px;            /* Tamaño de fuente más cómodo para escritorio */
    }

    /* Línea animada (tu efecto hover) */
    .menu-list li a::after {
        content: '';
        position: absolute;
        width: 100%;
        height: 2px;
        bottom: 0;
        left: 0;
        background-color: #151822;
        transform: scaleX(0);
        transform-origin: center;
        transition: transform 0.3s ease-out;
    }

    .menu-list li a:hover::after {
        transform: scaleX(1);
    }
    
    .menu-list li a:hover {
        background: transparent;
        color: #000000;
    }

    /* Ocultar elementos exclusivos de móvil */
    .menu-toggle,
    .close-menu,
    .menu-overlay {
        display: none !important;
    }
}

/* --- MANTENER VISTA MÓVIL (Lo que ya teníamos) --- */
@media (max-width: 991px) {

    /* Aquí se mantiene tu diseño de Logo Derecha / Toggle Izquierda */
    .nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}