/* =========================================
   RESET OBLIGATORIO
   ========================================= */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden; /* Evita el scroll horizontal en toda la página */
}

/* =========================================
   HEADER (ESTILO FLEXBOX - MÁS SEGURO)
   ========================================= */
header {
    background: #0000007c;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: 990;
    box-shadow: 0px 0px 5px #000000;
    backdrop-filter: blur(3px);
    
    /* CAMBIO MAYOR: Usamos Flexbox en vez de Grid */
    display: flex;
    justify-content: space-between; /* Empuja logo a la izq y menú a la der */
    align-items: center;
    padding: 0 30px; /* Espacio a los lados */
}

/* --- LOGO --- */
/* Envolvemos el selector para asegurar que le afecte */
header > div:first-child img, 
header a img,
#Quimera {
    width: 220px;
    max-width: 100%;
    height: auto;
    display: block;
    transition: all 0.3s ease-in-out;
}

header img:hover {
    filter: drop-shadow(0px 2px 5px #87ddff);
}

/* --- MENÚ DE ESCRITORIO --- */
.opciones {
    height: 100%;
    display: flex;
    align-items: center;
}

.opciones ul {
    list-style: none;
    display: flex;
    gap: 10px; /* Espacio uniforme entre botones */
}

header li {
    font-family: "Josefin Sans", sans-serif;
    font-size: 1.1em;
    color: #fff;
    text-shadow: 2px 2px 5px rgba(255, 255, 255, 0.527);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap; /* Evita que el texto baje de línea */
    padding: 5px 10px;   /* Área de click más cómoda */
}

.seleccionado {
    font-family: "Josefin Sans", sans-serif;
    font-size: 1.1em;
    color: white;
    border-bottom: #57aeff solid 3px;
    text-shadow: 2px 2px 5px #57aeff;
    border-radius: 5px;
    padding: 5px 10px;
    margin: 0 5px;
}

header li:hover {
    border-bottom: #57aeff solid 3px;
    text-shadow: 2px 2px 5px #57aeff;
    border-radius: 5px;
    transform: scale(1.05);
}

a {
    color: #fff;
    text-decoration: none;
}

/* --- BOTÓN HAMBURGUESA (OCULTO EN PC) --- */
#menu {
    display: none;
    font-size: 2em;
    color: white;
    cursor: pointer;
}

/* --- MENÚ DESPLEGABLE MÓVIL (CONTENEDORES) --- */
.allmenu {
    position: absolute;
    top: 100px;
    left: 0;
    width: 100%;
    height: 0; /* Por defecto cerrado */
    visibility: hidden; 
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 999;
}

.menu-responsive {
    background-color: #000000ef;
    width: 250px;
    padding: 20px;
    box-shadow: -2px 2px 5px #000000;
    border-radius: 0 0 0 10px;
    display: none; /* Se maneja con JS o hover según tu lógica */
}
/* Nota: Asumo que tienes un JS que cambia .allmenu a visible o .menu-responsive a block */


/* =========================================
   MEDIA QUERIES (AQUÍ ESTÁ LA SOLUCIÓN)
   ========================================= */

/* PUNTO DE QUIEBRE AGRESIVO (1400px)
   Si la pantalla mide menos de 1400px (casi todas las Laptops),
   automáticamente ocultamos el texto y mostramos la hamburguesa.
   Esto garantiza que NUNCA se vea cortado. */
   
@media (max-width: 1400px) {
    /* Ocultamos la lista de texto completa */
    .opciones ul li {
        display: none;
    }

    /* Mostramos SOLAMENTE el icono de menú */
    #menu {
        display: block; 
        margin-left: auto; /* Empuja el icono a la derecha */
    }

    /* Ajustamos el logo */
    header img {
        width: 180px;
    }
    
    /* Ajuste visual del header */
    header {
        justify-content: space-between;
        padding: 0 20px;
    }
}

/* --- FOOTER (Simplificado para evitar errores) --- */
footer {
    display: grid;
    grid-template-columns: 40% 60%;
    background-color: black;
    align-items: center;
    justify-content: center;
    height: 110px;
    padding: 0 40px;
}

footer img {
    width: 220px;
}

footer li {
    display: inline-block;
    margin: 0 15px;
    font-family: "Josefin Sans", sans-serif;
    color: #fff;
    list-style: none;
}

@media (max-width: 1000px) {
    footer {
        grid-template-columns: 1fr;
        height: auto;
        padding: 20px;
        text-align: center;
        gap: 20px;
    }
    
    footer li {
        display: block;
        margin: 10px 0;
    }
}