/* ==========================================================
   INICIO: REGLAS DE CARGA Y TIPOGRAFÍA (MÁXIMA COMPATIBILIDAD)
   ==========================================================*/

/* 1. Importación de fuentes de Google Fonts (DEBE SER LA PRIMERA REGLA) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;800&family=Oswald:wght@700&display=swap');

/* 2. Declaración de la fuente local 'Charlie Bucket' con 3 formatos */
@font-face {
    font-family: 'Charlie Bucket';
    /* El orden es CLAVE para la optimización y la compatibilidad */
    /* ** NOTA: REQUIERE SUBIR CharlieBucket.woff y CharlieBucket.woff2 al servidor ** */
    src: url('fonts/CharlieBucket.woff2') format('woff2'),
         url('fonts/CharlieBucket.woff') format('woff'),
         url('fonts/CharlieBucket.otf') format('opentype'); 
    font-weight: normal;
    font-style: normal;
}

/*==========================================================
 1. VARIABLES Y TIPOGRAFÍA
==========================================================*/

/* Definición de la paleta de colores BASE (Carnaval: Inicio, Historia, Carnaval) - ¡Inspirada en el pez! */
:root {
    --color-primary: #FFC000; /* Amarillo vivo (Logo y acentos activos) */
    
    /* Aguamarina/Cian para títulos (Secundario/Acentos) */
    --color-secondary: #00BCD4; 
    
    /* Rojo Carmesí para botones/banners */
    --color-accent: #DC143C; 
    
    /* FONDO DE NAV/FOOTER/TÍTULOS DE TARJETA: Azul Violeta Oscuro (Carnaval) */
    --color-dark: #8A2BE2; 
    
    --color-light: #F5F5F5; /* Blanco Roto para fondo de contenido principal */
    --color-text-light: #FFFFFF;
    --color-text-dark: #333333; /* Texto oscuro para fondos claros */

    /* Fuentes */
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --font-special: 'Charlie Bucket', cursive; 
}

/* **TEMA DE MOTOVELOCIDAD (SOBRESCRIBE VARS)** */
body.motovelocidad-theme {
    /* Fondos */
    background-color: #000000; 

    /* Colores primarios (Mantenemos BLANCOS Y ROJOS) */
    --color-primary: #FFFFFF; 
    --color-secondary: #DC143C; /* ROJO CARMESÍ (para subtítulos y negritas de MV) */
    --color-accent: #8B0000; 
    --color-vibrant: #5A0000; 
    --color-dark: #111111; /* Se mantiene Negro muy oscuro para MV */
    --color-light: #222222; 
    
    /* Colores de texto */
    --color-text-light: #FFFFFF; 
    --color-text-dark: #E0E0E0; 
    color: var(--color-text-dark); 
}


/* Reset Básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-dark); 
    line-height: 1.6;
    background-color: var(--color-light);
}

a {
    text-decoration: none;
    color: var(--color-secondary);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-accent);
}

/*==========================================================
 2. ESTILOS DE ENCABEZADO Y NAVEGACIÓN
==========================================================*/

.navbar-header {
    width: 100%;
    /* Fondo de Navbar ahora Azul Violeta Oscuro */
    background-color: var(--color-dark); 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1010; 
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 25px;
}

.logo {
    /* CAMBIO FINAL: Se usa !important y ajustes para asegurar que el logo use la fuente en el móvil */
    font-family: var(--font-special) !important; 
    /* Tamaño ajustado para la fuente manuscrita */
    font-size: 1.8rem; /* Reducido ligeramente para mejor ajuste móvil */
    font-weight: normal; 
    color: var(--color-primary); /* Amarillo para el logo */
    letter-spacing: 1.5px;
    line-height: 1;
    white-space: normal;
    padding-top: 5px;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    color: var(--color-text-light);
    font-weight: 600;
    text-transform: uppercase;
    padding: 5px 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-primary); /* Amarillo para activo/hover */
}

.nav-links a.active::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--color-primary); /* Amarillo para la línea activa */
    position: absolute;
    bottom: -5px;
    left: 0;
}

/* --- MENÚ HAMBURGUESA (MÓVIL) --- */
.menu-toggle {
    display: none; 
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.icon-bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--color-text-light);
    border-radius: 10px;
    transition: all 0.3s linear;
}

/*==========================================================
 3. SECCIÓN HERO (PÁGINA INICIO)
==========================================================*/

.hero-section {
    position: relative;
    height: 100vh;
    /* Usamos el nuevo --color-dark como el inicio del degradado */
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-accent) 50%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden; 
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2); 
    display: flex;
    flex-direction: column;
    z-index: 10; 
}

.hero-content {
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20; 
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.subtitle {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--color-light); 
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.hero-content h1 {
    /* Fuente Charlie Bucket para el h1 del Hero */
    font-family: var(--font-special); 
    font-size: 6.5rem; 
    color: var(--color-primary); /* Amarillo vibrante */
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 20px;
    white-space: nowrap; 
}

.cta-text {
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--color-text-light); 
    margin-bottom: 30px;
}

