/* [cazrom_bestsellers] : tabs per main category , one row of the catalog's product cards , a Shop button.
 * The cards themselves are the catalog's ( .czp ) ; everything in here is scoped under .czb.
 * The phone layout is in cazrom_bestsellers_mobile.css. */

.czb { --czb-gap: 18px; position: relative; width: 100%; max-width: 1440px; margin: 0 auto; box-sizing: border-box; }
.czb *, .czb *::before, .czb *::after { box-sizing: border-box; }
/* the catalog's root brings a page's worth of padding , the carousel sits in whatever section it is put in */
.czb .czp.czb-catalog { max-width: none; margin: 0; padding: 0; }

/* ----- the tabs : the catalog's filter pills , in a row that scrolls when it does not fit ----- */
.czb .czb-tabs { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; margin: 0 0 18px; padding: 2px; }
.czb .czb-tabs::-webkit-scrollbar { display: none; }
.czb .czb-tabs-inner { display: flex; flex-wrap: nowrap; gap: 8px; width: max-content; }
.czb.czb-tabs-center .czb-tabs-inner { margin: 0 auto; }
.czb.czb-tabs-right .czb-tabs-inner { margin: 0 0 0 auto; }
.czb .czb-tab { flex: none; cursor: pointer; }
.czb .czb-tab.is-selected, .czb .czb-tab.is-selected:hover, .czb .czb-tab.is-selected:focus, .czb .czb-tab.is-selected:active {
    background: var(--czp-ink); color: #fff; border: 1px solid var(--czp-ink);
}

/* ----- the row ----- */
.czb .czb-stage { position: relative; }
.czb .czp .czb-track {
    display: grid; grid-auto-flow: column; grid-template-columns: none;
    grid-auto-columns: calc((100% - 3 * var(--czb-gap)) / 4);
    gap: var(--czb-gap); overflow-x: auto; overscroll-behavior-x: contain;
    /* a swipe follows the finger , then glides to the nearest card */
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    /* room for the cards' hover shadow , which the scrolling box would otherwise cut */
    padding: 8px 4px 16px; margin: -8px -4px -16px; scroll-padding: 0 4px;
    scrollbar-width: none;
}
.czb .czp .czb-track::-webkit-scrollbar { display: none; }
.czb .czp .czb-track > .czp-card { scroll-snap-align: start; }
/* a product of another tab */
.czb .czp .czb-track > .czp-card.czb-off { display: none !important; }
/* fewer cards than fit : keep them on the side the tabs are on */
.czb.czb-tabs-center .czp .czb-track.is-short { justify-content: center; }
.czb.czb-tabs-right .czp .czb-track.is-short { justify-content: end; }

/* ----- chevrons , like the details page's ----- */
.czb .czp .czb-nav, .czb .czp .czb-nav:hover, .czb .czp .czb-nav:focus, .czb .czp .czb-nav:active {
    position: absolute; top: 38%; z-index: 4; transform: translateY(-50%);
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    background: #fff; color: var(--czp-ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); cursor: pointer;
}
.czb .czp .czb-nav:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.czb .czp .czb-nav:focus-visible { outline: 2px solid var(--czp-ink); outline-offset: 2px; }
.czb .czp .czb-nav-prev { left: -14px; }
.czb .czp .czb-nav-next { right: -14px; }
.czb .czp .czb-nav[hidden] { display: none; }

/* which pair is showing : phones only */
.czb .czb-dots { display: none; }

/* ----- the button under the row ----- */
.czb .czb-foot { display: flex; justify-content: center; margin-top: 30px; }
.czb.czb-tabs-left .czb-foot { justify-content: flex-start; }
.czb.czb-tabs-right .czb-foot { justify-content: flex-end; }

/* tablets : three across */
@media (max-width: 1100px) {
    .czb { --czb-gap: 14px; }
    .czb .czp .czb-track { grid-auto-columns: calc((100% - 2 * var(--czb-gap)) / 3); }
    .czb .czp .czb-nav-prev { left: -6px; }
    .czb .czp .czb-nav-next { right: -6px; }
}

@media (prefers-reduced-motion: reduce) {
    .czb .czp .czb-track { scroll-behavior: auto; }
}
