/* Storefront card styles for the public catalog: shop, grid3, bento and
   spotlight, plus their discount badge, price chip and inline size chips.
   Linked by company.php next to public-biz.css; colours come only from the
   page tokens so every preset stays native. Behaviour lives in
   js/biz-public.js (size chips, spotlight dots and arrows). */

:root {
    --shop-plinth: color-mix(in srgb, var(--accent) 7%, var(--biz-ink-soft));
    --shop-chip-bg: color-mix(in srgb, var(--bg) 92%, transparent);
    --shop-on-photo: #ffffff;
    --shop-scrim: linear-gradient(180deg, rgb(0 0 0 / 0) 28%, rgb(0 0 0 / 0.56) 56%, rgb(0 0 0 / 0.86) 100%);
    --shop-scrim-soft: linear-gradient(180deg, rgb(0 0 0 / 0) 40%, rgb(0 0 0 / 0.5) 100%);
    --shop-glass: rgb(0 0 0 / 0.45);
    --shop-glass-line: rgb(255 255 255 / 0.4);
    --shop-text-shadow: 0 1px 10px rgb(0 0 0 / 0.45);
    --shop-lift: 0 10px 28px rgb(15 23 42 / 0.12);
    --shop-tile-radius: min(var(--radius-card), 14px);
}

/* ── Shared: discount badge and size chips ───────────────── */
/* On the photo's corner (or the tile's, when there is no photo). */
.mn-item--shop .mn-item__discount,
.mn-item--grid3 .mn-item__discount,
.mn-item--bento .mn-item__discount,
.mn-item--spotlight .mn-item__discount {
    position: absolute;
    top: var(--sl-space-2);
    inset-inline-start: var(--sl-space-2);
    z-index: var(--sl-z-raised);
    min-height: 26px;
    padding: 2px 10px;
    border: 0;
    border-radius: min(var(--radius-btn), 8px);
    background: var(--accent);
    color: var(--accent-ink);
    font-size: var(--sl-text-sm);
    font-weight: var(--sl-weight-heavy);
    line-height: 1.3;
    font-family: var(--page-font);
    opacity: 1;
    box-shadow: 0 2px 8px var(--accent-glow);
    pointer-events: none;
}

/* Equal columns: three across, or two by two for four sizes. */
.mn-item--shop .mn-sizes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
}

.mn-item--shop .mn-sizes:has(> :nth-child(4)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mn-item--shop .mn-size {
    justify-content: center;
    min-width: 0;
    padding: 2px 6px;
    text-align: center;
}

.mn-item--shop .mn-size,
.mn-item--spotlight .mn-size {
    background: var(--biz-surface);
}

.mn-item--shop .mn-size[aria-checked="true"],
.mn-item--spotlight .mn-size[aria-checked="true"] {
    background: var(--biz-tint);
}

/* Narrow cards show the picked size's price in the foot instead. */
.mn-item--shop .mn-size__price {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    white-space: nowrap;
}

.mn-item--shop .mn-size abbr,
.mn-item--bento .mn-size abbr,
.mn-item--spotlight .mn-size abbr {
    text-decoration: none;
}

.mn-item[data-soldout] .mn-sizes {
    opacity: 0.5;
}

/* ── shop: product grid with a wide add button ───────────── */
.mn-list--shop {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sl-space-3);
}

.mn-item--shop {
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.mn-item--shop .mn-item__media {
    aspect-ratio: 1;
    margin: 6px 6px 0;
    border-radius: calc(var(--biz-radius) - 4px);
    background: var(--shop-plinth);
}

.mn-item--shop .mn-item__media--empty {
    background:
        radial-gradient(120% 90% at 50% 0%, var(--biz-tint-strong) 0%, transparent 72%),
        var(--shop-plinth);
}

.mn-item--shop .mn-item__body {
    gap: var(--sl-space-1);
    padding: var(--sl-space-3) var(--sl-space-3) var(--sl-space-3);
}

.mn-item--shop .mn-item__badges .mn-badge:nth-child(n + 2) {
    display: none;
}

.mn-item--shop .mn-item__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: var(--sl-text-sm);
    font-weight: var(--sl-weight-semibold);
    line-height: var(--sl-leading-ui);
}

.mn-item--shop .mn-item__desc {
    -webkit-line-clamp: 1;
    line-clamp: 1;
    font-size: var(--sl-text-xs);
}

