/* "In stock at Zeltrix" (scripts/commerce/in-stock.mjs, in-stock.js): our own products that match the page. Always below
   the page's answer. Compact: three rows on a phone, three columns on a desktop. */
/* Product pictures sit on white in every theme: most are photographed on white, and a mix of white and clear on dark looks patchy. */
.in-stock, .stock-row, .shop-page { --zx-tile: #fff; }
.in-stock { margin: 32px 0; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-tint); }
/* Placed straight in <main> (pages without an anchor): same width as .shell. */
main > .in-stock { width: min(var(--shell), calc(100% - 48px)); margin-left: auto; margin-right: auto; }
.in-stock[hidden], .in-stock-item[hidden] { display: none; }
.in-stock h2 { margin: 0 0 12px; font-size: 20px; }
.in-stock-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.in-stock-link { display: flex; align-items: center; gap: 12px; height: 100%; min-height: 44px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--ink); text-decoration: none; }
.in-stock-link:hover { border-color: currentColor; }
.in-stock-link img { flex: none; width: 72px; height: 72px; object-fit: contain; border-radius: 6px; background: var(--zx-tile); }
.in-stock-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.in-stock-name { font-size: 15px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.in-stock-price { font-weight: 800; }
.in-stock-price small { font-weight: 600; color: var(--muted); }
.in-stock-note { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
@media (max-width: 700px) {
  .in-stock { margin: 24px 0; padding: 14px; }
}
@media (prefers-reduced-motion: no-preference) {
  .in-stock-link { transition: border-color .15s; }
}

/* The line (scripts/commerce/in-stock.mjs lineHtml): an aside on answer pages. One slim row, no box around it, no heading. */
.in-stock-line { margin: 16px 0; padding: 0; border: 0; background: transparent; }
.in-stock-line .in-stock-list { display: flex; flex-direction: column; gap: 8px; }
.in-stock-line .in-stock-link { gap: 10px; min-height: 56px; padding: 6px 12px 6px 6px; background: transparent; }
.in-stock-line .in-stock-link img { width: 48px; height: 48px; }
.in-stock-line .in-stock-text { flex: 1 1 auto; gap: 1px; }
.in-stock-kicker { font-size: 12px; font-weight: 700; color: var(--ok-text); line-height: 1.3; }
.in-stock-line .in-stock-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 14px; font-weight: 600; overflow-wrap: break-word; }
.in-stock-line .in-stock-price { flex: none; font-size: 15px; white-space: nowrap; }
/* In the page's header band the row takes the band's text colour. */
.page-header .in-stock-link { color: inherit; border-color: rgba(128, 140, 170, .45); }
.page-header .in-stock-price small { color: inherit; opacity: .8; }
/* In the scanner's result screen and under My Collection it lines up with what is around it. */
html.zx-shell .zx-scr + .in-stock-line, .zx-col-body + .in-stock-line { margin: 16px; }

/* The home page's row: real products with a picture and a price. A phone scrolls it sideways; a computer shows them all. */
/* contain: a sideways-scrolling row inside a grid or flex parent must not widen the page. */
.stock-row { grid-column: 1 / -1; min-width: 0; margin: 20px 0; contain: inline-size; }
#main > .stock-row { width: min(var(--shell), calc(100% - 48px)); margin: 24px auto; }
.stock-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.stock-row-head h2 { margin: 0; font-size: 20px; }
.stock-row-head .section-link { display: inline-flex; align-items: center; min-height: 44px; }
.stock-cards { list-style: none; margin: 0; padding: 0 0 6px; display: grid; grid-auto-flow: column; grid-auto-columns: 136px; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; }
.stock-card { min-width: 0; scroll-snap-align: start; }
.stock-card[hidden] { display: none; }
.stock-card-link { display: flex; flex-direction: column; gap: 4px; height: 100%; color: var(--ink); text-decoration: none; }
.stock-card-pic { display: block; aspect-ratio: 1 / 1; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--zx-tile); }
/* aspect-ratio on the picture too: a tall photo stays inside the square instead of stretching its card (seen 2026-11-15). */
.stock-card-pic img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.stock-card-link:hover .stock-card-pic { border-color: currentColor; }
.stock-card .in-stock-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 13px; font-weight: 600; line-height: 1.3; overflow-wrap: break-word; }
.stock-card .in-stock-price { font-size: 15px; }
@media (min-width: 1024px) {
  .stock-cards { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-columns: auto; overflow: visible; }
}

/* The shop (/products/): a plain grid of what we have, the answer on the first screen at 400 px. */
.shop-page .page-header { padding-top: 14px; padding-bottom: 14px; }
.shop-page .page-header h1 { margin-bottom: 4px; }
.shop-page .page-lead { margin: 0; font-size: 15px; }
.shop-chips { display: flex; gap: 8px; margin: 14px 0; overflow-x: auto; scrollbar-width: none; }
.shop-chips::-webkit-scrollbar { display: none; }
.shop-chip { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.shop-chip:hover { border-color: currentColor; }
.shop-chip[aria-current="true"] { background: var(--lime); border-color: var(--lime); color: var(--navy); }
.shop-chip:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.shop-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.shop-grid .product-media { background: var(--zx-tile); }
.shop-grid .product-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.shop-state { font-size: 13px; font-weight: 600; color: var(--ok-text); }
.shop-card[hidden], .shop-card[data-shop-off] { display: none; }
.shop-card .product-action { min-height: 44px; }
.shop-note { margin: 16px 0 32px; font-size: 14px; color: var(--muted); }
@media (max-width: 700px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .shop-grid .product-meta { padding: 10px 10px 2px; }
  .shop-grid .product-action { margin: 8px 10px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .stock-cards { scroll-snap-type: none; }
  .shop-grid .product-media img { transition: none; }
  .shop-card:hover .product-media img { transform: none; }
}

/* The rail (scripts/commerce/in-stock.mjs railHtml): "From the Zeltrix shop" on hub pages. The home row's cards, a little
   smaller, without the block's box. A phone scrolls it sideways inside itself; a computer shows the four in a row. */
.in-stock-rail { padding: 0; border: 0; background: transparent; min-width: 0; contain: inline-size; }
.in-stock-rail .stock-cards { grid-auto-columns: 124px; }
.in-stock-rail .in-stock-note { margin-top: 6px; }
@media (min-width: 1024px) {
  .in-stock-rail .stock-cards { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 168px)); grid-auto-columns: auto; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) {
  .in-stock-rail .stock-cards { scroll-snap-type: none; }
}

/* "Also sold by Zeltrix" (scripts/commerce/in-stock.mjs buyBoxHtml): on Pokémon Market set and product pages, after the store
   comparison. One row per product: the product (picture, name, "In stock", our price) and "Add to cart" beside it, under it
   on a phone. */
.in-stock-buy .in-stock-list { grid-template-columns: 1fr; }
.in-stock-buy .in-stock-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.in-stock-buy .in-stock-link { flex: 1 1 260px; min-width: 0; height: auto; }
.in-stock-state { font-size: 13px; font-weight: 700; color: var(--ok-text); line-height: 1.3; }
.in-stock-buy .in-stock-add { flex: 0 0 auto; min-height: 44px; }
@media (max-width: 520px) {
  .in-stock-buy .in-stock-add { flex: 1 1 100%; justify-content: center; }
}
