/*
 * Partijaanbiedingen: a scrolling row of product cards on small screens, a
 * plain grid once they all fit.
 *
 * The number of offers comes from an unbounded admin-ordered query, so nothing
 * here assumes there are five. auto-fit with a minimum keeps any count tidy.
 */

.promo-row {
    display: flex;
    gap: var(--shop-gap-tight);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    /* Hides the bar on platforms that show one over content; the row still
       scrolls, and the partially visible next card is the affordance. */
    scrollbar-width: none;
    /* Room inside the scroller, which clips on both axes, for a card's focus
       ring and hover lift - as the category strip has. Cancelled outside. */
    padding-block: 4px;
    margin-block: -4px;
}

.promo-row::-webkit-scrollbar {
    display: none;
}

/* Card widths belong to the container, never to the card — see
   product-card.css. Two cards and a clear sliver of a third: the sliver is
   what says "swipe". At 55% the second card was cut about in half at the
   screen edge, which reads as a grid that overflows rather than a row that
   moves, and the cards were a size larger than the catalogue's below. */
.promo-row > .product-card {
    flex: 0 0 44%;
    scroll-snap-align: start;
}

@media (min-width: 640px) {
    .promo-row {
        gap: 14px;
    }

    /* Three cards and a clear edge of the fourth (about 35-45px), the same
       cue a phone gets. At 32% the edge was 0-8px, which read as a glitch
       rather than as more to swipe. */
    .promo-row > .product-card {
        flex-basis: 30%;
    }
}

@media (min-width: 1024px) {
    .promo-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: var(--shop-space-4);
        overflow-x: visible;
        padding-block: 0;
        margin-block: 0;
    }

}
