@import url('https://fonts.cdnfonts.com/css/poppins');

body {
    font-family: Arial, sans-serif;
}

.main {
    padding: 20px;
    margin-top: 60px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.product {
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
    width: 100%;
    max-width: 200px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product:hover {
    transform: scale(1.05);
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
}

.product-image {
    width: 100%;
    height: auto;
}

.cart-btn {
    display: flex;
    flex-direction: column;
}

.cart {
    z-index: 1;
    position: fixed;
    right: -100%;
    top: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: #fff;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5);
    transition: right 0.5s ease;
    display: flex;
    flex-direction: column;
    color: #381616;

    /* Add this for vertical scrolling */
    overflow-y: scroll;
}


.cart.open {
    right: 0;
}

.cart-header {
    padding: 10px;
    background-color: white;
    color: black;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    margin-left: 15px;
    color: #381616;
}

.cart-header button {
    margin-right: 10px;
    width: 30px;
    transition: background-color 0.3s ease;
}

.cart-header button:hover {
    background-color: #864242;
    color: white;
}

.cart-body {
    /* padding: 20px; */
    overflow-y: auto;
    transition: all 0.3s ease;
}
.cart-container{
    margin: 3rem;
    
    
}
.cart-container .left-cart {
    margin-right: 2rem;
    font-size: 2.3rem;
    font-weight: 600;
    color: #381616;
}
.cart-container .right-cart {
    margin-left: 18rem;
    font-size: 2rem;
    font-weight: 500;
}
.cart-body li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    transition: transform 0.3s ease;
}

.cart-body li:hover {
    transform: scale(1.02);
}

.cart-body img {
    width: 70px;
    height: 90px;
    /* margin-right: 10px; */
    transition: transform 0.3s ease;
}

.cart-body img:hover {
    transform: scale(1.1);
}

.cart-product-details {
    flex-grow: 1;
    margin-right: 10px;
}

.quantity-controls {
    display: flex;
    align-items: center;
}

.quantity-controls input {
    width: 40px;
    text-align: center;
    margin: 0 5px;
    transition: border-color 0.3s ease;
}

.quantity-controls input:focus {
    border-color: #a55546;
    outline: none;
}

.remove-button {
    background-color: white !important;
    border: none;
    color: rgb(218, 26, 26);
    cursor: pointer;
    transition: color 0.3s ease;
}

.remove-button:hover {
    color: #ff6666;
}

.item-total-Rs,
.item-total {
    font-size: 14px;
    color: #504d4d;
}

.cart-footer {
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    font-size: 2rem;
    color: #381616;
}

.cart-footer p {
    margin: 10px;
    font-weight: bold;
    color: #481810;
    letter-spacing: 2px;
}

#checkout {
    background-color: #78362A;
    color: white;
    width: 100%;
    border: none;
    font-weight: bold;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease;
}

#checkout:hover {
    background-color:#78362A;
}

#close-cart {
    background-color: #78362A;
    border: none;
    color: white;
    height: 30px;
    width: 30px;
    font-size: 20px;
    line-height: 1px; 
    text-align: center; 
    padding-left: 9px; 
    cursor: pointer;
    border-radius: 1rem;
    transition: background-color 0.3s ease;
}


#close-cart:hover {
    background-color: #864242;
}

/* Media Queries */
@media (max-width: 768px) {
    .cart {
        width: 80%;
    }

    .product {
        width: 100%;
        max-width: none;
    }

    .cart-body li {
        flex-direction: row;
        align-items: flex-start;
    }

    .cart-body img {
        width: 60px;
        height: 80px;
    }

    .quantity-controls input {
        width: 30px;
    }

    #checkout {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .cart {
        width: 100%;
    }

    .cart-header h2 {
        font-size: 18px;
    }

    .cart-body img {
        width: 50px;
        height: 70px;
    }

    .quantity-controls input {
        width: 25px;
    }

    .cart-footer p {
        font-size: 16px;
    }
}
/* Style for the cart icon */
#carticon {
    position: relative;
    font-size: 24px; /* Adjust the icon size */
}

/* Style for the cart count badge */
#cart-count {
    position: absolute;
    top: -5px; /* Position the count above the cart icon */
    right: -5px; /* Position the count slightly to the right */
    background-color: rgb(0, 162, 255);
    color: white;
    padding: 2px 4px;
    border-radius: 50%;
    font-size: 10px;
    /* font-weight: bold; */
    line-height: 1;
    display: inline-block;
    min-width: 12px;
    text-align: center;
}
.cart::-webkit-scrollbar {
    height: 8px; 
}

.cart::-webkit-scrollbar-thumb {
    background-color: #32292842;
    /* border-radius: 1px; */
}

.cart::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* suggested products */

.suggested-products {
    margin: 20px;
    border-top: 2px solid #ccc;
    padding-top: 15px;
}

.suggested-products h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #78362A;
}

.suggested-container {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 10px 0;
    scrollbar-width: thin; /* For modern browsers */
    scrollbar-color: #78362A #f1f1f1;
}

.suggested-container::-webkit-scrollbar {
    height: 8px; /* Horizontal scrollbar height */
}

.suggested-container::-webkit-scrollbar-thumb {
    background-color: #78362A;
    border-radius: 5px;
}

.suggested-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.prod-card {
    flex: 0 0 auto; /* Ensures horizontal scrolling */
    width: 150px;
    text-align: center;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    background-color: #fff;
}

.prod-card img {
    max-width: 100%;
    height: 150px;
    border-radius: 5px;
}

.prod-card p {
    margin: 10px 0;
    font-size: 1.5rem;
    color: #481810;
    font-weight: 700;
}

.ad-to-cart {
    background-color: #78362A;
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
}

.ad-to-cart:hover {
    background-color: #5b291e;
}
