/* === AJUSTE DE SECCIÓN DE STATS (IGUALADO A TARJETAS) === */
.video-section-stats {
    display: block;
    max-width: 1280px;
    /* Ajuste de 10px para igualar el inicio visual de las tarjetas */
    padding: 10px 10px 0 10px; 
    margin: 40px auto 0 auto !important; 
}

/* TÍTULO EXCLUSIVO DE STATS (MISMA FUENTE Y COLOR QUE TARJETAS) */
.stats-section-title {
    margin-bottom: 40px !important; /* Igualamos el aire (20px margin + 20px gap del grid) */
    margin-top: 0 !important;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-align: left;
    font-family: 'Open Sans', sans-serif;
    display: block;
    width: 100%;
}

/* === EL CONTENEDOR BLANCO (SIN CAMBIOS) === */
.seccion-metricas-tux {
    width: 100% !important;
    max-width: 1280px !important;
    height: 600px !important;
    margin: 0 auto 30px auto !important; 
    background: #ffffff;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    padding: 20px 40px 30px 40px; 
    box-sizing: border-box;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

/* --- ELEMENTOS INTERNOS (INTACTOS) --- */
#chartTitle {
    text-align: center;
    margin: 5px 0 15px 0 !important; 
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1a1a1a;
    font-family: 'Open Sans', sans-serif;
}

#pantalla-stats {
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: center; 
    transition: opacity 0.4s ease; 
}

/* ============================================================
   NUEVOS BOTONES LATERALES (CRISTAL OSCURO)
   ============================================================ */
.nav-stat-btn {
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    transition: all 0.4s ease;

    /* Efecto Cristal Oscuro */
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    font-size: 35px;
    font-family: inherit;
    user-select: none;
}

/* Área de detección invisible de 50px adicionales */
.nav-stat-btn::after {
    content: "";
    position: absolute;
    top: 0;
    height: 100%;
    width: 130px; /* 80px del botón + 50px de margen */
}

.nav-stat-btn.prev { 
    left: 0; 
}

.nav-stat-btn.prev::after {
    left: 0;
}

.nav-stat-btn.next { 
    right: 0; 
}

.nav-stat-btn.next::after {
    right: 0;
}

/* Aparecen solo cuando el ratón entra en el área del botón o su margen */
.nav-stat-btn:hover {
    opacity: 1;
}

.nav-stat-btn:hover {
    background: rgba(0, 0, 0, 0.4);
}

.nav-stat-btn span {
    transition: transform 0.2s ease;
}

.nav-stat-btn:active span {
    transform: scale(0.85);
}

/* ============================================================
   CONTROLES DE ESTADÍSTICAS - MISMO ESTILO QUE EL CARRUSEL
   Siempre fuera de la tarjeta blanca
   ============================================================ */

.nav-bar-stats {
    max-width: 1280px;
    margin: -20px auto 30px;
    padding: 0 52px 0 8px;
}

/* Flechas inferiores exclusivas de móvil; escritorio conserva las laterales. */
.stats-mobile-arrow {
    display: none;
}

/* ============================================================
   MÓVIL: MISMA DISTRIBUCIÓN QUE LA BARRA DEL CARRUSEL
   ============================================================ */

@media (max-width: 480px) {
    .nav-bar-stats {
        padding-left: 12px;
        padding-right: 12px;
    }

    .stats-dots {
        gap: 6px;
    }
}

/* ============================================================
   MÓVIL: ESTADÍSTICAS INTEGRADAS EN EL FONDO DE LA PÁGINA
   La altura se adapta al contenido de cada gráfica.
   Escritorio conserva la tarjeta blanca original.
   ============================================================ */
@media (max-width: 768px) {
    .seccion-metricas-tux {
        width: 100vw !important;
        max-width: none !important;
        height: auto !important;
        min-height: 750px;
        margin: 0 0 0 calc(50% - 50vw) !important;
        padding: 30px 18px 42px;
        box-sizing: border-box;
        background: rgba(255, 255, 255, 0.48);
        border: 0;
        border-top: 1px solid rgba(80, 90, 100, 0.16);
        border-bottom: 1px solid rgba(80, 90, 100, 0.16);
        border-radius: 0;
        box-shadow: 0 8px 22px rgba(25, 35, 45, 0.07);
        overflow: visible;
    }

    #pantalla-stats {
        flex: 1 0 auto;
        min-height: 750px;
        height: auto;
        justify-content: center;
        overflow: visible;
    }

    #chartTitle {
        margin-top: 5px !important;
        margin-bottom: 22px !important;
    }

    /* En móvil se navega con los indicadores inferiores. */
    .seccion-metricas-tux .nav-stat-btn {
        display: none !important;
        pointer-events: none !important;
    }

    .nav-bar-stats {
        width: 100vw;
        max-width: none;
        margin: 8px 0 28px calc(50% - 50vw);
        padding: 0 12px;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .seccion-metricas-tux {
        min-height: 750px;
        padding: 28px 16px 38px;
    }

    #pantalla-stats {
        min-height: 750px;
    }
}