:root{
    --text: #1a1f1c;
    --text-hover: #ffffff;
    --elem-hover: #000000;

    --shadow: rgba(0, 0, 0, 0.35);

    --color-command: #e6f4ec;

   
    --color-container: #f2f7f4;
    --color-item: #e9f2ed;
}


@media (prefers-color-scheme: dark) {
    :root{
        --text: #e6f1eb;
        --text-hover: #1e2a26;
        --elem-hover: #ffffff;

        --shadow: rgba(0, 0, 0, 0.65);

        --background: #17201d;
        --color-container: #22302a;
        --color-item: #2b3b34;
        --color-command: #314a41;
    }
}


.container{
display:flex;
flex-direction: column;
width:70%;

}

.item{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin : 5px;
    padding : 5px;
    border : none;
    background-color: var(--color-item);
    box-shadow: inset 0 0 5px var(--shadow);
    border-radius: 15px;
    width:80%;
}


.container>div:first-child{
    max-height: 55vh;
    margin : 20px;
    padding-bottom : 60px; 
    position: relative;
    border : none;
    border-radius: 15px;
    box-shadow: 2px 2px 2px var(--shadow);
    background-color: var(--color-container);
}

.container p {
    text-align: center;
}

.item p{
    overflow-wrap: anywhere;
    padding:5px;
    text-align:center;
    color: var(--text)
}
*
.item>div{
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    color:var(--text);
    width: 100%;
}
.info-photo{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color : var(--text);
    width:100%;
}

#price{
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
}

span{
    color: var(--text);
}

.items-container{
    display: flex;
    margin:0px;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    padding : 10px;
    border-radius: 5px;
    height: 100%;        
    overflow-y:scroll;
    overflow-x: hidden;
    box-sizing: border-box;
    /*be in the parent container and adapt number of items*/
    min-height: 20vh;
    max-height: 47vh;
}

/* remove button */
#clearAll, .remove{
    margin:2px;
    background-color: var(--color-negative-light);
    border: solid 2px var(--color-negative);
    color: var(--text);
    padding : 10px;
    border-radius : 10px;
    cursor: pointer;
}
#clearAll:hover, .remove:hover{
    background-color: var(--color-negative-light-hover);
    border: solid 2px var(--color-negative-hover);
    color: var(--text-hover);
    font-weight: 300;
    transform: scale(1.05);
}

#clearAll{
    position : absolute;
    bottom : 8px;
    right : 8px;
}

.form-command{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap : 10px;
    background-color: var(--color-command);
    padding : 10px;
    margin:20px;
    border : none;
    border-radius: 15px;
    box-shadow: 2px 2px 2px var(--shadow);
}

.img-preview{
    min-height: 100%;
    height : 20vh;
    max-width:40%;
    aspect-ratio: 800 / 553;
    overflow: hidden;
    object-fit: cover;
    object-position: 50% 30%;
    display: block;
    border-radius: 15px;
    cursor: pointer;
}

.img-preview:hover{
    border: black 2px solid;
}

.cart-buttons{
    width:80%;
}

/*---------------Flash messages---------------*/

.message{
    width: 40%;
    margin: 10px auto;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    box-shadow: 2px 2px 5px var(--shadow);
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 1000;
    font-size: 1.2rem;
}

@media (max-width: 500px) {
    .container {
        width: 100%;
    }
    .item>div{
        width:100%;
    }

    .item {
        flex-direction: column;
        width: 100%;
    }

    .item img {
        height: 15vh;
    }

    .item p {
        font-size: 14px;
        margin: 5px 0;
    }

    .remove {
        font-size: 12px;
        padding: 5px 10px;
    }

    .info-photo {
        align-items: flex-start;
    }

    .cart-buttons {
        width: 100%;
    }
    #clearAll{
        font-size: 12px;
        bottom: 3px;
        right: 3px;
        padding: 5px;
    }

    .message{
        width: 80%;
        font-size: 1rem;
    }
    
}
@media (min-width: 501px) and (max-width: 850px) {
    .container {
        width: 90%;
    }

    .item>div{
        width:100%;
    }


    .item {
        flex-direction: column;
        width: 100%;
    }

    .info-photo {
        align-items: flex-start;
    }

    .cart-buttons {
        width: 100%;
    }

    #clearAll{
    font-size: 14px;
       bottom: 3px;
       right: 3px;
       padding: 6px;
    }

    .message{
        width: 60%;
        font-size: 1.1rem;
    }
}