:root {
    --cor-ciclo-primaria: #CD1417;
    --cor-ciclo-secundaria: #971012;
}

/* POPUP PARA PESQUISAR PRODUTO  */
.overlay {
    display: none;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    position: fixed;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.search-popup {
    display: none;
    flex-direction: column;
    justify-content: center;

    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    margin-top: 2vh;

    width: 100%;

    transition: all 0.5s ease;

    &>div {
        display: flex;
        justify-content: center;

        &>.input-search {
            width: 30%;
            height: 7vh;

            padding-left: 2%;

            border: none;
            border-radius: 50px 0 0 50px;

        }

        &>.botao-search {
            width: 7vh;
            height: 7vh;

            border: none;
            border-radius: 0 50px 50px 0;

            background-color: #fff;

            font-size: 23px;

            &:hover,
            &:active,
            &:focus {
                background-color: var(--cor-ciclo-primaria);
                color: #fff;
                transition: .3s all ease-in-out;
            }
        }

        &>.close-search {
            width: 7vh;
            height: 7vh;

            margin-left: 1%;

            font-size: 25px;
            color: #fff;

            background-color: var(--cor-ciclo-primaria);

            border: none;
            border-radius: 50%;

            &:hover {
                background-color: #971012;
                transition: .3s all ease-in-out;
            }
        }
    }

}

#returned-product {
    display: none;
    overflow-y: auto;
    /* overflow-clip-margin: 10vh; */
    /* padding-block-end: 20px; */


    margin: 1% auto .5%;
    padding: 0;
    padding-right: 1%;

    width: 75%;
    max-height: calc(100dvh - 20dvh);

    /* background-color: #fff; */
    border-radius: 5px;
    /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);  */

    &>.product-grid {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1vw;
        width: 100%;

        &>.product-item {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            flex: 1 calc(20% - 1vw);
            flex-grow: initial;

            position: relative;

            padding: 1%;

            width: 25%;

            /* background-color: #f9f9f9; */
            background-color: #fff;
            border: 1px solid #ccc;
            border-radius: 5px;
            box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);

            text-align: center;

            /* &:nth-last-child(-n + 5) {
                margin-bottom: 2vh;
            } */

            &>.product-infos {
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                gap: 1vw;

                &>.product-image {
                    width: 100px;
                    /* Largura fixa */
                    height: 100px;
                    /* Altura fixa */
                    object-fit: contain;
                    /* Manter proporção da imagem */
                    margin: 0;
                }

                &>p {
                    margin: 0;

                    line-height: 1em;
                    font-size: 17px;
                }
            }

            /* Ajuste nos botões */
            &>.product-buttons {
                display: flex;
                justify-content: space-between;
                align-items: center;
                /* gap: 100%; */

                width: 100%;

                margin-top: 10%;

                &>button {
                    display: flex;
                    justify-content: center;
                    align-items: center;

                    padding: 0 7%;

                    /* width: 40%; */
                    height: 5vh;

                    color: #fff;

                    border: none;
                    border-radius: 3px;

                }

                &>.btn-comprar {
                    background-color: #26d466;
                    /* border-bottom: 3px solid var(--cor-ciclo-primaria); */
                    border-radius: 5px;

                    font-size: 17px;
                    font-weight: 700;

                    &:hover {
                        background-color: #20b356;
                        transition: .3s all ease-in-out;
                    }

                    &>i {
                        margin-right: 5%;
                    }
                }

                &>.btn-revista {
                    font-size: 25px;
                    background-color: var(--cor-ciclo-primaria);

                    &:hover {
                        background-color: #b41114;
                        transition: .3s all ease-in-out;
                    }
                }
            }

        }
    }
}

#pagination-top {
    display: none;
    justify-content: center;
    align-items: center;
    /* gap: 1vh; */

    position: relative;
    /* Não fixa, para evitar sobreposição */
    background-color: transparent;
    /* Fundo transparente */
    z-index: 0;
    /* Atrás da tela de resultados, se necessário */

    margin: auto;
    margin-bottom: 10px;
    padding: .5%;

    width: fit-content;

    transform: translateX(-5%);

    /* background-color: #25D366; */

    &>.btn-pagination {
        display: flex;
        justify-content: center;
        align-items: center;

        max-width: 4vh;
        max-height: 4vh;
        min-width: 4vh;
        min-height: 4vh;


        background-color: var(--cor-ciclo-primaria);
        border: none;
        /* border: 2px solid var(--cor-ciclo-primaria); */
        border-radius: 50px;

        color: #fff;
        font-size: 17px;
        font-weight: 700;

        &.number {
            margin: 0 1%;

            &.active {
                background-color: #971012;
            }
        }

        &.arrow {
            /* background-color: #25D366; */
            margin: 0 10%;


            &>i {
                padding: 0 !important;
                margin: 0 !important;

                font-size: 20px;
                /* transform: translateY(1px); */

            }
        }

        &:hover {
            background-color: #971012;
            transition: .3s all ease-in-out;
        }

    }

    &>.pagination-ellipsis {
        /* padding: 8px 12px; */
        margin: 0 5%;

        background-color: transparent;

        color: #fff;
        font-size: 30px;

        cursor: default;
    }
}

