/* --- global.css --- */

/* 1. DEFINICIÓN DE VARIABLES (PALETA DE COLORES) */
:root {
    /* --- MODO CLARO (Por Defecto) --- */
    --bg-body: #ffffff;
    --text-main: #1a1a1a;
    --text-secondary: #555555;
    --card-bg: #ffffff;
    --card-border: #eeeeee;
    --header-cat-bg: #f4f4f4; /* Fondo para cabeceras de categoría */
    --accent-color: #0099ff;
    --footer-bg: #111111;
    --nav-text: rgba(255, 255, 255, 0.9); /* El nav suele estar sobre fondos oscuros o imágenes */
}

body.dark-mode {
    /* --- MODO OSCURO (Se activa con JS) --- */
    --bg-body: #0a0a0a;
    --text-main: #f0f0f0;
    --text-secondary: #aaaaaa;
    --card-bg: #161616;
    --card-border: #333333;
    --header-cat-bg: #111111;
}

/* 2. RESET Y ESTILOS BASE */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease; /* Transición suave al cambiar tema */
}

ul { list-style: none; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 3. HEADER */
.main-header {
    position: absolute; width: 100%; top: 0;
    padding: 25px 0; z-index: 100;
}
.nav-container { display: flex; justify-content: space-between; align-items: center; }

.logo {
    font-size: 1.4rem; font-weight: 800; color: white;
    letter-spacing: 1px; text-transform: uppercase;
    display: inline-block; transition: transform 0.3s;
}
.logo:hover { transform: scale(1.05); }

.main-header nav ul { display: flex; gap: 25px; align-items: center; }

.main-header a {
    color: var(--nav-text);
    font-weight: 600; font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 0.5px;
    display: inline-block; transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.main-header a:hover {
    color: #fff; transform: translateY(-3px);
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Botón "Ver Guías" del Header */
.btn-header {
    background-color: var(--accent-color);
    color: white !important;
    padding: 10px 25px; border-radius: 50px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.btn-header:hover {
    background-color: #007acc; transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 153, 255, 0.4);
}

/* 4. BOTÓN INTERRUPTOR DE TEMA (MODO OSCURO) */
.theme-btn {
    background: rgba(255, 255, 255, 0.1); /* Transparente sutil */
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 50%;
    transition: 0.3s;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
}
.theme-btn:hover { background: var(--accent-color); border-color: var(--accent-color); }

/* 5. FOOTER */
.main-footer {
    background-color: var(--footer-bg);
    border-top: 1px solid #333;
    padding: 40px 0; margin-top: 60px; text-align: center;
}
.footer-links { margin-bottom: 20px; }
.footer-links a {
    color: #888; text-decoration: none; margin: 0 15px;
    font-size: 0.95rem; font-weight: 500; transition: color 0.3s ease;
}
.footer-links a:hover { color: var(--accent-color); }
.main-footer p { color: #555; font-size: 0.85rem; }

/* --- Arreglo Definitivo del Header en Móvil --- */
@media (max-width: 768px) {
    .main-header {
        position: relative !important; /* Para que no flote sobre el contenido en móvil */
        padding: 10px 0 !important;
        background: #111 !important; /* Le damos un fondo sólido para que se lea el menú */
    }

    .nav-container {
        flex-direction: column !important;
        text-align: center !important;
        gap: 10px !important;
    }

    .main-header nav ul {
        flex-direction: column !important; /* Menú en lista vertical */
        gap: 8px !important;
        padding-bottom: 10px !important;
    }

    .logo {
        font-size: 1rem !important;
        margin-bottom: 5px !important;
    }

    .main-header a {
        font-size: 0.75rem !important;
        padding: 5px 0 !important;
    }

    .btn-header {
        display: inline-block !important;
        margin-top: 5px !important;
        padding: 8px 20px !important;
    }
}