.summary-chart {
    width: 100%;
}

.summary-chart-mobile-slider {
    .slick-slide {
        padding: 0rem .75rem; // Cria espaçamento horizontal
        box-sizing: border-box;
    }
}

.summary-chart-mobile-slider {
    display: none;
}

.summary-chart-grid {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    grid-auto-flow: row;
    gap: 1rem;
    width: 100%;
    padding: 0rem .75rem;


}

.image-container-summary {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    padding: 0;

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.information-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 3;
}

.summary-chart-container {
    border-radius: 1rem;
    cursor: pointer;
    width: 100%;

    &:hover {
        box-shadow: 0rem 1.875rem 3.75rem 0rem #00000029;
    }
}

.summary-chart-box-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    border: unset;
    min-height: fit-content !important;
    width: 100%;
    z-index: 1;
    flex: 1;
    justify-content: unset;

    .error-container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1rem;
        margin-top: 1rem;
        font-size: 1rem;
        font-family: inherit;
        font-weight: 700;
        line-height: 1.5rem;
        text-align: center;

        img {
            width: 6.25rem;
            height: 6.25rem;
        }

        h6 {

            font-family: inherit;
            font-size: .875rem;
            font-weight: 500;
            line-height: 1.5rem;
            text-align: center;
            color: #64718B;
        }
    }

    .loading-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100%;
        min-height: 40vh;
        justify-content: center;
        align-items: center;
    }

    .chart-title-container {


        .icon-container {
            width: 2.5rem;
            height: 2.5rem;
            border-radius: 100%;
            padding: .5rem;
            box-sizing: border-box;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        h6.title {
            width: 100%;
            font-size: 1.5rem;
            font-family: inherit;
            font-weight: 700;
            line-height: 2.25rem;
            display: flex;
            flex: 1;
            color: #2B363C;
            text-align: start;
            margin: 0;
            max-lines: 1;
            overflow: hidden;
        }


    }

    .body-container {
        display: flex;
        flex-direction: row;
        align-items: flex-end;
        width: 100%;
        color: #2B363C;
        margin-top: auto;
        position: relative;
        justify-content: flex-start;
        gap: .5rem;
        min-height: fit-content;

        .legend-container-arrow {
            width: .625rem;
            height: auto;
            margin-right: .625rem;
            justify-content: center;
            display: flex;


        }

        .down {
            height: .625rem;
            margin-top: .5rem;
        }

        span {
            position: unset;
            font-size: .875rem;
            font-weight: 400;
            line-height: 1.25rem;
            text-align: left;
            color: #2B363C;
        }

        img {
            width: 12rem;
            height: 12rem;
            position: relative;
            align-items: center;
        }
    }

    .chart-footer-container {
        display: flex;
        justify-content: start;
        width: 100%;
        height: auto;
        cursor: unset;
        min-height: fit-content;

        span {
            color: #23282E;
            font-size: 1rem;
            font-weight: 500;
        }
    }

    .chart-pie-container {
        position: absolute;
        background-color: transparent;
        width: 13.75rem;
        height: 13.75rem;
        top: -0.625rem;
        right: -0.625rem;
    }

    .chart-line-container {
        position: relative;
        background-color: rgba(0, 0, 0, 0);
        top: 0rem;
        left: -0.9375rem;
        min-height: 11.75rem;
        z-index: 1;
    }

    .chart-kpi-container {
        margin: 0 !important;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        border-radius: .5rem;
        width: 100%;
        background-color: transparent;
        gap: 0rem;

        .card {
            display: flex;
            flex-direction: row;
            justify-content: flex-start;
            min-height: fit-content;
            border-radius: 0rem;
            position: relative;
            overflow: hidden;
            width: 100%;
            height: 100%;
            background: transparent;
            gap: 1rem;
            align-items: center;
            margin: 0;
            flex-wrap: nowrap;

            &.first {
                padding-bottom: 1.5rem;
            }

            &.second {
                padding-top: 1.5rem;
                border-top: .0625rem solid #64718B;
            }

            .title {
                display: flex;
                font-size: 1.25rem;
                color: #2B363C;
                text-align: left;
                left: .625rem;
                font-weight: 700;
            }

            .text {
                display: flex;
                color: #2B363C;
                font-size: 1.875rem;
                font-weight: 400;
                line-height: 2.25rem;
                text-align: left;
                padding-top: 0rem;
                padding-left: 0rem;
                margin-left: auto;
                min-width: fit-content;
                align-items: center;

                .chart-kpi-arrow {
                    width: .625rem;
                    height: auto;
                    margin-right: .625rem;
                    justify-content: center;
                    display: flex;
                }

                .down {
                    height: .625rem;
                    margin-top: .5rem;
                }
            }

            .image {
                max-width: 1.5rem;
                max-height: 1.5rem;
                position: unset;
            }
        }
    }

    .chart-image-container {
        pointer-events: none;
        position: absolute;
        background-color: transparent;
        width: 12.5rem;
        height: 12.5rem;
        top: -0.625rem;
        right: .625rem;
        z-index: -1;
    }

    .portugal-container {
        pointer-events: none;
        position: relative;
        background-color: transparent;
        width: 100%;
        min-height: 23rem;
        min-width: 11.4375rem;
        right: 0rem;
        font-family: inherit;
        font-size: .75rem;
        font-weight: bold;
        line-height: 1.5rem;
        text-align: center;
    }

    .acores-container {
        pointer-events: none;
        position: relative;
        background-color: transparent;
        min-height: 8.75rem;
        min-width: 8.125rem;
        z-index: -0.0625rem;
        right: 0rem;

        font-family: inherit;
        font-size: .75rem;
        font-weight: 900;
        line-height: 1.5rem;
        text-align: left;

    }

    .madeira-container {
        pointer-events: none;
        position: relative;
        background-color: transparent;
        min-width: 3.125rem;
        min-height: 1.875rem;
        right: 0rem;

        font-family: inherit;
        font-size: .75rem;
        font-weight: 900;
        line-height: 1.5rem;
        text-align: left;

    }
}

