:root {
    --cor-ciclo-primaria: #558c31;
    --cor-ciclo-secundaria: #152518;
}

/* POPUP PARA PESQUISAR PRODUTO  */
.overlay {
    display: none;
    position: fixed;
    z-index: 1002;
    width: 100dvw;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.search-popup {
    display: none;
    flex-direction: column;
    justify-content: center;
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1007;
    width: 100%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;

    &>.scanner-camera {
        display: none;
        justify-content: center;
        width: 100%;
        margin-bottom: 1vh;
    }

    &>.container-barra-pesquisa {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 2vw;
        padding: 0 5%;

        &>.barra-pesquisa-entradas {
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
            width: 50%;

            &>.inputs {
                display: flex;
                justify-content: center;
                position: relative;
                z-index: 10;
                width: 100%;

                &>.input-search {
                    width: calc(100% - 5vh);
                    height: 6vh;
                    padding-left: 5%;
                    border: none;
                    border-radius: 50px 0 0 50px;
                    font-size: 14px;
                    outline: 0;
                }

                &>.botao-filter {
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    width: 5vh;
                    height: 6vh;
                    background-color: #fff;
                    border: none;
                    border-radius: 0 50px 50px 0;
                    color: gray;
                    font-size: 15px;

                    &:hover,
                    &:active,
                    &:focus {
                        background-color: #ededed;
                        transition: .3s all ease-in-out;
                    }

                    &>i {
                        transform: translateY(1px);
                    }
                }

                &>.botao-search {
                    display: none;
                    justify-content: center;
                    align-items: center;
                    width: 7vh;
                    height: 6vh;
                    border: none;
                    border-radius: 0 50px 50px 0;
                    background-color: #fff;
                    font-size: 20px;

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

            &>.filtros {
                display: none;
                justify-content: space-evenly;
                position: relative;
                z-index: 9;
                margin: 2% 0;
                width: 100%;
                transform: translateY(30px);
                transition: .3s all ease-in-out;
                opacity: 0;

                &.active {
                    transform: translateY(0);
                    opacity: 1;
                }

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

                    width: 45%;

                    padding: 2% 0;
                    padding-left: 3%;

                    background-color: white;
                    border: none;
                    border-radius: 20px;

                    font-size: 14px;
                }
            }
        }

        &>.close-search,
        &>.share-search,
        &>.open-scanner,
        &>.close-scanner {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 6vh;
            height: 6vh;
            /* margin-left: 1%; */
            font-size: 17px;
            color: #fff;
            background-color: var(--cor-ciclo-primaria);
            border: none;
            border-radius: 50%;

            &:hover {
                background-color: var(--cor-ciclo-secundaria);
                transition: .3s all ease-in-out;
            }
        }

        /* &>.share-search {
            display: none;
        } */
    }
}
/* ---- Filtros usados na versão mobile ---- */
.popup-filtros {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 5vw;
    position: fixed;
    bottom: 0;
    z-index: 1008;
    padding: 7% 5%;
    width: 100%;
    background-color: #FFF;
    box-shadow: 0px -4px 10px 0px #00000040;
    transform: translateY(300px);
    transition: .5s all ease-in-out;
    opacity: 0;

    &.active {
        transform: translateY(0);
        opacity: 1;
    }

    &>.filtros-select {
        padding: 5%;
        width: 100%;
        background-color: white;
        /* border-bottom: none; */
        border-radius: 50px;
        box-shadow: 0px 3px 3px 0px #00000040;
        color: #363636;
        font-size: 15px;
        font-weight: 700;
        outline: none;
    }
}
/* ---- Lista de Produtos retornados na Pesquisa ---- */
#returned-product {
    display: none;
    overflow-y: auto;
    margin: 3% auto;
    padding: 0;
    padding-right: 2%;
    width: 90%;
    max-height: calc(100dvh - 25dvh);
    border-radius: 5px;

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

        &>.product-item {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            flex: none;
            flex-grow: initial;
            position: relative;
            padding: 3%;
            width: 100%;
            background-color: #ffffff;
            border: 1px solid #ccc;
            border-radius: 3px;
            box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
            text-align: center;

            &>.product-demo {
                width: 25%;
                margin-right: 3%;
                /* position: relative;
                z-index: 1010; */

                &>img {
                    width: 10vh;
                    height: 10vh;
                    object-fit: contain;
                    margin: 0;
                }
            }

            &>.product-infos {
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                gap: 1vw;
                /* position: relative;
                z-index: 1010; */
                width: 75%;

                &>.product-identify {
                    padding: 0 2%;
                    width: 100%;

                    &>p {
                        text-align: start;
                        margin-bottom: 0;
                    }

                    &>.nome-do-produto {
                        font-size: 12px;
                    }

                    &>.ean-do-produto, .cod-do-produto {
                        font-size: 10px;
                    }
                }

                &>.product-functions {
                    display: flex;
                    flex-direction: column;
                    align-items: start;
                    gap: 1vw;
                    width: 100%;

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

                        &>button {
                            display: flex;
                            justify-content: center;
                            align-items: center;
                            width: 3vh;
                            height: 3vh;
                            background-color: var(--cor-ciclo-primaria);
                            border: none;
                            border-radius: 50%;
                            color: white;

                            &>i {
                                text-align: center;
                            }
                        }

                        &>input {
                            width: 8vh;
                            height: 3vh;
                            background-color: #f1f1f1;
                            border: none;
                            border-bottom: 1px solid grey;
                            text-align: center;
                            outline: 0;
                        }
                    }

                    &>.product-buttons {
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        gap: 1vh;
                        margin-top: 2%;
                        width: 100%;

                        &>button {
                            display: flex;
                            justify-content: center;
                            align-items: center;
                            border: none;
                            color: white;
                            box-shadow: 2px 2px 5px 0px #00000042;

                            &>i {
                                text-align: center;
                            }
                        }

                        &>.btn-comprar {
                            width: 75%;
                            height: 4vh;
                            background-color: #25D366;
                            border-radius: 4vh;
                            font-size: 20px;
                        }

                        &>.btn-revista {
                            width: 4vh;
                            height: 4vh;
                            background-color: var(--cor-topbar);
                            border-radius: 50%;
                        }
                    }
                }
            }

            /* &>.buy-overlay {
                display: flex;
                justify-content: center;
                align-items: center;
                position: absolute;
                top: 0;
                left: 0;
                width: 0;
                height: 100%;
                background-color: #25D366;
                transition: all .3s ease-in-out;

                &.active{
                    width: 100%;
                }

                &>p {
                    font-size: 23px;
                    text-align: center;
                    color: white;

                    &>i {
                        margin-top: 2%;
                        padding: 5%;
                        border-radius: 50%;
                        background-color: #21b658;
                        font-size: 25px;
                    }
                }
            } */
            &>.buy-overlay {
                display: flex;
                justify-content: center;
                align-items: center;
                position: absolute;
                top: 0;
                left: 0;
                width: 0;
                height: 100%;
                background-color: #25D366;
                transition: width 0.7s ease-in-out;
                overflow: hidden; /* Evita que o conteúdo apareça antes da transição */
                white-space: nowrap;
            
                &.active {
                    width: 100%;
                }
            
                &>p {
                    font-size: 23px;
                    text-align: center;
                    color: white;
                    opacity: 0;
                    transform: translateX(-50px);
                    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
            
                    &>i {
                        margin-top: 2%;
                        padding: 5%;
                        border-radius: 50%;
                        background-color: #21b658;
                        font-size: 25px;
                        opacity: 0;
                        transform: translateX(-50px);
                        transition: opacity 0.3s ease-in-out 0.1s, transform 0.3s ease-in-out 0.1s;
                    }
                }
            
                &.active>p {
                    opacity: 1;
                    transform: translateX(0);
            
                    &>i {
                        opacity: 1;
                        transform: translateX(0);
                    }
                }
            }
        }
    }
}
/* ---- Paginação de Resultados da Pesquisa ---- */
#pagination-top {
    display: none;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 0;
    margin: auto;
    margin-bottom: 10px;
    padding: .5%;
    width: 95%;
    background-color: transparent;
    transform: translateX(0);

    &>.btn-pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        max-width: 4vh;
        max-height: 4vh;
        min-width: 4vh;
        min-height: 4vh;
        background-color: #ffffff86;
        border: none;
        border-radius: 10px;
        color: var(--cor-ciclo-secundaria);
        font-size: 14px;
        font-weight: 700;

        &.number {
            margin: 0 1%;

            &.active {
                background-color: rgb(235, 233, 233);
            }
        }

        &.arrow {
            margin: 0 2%;

            &>i {
                padding: 0 !important;
                margin: 0 !important;
                font-size: 20px;
            }
        }

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

    &>.pagination-ellipsis {
        margin: 0 1%;
        background-color: transparent;
        color: white;
        font-size: 30px;
        cursor: default;
    }
}
/* ---- Animação de carregamento da pesquisa ---- */
.container-loading {
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: absolute;
    top: 65%;
    left: 50%;
    z-index: 1001;
    transform: translate(-50%, -50%);

    &>.loading {
        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;
    }
}
/* ---- Popups de Alerta - Barra de Pesquisa ---- */
#alerts-popup {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0 10%;
    position: fixed;
    z-index: 1003;
    transform: translateY(-150px);
    transition: all .5s ease-in-out;

    &.active {
        transform: translateY(0px);
    }

    &>.alerts-popup-container {
        margin-top: 10%;
        padding: 2% 5%;
        width: max-content;
        background-color: var(--cor-ciclo-primaria);
        border-radius: 20px;
        opacity: .9;

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

/* ---- RESPONSIVIDADE - PESQUISA ---- */
@media screen and (min-width: 475px) {
    .search-popup {
        &>.container-barra-pesquisa {
            align-items: self-end;
            padding: 0 18%;
            gap: 1vw;

            &>.barra-pesquisa-entradas {
                width: 60%;

                &>.inputs {
                    &>.input-search {
                        width: calc(100% - 5vh);
                        height: 5vh;
                        padding-left: 7%;
                        font-size: 18px;
                    }

                    &>.botao-filter {
                        width: 5vh;
                        height: 5vh;
                        font-size: 25px;
                    }
                }

                &>.filtros {
                    display: flex;
                }
            }

            &>.share-search,
            &>.close-search,
            &>.open-scanner,
            &>.close-scanner {
                width: 5vh;
                height: 5vh;
                font-size: 25px;
            }
        }
    }

    #returned-product {
        margin: 2% auto;
        width: 90%;

        &>.product-grid {
            flex-wrap: wrap;
            gap: 1.5vw;

            &>.product-item {
                flex: 1 calc(50% - 1vw);
                max-width: 50%;
                padding: 2%;
                border-radius: 5px;

                &>.product-demo {
                    &>img {
                        width: 6vh;
                        height: 6vh;
                    }
                }
    
                &>.product-infos {
                    gap: 0.5vw;
    
                    &>.product-identify {

                        &>.nome-do-produto {
                            font-size: 13px;
                        }
    
                        &>.ean-do-produto, .cod-do-produto {
                            font-size: 13px;
                            color: #5f5e5e;
                        }
                    }
    
                    &>.product-functions {
                        gap: 0.5vw;
    
                        &>.product-quantity {
    
                            &>button {
                                width: 2vh;
                                height: 2vh;
                            }
    
                            &>input {
                                width: 5vh;
                                height: 2vh;
                                border-bottom-width: 2px;
                                border-radius: 5px;
                            }
                        }
    
                        &>.product-buttons {
                            
                            &>.btn-comprar {
                                height: 3vh;
                            }
    
                            &>.btn-revista {
                                width: 3vh;
                                height: 3vh;
                            }
                        }
                    }
                }
            }
        }
    }

    #pagination-top {
    
        &>.btn-pagination {
            max-width: 3vh;
            max-height: 3vh;
            min-width: 3vh;
            min-height: 3vh;
    
            &.number {
                margin: 0 1%;
            }
            &.arrow {
                margin: 0 1%;
            }
    
        }
    
        &>.pagination-ellipsis {
            margin: 0 1%;
            background-color: transparent;
            color: white;
            font-size: 30px;
            cursor: default;
        }
    }
    
    #alerts-popup {
        padding: 0 10%;
        transform: translateY(-250px);
        transition: all 1s ease-in-out;

        &>.alerts-popup-container {
            padding: 1% 5%;

            &>p {
                font-size: 25px;
            }
        }
    }
}

