*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-white: #ffffff;
    --bg-light: #e2e1e1;
    --bg-red: #ff0000;
    --bg-dark: #ff9696;
    --tx-color: #000;
}

body{
    background-color: var(--bg-light);
    font-family: Arial, Helvetica, sans-serif;
}

.container{
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
}

h1{
    display: none;
}

h3{
    background-color: var(--bg-red);
    padding: 7px;
    text-align: center;
    font-size: 1rem;
    margin: 0;
    font-weight: 700;
}

nav{
    background-color: var(--bg-white);
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 12px;
    padding: 8px 10px;
}

nav a{
    text-decoration: none;
    color: var(--tx-color);
    margin: 0 1%;
    font-weight: 600;
    line-height: 1.2;
}

nav img{
    width: 80px;
    margin: 5px 0;
}

.cart-toggle-btn,
.close-cart-btn,
.primary-btn,
.secondary-btn,
.remove-btn{
    font: inherit;
}

.cart-toggle-btn{
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.cart-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 998;
}

.cart-overlay.show{
    opacity: 1;
    visibility: visible;
}

.cart-sidebar{
    position: fixed;
    top: 0;
    right: -420px;
    width: min(100%, 420px);
    height: 100vh;
    background: #fff;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: right 0.25s ease;
}

.cart-sidebar.open{
    right: 0;
}

.cart-header,
.cart-footer{
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.cart-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-cart-btn{
    border: none;
    background: transparent;
    font-size: 1.6rem;
    cursor: pointer;
}

.cart-items{
    list-style: none;
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
}

.cart-item{
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cart-item p{
    font-size: 0.92rem;
    color: #555;
    margin-top: 4px;
}

.cart-item-actions{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.remove-btn{
    border: none;
    background: #ff0000;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
}

.cart-total-row{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 1.05rem;
}

.primary-btn,
.secondary-btn{
    width: 100%;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    margin-top: 8px;
}

.primary-btn{
    border: none;
    background: #ff0000;
    color: #fff;
    font-weight: 700;
}

.secondary-btn{
    border: 1px solid #ccc;
    background: #fff;
}

.primary-btn:disabled{
    opacity: 0.6;
    cursor: not-allowed;
}

.empty-cart{
    color: #666;
    text-align: center;
    padding: 16px 0;
}

body.cart-open{
    overflow: hidden;
}

h2{
    margin: 30px 0 20px;
    text-align: center;
}

.h5{
    margin: 0;
}

.card{
    display: grid;
    grid-template-columns: repeat(5, 180px);
    justify-content: center;
    gap: 16px;
    align-items: stretch;
}

.col{
    display: flex;
    width: 180px;
}

.h-100{
    display: flex;
    flex-direction: column;
    width: 180px;
    min-height: 280px;
    background-color: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    align-items: center;
}

.card-img-top{
    width: 100%;
    height: 160px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.card-body,
.card-footer{
    padding: 10px;
    align-items: center;
}

.card-body{
    text-align: center;
    margin-top: 6px;
}

.card-body p{
    font-size: 0.9rem;
    color: var(--tx-color);
    margin-top: 6px;
    font-weight: 500;
}

.card-footer{
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 10px;
    width: 100%;
}

.card-actions{
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-input{
    width: 58px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-align: center;
}

.cart-btn{
    border: none;
    background-color: var(--bg-red);
    color: var(--bg-white);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 1rem;
}

.container-footer{
    display: grid;
    grid-template-columns: 1fr 1fr;
    text-align: center;
}

.container-footer p{
    margin: 10px 0;
}

footer{
    text-align: center;
}

footer .container{
    margin: 20px auto;
}

.container-footer{
    justify-items: center;
    align-items: start;
}

.sub-container{
    width: 100%;
    max-width: 420px;
}

.copy-footer{
    background-color: var(--bg-dark);
    padding: 10px;
}

@media (max-width: 1100px){
    .card{
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px){
    .card{
        grid-template-columns: repeat(3, 1fr);
    }

    h3{
        font-size: 0.95rem;
    }
}

@media (max-width: 680px){
    .container{
        width: 95%;
    }

    .card{
        grid-template-columns: repeat(2, minmax(140px, 180px));
        justify-content: center;
    }

    .col,
    .h-100{
        width: 100%;
        max-width: 180px;
    }

    h3{
        font-size: 0.9rem;
        padding: 8px;
    }
}

@media (max-width: 480px){
    nav{
        flex-direction: column;
    }

    .cart-toggle-btn{
        width: 100%;
        justify-content: center;
    }

    nav a{
        margin: 4px 0;
    }

    .card{
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: center;
    }

    .col,
    .h-100{
        width: 100%;
    }

    .card-img-top{
        height: 140px;
    }
}