/* --- ICONOS DECORATIVOS (PEZ Y TREN) --- */
.hero-decoration {
    position: absolute;
    z-index: 15; 
    opacity: 0.8;
    transition: transform 0.5s ease;
}

.train-icon {
    width: 180px; 
    bottom: 5%;
    left: 5%;
    transform: rotate(-10deg);
}

.fish-icon {
    width: 180px; 
    top: 10%;
    right: 5%;
    transform: rotate(15deg);
}

/* --- BOTÓN CTA PRINCIPAL --- */
.cta-button {
    /* Fondo del botón a color primario (Amarillo) */
    background-color: var(--color-primary); 
    color: var(--color-text-light);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    padding: 15px 40px;
    border: none;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    /* Ajustamos el color de la sombra para que coincida con el nuevo fondo */
    box-shadow: 0 6px 15px rgba(255, 192, 0, 0.4); 
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    /* Mantenemos el hover en Aguamarina/Cian */
    background-color: var(--color-secondary); 
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 188, 212, 0.6);
}

/*==========================================================
 4. ESTILOS DE CONTENIDO GENERAL
==========================================================*/

body:not(.motovelocidad-theme) {
    background-color: var(--color-light); 
}

.content-section {
    padding: 60px 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    text-align: center;
    color: var(--color-secondary); /* Aguamarina/Cian */
    text-transform: uppercase;
    margin-bottom: 40px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--color-primary); /* Línea amarilla (contraste) */
    display: inline-block;
    width: auto;
    margin-left: auto;
    margin-right: auto;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.content-card {
    background-color: var(--color-text-light);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    /* Borde de tarjeta ahora usa el nuevo --color-dark (Azul Violeta Oscuro) */
    border-top: 5px solid var(--color-dark); 
}

/* Ajuste de tarjeta para el tema oscuro de Motovelocidad */
.motovelocidad-theme .content-card {
    background-color: var(--color-light); 
    border-top-color: var(--color-accent); /* Rojo oscuro para borde */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.motovelocidad-theme .content-card h3 {
    font-family: var(--font-heading); /* Asegurando que los títulos de tarjetas sigan usando Oswald */
    color: var(--color-primary); 
}

.motovelocidad-theme .content-card p {
    color: var(--color-text-dark); 
}

/* REGLA CSS PARA NEGRITAS EN PÁGINAS GENERALES (NO MV) */
/* Estilo para frases destacadas (strong) dentro de los párrafos de las tarjetas */
.content-card p strong {
    font-weight: 800; /* Negrita muy marcada */
    color: var(--color-dark); /* Color Azul Violeta Oscuro para resaltar */
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.content-card h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    /* Título de tarjeta ahora Azul Violeta Oscuro */
    color: var(--color-dark); 
    margin-bottom: 10px;
}

.content-card p {
    font-size: 0.95rem;
    color: var(--color-text-dark); 
    margin-bottom: 15px;
}

.content-card-image {
    width: 100%; /* La imagen ocupará el 100% del ancho de su tarjeta */
    /* *** MODIFICACIÓN PARA UNIFICAR TAMAÑO EN TODAS LAS PÁGINAS (Inicio, Historia, Carnaval) *** */
    height: 200px; /* <--- Altura Fija */
    object-fit: cover; /* <--- Asegura que la imagen cubra el espacio sin distorsionarse */
    /* ***************************************************************************************** */
    
    display: block;
    margin-top: 15px; 
    border-radius: 5px; 
    border: 2px solid var(--color-secondary); /* Aguamarina/Cian */
}

/*==========================================================
 5. ESTILOS DE CARNAVAL
==========================================================*/

.carnaval-hero-graphic {
    background-color: var(--color-accent); /* Rojo Carmesí para el fondo del banner de carnaval */
    padding: 40px 0;
    text-align: center;
}

.carnaval-graphic-container img {
    max-width: 90%;
    height: auto;
    border: 5px solid var(--color-primary); /* Amarillo */
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 192, 0, 0.5);
}

.carnaval-slogan {
    /* Fuente Charlie Bucket para el slogan del carnaval (estilo circense) */
    font-family: var(--font-special); 
    font-size: 2.2rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    margin-top: 20px;
}

/*==========================================================
 6. ESTILOS DE MOTOVELOCIDAD (TEMA Y LAYOUT)
==========================================================*/

/* Títulos de sección de MV usando Rojo Carmesí */
.motovelocidad-theme .section-title,
.motovelocidad-theme .mv-sub-section h3 {
    color: var(--color-secondary); 
}

.mv-main-layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 0;
}

.mv-sidebar {
    width: 250px;
    padding: 20px;
    margin-right: 30px;
    position: sticky;
    top: 80px; 
    height: fit-content;
    background-color: var(--color-light); /* Gris oscuro de MV */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8);
}

.mv-sidebar h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--color-primary); /* BLANCO */
    color: var(--color-primary); /* BLANCO */
    padding-bottom: 5px;
}

.mv-sidebar ul {
    list-style: none;
}