.mn-item--shop .mn-item__meta {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mn-item--shop .mn-item__foot {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sl-space-2);
    padding-top: var(--sl-space-2);
}

.mn-item--shop .mn-item__price {
    align-self: flex-start;
    flex-wrap: wrap;
    max-width: 100%;
    font-size: var(--sl-text-lg);
}

.mn-item--shop .mn-item__out {
    align-self: flex-start;
}

.mn-add--wide,
.mn-item--shop .mn-add {
    display: inline-flex;
    gap: 6px;
    width: 100%;
    height: auto;
    min-height: 44px;
    margin: 0;
    padding: 0 var(--sl-space-3);
    border-radius: min(var(--radius-btn), 12px);
    font-family: inherit;
    font-size: var(--sl-text-sm);
    font-weight: var(--sl-weight-bold);
    line-height: 1.2;
    white-space: nowrap;
}

.mn-add--wide .sl-i,
.mn-item--shop .mn-add .sl-i {
    flex-shrink: 0;
    font-size: 18px;
}

.mn-add--wide:hover,
.mn-item--shop .mn-add:hover {
    transform: translateY(-1px);
}

.mn-add--wide:active,
.mn-item--shop .mn-add:active {
    transform: translateY(1px);
}

@media (hover: hover) {
    .mn-item--shop:hover {
        box-shadow: var(--shop-lift);
        transform: translateY(-2px);
    }
}

/* ── grid3: a tight three-up photo grid ───────────────────── */
.mn-list--grid3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sl-space-3) 6px;
}

.mn-item--grid3 {
    border: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
}

.mn-item--grid3 .mn-item__media {
    aspect-ratio: 1;
    border-radius: var(--shop-tile-radius);
}

.mn-item--grid3.has-photo .mn-item__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--shop-scrim-soft);
    opacity: 0.6;
    pointer-events: none;
}

.mn-item--grid3 .mn-item__media--empty > span[aria-hidden] {
    font-size: var(--sl-text-2xl);
}

.mn-item--grid3 .mn-item__open::after {
    border-radius: var(--shop-tile-radius);
}

.mn-item--grid3 .mn-item__body {
    gap: 0;
    padding: 6px 2px 0;
}

.mn-item--grid3 .mn-item__name {
    overflow: hidden;
    font-size: var(--sl-text-xs);
    font-weight: var(--sl-weight-semibold);
    line-height: var(--sl-leading-ui);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mn-item--grid3 .mn-item__open {
    display: block;
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
}

.mn-item--grid3 .mn-item__badges,
.mn-item--grid3 .mn-item__desc,
.mn-item--grid3 .mn-item__meta {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Too small for chips: the add button opens the item sheet instead. */
.mn-item--grid3 .mn-sizes,
.mn-item--bento .mn-sizes {
    display: none;
}

.mn-item--grid3 .mn-item__foot {
    padding: 0;
}

.mn-item--grid3 .mn-item__price-chip {
    position: absolute;
    bottom: 6px;
    inset-inline-start: 6px;
    z-index: var(--sl-z-raised);
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    max-width: calc(100% - 12px);
    padding: 2px 8px;
    border-radius: min(var(--radius-btn), 8px);
    background: var(--shop-chip-bg);
    color: var(--text-h);
    font-size: var(--sl-text-xs);
    font-weight: var(--sl-weight-heavy);
    line-height: 1.5;
    font-family: var(--page-font);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 1;
    backdrop-filter: blur(6px);
    pointer-events: none;
}

.mn-item--grid3 .mn-item__price-chip abbr {
    text-decoration: none;
}

.mn-item--grid3 .mn-item__price-chip .mn-item__from {
    font-weight: var(--sl-weight-medium);
}

.mn-item--grid3 .mn-item__discount {
    top: 6px;
    inset-inline-start: 6px;
    min-height: 22px;
    padding: 1px 7px;
    font-size: var(--sl-text-xs);
}

.mn-item--grid3 .mn-add {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    width: 36px;
    height: 36px;
    font-size: 18px;
    box-shadow: var(--biz-photo-shadow);
}

.mn-item--grid3 .mn-item__out {
    position: absolute;
    top: 6px;
    inset-inline-end: 6px;
    z-index: var(--sl-z-raised);
    background: var(--shop-chip-bg);
    color: var(--text-h);
}

@media (min-width: 571px) {
    .mn-list--shop {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mn-list--grid3 {
        gap: var(--sl-space-4) var(--sl-space-2);
    }

    .mn-item--grid3 .mn-item__name {
        font-size: var(--sl-text-sm);
    }
}

/* ── bento: a mosaic of photo tiles ──────────────────────── */
.mn-list--bento {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row dense;
    gap: var(--sl-space-2);
}

.mn-item--bento {
    overflow: hidden;
    aspect-ratio: 1;
    border-radius: var(--shop-tile-radius);
    color: var(--shop-on-photo);
}

.mn-item--bento.mn-item--big {
    grid-row: span 2;
    grid-column: span 2;
}

.mn-item--bento .mn-item__open::after {
    border-radius: var(--shop-tile-radius);
}

.mn-item--bento .mn-item__media {
    position: absolute;
    inset: 0;
}

.mn-item--bento.has-photo .mn-item__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--shop-scrim);
    pointer-events: none;
}

.mn-item--bento .mn-item__body {
    position: relative;
    justify-content: flex-end;
    gap: 2px;
    padding: var(--sl-space-3);
}

.mn-item--bento.has-photo .mn-item__body {
    text-shadow: var(--shop-text-shadow);
}

.mn-item--bento.has-photo .mn-item__name,
.mn-item--bento.has-photo .mn-item__price,
.mn-item--bento.has-photo .mn-item__desc,
.mn-item--bento.has-photo .mn-item__meta,
.mn-item--bento.has-photo .mn-item__from,
.mn-item--bento.has-photo .mn-item__was {
    color: var(--shop-on-photo);
}

/* Price styles on a photo: the pill turns to glass, the tag keeps its ink. */
.pr-pill .mn-item--bento.has-photo .mn-item__price {
    background: var(--shop-glass);
    backdrop-filter: blur(6px);
}

.pr-tag .mn-item--bento.has-photo .mn-item__price,
.pr-tag .mn-item--bento.has-photo .mn-item__from,
.pr-tag .mn-item--bento.has-photo .mn-item__was {
    color: var(--accent-ink);
    text-shadow: none;
}

.mn-item--bento .mn-item__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: var(--sl-text-sm);
    line-height: var(--sl-leading-tight);
}