@media screen and (min-width: 1025px) {
    .search-popup {
        &>.container-barra-pesquisa {

            &>.barra-pesquisa-entradas {
                width: 50%;

                &>.inputs {

                    &>.input-search {
                        width: calc(100% - 7vh);
                        height: 6vh;
                        padding-left: 4%;
                        font-size: 18px;
                    }

                    &>.botao-filter {
                        width: 7vh;
                        height: 6vh;
                        border-radius: 0;
                        font-size: 20px;
                    }

                    &>.botao-search {
                        display: flex;
                    }
                }

                &>.filtros {
                    display: flex;
                    transform: translateY(60px);

                    &>select {
                        padding: 1.2% 0;
                        padding-left: 3%;
                    }
                }
            }

            &>.share-search,
            &>.close-search,
            &>.open-scanner,
            &>.close-scanner {
                width: 6vh;
                height: 6vh;
                font-size: 20px;
            }
        }
    }
    .popup-filtros {
        display: none;
    }
    #returned-product {
        margin: 1% auto;
        padding-right: 1%;
        width: 80%;
        max-height: calc(100dvh - 30dvh);

        &>.product-grid {
            flex-wrap: wrap;
            gap: .7vw;

            &>.product-item {
                flex: 1 calc(25% - 1vw);
                max-width: 25%;
                padding: 1%;

                &>.product-demo {
                    &>img {
                        width: 8vh;
                        height: 8vh;
                    }
                }
    
    
                &>.product-infos {
                    gap: 0.5vw;
                    justify-content: space-between;
                    height: 100%;
    
                    &>.product-identify {

                        &>.nome-do-produto {
                            font-size: 15px;
                        }
    
                        &>.ean-do-produto, .cod-do-produto {
                            font-size: 14px;
                            color: #5f5e5e;
                        }
                    }
    
                    &>.product-functions {
                        justify-content: center;
                        gap: 0.5vw;
    
                        &>.product-quantity {
                            gap: 0.5vw;
    
                            &>button {
                                width: 3vh;
                                height: 3vh;
                            }
    
                            &>input {
                                width: 7vh;
                                height: 3vh;
                            }
                        }
    
                        &>.product-buttons {
                            
                            &>.btn-comprar {
                                height: 4vh;
                            }
    
                            &>.btn-revista {
                                width: 4vh;
                                height: 4vh;
                            }
                        }
                    }
                }
            }
        }
    }
    #alerts-popup {
        
        transform: translateY(-150px);
        transition: all .8s ease-in-out;

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

            &>p {
                font-size: 20px;
            }
        }
    }
    #pagination-top {
        padding: 0;
    
        &>.btn-pagination {
            max-width: 3.5vh;
            max-height: 3.5vh;
            min-width: 3.5vh;
            min-height: 3.5vh;
            font-size: 16px;
    
            &.number {
                margin: 0 .5%;
            }   
            &.arrow {
                margin: 0 .5%;
            }
        }
    
        &>.pagination-ellipsis {
            margin: 0 .5%;
        }
    }
}
/* ---- MANIPULAÇÃO DA SCROLL BAR ---- */
#returned-product::-webkit-scrollbar {
    width: 4px;
}

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

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

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

::-webkit-scrollbar-thumb:window-inactive {
    background: #CD1417;
}
