/* ============================================
   FIXES CRÍTICOS PARA MÓVIL
   Este archivo se carga AL FINAL para sobrescribir conflictos
   ============================================ */

/* ASEGURAR QUE EL BODY NO OCULTE ELEMENTOS FLOTANTES */
html,
body {
    overflow-x: hidden !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100vw !important;
}

/* PREVENIR QUE OTROS CONTENEDORES OCULTEN BOTONES FLOTANTES */
.contenedor,
.footer,
main,
section {
    overflow: visible !important;
}

/* ASEGURAR BOTÓN VOLVER ARRIBA VISIBLE */
.back-to-top {
    position: fixed !important;
    bottom: 2rem !important;
    right: 2rem !important;
    width: 5rem !important;
    height: 5rem !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #82ee1d !important;
    color: #001338 !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 2.4rem !important;
    font-weight: bold !important;
    cursor: pointer !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.back-to-top.show {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ASEGURAR BOTÓN WHATSAPP VISIBLE */
.whatsapp-float {
    position: fixed !important;
    bottom: 2rem !important;
    left: 2rem !important;
    width: 6rem !important;
    height: 6rem !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #25d366 !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    animation: whatsapp-pulse 2s infinite !important;
}

.whatsapp-float svg {
    width: 3.2rem !important;
    height: 3.2rem !important;
    pointer-events: none !important;
}

/* NAVEGACIÓN - SOBRESCRIBIR ESTILOS DE APP.CSS */
@media (max-width: 767px) {
    /* Forzar layout vertical en móvil */
    .navegacion-principal {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1.5rem !important;
        width: 100% !important;
    }

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

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

    .header .contenido-header {
        flex-direction: column !important;
        align-items: center !important;
        gap: 2rem !important;
        padding: 1.5rem !important;
    }

    .header .contenido-header img {
        height: 6rem !important;
    }

    /* Botones flotantes más pequeños en móvil */
    .back-to-top {
        width: 4.5rem !important;
        height: 4.5rem !important;
        font-size: 2rem !important;
        bottom: 1.5rem !important;
        right: 1.5rem !important;
    }

    .whatsapp-float {
        width: 5.5rem !important;
        height: 5.5rem !important;
        bottom: 1.5rem !important;
        left: 1.5rem !important;
    }

    .whatsapp-float svg {
        width: 2.8rem !important;
        height: 2.8rem !important;
    }
}

/* MOBILE PEQUEÑO */
@media (max-width: 480px) {
    .navegacion-principal a {
        font-size: 1.4rem !important;
        padding: 0.8rem 1rem !important;
    }

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

    .back-to-top {
        width: 4rem !important;
        height: 4rem !important;
        font-size: 1.8rem !important;
        bottom: 1rem !important;
        right: 1rem !important;
    }

    .whatsapp-float {
        width: 5rem !important;
        height: 5rem !important;
        bottom: 1rem !important;
        left: 1rem !important;
    }

    .whatsapp-float svg {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
}

/* FIX PARA FOOTER QUE NO OCULTE BOTONES */
.footer {
    padding-bottom: 8rem !important; /* Espacio para botones flotantes */
}

/* ASEGURAR QUE NADA TAPE LOS BOTONES */
* {
    max-width: 100vw !important;
}

/* EXCEPCIONES */
img,
svg,
video,
iframe {
    max-width: 100% !important;
}

.contenedor,
.footer-contenido {
    max-width: 120rem !important;
}

/* FIX PARA GRID QUE SE DESBORDA */
.galeria-participantes,
.columnas2x2,
.columnas3,
.columnas4 {
    max-width: 100% !important;
}

@media (max-width: 600px) {
    .galeria-participantes {
        grid-template-columns: 1fr !important;
    }
}

/* PREVENIR SCROLL HORIZONTAL */
html {
    overflow-x: hidden !important;
}

body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* ASEGURAR VISIBILIDAD EN TODOS LOS DISPOSITIVOS */
@media screen and (max-width: 1024px) {
    /* Asegurar que botones flotantes sean visibles en tablets también */
    .back-to-top,
    .whatsapp-float {
        display: flex !important;
    }
}

/* FIX PARA ANIMACIÓN DE PULSO */
@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* DEBUG: Hacer visible en caso de problemas de visibilidad */
.back-to-top,
.whatsapp-float {
    outline: 2px solid transparent !important; /* Para debug si es necesario */
}

/* ============================================
   FIXES PARA PÁGINA SUPER HEROES
   ============================================ */

/* SOLUCIÓN CRÍTICA: Prevenir desbordamiento horizontal en cards */
.container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 2rem 1.5rem !important;
    box-sizing: border-box !important;
}

/* Forzar responsive en mobile para evitar minmax(280px) */
@media (max-width: 767px) {
    .container {
        grid-template-columns: 1fr !important; /* UNA columna en móvil */
        gap: 2rem !important;
        padding: 1.5rem 1rem !important;
    }

    .card {
        min-height: 35rem !important;
        padding: 3rem 2rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .card h2 {
        font-size: 2.6rem !important;
    }

    .icon-circle {
        width: 10rem !important;
        height: 10rem !important;
        margin-bottom: 2.5rem !important;
    }

    .icon {
        font-size: 5rem !important;
    }

    .btn {
        padding: 1.2rem 3rem !important;
        font-size: 1.4rem !important;
        width: 100% !important;
        max-width: 25rem !important;
    }
}

/* Tablet - 2 columnas */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2.5rem !important;
        padding: 2rem !important;
    }

    .card {
        min-height: 38rem !important;
    }
}

/* Desktop pequeño - 3 columnas */
@media (min-width: 1025px) and (max-width: 1280px) {
    .container {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 3rem !important;
    }
}

/* Desktop grande - 5 columnas (original) pero con mejor spacing */
@media (min-width: 1281px) {
    .container {
        grid-template-columns: repeat(5, 1fr) !important;
        max-width: 140rem !important;
    }
}
