@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    color: #333;
} */


/*=============== VARIABLES CSS ===============*/
:root {
    --header-height: 3.5rem;
  
    /*========== Colors ==========*/
    /*Color mode HSL(hue, saturation, lightness)*/
    --first-color: hsl(230, 62%, 56%);
    --title-color: hsl(230, 70%, 16%);
    --text-color: hsl(230, 16%, 45%);
    --border-color: hsl(230, 50%, 90%);
    --white-color: hsl(0, 0%, 100%);
    --body-color: hsl(230, 100%, 96%);
    --container-color: hsl(230, 100%, 97%);
}  



.logo {
    font-size: 25px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
}

#cart-icon {
    position: relative;
    display: flex;
    font-size: 30px;
    cursor: pointer;
}

#cart-icon .cart-item-count {
    position: absolute;
    top: -5px;
    right: -10px;
    min-width: 22px;
    height: 22px;
    background: var(--first-color);
    border-radius: 50%;
    font-size: 13px;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
}

.shop{
    padding: 100px 9% 30px;
}

.section-title{
    font-size: 35px;
    text-align: center;
    margin-bottom: 15px;
}

.product-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 items per row */
    gap: 20px; /* Space between items */
    justify-content: center;
    padding: 20px;
}

.product-box {
    background-color: var(--container-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.product-box:hover {
    transform: translateY(-5px);
}

.img-box {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 10px;
}

.img-box img {
    width: 150px; /* Fixed width */
    height: 200px; /* Fixed height */
    object-fit: cover; /* Crop images to fit */
    transition: 0.5s;
}

.img-box:hover img{
    transform: scale(1.1);
}

.product-box .product-title{
    font-size: 20px;
    margin-top: 10px;
}

.product-box .price-and-cart{
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-and-cart .price{
    font-size: 18px;
    font-weight: 500;
}

.price-and-cart .add-cart{
    padding: 10px;
    background: var(--first-color);
    border-radius: 6px;
    font-size: 20px;
    color: #fff;
    cursor: pointer;
}

.cart{
    position: fixed;
    top: 0;
    right: -100%;
    width: 360px;
    height: 100%;
    background: var(--body-color);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    padding: 65px 20px 40px;
    z-index: 100;
    overflow: auto;
    transition: 0.5s;
    
}

.cart.active{
    right: 0;
} 

.cart-title{
    text-align: center;
    font-size: 30px;
}

.cart-box{
    display: flex;
    align-items: center;
    margin-top: 20px;
}

.cart-box img{
    width: 150px;
    height: 200px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 20px;
}

.cart-detail{
    display: grid;
    gap: 8px;
    margin-right: auto;
}

.cart-product-title{
    font-size: 16px;
    line-height: 1;
}

.cart-price{
    font-weight: 500;
}

.cart-quantity{
    display: flex;
    width: 100px;
    border: 1px solid #999;
    border-radius: 6px;
}


.cart-quantity button{
    background: transparent;
    width: 30px;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.cart-quantity #decrement{
    color: #999;
}

.cart-quantity .number{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    border-left: 1px solid #999;
    border-right: 1px solid #999;
    cursor: default;
}

.cart-remove{
    font-size: 25px;
    cursor: pointer;
}

.total{
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px solid #333;
    margin-top: 20px;
    font-size: 18px;
}

.total-price{
    margin-left: 10px;
    font-weight: 600;
}

.btn-buy{
    display: block;
    padding: 10px 30px;
    background: var(--first-color);
    border: none;
    border-radius: 6px;
    font-size: 16px;
    color: #fff;
    margin: 20px auto 0;
    cursor: pointer;
}

#cart-close{
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
}

.cart-summary {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}



/* Media Query for Mobile Devices */
@media screen and (max-width: 768px) {
    .shop {
        padding: 50px 5% 20px;
    }

    .product-content {
        grid-template-columns: repeat(2, 1fr); /* Show 2 items per row on mobile */
        gap: 15px;
    }

    .product-box {
        padding: 10px;
    }

    .img-box img {
        width: 120px;
        height: 160px;
    }

    .cart {
        width: 100%; /* Make cart full width on mobile */
        right: -100%;
    }

    .cart.active {
        right: 0;
    }

    .cart-title {
        font-size: 24px;
    }

    .cart-box img {
        width: 100px;
        height: 130px;
    }

    .total {
        font-size: 16px;
    }

    .btn-buy {
        padding: 8px 20px;
        font-size: 14px;
    }
}
