@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');

/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
box-sizing: border-box;
}

/* 2. Remove default margin and padding, Set Font Family, set Transition */
* {
    margin: 0;
    padding: 0;
    transition: all 0.3s ease-in-out;
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    /* 3. Add accessible line-height */
    line-height: 1.5;
    /* 4. Improve text rendering */
    -webkit-font-smoothing: antialiased;
    /* Set Overflow hidden because div container will served as body*/
    overflow: hidden;
}

/* 5. Improve media defaults */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

/* 6. Inherit fonts for form controls */
input, button, textarea, select {
    font: inherit;
}

/* 7. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* 8. Improve line wrapping */
p {
    text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

/*
9. Create a root stacking context
*/
#root, #__next {
    isolation: isolate;
}

/* 10. Table Styling */

table {
    margin: 5px 0px;
    width: 100%;
    border-collapse: collapse;
}
th, td {
    border: 1px solid black;
    padding: 8px;
    text-align: left;
}
th {
    background-color: #f2f2f2;
}
.total {
    font-weight: bold;
    text-align: right; /* Aligns the total price to the right */
}

/* set margin for hr */
hr{
    margin: 5px 0px;
}
/* ----------------------------------------------------- */

/* container */
#container{
    display: grid;
    height: 100vh;
    grid-template-columns: 2fr 1.45fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas: 
    "products receipt"
    "monitor receipt"
    ;    
}

#container > div{
    box-shadow: 0px 0px 5px 5px rgba(0, 0, 0, 0.2);
    margin: 10px;
    padding: 10px;
    border-radius: 5px;
    overflow-y: scroll;
    position: relative;
}

/* products */

#products{    
    grid-area: products;
}

header{
    display: flex;    
    align-items: baseline;
    gap: 5px;
}

#items{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.item{
    display: flex;
    align-items: center;
    padding: 5px;
    border-radius: 5px;
    flex-direction: column;  
    box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.2);
    /* width: 240px;   */
    margin: 5px;
}

.item:hover{
    transform: scale(0.9);
    cursor: pointer;
}

img[src*="barcode"]{
    height: 100px;
    width: 100px;
}

.active-promotion{
    color: rgb(62, 173, 62);
}

.non-promotion{
    color: rgb(230, 84, 84);
}

.total-items-details{
    background-color: rgb(216, 214, 214);
    padding: 10px;
    margin: 10px;
    border-radius: 5px;
}

/* monitor */

#monitor{
    grid-area: monitor;
}

#reset, .delete-btn{
    display: block;
    padding: 5px 10px;
    margin: 5px;
    border: none;
    background-color: rgb(230, 84, 84);
    color: white;
    cursor: pointer;
    border-radius: 5px;
}

/* receipt */

#receipt{
    display: grid;
    grid-template-rows: 1fr 0.1fr;
    gap: 5px;
    grid-area: receipt;    
}

#official-receipt{
    width: 100%;
    height: 100%;    
    border: 2px solid rgb(63, 63, 63);
    padding: 5px;
    border-radius: 5px;
}

#print-receipt{
    border: none;
    padding: 5px;
    border-radius: 5px;
    background-color: #2e3760;
    color: white;
    font-weight: bolder;
    cursor: pointer;
}

#print-receipt:hover, #checkout-item:hover, #reset:hover, .delete-btn:hover{
    transform: scale(0.9);    
    opacity: 0.9;
}

/* modal */
#checkout-container{    
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
}

#checkout-modal{
    background-color: white;
    padding: 10px;
    border-radius: 10px;
}

.modal-quantity{
    margin: 15px 5px;
}

#checkout-item{
    width: 100%;
    border: none;
    background-color: #2e3760;
    color: white;
    padding: 5px;
    border-radius: 5px;
    cursor: pointer;
}

/* Responsive Web */

@media screen and (max-width: 615px) {
    #container{
        display: grid;
        height: 100vh;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr 1.5fr;
        grid-template-areas: 
        "products"
        "monitor"
        "receipt"
        ;    
    }
}