.mn-item--bento .mn-item__badges {
    display: none;
}

.mn-item--bento .mn-item__desc,
.mn-item--bento .mn-item__meta {
    display: none;
}

.mn-item--bento .mn-item__foot {
    flex-wrap: nowrap;
    margin-top: 0;
    padding-top: 2px;
}

.mn-item--bento .mn-item__price {
    flex-wrap: wrap;
    min-width: 0;
    font-size: var(--sl-text-sm);
}

/* Small tiles: the discount badge already tells the saving. */
.mn-item--bento:not(.mn-item--big) .mn-item__was {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    white-space: nowrap;
}

.mn-item--bento:not(.mn-item--big) .mn-item__price {
    flex-wrap: nowrap;
}

.mn-item--bento .mn-add {
    width: 36px;
    height: 36px;
    font-size: 18px;
}

.mn-item--bento .mn-item__out {
    position: absolute;
    top: var(--sl-space-2);
    inset-inline-end: var(--sl-space-2);
    background: var(--shop-chip-bg);
    color: var(--text-h);
    text-shadow: none;
}

/* No photo: a solid tinted tile with the initial as a watermark. */
.mn-item--bento.no-photo {
    border-color: transparent;
    background:
        radial-gradient(130% 100% at 100% 0%, var(--biz-tint-strong) 0%, transparent 70%),
        linear-gradient(var(--biz-tint), var(--biz-tint)),
        var(--biz-surface);
    color: var(--text-h);
}

.mn-item--bento.no-photo:nth-child(3n + 2) {
    background:
        radial-gradient(130% 100% at 0% 100%, var(--biz-tint-strong) 0%, transparent 70%),
        linear-gradient(var(--biz-ink-soft), var(--biz-ink-soft)),
        var(--biz-surface);
}

.mn-item--bento .mn-item__media--empty {
    background: none;
}

.mn-item--bento .mn-item__media--empty > span[aria-hidden] {
    position: absolute;
    top: var(--sl-space-2);
    inset-inline-start: var(--sl-space-3);
    font-size: var(--sl-text-display);
    opacity: 0.35;
}

/* Two columns on phones: an odd small tile closes its row as a wide one. */
@media (max-width: 570px) {
    .mn-item--bento:not(.mn-item--big):nth-child(odd of :not(.mn-item--big)):nth-last-child(1 of :not(.mn-item--big)) {
        grid-column: span 2;
        aspect-ratio: 2 / 1;
    }
}

