/*
|--------------------------------------------------------------------------
| Homepage curated rows: Free Shipping Deals, Deals of the Day, Best Selling
|--------------------------------------------------------------------------
|
| Loaded after home-v2.css. It changes only the three product rows:
|
|   1. A fixed number of cards is visible (7 on desktop). Cards keep the same
|      width whether the section has 1 item or 20; extra items scroll
|      sideways. Fewer than 7 items sit at normal size from the left.
|   2. The product photo always fits completely inside its area.
|
| To change how many cards show, edit --curated-visible below.
|
*/

#free-products,
#deal-products,
#best-products {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    justify-content: start;
    overflow-x: visible;
}

/* Photo: fixed pixel heights on both the area and the image, so the whole
   product is always visible (scaled down to fit, never cropped). */
#free-products .product-image-wrap,
#deal-products .product-image-wrap,
#best-products .product-image-wrap {
    height: 155px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}

#free-products .product-image,
#deal-products .product-image,
#best-products .product-image {
    width: 100%;
    height: 155px;
    object-fit: contain;
    object-position: center;
}

/* Keep the price clear of the round cart button in the corner. */
#free-products .product-pricing,
#deal-products .product-pricing,
#best-products .product-pricing {
    padding-right: 34px;
}

/* Tablet: 3 per row */
@media (max-width: 991px) {
    #free-products,
    #deal-products,
    #best-products {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    #free-products .product-image-wrap,
    #deal-products .product-image-wrap,
    #best-products .product-image-wrap,
    #free-products .product-image,
    #deal-products .product-image,
    #best-products .product-image {
        height: 145px;
    }
}

/* Phone: 2 per row */
@media (max-width: 640px) {
    #free-products,
    #deal-products,
    #best-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    #free-products .product-image-wrap,
    #deal-products .product-image-wrap,
    #best-products .product-image-wrap,
    #free-products .product-image,
    #deal-products .product-image,
    #best-products .product-image {
        height: 135px;
    }

    #free-products .product-card,
    #deal-products .product-card,
    #best-products .product-card {
        padding: 9px 8px 10px;
    }

    #free-products .product-name,
    #deal-products .product-name,
    #best-products .product-name {
        font-size: 0.8rem;
        line-height: 1.25;
        height: 2.5em;
        margin-bottom: 6px;
    }

    #free-products .current-price,
    #deal-products .current-price,
    #best-products .current-price {
        font-size: 0.95rem;
    }
}

/*
| A Deal of the Day whose deal has ended: still shown, greyed out, labelled
| "Out of Stock" and not clickable.
*/
#free-products .product-card.is-out-of-stock,
#deal-products .product-card.is-out-of-stock,
#best-products .product-card.is-out-of-stock {
    cursor: not-allowed;
}

.product-card.is-out-of-stock .product-image {
    filter: grayscale(1);
    opacity: 0.5;
}

.product-card.is-out-of-stock .product-name,
.product-card.is-out-of-stock .current-price {
    color: #9aa0a6;
}

.product-card.is-out-of-stock .product-badge {
    background: #6c757d;
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
}


/*
| Price block on curated cards (homepage rows and the deals pages):
| the price on top, and under it either the struck-through old price
| (Deals of the Day, Best Selling) or the GHS amount (Free Shipping Deals).
| The second line always takes its space, so cards stay the same height.
*/
.product-card .product-pricing {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    flex-wrap: nowrap;
}

.product-card .product-pricing .original-price,
.product-card .product-pricing .cedi-equivalent,
.product-card .product-pricing .price-spacer {
    display: block;
    font-size: 0.92rem;
    line-height: 1.3;
    min-height: 1.3em;
    white-space: nowrap;
}

.product-card .product-pricing .original-price {
    color: #9199a5;
    font-weight: 600;
    text-decoration: line-through;
}

.product-card .product-pricing .cedi-equivalent {
    color: #202a36;
    font-weight: 800;
}
