/* === base carousel === */
.datos-actualizados-section {
    background: #e0ecd9;
    padding: 60px 0;
}

.datos-title {
    text-align: center;
    color: #254934;
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.datos-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
}

.municipios-carousel {
    overflow-x: hidden;
    /* recorta solo en X */
    overflow-y: visible;
    /* permite el hover hacia arriba */
    position: relative;
    padding-bottom: 40px;
    /* espacio extra para el hover */
}

.track {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    margin-top: 20px;
    width: max-content;
    animation: scroll 600s linear infinite;
}

.track-left {
    animation-direction: reverse;
}

@keyframes scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.municipio-card {
    flex: 0 0 auto;
    width: 240px;
    height: 120px;
    margin-bottom: 12px;
    /* separa filas */
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    transition: transform .3s, box-shadow .3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.municipio-card.dark {
    background: #254934;
    color: #fff;
}

.municipio-card.light {
    background: #c3b75c;
    color: #fff;
}

.municipio-card:hover {
    transform: translateY(-12px);
    z-index: 10;
    /* por encima de vecinos */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.invisible {
    visibility: hidden;
}

/* === pop-out detalle === */
.gallery-detail {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 20px;
    /* radio más generoso */
    overflow: hidden;
    /* recorta header y body */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    min-width: 300px;
    font-family: "Segoe UI", sans-serif;
    z-index: 1000;
}

.gallery-detail.hidden {
    display: none;
}

/* header oscuro con cierre */
.gallery-detail .popup-header {
    background: #254934;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.gallery-detail .popup-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #fff;
    /* forzamos texto blanco */
}

.gallery-detail .popup-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
}

/* stats estilo hero */
.gallery-detail .gallery-stats {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    /* ligero contraste */
}

/* tarjetas internas */
.gallery-detail .gallery-stats .card-info {
    border-radius: 12px;
    /* suaviza esquinas */
}

/* --- Responsive para el pop-up de detalle --- */
@media (max-width: 600px) {
    .gallery-detail {
        min-width: unset;
        width: 95vw;
        max-width: 98vw;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        border-radius: 12px;
        padding: 0;
    }

    .gallery-detail .gallery-stats {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .gallery-detail .card-info {
        flex-direction: row;
        align-items: center;
        padding: 8px 0;
    }

    .gallery-detail .card-icon img {
        width: 32px;
        height: 32px;
    }

    .gallery-detail .card-content {
        margin-left: 10px;
    }

    .gallery-detail .popup-header {
        padding: 10px 8px;
        font-size: 1rem;
    }

    .gallery-detail .popup-header h3 {
        font-size: 1rem;
    }
}