/* ---- Loading Animation ---- */
.container-loading {
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);

    z-index: 1001;

    & > .loading {
        /* position: absolute;
        left: 50%;
        top: 50%; */
    
        /* margin: -25px 0 0 -25px; */
    
        height: 50px;
        width: 50px;
    
        border-bottom: 6px solid rgba(0, 0, 0, .1);
        border-left: 6px solid rgba(0, 0, 0, .1);
        border-right: 6px solid rgba(0, 0, 0, .1);
        border-top: 6px solid var(--cor-ciclo-primaria);
        border-radius: 100%;
    
        animation: rot .6s infinite linear;
    }
    &>p {
        margin-top: 2%;

        font-size: 18px;
        color: #fff;
        font-weight: 700;
        letter-spacing: 1px;
        text-align: center;
    }
}

/* ---- Popup de Alerta - Barra de Pesquisa ---- */
#alerts-popup {
    display: none;
    justify-content: center;
    align-items: center;

    width: 100%;

    position: fixed;
    z-index: 10000;
    animation: slideDown 1s forwards;

    & > .alerts-popup-container {
        margin-top: 2.5%;
        padding: 1%;

        width: max-content;
    
        background-color: var(--cor-ciclo-primaria);
        border-radius: 20px;
    

        & > p {
            margin: 0;
    
            color: #fff;
            font-size: 22px;
            text-align: center;
        }
    }
}


/* ---- RESPONSIVIDADE - PESQUISA ---- */
@media screen and (max-width: 1024px) {
    .search-popup {
        &>div {
            padding: 0 5%;

            &>.input-search {
                padding-left: 4%;
                width: calc(80% - 14vh);
                height: 5vh;
                font-size: 17px;
            }

            &>.botao-search {
                width: 5vh;
                height: 5vh;
                /* font-size: 32px; */
            }

            &>.close-search {
                width: 5vh;
                height: 5vh;
                /* font-size: 35px; */
            }
        }
    }

    #returned-product {
        width: 90%;
        max-height: calc(100dvh - 30dvh);
        margin: 5% auto 2%;

        &>.product-grid {
            gap: 3vw;

            &>.product-item {
                flex: 1 calc(33% - 3vw);
                flex-grow: initial;
                padding: 3%;

                &>.product-infos {
                    &>.product-image {
                        width: 7vh;
                        height: 7vh;
                    }

                    &>p {
                        margin-bottom: 1%;
                        font-size: 15px;
                    }
                }

                &>.product-buttons {
                    margin-top: 7%;

                    &>button {
                        padding: 0 7%;

                        height: 3vh;
                    }

                    &>.btn-comprar {
                        font-size: 20px;
                    }

                    &>.btn-revista {
                        font-size: 20px;
                    }

                }
            }
        }
    }

    #pagination-top {
        width: 95%;
        transform: translateX(0);

        &>.btn-pagination {

            font-size: 14px;

            &.number {
                margin: 0 1%;
                font-size: 20px;
            }

            &.arrow {
                margin: 0 2%;
            }
        }

        &>.pagination-ellipsis {
            margin: 0 1%;
        }
    }
}

@media screen and (max-width: 475px) {
    .search-popup {
        &>div {
            padding: 0 5%;

            &>.input-search {
                padding-left: 4%;
                width: calc(100% - 14vh);
                font-size: 17px;
            }
        }
    }

    #returned-product {
        width: 90%;
        max-height: calc(100dvh - 25dvh);
        margin: 5% auto 2%;

        &>.product-grid {
            gap: 2vw;

            &>.product-item {
                flex: 1 calc(50% - 2vw);
                flex-grow: initial;
                padding: 4% 3%;

                &>.product-infos {
                    &>.product-image {
                        width: 10vh;
                        height: 10vh;
                    }

                    &>p {
                        margin-bottom: 1%;
                        font-size: 13px;
                    }
                }

                &>.product-buttons {
                    margin-top: 5%;

                    &>button {
                        padding: 0 5%;
                    }

                    &>.btn-comprar {
                        font-size: 14px;
                    }

                    &>.btn-revista {
                        font-size: 20px;
                    }

                }
            }
        }
    }

    #pagination-top {
        width: 95%;
        transform: translateX(0);

        &>.btn-pagination {

            font-size: 14px;

            &.number {
                margin: 0 1%;

            }

            &.arrow {
                margin: 0 2%;
            }
        }

        &>.pagination-ellipsis {
            margin: 0 1%;
        }
    }

    #alerts-popup {
    
        & > .alerts-popup-container {
            margin-top: 22.5%;
            padding: 1% 4%;
    
            & > p {
                font-size: 17px;
            }
        }
    }
}

.slide-up {
    animation: slideUp 1s forwards !important;
    animation-delay: 2s;
}
@keyframes slideUp{
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-300px);
    }
}
@keyframes slideDown{
    from {
        transform: translateY(-300px);
    }
    to {
        transform: translateY(0);
    }
}
@keyframes rot {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(359deg);
    }
}


/* ---- MANIPULAÇÃO DA SCROLL BAR ---- */
/* Índice com fundo transparente */
#returned-product::-webkit-scrollbar {
    width: 8px;
}

#returned-product.thin::-webkit-scrollbar {
    width: 2px;
}

::-webkit-scrollbar-track {
    border-radius: 10px;
    background: #cacaca;
}

::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #CD1417;
}

::-webkit-scrollbar-thumb:window-inactive {
    background: rgba(100, 100, 100, 0.4);
}