// NOVA REGRA: Texto branco para fundo rgb(35, 40, 46)
.summary-chart-box-container.white-text,
.summary-chart-box-container[style*="rgb(35, 40, 46)"],
.summary-chart-box-container[style*="rgb(35,40,46)"] {

    // Todos os textos ficam brancos
    .chart-title-container h6.title {
        color: #ffffff !important;
    }

    .body-container {
        .legend-text-container {
            h5 {
                color: #ffffff !important;
            }

            span {
                color: #ffffff !important;
            }
        }

        h5 {
            color: #ffffff !important;
        }

        span {
            color: #ffffff !important;
        }
    }

    .chart-footer-container span {
        color: #ffffff !important;
    }



    // KPI específico - todos os elementos ficam brancos
    &.kpi {
        .chart-kpi-container .card {
            .title {
                color: #2B363C;
                margin-bottom: 0rem;
                width: 100%;
            }

            .text {
                color: #2B363C;
            }

            &.second {
                border-top-color: rgba(255, 255, 255, 0.3) !important;
            }
        }
    }

    .legend-container-arrow,
    .chart-kpi-arrow {
        filter: brightness(0) saturate(100%) invert(100%) sepia(30%) saturate(2%) hue-rotate(285deg) brightness(113%) contrast(101%) !important;
    }


    .error-container h6,
    .loading-container *,
    img {
        color: initial !important;
        filter: initial !important;
    }
}

.summary-chart-box-container.no-image {
    h6 {
        color: #2B363C;
    }
}

.body-container {

    .legend-text-container {

        display: flex;
        align-items: flex-end;
        gap: .5rem;
        margin-bottom: 1rem;

        h5 {
            display: flex;
            margin: 0;
            left: 0rem;
            color: #2B363C;
            position: relative;
            font-family: inherit;
            font-size: 2.5rem;
            font-weight: 700;
            line-height: 2.5rem;
            position: unset;
            min-width: fit-content;
            align-items: center;
        }

        span {
            position: unset;
            margin: 0;
            color: #2B363C;
        }

    }

}

.chart-footer-container {
    span {
        color: #2B363C;
    }
}


.summary-chart-box-container.image {
    .chart-title-container {
        h6.title {
            color: #FFFFFF;
        }
    }

    .chart-footer-container {
        span {
            color: #fff;
        }
    }
}




.summary-chart-box-container.image::after {
    content: "";
    position: absolute;
    top: 0rem;
    left: 0rem;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(270deg, rgba(0, 0, 0, .1) 10%, rgba(0, 0, 0, .6) 80%)
}

.summary-chart-box-container.pie {

    z-index: 2;

    .chart-title-container {

        width: 55%;

        h6.title {

            color: #23282E;
        }
    }

}

.summary-chart-box-container.kpi {
    .chart-title-container {
        h6.title {
            color: #2B363C;
            margin-bottom: 1.25rem;
            width: 100%;
        }

    }

    .body-container {

        margin-top: initial;

        .legend-text-container {
            display: none;
        }

    }

    .chart-footer-container {
        margin-top: 0;

        span {
            color: #2B363C
        }
    }
}

.summary-chart-box-container.lines {
    .chart-title-container {
        h6.title {
            width: 100%;
        }

    }
}




.slick-slide>div {
    display: flex;
    align-items: stretch;
    height: 100%;
}

.summary-chart-box-container {
    overflow: visible;

    &.image {
        overflow: hidden;

        .chart-pie-container,
        .chart-line-container,
        .portugal-container,
        .acores-container,
        .madeira-container {
            overflow: visible;
        }
    }
}

.chart-pie-container,
.chart-line-container,
.portugal-container {
    overflow: visible;
    z-index: 1000;
}