.mv-sidebar li {
    margin-bottom: 10px;
}

.mv-sidebar a {
    color: var(--color-text-dark); /* Gris claro */
    font-weight: 400;
    display: block;
    padding: 8px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.mv-sidebar a:hover,
.mv-sidebar a.mv-active {
    background-color: var(--color-secondary); /* Rojo Carmesí */
    color: var(--color-text-light); /* Blanco */
}

.mv-content-area {
    flex-grow: 1;
    padding: 0 25px; 
}

.mv-sub-section {
    margin-bottom: 40px;
    padding-top: 50px; 
    margin-top: -50px; 
}

.mv-sub-section h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 20px;
    border-left: 5px solid var(--color-secondary); /* Rojo Carmesí */
    padding-left: 10px;
}

/* MODIFICACIÓN SOLICITADA: Reducir imágenes principales de MV */
.mv-sub-section img:not(.mv-racer-card img) {
    max-width: 85%; /* Ligeramente más pequeñas que 100% */
    height: auto;
    max-height: 350px; /* Altura máxima para que no dominen tanto */
    object-fit: cover;
    display: block;
    margin: 20px auto; /* Centrar imágenes y darles margen */
    border-radius: 8px;
    border: 3px solid var(--color-secondary); /* Borde Rojo Carmesí */
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.6);
}

/* Grid de Corredores Icónicos */
.mv-sub-content-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.mv-racer-card {
    flex: 1 1 calc(20% - 20px); 
    min-width: 120px;
    text-align: center;
}

/* MANTENEMOS EL TAMAÑO DE LAS IMÁGENES DE CORREDORES */
.mv-racer-card img {
    width: 100%;
    /* IMAGEN CUADRADA */
    height: 150px; 
    object-fit: cover; 
    /* Esquinas cuadradas */
    border-radius: 0; 
    border: 4px solid var(--color-primary); /* BLANCO */
    margin-bottom: 10px;
}

.mv-racer-card h4 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text-light); /* Blanco */
}

/* =========================================================
   REGLA AÑADIDA PARA EL COLOR ROJO DE NEGRITAS EN MV
   ========================================================= */

/* Aplica el color rojo de los subtítulos (color-secondary en tema MV) a las etiquetas <strong> solo en esta página */
body.motovelocidad-theme .mv-content-area p strong {
    color: var(--color-secondary); /* Rojo Carmesí: #DC143C */
    font-weight: 800;
}


/*==========================================================
 7. FOOTER
==========================================================*/

footer {
    /* Fondo de Footer ahora Azul Violeta Oscuro */
    background-color: var(--color-dark); 
    color: var(--color-text-light);
    padding: 20px 25px;
    text-align: center;
    border-top: 5px solid var(--color-secondary); /* Aguamarina/Cian */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agency-info {
    display: flex;
    align-items: center;
}

.agency-info p {
    margin-right: 15px;
    font-size: 0.8rem;
    opacity: 0.8;
}

.agency-logo {
    width: 60px; 
    height: auto;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.agency-logo:hover {
    opacity: 1;
}

/*==========================================================
 8. MEDIA QUERIES (RESPONSIVE DESIGN)
==========================================================*/

@media (max-width: 900px) {
    
    .hero-content h1 {
        font-size: 4rem; 
        white-space: normal; 
    }

    .cta-text {
        font-size: 1.5rem;
    }
    
    .mv-main-layout {
        flex-direction: column;
    }

    .mv-sidebar {
        width: 100%;
        position: static;
        margin-right: 0;
        margin-bottom: 30px;
    }

    .mv-sidebar ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .mv-sidebar li {
        margin-bottom: 0;
    }

    .mv-sidebar a {
        padding: 5px 15px;
    }
    
    .mv-content-area {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    
    .navbar {
        padding: 10px 15px;
    }

    .logo {
        font-size: 1.5rem; 
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px; 
        left: 0;
        background-color: var(--color-dark);
        border-top: 1px solid var(--color-secondary);
        padding: 20px 0;
        text-align: center;
        z-index: 999;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 10px 0;
    }

    .nav-links a.active::after {
        content: none; 
    }
    
    .menu-toggle.active .icon-bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }
    .menu-toggle.active .icon-bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active .icon-bar:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }
    
    .hero-section {
        height: 80vh;
    }
    
    .hero-content h1 {
        font-size: 3rem;
    }

    .subtitle, .cta-text {
        font-size: 1rem;
    }

    .cta-button {
        font-size: 1.2rem;
        padding: 10px 30px;
    }

    .hero-decoration {
        display: none; 
    }
    
    .content-section {
        padding: 40px 15px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .content-card {
        padding: 20px;
    }

    .carnaval-slogan {
        font-size: 1.5rem;
        padding: 0 15px;
    }

    .mv-racer-card {
        flex: 1 1 calc(50% - 10px); 
    }
    
    footer {
        padding: 20px 15px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .agency-info {
        flex-direction: column;
        margin-top: 15px;
    }
    
    .agency-info p {
        margin-right: 0;
        margin-bottom: 5px;
    }
}