/* Without a photo a big tile is a full-width band as tall as its text. */
.mn-item--bento.mn-item--big.no-photo {
    grid-row: auto;
    grid-column: 1 / -1;
    aspect-ratio: auto;
    min-height: 220px;
}

/* Big tiles get room for a description and the size chips. */
.mn-item--bento.mn-item--big .mn-item__body {
    gap: var(--sl-space-1);
    padding: var(--sl-space-4);
}

.mn-item--bento.mn-item--big .mn-item__badges {
    display: flex;
    margin-bottom: var(--sl-space-1);
}

.mn-item--bento.mn-item--big.has-photo .mn-badge {
    background: var(--shop-glass);
    color: var(--shop-on-photo);
    text-shadow: none;
    backdrop-filter: blur(6px);
}

.mn-item--bento.mn-item--big .mn-badge--featured,
.mn-item--bento.mn-item--big.has-photo .mn-badge--featured {
    background: var(--accent);
    color: var(--accent-ink);
}

.mn-item--bento.mn-item--big .mn-item__name {
    font-family: var(--title-font);
    font-size: var(--sl-text-2xl);
}

.mn-item--bento.mn-item--big .mn-item__desc {
    display: -webkit-box;
}

.mn-item--bento.mn-item--big .mn-item__price {
    font-size: var(--sl-text-lg);
}

.mn-item--bento.mn-item--big .mn-add {
    width: 44px;
    height: 44px;
    font-size: 22px;
}

.mn-item--bento.mn-item--big .mn-sizes {
    display: flex;
    margin-top: var(--sl-space-1);
}

.mn-item--bento.mn-item--big .mn-size {
    flex: 0 1 auto;
    text-shadow: none;
}

.mn-item--bento.mn-item--big.has-photo .mn-size {
    border-color: var(--shop-glass-line);
    background: var(--shop-glass);
    color: var(--shop-on-photo);
    backdrop-filter: blur(6px);
}

.mn-item--bento.mn-item--big.has-photo .mn-size[aria-checked="true"] {
    border-color: var(--shop-on-photo);
    background: var(--shop-on-photo);
    color: var(--biz-mask);
}

.mn-item--bento.has-photo .mn-size:focus-visible,
.mn-item--bento.has-photo .mn-add:focus-visible,
.mn-item--bento.has-photo .mn-item__open:focus-visible::after {
    outline-color: var(--shop-on-photo);
}

@media (min-width: 571px) {
    .mn-list--bento {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ── spotlight: one item per screen, swiped sideways ──────── */
.mn-list--spotlight {
    display: grid;
    grid-auto-columns: 100%;
    grid-auto-flow: column;
    gap: var(--sl-space-4);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.mn-list--spotlight::-webkit-scrollbar {
    display: none;
}

.mn-item--spotlight {
    overflow: hidden;
    scroll-snap-align: start;
}

.mn-item--spotlight .mn-item__media {
    aspect-ratio: 4 / 5;
    max-height: 62vh;
}

.mn-item--spotlight .mn-item__media--empty {
    aspect-ratio: 16 / 10;
}

.mn-item--spotlight .mn-item__media--empty > span[aria-hidden] {
    font-size: var(--sl-text-display);
}

.mn-item--spotlight .mn-item__body {
    gap: var(--sl-space-2);
    padding: var(--sl-space-4) var(--sl-space-4) var(--sl-space-5);
}

.mn-item--spotlight .mn-item__name {
    font-family: var(--title-font);
    font-size: var(--sl-text-2xl);
    line-height: var(--sl-leading-tight);
}

.mn-item--spotlight .mn-item__desc {
    -webkit-line-clamp: 3;
    line-clamp: 3;
    font-size: var(--sl-text-md);
}

.mn-item--spotlight .mn-item__foot {
    gap: var(--sl-space-3);
    padding-top: var(--sl-space-2);
}

.mn-item--spotlight .mn-item__price {
    font-size: var(--sl-text-xl);
}

.mn-item--spotlight .mn-item__was {
    font-size: var(--sl-text-sm);
}

.mn-item--spotlight .mn-add {
    width: 48px;
    height: 48px;
    font-size: 24px;
}

.mn-item--spotlight .mn-item__discount {
    top: var(--sl-space-3);
    inset-inline-start: var(--sl-space-3);
    min-height: 30px;
    padding: 2px 12px;
    font-size: var(--sl-text-md);
}

.mn-item--spotlight .mn-size {
    flex: 0 1 auto;
}

/* Control bar under the track: previous, dots, next. The renderer
   already prints direction-correct chevrons for RTL. */
.mn-spot__ctrl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sl-space-1);
    margin-top: var(--sl-space-2);
}

.mn-spot__prev,
.mn-spot__next {
    display: inline-grid;
    flex-shrink: 0;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: var(--biz-edge);
    border-radius: 50%;
    background: var(--biz-surface);
    color: var(--text-h);
    font-size: 20px;
    box-shadow: var(--biz-shadow);
    cursor: pointer;
    transition: opacity var(--transition), border-color var(--transition), transform var(--sl-dur-fast) var(--sl-ease-standard);
}

.mn-spot__prev .sl-i,
.mn-spot__next .sl-i {
    stroke-width: 2.5;
}

@media (hover: hover) {
    .mn-spot__prev:hover,
    .mn-spot__next:hover {
        border-color: var(--border-hover);
    }
}

.mn-spot__prev:active,
.mn-spot__next:active {
    transform: scale(0.94);
}

.mn-spot__prev:focus-visible,
.mn-spot__next:focus-visible,
.mn-spot__dot:focus-visible {
    outline: 3px solid var(--text-h);
    outline-offset: 2px;
}

.mn-spot__prev[aria-disabled="true"],
.mn-spot__next[aria-disabled="true"] {
    box-shadow: none;
    opacity: 0.4;
    cursor: default;
}

.mn-spot__prev[aria-disabled="true"]:active,
.mn-spot__next[aria-disabled="true"]:active {
    transform: none;
}

.mn-spot__dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    min-width: 0;
}

