/* ================================================
   1. VARIABLES DE TEMA (DEBE IR PRIMERO)
   ================================================ */
:root {
    --background: #333333;
    --color: #f0f0f0;
    --primary-color: #0d79e6;
    --glass-color: rgba(255, 255, 255, 0.1); 
    
    --header-height: 120px;
    --nav-height: 45px;
    --total-fixed-height: calc(var(--header-height) + var(--nav-height));
}

/* ================================================
   2. ESTILOS BASE Y LAYOUT GENERAL
   ================================================ */

/* Empuja el contenido hacia abajo para evitar que se esconda bajo el menú fijo */
body {
    background: var(--background);
    color: var(--color);
    margin: 0;
    padding: 0;
    /* 🛑 CRÍTICO: padding-top igual a la altura combinada de cabecera y nav */
    padding-top: var(--total-fixed-height); 
    min-height: 100vh;
}

main {
    flex-grow: 1; 
    padding-bottom: 20px;
    padding-top: 20px;
}

/* Cabecera principal: FIJA */
#cabecera {
    display: flex;
    justify-content: center;
    align-items: center;
    height: var(--header-height);
    background: #111;
    color: #fff;
    
    position: fixed; 
    top: 0;
    width: 100%;
    z-index: 1000;
}

/* Pie de Página */
footer {
    background-color: var(--primary-color);
    color: var(--color);
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden; 
    margin-top: 40px;
    border-top: 5px solid var(--background);
    z-index: 10;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-info {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

/* --- ESTILO CRÍTICO PARA LA IMAGEN DEL GATO --- */
.pie-imagen {
    position: relative;
    width: 200px;
    height: 210px;
    margin-right: 40px;
    margin-bottom: 20px;
    bottom: 10px;
    left: -290px;
}

.gato-footer {
    width: 100%;
    height: auto;
    position: absolute;
    bottom: -10px;
    left: 0;
    object-fit: contain;
    z-index: 1;
}

/* ================================================
   3. ESTILOS DE NAVEGACIÓN Y MENÚ FIJO
   ================================================ */
nav {
    background: linear-gradient(to bottom, #918989, #ccc); 
    width: 100%;
    
    position: fixed;
    top: var(--header-height); 
    z-index: 999; 

    display: flex;
    align-items: center;
    padding: 0 10px;
    height: var(--nav-height);
}

/* Lista de navegación */
.nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-grow: 1;
    margin-right: auto;
}

/* Lista de perfil (Derecha) */
.nav-profile {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex; 
    align-items: center;
    gap: 15px; 
}

.nav li.saludo-sesion {
    margin-top: 5px; 
}
.nav li.saludo-sesion span {
    padding: 5px 10px; 
    line-height: 20px; 
}

.nav > li {
    position: relative;
}

/* Enlaces del menú */
.nav li a, .nav-dropdown li a {
    display: block;
    padding: 12px 18px 14px;
    text-decoration: none;
    color: #FFFFFF;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    border-radius: 6px;
    background: var(--primary-color);
    transition: background 0.2s, color 0.2s;
}
.nav li ul {
    display: none;
    min-width: 140px;
    z-index: 1000;
    background: #A9A9A9;
    border: 1px solid #888888; 
}
.nav li:hover > ul {
    display: block;
}
.nav li a:hover {
    background: #4e4d4d;
    color: #000;
}
.nav li a.resalto {
    background: #0d79e6;
    color: #fff;
}

/* ================================================
   DROPDOWN MENU
   ================================================ */
.dropdown { position: relative; }
.dropbtn { cursor: pointer; }
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #8b1313;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 5px;
    top: 41px;
    left: 0;
}
.dropdown-content a {
    color: var(--color, black);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.dropbtn::after {
    content: '⏷'; 
    margin-left: 6px;
    font-size: 0.5em;
    vertical-align: middle;
}
.dropdown-content a:hover { background-color: #ddd; }
.dropdown:hover .dropdown-content { display: block; }
.dropdown:hover .dropbtn { background-color: #ddd; }

/* Clase adicional para elementos destacados (SALIR) */
.resalto {
    color: #f0e7e7 !important;
    background: #e95a22 !important; 
    border-radius: 6px;
    padding: 10px 18px;
    font-weight: bold;
    transition: background 0.3s;
}
.resalto:hover {
    background: #c0392b !important; 
    color: #ffe700 !important;
}

/* ================================================
   IMAGEN PARA USUARIO (AVATAR)
   ================================================ */
.profile-icon-link {
    display: inline-block;
    padding: 5px; 
}

.profile-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    margin-top: 5px; 
}

/* ================================================
   BANNER ANIMADO DE IMÁGENES
   ================================================ */
.banner {
    position: relative;
    overflow: hidden;
    height: 200px;
    width: 100%;
}
.banner-track {
    display: flex;
    width: max-content;
    animation: scroll 20s linear infinite;
}
.banner img {
    height: 200px;
    width: 600px;
    margin-right: 10px;
    border-radius: 5px;
    object-fit: cover;
    max-width: 100%;
}
@keyframes scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ================================================
   SECCION REDES SOCIALES
   ================================================ */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 16px 0;
    flex-wrap: wrap;
}
.social-icons a {
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    background: #333;
    transition: background 0.3s;
    font-size: 1.1em;
}
.social-icons a:hover {
    background: #555;
    transform: scale(1.05);
}

/* ================================================
   TIPOGRAFÍA GLOBAL (En lugar de Texto del Login)
   ================================================ */
a {
    text-decoration: none;
    color: var(--color); 
}
h1 {
    font-size: 2.5rem;
    color: var(--color); 
}
h1, h2, h3, h4, h5, h6 {
    margin: 24px 0 8px 0;
    text-align: left;
    color: #fff; /* Hereda de _base.css */
    background: none;
}

/* ================================================
   RESPONSIVE DESIGN - MÓVILES Y TABLETS
   ================================================ */
/* 🛑 BLOQUE RESPONSIVE FUSIONADO Y ÚNICO 🛑 */
@media (max-width: 700px) {
    /* Menú se vuelve vertical en móvil */
    .nav {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }
    .nav li a {
        padding: 12px 10px;
        font-size: 16px;
        text-align: left;
        background: #f3eded;
    }
    
    /* Menú deja de ser fijo en móvil */
    nav {
        position: static; 
        top: 0 !important;
        height: auto;
    }
    .nav-profile {
        justify-content: center;
        margin-top: 10px;
    }
    
    /* 🛑 CRÍTICO: Restaurar padding del body si la navegación deja de ser fija */
    body {
        padding-top: var(--header-height); /* Solo la altura de la cabecera */
    }

    /* Banner más pequeño en móvil */
    .banner { height: 120px; }
    .banner img { height: 120px; width: 95vw; margin-right: 4px; }
    .banner-track { animation: scroll 12s linear infinite; }

    /* Redes sociales en móvil */
    .social-icons {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    /* Gato en móvil (Centrado) */
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    .pie-imagen {
        margin-right: 0;
        margin-bottom: 20px;
        margin-left: auto;
        margin-right: auto;
        /* 3. Le damos un tamaño para que no sea gigante */
        max-width: 150px; /* <-- Ajusta este tamaño si quieres */
    }
    .gato-footer {
        position: static;  /* <-- Lo vuelve un bloque normal, IGNORA 'bottom'/'left' */
        bottom: auto;      /* <-- Resetea 'bottom: -30px' */
        left: auto;        /* <-- Resetea 'left: 50%' */
        transform: none;   /* <-- Resetea 'translateX(-50%)' */
        /* 5. Hacemos que la imagen ocupe el 100% de su contenedor (150px) */
        width: 100%;
        height: auto;
    }
}