/* ============================================
   FIXES RESPONSIVE CRÍTICOS
   ============================================ */

/* 1. HEADER - Max width y overflow */
.header {
    max-width: 100%;
    overflow-x: hidden;
}

.header .contenido-header {
    max-width: 100%;
    width: 95%;
    margin: 0 auto;
}

/* 2. NAVEGACIÓN PRINCIPAL - Flex wrap y responsive */
.navegacion-principal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.nav-titulo {
    font-size: 2rem;
    font-weight: 700;
    color: #82ee1d;
    text-transform: uppercase;
    text-align: center;
    width: 100%;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(130, 238, 29, 0.3);
}

.nav-seccion {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.nav-badge {
    font-size: 1.3rem;
    font-weight: 700;
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    text-transform: uppercase;
    display: inline-block;
}

.nav-badge.activa {
    background-color: #82ee1d;
    color: #001338;
}

.nav-badge.finalizada {
    background-color: #666;
    color: #fff;
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .navegacion-principal {
        gap: 1.2rem;
    }

    .nav-titulo {
        font-size: 1.8rem;
    }

    .navegacion-principal a {
        font-size: 2rem; /* Reducir tamaño */
    }

    .nav-seccion {
        gap: 1.2rem;
    }
}

/* Mobile (hasta 768px) */
@media (max-width: 768px) {
    .header .contenido-header {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        padding: 1.5rem;
    }

    .header .contenido-header img {
        height: 6rem; /* Logo más pequeño */
    }

    .navegacion-principal {
        flex-direction: column;
        width: 100%;
        gap: 1.5rem;
    }

    .nav-titulo {
        font-size: 1.6rem;
        padding-bottom: 0.8rem;
    }

    .nav-seccion {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        padding: 1rem 0;
    }

    .nav-badge {
        font-size: 1.2rem;
        padding: 0.4rem 1rem;
    }

    .navegacion-principal a {
        font-size: 1.6rem;
        padding: 0.8rem 1.5rem;
        text-align: center;
        width: 100%;
        display: block;
    }
}

/* Small Mobile (hasta 480px) */
@media (max-width: 480px) {
    .header .contenido-header {
        padding: 1rem;
    }

    .header .contenido-header img {
        height: 5rem;
    }

    .nav-titulo {
        font-size: 1.4rem;
    }

    .nav-badge {
        font-size: 1.1rem;
        padding: 0.3rem 0.8rem;
    }

    .navegacion-principal a {
        font-size: 1.4rem;
        padding: 0.8rem 1rem;
    }
}

/* 3. GRID DE TARJETAS PRINCIPAL (index.php) */
.galeria-participantes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .galeria-participantes {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 600px) {
    .galeria-participantes {
        grid-template-columns: 1fr; /* Una sola columna */
        gap: 2rem;
    }
}

/* 4. CONTENEDOR PRINCIPAL */
.contenedor {
    width: 95%;
    max-width: 120rem;
    margin: 0 auto;
    overflow-x: hidden; /* Evitar scroll horizontal */
}

/* 5. VIDEO RESPONSIVE */
.video {
    position: relative;
    min-height: 50rem;
    max-height: 70rem;
    overflow: hidden;
    width: 100%;
}

@media (max-width: 768px) {
    .video {
        min-height: 35rem;
        max-height: 50rem;
    }

    .contenido-video h2 {
        font-size: 4rem;
    }

    .contenido-video .text-reto .text-princ {
        font-size: 3rem;
    }

    .contenido-video .text-reto .text-sec {
        font-size: 2rem;
    }

    .contenido-video .text-reto .text-fondo {
        width: 90%;
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .video {
        min-height: 25rem;
        max-height: 40rem;
    }

    .contenido-video h2 {
        font-size: 3rem;
    }

    .contenido-video .text-reto .text-princ {
        font-size: 2.5rem;
    }

    .contenido-video .text-reto .text-sec {
        font-size: 1.8rem;
    }
}

/* 6. FOOTER - Asegurar que no se desborde */
.footer {
    max-width: 100%;
    overflow-x: hidden;
}

.footer-contenido {
    width: 95%;
    max-width: 120rem;
    margin: 0 auto;
}

/* 7. IMÁGENES RESPONSIVE */
img {
    max-width: 100%;
    height: auto;
}

/* 8. FORMULARIOS RESPONSIVE */
@media (max-width: 768px) {
    .formulario {
        width: 95%;
        padding: 3rem 2rem;
    }

    .formulario .select-fecha select {
        width: 100%;
        margin-bottom: 1rem;
    }

    .contenedor-genero {
        max-width: 100%;
    }
}

/* 9. TABLAS RESPONSIVE */
@media (max-width: 768px) {
    table.tabla {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* 10. COLUMNAS RESPONSIVE */
@media (max-width: 768px) {
    .columnas2x2,
    .columnas3,
    .columnas4 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .columnas2x2,
    .columnas3,
    .columnas4 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* 11. BOTONES RESPONSIVE */
@media (max-width: 480px) {
    .boton-verde,
    .boton-verde-block,
    .boton-azul,
    .boton-rojo-block,
    .boton-amarillo-block {
        padding: 1.2rem 2rem;
        font-size: 1.6rem;
    }
}

/* 12. OVERLAY FIX PARA MÓVIL */
@media (max-width: 768px) {
    .corredor .overlay {
        bottom: 5%;
    }

    .contenido-imagen h2 {
        font-size: 2rem;
        padding: 0.8rem 1.5rem;
    }

    .contenido-imagen p {
        width: 90%;
        font-size: 1.6rem;
    }
}
