/* ====================
   Page: Home
   ==================== */
:root {
    --devir-blue-dark: #080D1FFC;
    /* Navbar bg */
    --devir-hero-bg: #16234A;
    --devir-pink: #CE466C;
    --devir-orange: #EB974A;
    --devir-orange-text: #16224A;
}

body {
    background: #16234A url('../../images/figma/bg-wrapers.png') no-repeat center center fixed;
    background-size: cover;
    margin: 0;
    padding: 0;
}

/* Unificación de fondos para evitar saltos/repeticiones */
.main-bg-wrapper {
    background: url('../../images/figma/bg-op.png') center top / cover no-repeat fixed;
    background-color: #16234A;
    width: 100%;
    position: relative;
}

.main-bg-wrapper.bg-alt {
    background-image: url('../../images/figma/bg-cards.png');
}

.featured-section-bg {
    background-image: url('../../images/figma/bg2-op.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #16234A;
    padding: 4rem 0;
    margin: 0;
    position: relative;
    z-index: 2;
    width: 100%;
}

.content-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Featured Cards Grid */
.featured-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

/* Mobile: Horizontal swipeable slider */
@media (max-width: 768px) {
    .featured-cards-grid {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        gap: 1rem;
        padding: 0 1rem 1rem;
        scrollbar-width: none;
        flex-wrap: nowrap !important;
    }
    
    .featured-cards-grid::-webkit-scrollbar {
        display: none;
    }
    
    .featured-cards-grid .featured-card {
        scroll-snap-align: center;
        flex: 0 0 85% !important;
        min-width: 280px;
        max-width: 320px;
        flex-shrink: 0 !important;
    }
}

/* Stats Section */
.stats-container {
    padding: 8rem 0 4rem;
    background: transparent !important;
    position: relative;
    z-index: 5;
    width: 100%;
    margin-top: -80px;
}

.stats-boxes {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}

.stats-text-content {
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.stat-box {
    width: 210px;
    height: 126px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.stat-box:hover {
    transform: scale(1.05);
}

.stat-box.pink {
    background: linear-gradient(180deg, #EB7A9A 0%, #DD6083 15%, #F82D98 80%);
}

.stat-box.orange {
    background: var(--devir-orange);
}

.stat-number-slot {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
    display: block;
}

.stat-label-slot {
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-box.orange .stat-label-slot,
.stat-box.orange .stat-number-slot {
    color: var(--devir-orange-text);
}

/* Stats Text Styles */
.stats-text-title {
    font-family: 'Graphik', sans-serif;
    font-size: 45px;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
    margin-bottom: 1.5rem;
    text-align: center;
}

.stats-text-subtitle {
    font-family: 'Graphik', sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.4;
    color: #ffffff;
    opacity: 0.9;
    text-align: center;
}

/* Map Section */
#mapa {
    background: transparent !important;
    position: relative;
    padding: 2rem 0 10rem;
    z-index: 5;
    width: 100%;
}

.paper-transition {
    /* Puente: degradado a negro sólido para empatar con el recorte del papel */
    height: 140px;
    width: 100%;
    position: relative;
    z-index: 9;
    margin-top: -120px; /* se mete dentro del final del mapa para tapar el “hachazo” */
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.85) 65%,
        rgba(0, 0, 0, 1) 100% /* Negro sólido para empatar con el borde superior del papel rasgado */
    );
    pointer-events: none;
}

.content {
    background: transparent !important;
}

/* Store CTA Section (Papel rasgado Pink) */
.store-cta-section {
    background-image: url('../../images/figma/bg-medium.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    padding: 8rem 1rem; /* Más altura para que la imagen rosa se vea grande */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    margin-top: -60px;
    margin-bottom: -60px;
    position: relative;
    z-index: 10;
    font-weight: 400;
    min-height: 400px; /* Altura mínima para que se vea bien */
    overflow: hidden; /* Evitar que el contenido se salga del "hachazo" del papel rasgado */
}

.store-cta-section h2 {
    font-family: 'Graphik', sans-serif;
    color: #ffffff;
    font-size: 40px;
    font-weight: 700;
    line-height: 44px;
    letter-spacing: 0;
    text-align: center;
    margin-bottom: 1.25rem; /* Espacio entre h2 y p según Figma */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.store-cta-section p {
    font-family: 'Graphik', sans-serif;
    color: #ffffff;
    font-size: 25px;
    font-weight: 400;
    line-height: 35px; /* Según Figma */
    letter-spacing: 0;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Community CTA (segunda sección con papel rasgado) */
.store-cta-section.community-cta {
    padding: 10rem 1rem; /* Más altura para que la imagen se vea grande */
    min-height: 500px; /* Altura mínima más grande */
    overflow: hidden; /* Evitar que el texto se salga del "hachazo" del papel rasgado */
}

.btn-store-cta {
    font-family: 'Graphik', sans-serif;
    background: #ffffff;
    color: #16224a;
    padding: 0.75rem 2rem;
    border-radius: 5px;
    font-weight: 500;
    font-size: 20px;
    line-height: 22px;
    letter-spacing: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 386px; /* Ancho según Figma */
    height: 47px; /* Altura según Figma */
}

.btn-store-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-store-cta strong {
    font-weight: 800;
}

/* Eventos Section */
#eventos {
    background: transparent !important;
    padding: 10rem 0 8rem;
    position: relative;
    z-index: 5;
    width: 100%;
}

.events-header {
    text-align: center;
    margin-bottom: 4rem;
}

.events-header h2 {
    font-family: 'Graphik', sans-serif;
    color: #ce466c;
    font-size: 40px;
    font-weight: 700;
    line-height: 44px;
    letter-spacing: 0;
    text-align: center;
    margin-bottom: 1.5rem;
    text-transform: none;
}

.events-header p {
    font-family: 'Graphik', sans-serif;
    color: #ffffff;
    font-size: 25px;
    font-weight: 400;
    line-height: 35px;
    letter-spacing: 0;
    text-align: center;
    margin: 0.5rem 0;
}

.events-header .highlight-text {
    font-family: 'Graphik', sans-serif;
    color: #ffffff;
    font-size: 25px;
    font-weight: 400;
    line-height: 35px;
    letter-spacing: 0;
    text-align: center;
    margin: 0.5rem 0;
}

.map-container {
    background: #0b1534;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    margin: 1rem 0; /* Margen reducido */
}

.map-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    background: linear-gradient(135deg, #1f2448 0%, #0d1835 100%);
    color: white;
    padding: 1.5rem;
}

.map-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: none;
}

.map-filters {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.map-filters select,
.map-filters .custom-select-trigger,
.map-filters button.btn-small {
    background: #ffffff;
    color: #16224a;
    border: none;
    border-radius: 4px;
    padding: 0 1.2rem;
    font-weight: 700;
    height: 44px; /* Altura fija para todos */
    min-width: 180px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    box-sizing: border-box;
}

/* Unificación total del estilo de botones y selects */
.map-filters button.btn-small {
    background: linear-gradient(135deg, #eb7a9a 0%, #ce466c 100%);
    color: #ffffff;
    font-weight: 800;
    min-width: 140px;
    justify-content: center;
}

/* Estilo específico para el select nativo */
.map-filters select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2316224a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.map-filters .custom-select-trigger {
    position: relative;
    padding-right: 2.5rem;
}

.map-filters .custom-select-trigger .arrow {
    position: absolute;
    right: 1rem;
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Custom select de juegos con imágenes */
.custom-select-wrapper-juego {
    position: relative;
    display: inline-block;
}

.custom-select-trigger-juego {
    background: #ffffff;
    color: #16224a;
    border: none;
    border-radius: 4px;
    padding: 0 2.5rem 0 1.2rem;
    font-weight: 700;
    height: 44px;
    min-width: 180px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    box-sizing: border-box;
    position: relative;
}

.custom-select-trigger-juego:hover {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.custom-select-trigger-juego .arrow {
    position: absolute;
    right: 1rem;
    font-size: 0.7rem;
    opacity: 0.7;
    transition: transform 0.2s;
}

.custom-select-wrapper-juego.open .arrow {
    transform: rotate(180deg);
}

.custom-options-juego {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 1000;
}

.custom-select-wrapper-juego.open .custom-options-juego {
    max-height: 400px;
    overflow-y: auto;
}

.custom-option-juego {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #16224a;
    font-weight: 600;
    font-size: 0.9rem;
}

.custom-option-juego img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.custom-option-juego:hover {
    background: #f0f2f5;
}

.custom-option-juego.selected {
    background: #e8f4f8;
    font-weight: 700;
}

.custom-select-trigger-juego img {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

#selected-game-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-filters button.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(206, 70, 108, 0.3);
}

@media (min-width: 992px) {
    .map-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }

    .map-filters {
        width: auto;
        justify-content: flex-end;
    }
}

/* Responsive / Mobile Refinement */
@media (max-width: 768px) {
    /* 1. Tipografía Global Mobile */
    .stats-text-title, .events-header h2 {
        font-size: 28px !important;
        line-height: 1.2 !important;
        padding: 0 1rem;
    }

    .stats-text-subtitle, .events-header p, .events-header .highlight-text {
        font-size: 18px !important;
        line-height: 1.4 !important;
        padding: 0 1rem;
    }

    /* 2. Noticias/Anuncios Swipeables */
    .featured-cards-grid {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        padding: 0 1.5rem 1.5rem !important;
        margin: 0 !important;
        scrollbar-width: none;
    }
    .featured-cards-grid::-webkit-scrollbar { display: none; }
    .featured-card {
        flex: 0 0 85% !important;
        scroll-snap-align: center;
        max-width: 300px !important;
    }

    /* 3. Stats Boxes */
    .stats-container {
        padding: 4rem 1rem 2rem;
        margin-top: -20px;
    }
    .stats-boxes {
        gap: 1rem !important;
        margin-bottom: 2rem !important;
    }
    .stat-box {
        width: 45% !important; /* Dos por fila */
        height: 100px !important;
    }
    .stat-number-slot { font-size: 2.2rem !important; }
    .stat-label-slot { font-size: 0.7rem !important; }

    /* 4. Mapa y Filtros */
    .map-header {
        flex-direction: column !important;
        gap: 1rem !important;
        text-align: center;
        padding: 1.5rem 1rem !important;
    }
    .map-header h3 { 
        font-size: 1.2rem !important;
        padding: 0 !important;
    }
    .map-filters {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        width: 100% !important;
        padding: 0 0.5rem !important;
    }
    
    /* TODOS los elementos de filtro con el mismo ancho en mobile */
    .map-filters .custom-select-wrapper,
    .map-filters .custom-select-wrapper-juego,
    .map-filters .custom-select-trigger,
    .map-filters .custom-select-trigger-juego,
    .map-filters button.btn-small {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Custom select de juegos en mobile */
    .custom-select-trigger-juego {
        font-size: 0.85rem !important;
    }
    
    .custom-option-juego {
        font-size: 0.85rem !important;
        padding: 0.65rem 0.85rem !important;
    }
    
    .custom-option-juego img {
        width: 28px !important;
        height: 28px !important;
    }

    /* 5. CTAs Papel Rasgado */
    .store-cta-section {
        padding: 5rem 1.5rem !important;
        min-height: 300px !important;
        background-size: cover !important; /* Para que no se estire */
    }
    .store-cta-section h2 { font-size: 24px !important; line-height: 1.2 !important; }
    .store-cta-section p { font-size: 16px !important; line-height: 1.4 !important; }
    .btn-store-cta {
        width: 100% !important;
        min-width: unset !important;
        font-size: 16px !important;
        height: 52px !important;
        padding: 0 1rem !important;
        margin: 1rem auto 0 auto !important;
        justify-content: center !important;
    }

    /* 6. Ajustes de espaciado */
    #eventos { padding: 4rem 0 !important; }
}
