/* Suggestions rail (bag + checkout), owner 2026-12-02: a swipe row of small cards, each adds with one tap.
   Markup: app/Views/store/partials/reco-rail.php. Every option here is set in the theme editor (App\Services\BagTheme):
   data-size small|medium|large (cards a row), data-ratio portrait|square, data-fit cover|contain,
   data-btn outline|solid, data-arrows on|off, and the offer colours as --offer-* on the rail itself. */
/* contain: the row of cards never widens what holds it (it did on the checkout, inside a grid column) */
.rn-reco { --reco-per: 2.14; --reco-gap: 12px; --offer-cut: #e3172a; position: relative; grid-column: 1 / -1; width: 100%; min-width: 0; max-width: 100%; contain: inline-size; }
.rn-reco[data-size="small"] { --reco-per: 3.14; --reco-gap: 10px; }
.rn-reco[data-size="large"] { --reco-per: 1.4; }
.rui-co-suggest { min-width: 0; max-width: 100%; }
.rn-reco .rn-reco__track { display: flex; gap: var(--reco-gap); margin: 0; padding: 0 0 2px; list-style: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.rn-reco .rn-reco__track::-webkit-scrollbar { display: none; }
/* whole cards and the edge of the next one, so it reads as a row that moves */
.rn-reco .rn-reco__card { flex: 0 0 calc((100% - var(--reco-gap) * 2) / var(--reco-per)); display: flex; flex-direction: column; gap: 0; min-width: 0; padding: 0; border: 0; background: none; overflow: hidden; scroll-snap-align: start; transition: opacity .2s; }
.rn-reco__media { position: relative; display: block; aspect-ratio: 4 / 5; background: #f7f7f3; overflow: hidden; }
.rn-reco[data-ratio="square"] .rn-reco__media { aspect-ratio: 1 / 1; }
.rn-reco__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rn-reco[data-fit="contain"] .rn-reco__media img { object-fit: contain; }
.rn-reco__why { position: absolute; inset-block-start: 6px; inset-inline-start: 6px; max-width: calc(100% - 12px); padding: 2px 7px; overflow: hidden; background: #fff; color: #222; font-size: 10.5px; font-weight: 600; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.rn-reco__why--viewed { background: #222; color: #fff; }
.rn-reco__name, .rn-reco__insp, .rn-reco__price, .rn-reco__unlock { display: block; min-width: 0; max-width: 100%; }
.rn-reco__name { margin-block-start: 8px; overflow: hidden; color: var(--rui-text, #222); font-size: 14px; font-weight: 600; line-height: 1.3; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.rn-reco__insp { overflow: hidden; color: var(--rui-text-muted, #77776f); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.rn-reco__price { margin-block-start: 4px; color: var(--rui-text-muted, #77776f); font-size: 12px; }
.rn-reco__price b { color: var(--rui-text, #222); font-size: 13px; font-weight: 700; }
.rn-reco__price s { margin-inline-start: 4px; }
.rn-reco__price.is-cut b { color: color-mix(in srgb, var(--offer-cut) 88%, #000); }
.rn-reco__unlock { display: none; margin-block-start: 3px; color: #2f6b45; font-size: 11px; line-height: 1.4; }
.rn-reco__card.is-unlock .rn-reco__unlock { display: block; }
.rn-reco__form { margin: 0; margin-block-start: auto; padding-block-start: 8px; }
.rn-reco__add { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; min-height: 40px; margin: 0; margin-block-start: auto; padding: 0 8px; border: 1px solid #222; border-radius: 0; background: var(--rui-surface, #fff); color: #222; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.rn-reco__card > .rn-reco__add { margin-block-start: 8px; }
.rn-reco__add:hover:not(:disabled) { background: #222; color: #fff; }
.rn-reco[data-btn="solid"] .rn-reco__add { background: #222; color: #fff; }
.rn-reco[data-btn="solid"] .rn-reco__add:hover:not(:disabled) { background: #fff; color: #222; }
.rn-reco__add:focus-visible, .rn-reco__nav:focus-visible { outline: 2px solid #222; outline-offset: 2px; }
.rn-reco__add:disabled { opacity: .5; cursor: default; }
.rn-reco .rn-reco__add.is-added { border-color: #2f8f4e; background: #fff; color: #2f8f4e; opacity: 1; }
.rn-reco__card.is-added { opacity: .6; }
.rn-reco[data-size="small"] .rn-reco__name { font-size: 12.5px; }
.rn-reco[data-size="small"] .rn-reco__add { min-height: 36px; font-size: 11.5px; }
.rn-reco[data-size="small"] .rn-reco__add svg { display: none; }
.rn-reco__nav { position: absolute; inset-block-start: 32%; z-index: 2; display: none; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid #222; border-radius: 0; background: #fff; color: #222; cursor: pointer; }
.rn-reco__nav[hidden], .rn-reco[data-arrows="off"] .rn-reco__nav { display: none !important; }
.rn-reco__nav--prev { inset-inline-start: -6px; }
.rn-reco__nav--next { inset-inline-end: -6px; }
.rn-reco__nav:hover { background: #222; color: #fff; }
[dir="rtl"] .rn-reco__nav svg { transform: scaleX(-1); }
@media (hover: hover) and (pointer: fine) { .rn-reco__nav { display: flex; } }
@media (prefers-reduced-motion: reduce) { .rn-reco .rn-reco__track { scroll-behavior: auto; } .rn-reco .rn-reco__card, .rn-reco__add { transition: none; } }
/* the bag as a page (/cart) is wider: two more cards a row there */
.rcd--page .rn-reco { --reco-per: 4.14; }
.rcd--page .rn-reco[data-size="small"] { --reco-per: 5.14; }
.rcd--page .rn-reco[data-size="large"] { --reco-per: 3.14; }
@media (max-width: 850px) { .rcd--page .rn-reco { --reco-per: 2.14; } .rcd--page .rn-reco[data-size="small"] { --reco-per: 3.14; } .rcd--page .rn-reco[data-size="large"] { --reco-per: 1.4; } }
