:root{
    --main-color: #152a69;
    --green: #acd871;
    --red: #e73a2a;
    --gray: rgba(0,0,0,0.1);
    --radius: 10px;
}
img{
    max-width: 100%;
}
.no-display{
    display: none;
}
html{
    font-family: system-ui;
    font-size: 16px;
}
body{
    color: inherit;
}
a{
    color: inherit;
}
.center{
    text-align: center;
}
.right{
    text-align: right;
}
.justify{
    text-align: justify;
}
.flex{
    display: flex;
    flex-wrap: wrap;
}
/*general*/
.color-background{
    background-color: var(--main-color);
    color: white;
}
.margin{
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}
input, textarea, select, label{
    box-sizing: border-box;
    width: calc(100% - 2rem);
    margin: 1rem;
    font-size: 1rem;
    padding: 0.5rem 0.5rem;
    border: 1px solid grey;
    border-radius: 0.5rem;
}
label{
    border: 0px solid white;
}
input[type="submit"]{
    background-color: var(--main-color);
    color: white;
    cursor: pointer;
}
.center{
    text-align: center;
}
.message{
    position: absolute;
    width: fit-content;
    border-radius: 0.5rem;
    overflow: hidden;
    padding: 0 0.5rem;
    left: 50%;
    top: 15%;
    transform: translateX(-50%);
    opacity: 1;
    z-index: 5;
    opacity: 1;
    backdrop-filter: blur(18px);
    pointer-events: none;
    text-align: center;
    max-width: 90vw;
}
.message.fail{
    background-color: #fb5b5b;
    color: white;
}
.message.false{
    background-color: #fb5b5b;
    color: white;
}
.message.success{
    background-color: #acd871;
    color: white;
}
.green{
    color: var(--green);
}
/*login*/
.login header{
    border: 1px solid grey;
    border-width: 0px 0px 1px 0px;
}
.login .form{
    padding: 2rem 0 0 0;
    position: relative;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
.g-recaptcha{
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}
/*app header*/
.main header{
    display: flex;
    height: fit-content;
    padding: 1rem;
    gap: 0.5rem;
    flex: 1 1 100%;
    background-color: white;
    border: 1px solid var(--main-color);
    border-width: 0px 0px 5px 0;
    color: var(--main-color);

    .left, .right{
        width: 50%;
    }
}
.main header h2{
    margin: 0;
}
.main header .right{
    text-align: right;
}
/*main app*/
body.main{
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100lvh;
    min-height: 100svh; 
    overflow: hidden;
    display: flex; 
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    background-color: rgba(0,0,0,0.1);
}

.main .principal{
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    .toolbar{
        flex: 1 1 100%;
        display: flex;
        flex-wrap: wrap;
        padding: 1rem;
        margin: 1rem 0;
        border-radius: var(--radius);
        background-color: white;
        color: var(--main-color);

        .searcher{
            flex: 1;

            & input{
                border: 1px solid var(--main-color);
                margin: 0;
                width: 100%;
            }
        }

        .search-display-mods{
            width: fit-content;
            padding: 0rem;
            text-align: right;
            font-size: 2rem;
            box-sizing: border-box;
        }
    }
}
.main .seeker{
    display: flex;
    flex-wrap: wrap;
    flex: 3;
}
.main .container .searcher{
    width: 70%;
}
.main .container .bill{
    width: 30%;
}
/*sidemenu*/
.main .sidemenu{
    padding: 1rem;
    min-height: 500px;
    height: -webkit-fill-available;
    max-height: calc(100% - 6rem);
    margin: 1rem;
    background-color: white;
    border-radius: var(--radius);
    width: fit-content;
    box-sizing: border-box;
}
.sidemenu .entry:first-child{
    margin-top: 0;
    padding-top: 0;
}
.sidemenu .entry:first-child h1, .sidemenu .entry:first-child p{
    margin: 0;
}
.sidemenu .entry{
    padding: 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    margin: 0.5rem 0;
}
.sidemenu .entry:hover{
    background-color: rgba(255,255,255,0.3);
}
.sidemenu .entry p{
    font-size: 1.3rem;
    margin: 0;
}
.sidemenu .entry.active{
    background-color: var(--main-color);
    color: white;
}
.search-result{
        /* display: flex
; */
    /* flex-wrap: wrap; */
    flex: 3;
    gap: 1rem;
    padding: 0;
    box-sizing: border-box;
    height: 100vh;
    max-height: 100vh;
    overflow: scroll;
    padding-bottom: 20vh;
    position: relative;
    background-color: transparent;
    border-radius: var(--radius);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    grid-template-rows: max-content;
}
.search-result .card{
    padding: 0.5rem;
    box-shadow: 0px 0px 0px rgba(0,0,0,0.3);
    border-radius: 6px;
    transition: 0.5s all ease-out;
    transform: scale(1);
    cursor: pointer;
    background-color: white;
    border-radius: 5px;
    max-width: 400px;

    & *{
        user-select: none;
    }
}
.search-result .card:hover{

    transform: scale(1.05);
}
.search-result .card p {
    margin-top: 0;
}
.search-result .card .img-container{
    padding: 0.5rem;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.search-result .card img{
    width: 100%;
}
.search-result .card .name{
    text-align: center;
}
.search-result .card .price{
    text-align: center;
    font-size: 1.1rem;
    color:var(--green);
    text-align: center;
    font-size: 2rem;
    color: var(--green);
    font-weight: 800;
}
.search-display-mods i{
    margin-left: 0.5rem;
    cursor: pointer;
}
/*bill section*/
.bill{
    flex: 1;
    margin: 1rem;
    border-radius: var(--radius);
    padding: 1rem;
    background-color: white;
    max-height: calc(100vh - 8rem);
    overflow: hidden;

    .total, .finish{
        width: fit-content;
        background-color: var(--main-color);
        text-align: center;
        color: white;
        font-size: 1rem;
        padding: 1rem;
        margin: 1rem auto 1rem auto;
        border-radius: 11px;
        cursor: pointer;
        & p{
            margin: 0;
        }
    }
}
.bill-detail{
    max-height: 100vh;
    overflow: scroll;
    padding: 0rem;
    padding-bottom: 50vh;
    gap: 1rem;
    box-sizing: border-box;
}
.bill-detail .card{
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    background-color: var(--main-color);
    color: white;
    border-radius: 5px;
    padding: 0 0.5rem 0 3rem;
    position: relative;
    overflow: hidden;
    & *{
        user-select: none;
    }
}
.bill-detail .img-container{
    display: none;
}
.bill-detail img{
    width: 100%;
}
.bill-detail .name{
    flex: 3;
}
.bill-detail .price{
    flex: 1;
    text-align: right;
}
.bill-detail .delete-button{
    background-color: var(--red);
    color: white;
    font-size: 2.1rem;
    position: absolute;
    height: 100%;
    top: 0;
    left: 0;
    padding: 0.5rem;
    box-sizing: border-box;
    font-family: monospace;
    cursor: pointer;
}
.bill .finish{
    background-color: var(--green);
    color: white;
}
/*modal*/
.modal{
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.5);
    z-index: 4;

    & .content{
        background-color: white;
        text-align: center;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
        padding: 1rem;
        transform: translateY(calc(50vh - 50%));
        overflow: hidden;
        border-radius: 11px;
        max-width: 95%;
        box-sizing: border-box;
    }
}
/*change modal*/

.modal.change{
    font-size: 2rem;
}

.modal .scrollable{
    overflow-y: scroll;
    max-height: 80vh;
}

button{
    font-size: 1rem;
    padding: 0.5rem 0.5rem;
    border: 0px solid white;
    cursor: pointer;
    border-radius: 5px;
    margin: 0 1rem;
    &.cancel{
        background-color: var(--red);
        color: white;
    }
    &.accept{
        background-color: var(--green);
        color: white;
    }
}
/*scanner*/
.scanner-container{
    flex: 1 1 100%;
    overflow: hidden;
    position: relative;
    &.show{
        height: 160px;
    }
    & video{
        margin-top: -100%;
        transform: translateY(50%);
    }
    & .stop-button{
        z-index: 2;
        position: absolute;
        bottom: 6px;
        right: 6px;
        color: var(--red);
        font-size: 2rem;
        display: block;
    }
}
video{
    width: 100%;
}
/*add item modal*/
.input-group.s{
    max-width: 7rem;
}
.input-group.m{
    width: 18rem;
    min-width: 18rem;
    max-width: 100%;
}
.input-group input + label{
    position: absolute;
}

form div{
    position: relative;
}
.input-group {
    position: relative;
}

.input-group input:not([type="checkbox"]) {
    border: 1px solid gray;
    outline: none;
    margin: 0;
    width: 100%;
}

.input-group label {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: white;
    padding: 0 0.25rem;
    color: gray;
    font-size: 1rem;
    pointer-events: none;
    transition: 0.2s ease all;
    width: fit-content;
    margin: 0;
    text-align: left;
}

/* Cuando el input tiene focus o contiene texto */
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: -0.5rem;
    left: 0.4rem;
    font-size: 0.8rem;
    color: var(--main-color); /* Puedes definir un color principal */
    background: white;
}
input[type="checkbox"]{
    width: fit-content;
    margin: 0 0.5rem;
}
.input-group i.fa-barcode{
    position: absolute;
    font-size: 2rem;
    right: 0.4rem;
    top: 0.2rem;
}
/*items section*/
.items{
    height: calc(100lvh - 8rem);
    box-sizing: border-box;
    overflow-y: scroll;
    padding: 1rem 1rem 200px 1rem;
    flex: 1;
}
.items .card{
    background-color: white;
    padding: 1rem;
    border-radius: var(--radius);
    box-sizing: border-box;
    cursor: pointer;
}
.items .img-container{
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.items{
    .customer-items, .core-items{
        display: grid;
        gap: 1rem;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-template-rows: max-content;
    }
}
form.item-detail-edit{
    display: flex;
    gap: 1rem;
}
/*tablets and smartphones*/
@media only screen and (max-width: 800px) {
    .main .principal{
        padding: 0 0.5rem;
    }
    .main .principal header{
        padding-left: 5rem;
    }
    .main .sidemenu{
        position: fixed;
        transform:  translateX(-100%);
        transition: 0.5s all ease-out;
        z-index: 2;
        margin: 0;
    }
    .sidemenu.visible{
        transform: translateX(0%);
    }
    .sidemenu-switch{
        cursor: pointer;
        position: absolute;
        left: 100%;
        top: 0;
        padding: 0.9rem;
        background-color: transparent;
    }
    .sidemenu-switch .flex{
        width: 2.4rem;
        gap: 0.2rem;
    }
    .sidemenu-switch span{
        display: block;
        width: 1rem;
        height: 1rem;
        background-color: var(--main-color);
        border-radius: 5px;
    }
    .main .container .searcher{
        width: 100%;
    }
    .main .bill{
        width: 100%;
        position: fixed;
        height: 100lvh;
        max-height: 100lvh;
        top: calc(100dvh - 6rem);
        transition: 0.5s all linear;
        z-index: 3;
        backdrop-filter: blur(18px);
        background-color: rgba(255, 255, 255, 0.7);
        margin: 0;
        box-sizing: border-box;
        left: 0;
    }
    .main .bill.show{
        top: 0%;
    }
    .input-group.s{
        max-width: auto;
        flex: 1;
    }
    .input-group.m{
        width: 100%;
        flex: 2;
        min-width: 100%;
        max-width: 100%;
    }
}