body {
    background-color: #f8f1e9;
    font-family: 'Arial', sans-serif;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#product-grid .col-md-4 {
    display: flex;
}

.product-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 400px;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    height: 400px;
    /* Fixed height for main image */
    width: 100%;
    /* Full card width */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    background-color: #fff;
    /* Fallback for minor gaps */
}

.product-image img.card-img-top {
    width: 100%;
    /* Fill card width */
    height: 400px;
    /* Match container height */
    object-fit: cover;
    /* Fill area with minimal cropping */
    object-position: center;
    /* Center to reduce edge cropping */
    border-radius: 10px 10px 0 0;
}

.product-image-container {
    background-color: #fff;
    /* White background for image section */
}

.image-thumbs {
    width: 100%;
    /* Match card width */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding: 20px 10px;
    /* Increased padding for clear separation */
    background-color: #e8d9c8;
    /* Darker shade for distinction */
    border-top: 2px solid #d0d0d0;
    /* Thicker separator line */
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Subtle shadow for depth */
}

.image-thumbs img {
    width: 50px;
    height: 50px;
    margin: 0 10px;
    /* Increased spacing between thumbnails */
    cursor: pointer;
    border: 2px solid transparent;
    object-fit: cover;
    /* Thumbnails fill area with minimal cropping */
    object-position: center;
    border-radius: 4px;
    /* Slight rounding for thumbnails */
    transition: transform .2s;
}

.image-thumbs img:hover,
.image-thumbs img.active {
    border-color: #8f8582;
    transform: scale(1.5); 
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: 20px;
    /* Increased spacing after thumbnails */
}

.btn-add-to-cart,
.btn-remove-from-cart {
    width: 100%;
}

.hidden {
    display: none;
}

.spinner-border {
    margin-left: 10px;
}

/* Style to ensure coupon row stands out */
.coupon-row {
    border-top: 2px solid #ddd;
    /* Visual separation */
}

#coupon-discount {
    font-weight: bold;
    color: #28a745;
    /* Green for discount, optional */
}

@media (max-width: 576px) {
    .text-end {
        text-align: right !important;
    }

    #coupon-discount {
        font-size: 0.9rem;
    }
}

/* Ensure basket is visible on mobile */
@media (max-width: 576px) {
    .navbar-nav {
        flex-direction: row !important;
    }

    .nav-item {
        padding: 0 10px;
    }

    #cart-count {
        font-size: 0.9rem;
        padding: 2px 6px;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }
}

/* Optional: Sticky basket on scroll */
.navbar.fixed-top {
    z-index: 1000;
}

.nav-link {
    white-space: nowrap;
}

/* Customize button size for small devices */
.btn-remove-from-cart {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

@media (max-width: 576px) {
    .btn-remove-from-cart {
        padding: 0.1rem 0.3rem;
        font-size: 0.8rem;
    }

    .btn-remove-from-cart .fas {
        margin: 0;
    }
}

.product-image-container {
    position: relative;
}

.product-image img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
}

.image-thumbs {
    display: flex;
    gap: 1px;
    margin-top: 5px;
}

.image-thumbs img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    cursor: pointer;
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-body {
    flex-grow: 1;
}

.contents-text {
    margin-top: 10px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.contents-text:hover {
    text-decoration: underline;
}

.price-text {
    display: inline;
}