.site {
    min-height: 100vh;
    display: grid;
    grid-template-rows: 70px 1fr 70px;
}

/* Main */
main {
    height: auto;
    margin: 16px 0;
    padding: 0px 32px;
}
.products-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.products-container-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.products-container-header h1 {
    font-size: 1.5rem;
}
.open-cart-sidebar {
    color: var(--bar-icon-color);
    display: inline-block;
    text-decoration: none;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
}
.open-cart-sidebar .cart-product-count {
    position: absolute;
    right: 0;
    bottom: 0;
    min-width: 1.5em;
    height: 1.5em;
    border-radius: 50%;
    border: 0.05em solid black;
    background-color: red;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75em;
    color: white;
}
.products-container-header span.material-symbols-outlined {
    vertical-align: middle;
    font-size: 2rem;
}
.product-item {
    width: 100%;
    background-color: var(--container-background-color);
    border-radius: var(--container-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.product-item-description {
    padding: 8px;
}
.product-item-description h2 {
    font-size: 1rem;
    line-height: 1rem;
}
.product-item-description p {
    font-size: 0.9rem;
    color: grey;
}
.product-item-image {
    object-fit: cover;
    aspect-ratio: 1 / 1;
}
.product-item-rating {
    margin-top: 3px;
}
.product-item-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3px;
}
.product-item .add-to-cart {
    align-self: center;
    font-size: 1.2rem;
    padding: 6px;
    color: var(--container-background-color);
    background-color: var(--primary-color);
    border-radius: 50%;
    transition: background-color .5s;
    cursor: pointer;
}
.product-item .add-to-cart:hover {
    background-color: color-mix(in srgb, var(--primary-color), black 10%);
}

/* Cart side bar */
.nav-cart-sidebar.show {
    right: 0;
}
.nav-cart-sidebar.show ~ #overlay {
    display: block;
}
.nav-cart-sidebar {
    background-color: white;
    height: 100dvh;
    width: min(30em, 80%);
    position: fixed;
    right: -100%;
    top: 0;
    padding: 0px 16px;
    box-shadow: -3px 0 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
    transition: right 300ms ease-out;
    overflow-y: auto;
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0px;
}
.sidebar-items {
    height: auto;
    padding: 16px 0 0 0;
    margin-bottom: 16px;
}
.sidebar-item {
    display: flex;
    gap: 16px;
    align-items: start;
    margin-bottom: 8px;
}
.sidebar-item img {
    width: 30%;
    max-width: 100px;
    aspect-ratio: 1/1;
    object-fit: cover;
}
.side-item-details {
    width: 100%;
}
.side-item-details > * {
    margin-bottom: 6px;
}
.product-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.product-cart-delete.material-symbols-outlined {
    cursor: pointer;
    font-size: 1.25rem;
}
.product-cart-delete.material-symbols-outlined:hover {
    color: var(--danger-color);
    font-size: 1.25rem;
}
.cart-item-update-options {
    display: flex;
    align-items: center;
    gap: 6px;
}
.product-cart-update.material-symbols-outlined {
    background-color: var(--site-background-color);
    color: var(--primary-color);
    cursor: pointer;
}
.product-cart-update.material-symbols-outlined:hover {
    background-color: var(--primary-color);
    color: var(--site-background-color);
}
.product-cart-update.material-symbols-outlined {
    font-size: 1rem;
}
.sidebar-order-summary {
    margin-top: auto;
}
.order-subtotal {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}
.checkout-button {
    width: 100%;
    height: 30px;
    border-radius: var(--container-radius);
    border: none;
    background-color: var(--primary-color);
    color: white;
    margin: 16px auto 16px auto;
    cursor: pointer;
    transition: background-color .5s;
}
.checkout-button:hover {
    background-color: color-mix(in srgb, var(--primary-color), black 20%);
}
#overlay {
    background-color: rgba(0, 0, 0, 0.5);
    position: fixed;
    inset: 0;
    z-index: 9;
    display: none;
}

@media (min-width: 575px) {
    .product-item-description h2 {
        height: 2rem;
        text-overflow: ellipsis;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;      /* Explicitly allow up to 2 lines */
        -webkit-box-orient: vertical;
        line-clamp: 2;
    }
}

@media (min-width: 1600px) {
    .products-container {
        grid-template-columns: repeat(7, 1fr);
    }
}

@media (min-width: 1301px) and (max-width: 1600px) {
    .products-container {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1001px) and (max-width: 1300px) {
    .products-container {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 801px) and (max-width: 1000px){
    .products-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 575px) and (max-width: 800px){
    .products-container {
        grid-template-columns: repeat(3, 1fr);
    }
}