.mn-spot__dot {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.mn-spot__dot::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: var(--sl-radius-pill);
    background: color-mix(in srgb, var(--text-h) 30%, transparent);
    transition: width var(--transition), background var(--transition);
}

.mn-spot__dot[aria-selected="true"] {
    width: 34px;
}

.mn-spot__dot[aria-selected="true"]::before {
    width: 22px;
    background: var(--accent);
}

@media (hover: hover) {
    .mn-spot__dot:hover::before {
        background: color-mix(in srgb, var(--text-h) 55%, transparent);
    }

    .mn-spot__dot[aria-selected="true"]:hover::before {
        background: var(--accent);
    }
}

@media (min-width: 571px) {
    .mn-item--spotlight.has-photo {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        align-items: stretch;
    }

    .mn-item--spotlight.has-photo .mn-item__media {
        aspect-ratio: 4 / 5;
        max-height: none;
    }

    .mn-item--spotlight.has-photo .mn-item__body {
        justify-content: center;
        padding: var(--sl-space-6) var(--sl-space-5);
    }

    .mn-item--spotlight.has-photo .mn-item__foot {
        margin-top: var(--sl-space-2);
    }
}

/* ── Branded button styles ───────────────────────────────── */
.bs-brutal .mn-item--shop .mn-size,
.bs-stamp .mn-item--shop .mn-size,
.bs-comic .mn-item--shop .mn-size,
.bs-memphis .mn-item--shop .mn-size,
.bs-brutal .mn-item--spotlight .mn-size,
.bs-stamp .mn-item--spotlight .mn-size,
.bs-comic .mn-item--spotlight .mn-size,
.bs-memphis .mn-item--spotlight .mn-size,
.bs-brutal .mn-spot__prev,
.bs-brutal .mn-spot__next,
.bs-comic .mn-spot__prev,
.bs-comic .mn-spot__next,
.bs-memphis .mn-spot__prev,
.bs-memphis .mn-spot__next {
    border: 2px solid var(--text-h);
}

.bs-comic .mn-item--grid3 .mn-item__media,
.bs-brutal .mn-item--grid3 .mn-item__media,
.bs-memphis .mn-item--grid3 .mn-item__media,
.bs-comic .mn-item--bento,
.bs-brutal .mn-item--bento,
.bs-memphis .mn-item--bento {
    border: 2px solid var(--text-h);
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .mn-list--spotlight {
        scroll-behavior: auto;
    }

    .mn-item--shop:hover,
    .mn-add--wide:hover,
    .mn-add--wide:active,
    .mn-item--shop .mn-add:hover,
    .mn-item--shop .mn-add:active,
    .mn-spot__prev:active,
    .mn-spot__next:active {
        transform: none;
    }

    .mn-spot__dot::before {
        transition: none;
    }
}