.summary-chart-box-container.map {
    z-index: 2;
    overflow: visible !important;

    .chart-footer-container {
        margin-top: auto;
    }
}

.am5-focus-container {
    display: none !important;
}

.am5-tooltip-container {
    z-index: 9999;
    pointer-events: none;
}


@media (max-width: 87.5rem) {
    .summary-chart-box-container .chart-title-container h6.title {
        font-size: 1.25rem;
    }

    .summary-chart-box-container {

        .chart-pie-container {
            width: 11.875rem;
            height: 11.875rem;

        }

    }
}


@media (max-width: 75rem) {

    .summary-chart-slide {
        min-height: 18.75rem;
    }

    .summary-chart-mobile-slider {
        display: flex;
    }

    .summary-chart-grid {
        display: none !important;
    }

    .summary-chart-container {
        min-height: 19.375rem;

        &:hover {
            box-shadow: none !important;
        }
    }

    .summary-chart-box-container .body-container .arrow {
        top: .6875rem;
    }

    .summary-chart-box-container.image .body-container span,
    .summary-chart-box-container.pie .body-container span {
        padding: 0rem;
    }

    .summary-chart-box-container {
        .chart-title-container {
            h6.title {
                width: 100%;
            }
        }

        .body-container {


            span {
                font-size: .75rem;
                top: 3.125rem;
            }
        }

        .chart-pie-container {
            width: 10.625rem;
            height: 10.625rem;

        }

        &.kpi {
            justify-content: space-between;
        }

        .chart-kpi-container {
            flex-direction: column;
            min-height: 100%;
            height: 100%;
            align-items: center;
            padding: 0rem;
            margin: 0rem;
            justify-content: normal;
        }

        .chart-kpi-container .card {
            width: 100%;
            height: 100%;
            padding: 0rem;
            max-height: fit-content;
        }

        .chart-kpi-container .card .text {
            font-size: 2rem;
            line-height: auto;
            margin-bottom: 0rem;
            align-items: baseline;
        }

        .summary-chart-box-container .chart-kpi-container .card .text .chart-kpi-arrow {
            width: .875rem;
            height: .875rem;
            top: .6875rem;
        }

    }

    .summary-chart-box-container .chart-kpi-container .card {
        .title {
            font-size: 1rem;
        }

        .text {
            font-size: 1.25rem;
            align-items: center;

            .chart-kpi-arrow {
                font-size: 1.0625rem;
            }
        }

    }

    .summary-chart-box-container.image .body-container span,
    .summary-chart-box-container.pie .body-container span {
        padding: 0rem !important;
    }

    .slick-slider,
    .slick-track,
    .slick-slide {
        display: flex;
        align-items: stretch;
    }

    .summary-chart-mobile-slider .slick-slider,
    .container-banner-slider .slick-slider,
    .reduced-area-mobile .slick-slider,
    .screen-reduced .slick-slider {
        padding-bottom: .25rem;
        margin-bottom: 2rem;
    }

    // .slick-slider.highlight-slide, .slick-slider.slick-initialized{
    //     padding-bottom: .875rem;
    //     margin-bottom: 4.375rem;
    // }
    // .slick-slider .slick-list{
    //     height: 100%;
    // }

    .slide-row-container {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .summary-chart-container {
        height: 19.375rem !important;
        display: block;

        &:has(.summary-chart-box-container.map) {
            height: 39.75rem !important;
            display: inline;
        }

    }

    .summary-chart-box-container.white-text,
    .summary-chart-box-container[style*="rgb(35, 40, 46)"],
    .summary-chart-box-container[style*="rgb(35,40,46)"] {


        .chart-title-container h6.title {
            color: #ffffff !important;
        }

        .body-container {

            .legend-text-container {

                h5,
                span {
                    color: #ffffff !important;
                    padding: 0rem;
                }
            }
        }

        .chart-footer-container span {
            color: #ffffff !important;
        }

        &.kpi .chart-kpi-container .card {

            .title,
            .text {
                color: #ffffff !important;
            }
        }

        .legend-container-arrow,
        .chart-kpi-arrow {
            filter: brightness(0) saturate(100%) invert(100%) sepia(30%) saturate(2%) hue-rotate(285deg) brightness(113%) contrast(101%) !important;
        }
    }
}





@media (max-width: 36rem) {


    .summary-chart-box-container {

        .chart-title-container {
            h6.title {
                font-size: 1.25rem;
                line-height: normal;
            }
        }

        .chart-footer-container {
            span {
                font-size: .875rem !important;
            }
        }

        .chart-pie-container {
            width: 9.375rem !important;
            height: 9.375rem !important;
            top: 1.25rem !important;
            right: .625rem !important;
        }

    }
}

@media (max-width: 23.5rem) {

    .summary-chart-box-container.image .body-container span {
        padding: 0rem;
    }

    .summary-chart-box-container .body-container .arrow {
        top: .6875rem;
    }

    .chart-line-container {
        min-height: 8.3125rem;
    }
}