/* What every layout shares. Every colour is a token: the light set is on :root, the dark set under
   [data-dark="true"], and the shop's own colour comes in as --accent / --on-accent (written on <html> by
   functions/_lib/page.js). The type comes from one of three pairings of system fonts; nothing is fetched.
   looks/counter.css, looks/gallery.css and looks/poster.css only arrange and dress what is here.

   Rules the tokens keep: --ink, --dim, --open, --closed and --error read at 4.5:1 on --ground and --panel in both
   modes; --focus and --edge reach 3:1; --accent is only ever a fill, a border or large type (it is promised 3:1, not
   4.5:1); words on the accent are --on-accent; words on a photo sit on --scrim in --scrim-ink. */
:root {
  --ground: #ffffff;
  --panel: #f3f5f3;
  --ink: #17201c;
  --dim: #5d6863;
  --rule: #d5dcd8;
  --edge: #7a8580;
  --open: #1d7a3e;
  --closed: #a3361f;
  --error: #b42318;
  --focus: #1f4fb4;
  --scrim-ink: #ffffff;
  --scrim: rgba(0, 0, 0, .66);
  --shade: rgba(16, 22, 19, .55);
  --accent: #0f6b4f;
  --on-accent: #ffffff;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --head: var(--sans);
  --text: var(--sans);
  --head-weight: 700;
  --head-case: none;
  --head-space: -.01em;
  --radius: 12px;
  color-scheme: light;
}
:root[data-dark="true"] {
  --ground: #121715;
  --panel: #1c2320;
  --ink: #eef2ef;
  --dim: #a2aca7;
  --rule: #2f3934;
  --edge: #6b7671;
  --open: #5fd38d;
  --closed: #ff9b85;
  --error: #ff9b8f;
  --focus: #8ab4ff;
  --shade: rgba(0, 0, 0, .7);
  color-scheme: dark;
}
/* The three type pairings: headings change, body text stays an easy system face. */
:root[data-type="classic"] { --head: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif; --head-space: 0; }
:root[data-type="bold"] { --head: "Arial Black", "Segoe UI Black", "Helvetica Neue", Impact, system-ui, sans-serif; --head-weight: 900; --head-case: uppercase; --head-space: .01em; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--text); font-size: 17px; line-height: 1.55; overflow-wrap: break-word; }
img { max-width: 100%; }
a { color: inherit; text-underline-offset: .15em; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: var(--head-weight); text-transform: var(--head-case); letter-spacing: var(--head-space); line-height: 1.15; margin: 0; text-wrap: balance; overflow-wrap: anywhere; max-width: 100%; }
/* overflow-wrap: anywhere (not break-word) lowers a heading's narrowest size too, so one long word in a shop's or a
   product's name breaks instead of pushing the page sideways where a heading is sized to its words (justify-items: start). */
h2 { font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.1rem); margin-bottom: .6em; }
p { margin: 0 0 1em; max-width: 65ch; }
.muted { color: var(--dim); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 50; background: var(--ground); color: var(--ink); padding: 10px 16px; border-radius: 999px; font-weight: 700; }
.skip:focus { top: 12px; }
main:focus { outline: none; }
.inner { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); min-width: 0; }

/* buttons and links */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--accent); background: transparent; color: var(--ink); font: 700 1rem/1.2 var(--text); text-decoration: none; text-align: center; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.ghost { border-color: var(--edge); }
.btn:hover { box-shadow: 0 0 0 3px var(--rule); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.small { min-height: 40px; padding: 7px 14px; font-size: .92rem; }
.link { background: none; border: 0; padding: 0; color: var(--ink); font: inherit; text-decoration: underline; cursor: pointer; }

/* photo tiles: a real photo when one is posted, the shop's colour (darkened, so white words read) until then */
.ph { position: relative; overflow: hidden; border-radius: var(--radius); max-width: 100%; display: grid; place-items: center; padding: 12px; text-align: center; color: var(--scrim-ink); background: #2b3430; background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 50%, #000), color-mix(in srgb, var(--accent) 25%, #000)); font-family: var(--head); font-weight: var(--head-weight); text-transform: var(--head-case); }
.ph > span { position: relative; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph::after { content: attr(data-label); position: absolute; inset: auto 10px 10px; font-family: var(--text); font-weight: 600; text-transform: none; font-size: .85rem; color: var(--scrim-ink); background: var(--scrim); border-radius: 999px; padding: 5px 12px; }
.ph[data-label=""]::after { display: none; }
.ph.has-img > span { display: none; }
/* The gallery's "Photo coming" tiles (its stand-ins until the shop posts photos): the title and the pill stack in the
   middle, the pill under the title. min-width: 0 and the .ph's own overflow: hidden keep a tile from widening its column;
   the title wraps inside it; min-height: min-content lets a tile grow taller (never wider) when a title wraps, and
   align-self: stretch keeps the tiles in a row the same height. Only these tiles: picture boxes and shelf tiles keep
   the plain .ph rules. */
.gallery > .ph:not(.has-img) { min-width: 0; min-height: min-content; align-self: stretch; align-content: center; gap: 6px; }
.gallery > .ph:not(.has-img) > span { max-width: 100%; overflow-wrap: anywhere; }
.gallery > .ph:not(.has-img)::after { position: static; inset: auto; max-width: 100%; }

/* announcement */
.banner { background: var(--accent); color: var(--on-accent); font-weight: 700; text-align: center; padding: 10px 16px; }

/* top bar: the shop's name, the menu and the cart. On a phone the menu is its own row under the other two. */
.top { position: sticky; top: 0; z-index: 10; background: var(--ground); border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top, 0px); }
.top .inner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-block: 10px; }
.brand { flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--head); font-weight: var(--head-weight); text-transform: var(--head-case); letter-spacing: var(--head-space); font-size: 1.15rem; line-height: 1.2; }
.brand span { min-width: 0; overflow-wrap: anywhere; }
.brand img { height: 40px; width: auto; max-width: 40vw; border-radius: 8px; object-fit: contain; flex: none; }
.brand.has-logo span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#nav { order: 3; flex: 1 1 100%; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -8px; padding: 2px; }
#nav a { flex: none; color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 999px; font-weight: 600; font-size: .95rem; white-space: nowrap; }
#nav a:hover, #nav a.on { text-decoration: underline; text-decoration-thickness: 2px; }
.cart-btn { flex: none; order: 2; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.cart-btn .n { background: var(--on-accent); color: var(--accent); border-radius: 999px; min-width: 24px; height: 24px; padding: 0 6px; display: grid; place-items: center; font-size: .85rem; }
@media (min-width: 760px) {
  .brand { flex: 0 1 auto; }
  #nav { order: 0; flex: 0 1 auto; margin: 0 0 0 auto; }
}

/* the shop front: name, open sign, address and phone */
.hero { padding-block: 28px 20px; }
.hero-inner { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: center; }
.hero-text { display: grid; gap: 16px; justify-items: start; min-width: 0; }
.hero h1 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.4rem); }
.hero .tag { font-size: 1.1rem; color: var(--dim); margin: 0; }
.hero-photo { width: 100%; aspect-ratio: 4 / 3; font-size: 1.1rem; }
.sign { display: grid; gap: 2px; width: 100%; max-width: 34rem; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); color: var(--ink); border: 1px solid var(--rule); }
.status { display: flex; align-items: center; gap: 10px; font-family: var(--head); font-weight: var(--head-weight); font-size: 1.15rem; color: var(--open); }
.sign:has(.dot.closed) .status { color: var(--closed); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--open); flex: none; }
.dot.closed { background: var(--closed); }
.status-sub { color: var(--dim); font-variant-numeric: tabular-nums; }
.status-note { font-weight: 700; }
.facts { display: grid; gap: 4px; }
.facts p { margin: 0; }
.addr { color: var(--dim); }
.phone a { color: var(--ink); font-weight: 700; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* search, on the front: it opens the shop with what was typed */
.find { padding-block: 4px 12px; }
.find-form { display: flex; flex-wrap: wrap; gap: 10px; }
.find-form input { flex: 1 1 14rem; min-width: 0; }

/* form fields everywhere on the storefront */
input, select, textarea { font: inherit; color: var(--ink); background: var(--ground); border: 1px solid var(--edge); border-radius: 10px; padding: 10px 14px; min-height: 44px; }
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--dim); opacity: 1; }

section.block { padding-block: 36px; }
section.alt { background: var(--panel); }

/* shelves on the front */
.shelves { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.shelf { display: flex; flex-direction: column; min-width: 0; border-radius: var(--radius); overflow: hidden; background: var(--ground); border: 1px solid var(--rule); color: var(--ink); }
.shelf[data-shelf] { cursor: pointer; }
.shelf .ph { border-radius: 0; aspect-ratio: 16 / 10; font-size: .95rem; }
.shelf .txt { padding: 14px 16px 16px; min-width: 0; }
.shelf h3 { font-size: 1.1rem; margin-bottom: 6px; }
.shelf p { font-size: .95rem; color: var(--dim); margin: 0; }
.shelf .more { display: inline-block; margin-top: 8px; font-weight: 700; font-size: .92rem; text-decoration: underline; }
.shop-all { margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }

/* photos of the shop. Six tracks: a card takes two, a "big" card three, so a count that is not a multiple of three
   never leaves one card alone on the last row. Two across on a phone; an odd count makes the first card full width. */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gallery > .mbig { grid-column: span 2; }
.gallery > .ph { aspect-ratio: 16 / 10; }
.gallery .ph { cursor: zoom-in; }
.gallery .shot { min-width: 0; }
.gallery .shot .ph { aspect-ratio: 4 / 3; }
.gallery .shot .txt { padding: 8px 2px 0; }
.gallery .shot h3 { font-size: .95rem; }
@media (min-width: 760px) {
  .gallery { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
  .gallery > *, .gallery > .mbig { grid-column: span 2; }
  .gallery > .big { grid-column: span 3; }
}

/* hours */
.hours { display: grid; gap: 24px; align-items: start; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
td { padding: 10px 0; border-bottom: 1px solid var(--rule); }
td:last-child { text-align: right; color: var(--dim); padding-left: 12px; }
tr.today td { font-weight: 700; color: var(--ink); }
tr.today td:first-child::after { content: " (today)"; font-weight: 400; color: var(--dim); font-size: .85rem; }
.closures { margin: 14px 0 0; padding: 0; list-style: none; font-weight: 600; }
.late { background: var(--ground); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; }
.late h3 { font-size: 1.2rem; margin-bottom: 4px; }
.late .big { font-family: var(--head); font-weight: var(--head-weight); text-transform: var(--head-case); font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem); line-height: 1; margin: 6px 0 10px; }
.late .small { color: var(--dim); font-size: .95rem; }
/* When the shop is closed for the day the big line is a sentence ("Opens Friday at 10:00 AM"), not two words. */
.late .big.says { font-size: clamp(1.3rem, 1.05rem + 1.2vw, 1.8rem); line-height: 1.15; }
@media (min-width: 760px) { .hours { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 36px; } }

/* the shop on its own page (/shop): search, shelf chips, sort, the products */
body.view-shop .home-only { display: none !important; }
body:not(.view-shop) #shop { display: none; }
#shop { min-height: 70vh; }
#shop .back { display: inline-block; margin-bottom: 14px; font-size: .95rem; }
.shop-tools { margin: 16px 0 6px; }
.shop-tools .bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.shop-tools input[type="search"] { flex: 1 1 14rem; min-width: 0; }
.shop-tools .chk { display: inline-flex; gap: 8px; align-items: center; font-size: .95rem; white-space: nowrap; min-height: 44px; }
.chips { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding: 3px 3px 8px; scrollbar-width: thin; }
.chip { flex: none; min-height: 40px; background: var(--ground); color: var(--ink); border: 1px solid var(--edge); border-radius: 999px; padding: 6px 14px; font-size: .95rem; }
.chip span { color: var(--dim); font-size: .88em; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.chip.on span { color: var(--on-accent); }
.shop-count { min-height: 1.4em; margin-top: 6px; font-size: .95rem; }
.shop-group { margin-top: 26px; }
.ghead { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 12px; }
.ghead h3 { font-size: 1.25rem; }
.more-row { margin-top: 18px; text-align: center; }
.shop-empty { background: var(--ground); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; }

/* a product card */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.item { display: flex; flex-direction: column; min-width: 0; background: var(--ground); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.item .ph { border-radius: 0; aspect-ratio: 4 / 3; font-size: .9rem; }
.item .ph[data-open] { cursor: pointer; }
.item .txt { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.item h4 { font-size: 1.02rem; }
.item .pname { color: var(--ink); text-decoration: none; }
.item .pname:hover { text-decoration: underline; }
.item .blurb { color: var(--dim); font-size: .9rem; margin: 0; flex: 1; }
.item .row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.item .price { font-weight: 700; font-variant-numeric: tabular-nums; }
.item .soldout { color: var(--dim); font-size: .9rem; font-style: italic; }
.item .low { display: block; color: var(--closed); font-weight: 700; font-size: .85rem; }
.item.plain .row { min-height: 44px; }

/* mystery boxes */
.mystery { display: grid; gap: 24px; align-items: center; }
.mbox { position: relative; width: 100%; max-width: 420px; aspect-ratio: 4 / 3; display: grid; place-items: center; border: 0; background: none; padding: 0; color: var(--ink); justify-self: center; }
.mbox .crate { display: block; position: relative; width: 62%; aspect-ratio: 1 / .8; border-radius: 16px; background: var(--panel); border: 3px solid var(--accent); }
.mbox .lid { position: absolute; left: -3%; right: -3%; top: -10%; height: 26%; border-radius: 12px; background: var(--accent); transform-origin: left bottom; }
.mbox .q { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--head); font-weight: var(--head-weight); font-size: clamp(2.6rem, 8vw, 4.4rem); line-height: 1; }
.mbox .prize { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; text-align: center; font-weight: 700; font-size: .95rem; opacity: 0; }
.mbox .hint { position: absolute; bottom: 2%; color: var(--dim); font-size: .92rem; }
.mbox.open .lid { transform: rotate(-110deg); }
.mbox.open .q { opacity: 0; }
.mbox.open .prize { opacity: 1; }
.tiers { display: grid; gap: 10px; margin-top: 10px; }
.tier { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--panel); border-radius: var(--radius); padding: 12px 14px; }
.tier > div { min-width: 0; }
.tier small { display: block; color: var(--dim); }
@media (min-width: 760px) { .mystery { grid-template-columns: 1fr 1fr; gap: 36px; } }

/* find us */
.visit { display: grid; gap: 24px; }
.visit dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; }
/* Each fact's row is wrapped so a shop without that fact leaves it out whole; the wrapper takes no part in the grid. */
.visit dl > div { display: contents; }
.visit dt { color: var(--dim); }
.visit dd { margin: 0; min-width: 0; }
.copy { background: none; border: 1px solid var(--edge); color: var(--ink); border-radius: 999px; padding: 2px 10px; min-height: 30px; font-size: .82rem; margin-left: 6px; }
.map { display: grid; place-items: center; align-content: center; gap: 8px; aspect-ratio: 16 / 10; max-width: 100%; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--rule); color: var(--ink); text-align: center; padding: 16px; text-decoration: none; }
.map b { display: block; font-family: var(--head); font-weight: var(--head-weight); font-size: 1.2rem; text-decoration: underline; }
.pin { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid var(--ground); box-shadow: 0 0 0 2px var(--accent); }
@media (min-width: 760px) { .visit { grid-template-columns: 1fr 1fr; gap: 36px; } }

/* footer, and the credit on its own line */
footer { padding-block: 26px calc(26px + env(safe-area-inset-bottom, 0px)); color: var(--dim); font-size: .92rem; background: var(--ground); border-top: 1px solid var(--rule); }
footer .inner { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
footer a { color: var(--ink); }
footer .credit { flex: 1 1 100%; text-align: center; padding-top: 14px; border-top: 1px solid var(--rule); }
footer .credit:only-child { padding-top: 0; border-top: 0; }
footer .credit a { color: var(--ink); font-weight: 700; }

/* product pop-up */
.pd { position: fixed; inset: 0; z-index: 26; background: var(--shade); display: grid; place-items: center; padding: 20px; opacity: 0; visibility: hidden; pointer-events: none; }
.pd.open { opacity: 1; visibility: visible; pointer-events: auto; }
.pd .sheet { position: relative; width: min(980px, 100%); max-height: 100%; overflow-y: auto; background: var(--ground); color: var(--ink); border-radius: var(--radius); padding: 20px; }
.pd .x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--rule); background: var(--panel); color: var(--ink); font-size: 1.2rem; }
.pd-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pd-media .ph { aspect-ratio: 1 / 1; font-size: 1.2rem; }
.pd-media .ph img { object-fit: contain; background: #000; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumbs .th { flex: none; width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--panel); }
.thumbs .th.on { border-color: var(--accent); }
.thumbs .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pd-info h3 { font-size: 1.6rem; }
.pd .crumb { margin: 0; font-size: .95rem; }
.pd-info .price { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pd-info p { margin: 0; }
.pd-stock { color: var(--dim); font-size: .95rem; }
.pd-stock.low { color: var(--closed); font-weight: 700; }
.pd-stock.out { font-style: italic; }
.pd-buy { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.pd-buy .qty { background: var(--panel); border-radius: 999px; padding: 4px; }
.pd-buy .qty button { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--edge); background: var(--ground); color: var(--ink); font-size: 1.2rem; }
.pd-buy .qty span { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; }
.pd-note { font-size: .88rem; }
#pd-related { margin-top: 24px; }
#pd-related > h4 { font-size: 1.15rem; margin: 0 0 12px; }
.pd-grid.nopic .pd-media { display: none; }
.pd-grid.nopic .pd-info { padding-right: 52px; }
.pd .sheet:has(.pd-grid.nopic) { width: min(640px, 100%); }
@media (min-width: 701px) {
  .pd-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 26px; }
  .pd-grid.nopic { grid-template-columns: minmax(0, 1fr); }
  .pd-info { padding-top: 30px; }
  .pd-grid.nopic .pd-info { padding-top: 4px; }
}
@media (max-width: 700px) {
  .pd { padding: 0; }
  .pd .sheet { height: 100%; border-radius: 0; padding: 16px 14px 24px; }
  #pd-related .items { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* photo viewer: always dark, whatever the mode, so the photo is the brightest thing */
.lb { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .92); color: var(--scrim-ink); display: grid; place-items: center; padding: 24px max(24px, env(safe-area-inset-right, 0px)) 24px max(24px, env(safe-area-inset-left, 0px)); opacity: 0; visibility: hidden; pointer-events: none; }
.lb.open { opacity: 1; visibility: visible; pointer-events: auto; }
.lb .box { display: grid; justify-items: center; width: 100%; }
.lb .ph { width: min(900px, 100%); aspect-ratio: 4 / 3; font-size: 1.4rem; }
.lb .ph img { object-fit: contain; background: #000; }
.lb .cap { margin-top: 14px; color: var(--scrim-ink); }
.lb .x, .lb .arrow { position: absolute; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .6); color: #ffffff; font-size: 1.3rem; }
.lb :focus-visible { outline-color: #ffffff; }
.lb .x { top: calc(16px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }
.lb .arrow { top: 50%; transform: translateY(-50%); }
.lb .prev { left: max(10px, env(safe-area-inset-left, 0px)); }
.lb .next { right: max(10px, env(safe-area-inset-right, 0px)); }

/* cart drawer and checkout. Closed, it is out of reach of the keyboard as well as out of sight. */
.drawer-bg { position: fixed; inset: 0; background: var(--shade); z-index: 30; opacity: 0; visibility: hidden; pointer-events: none; }
.drawer-bg.open { opacity: 1; visibility: visible; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--ground); color: var(--ink); z-index: 31; transform: translateX(100%); visibility: hidden; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-right: env(safe-area-inset-right, 0px); border-left: 1px solid var(--rule); }
.drawer.open { transform: none; visibility: visible; }
/* The chat button steps aside while the cart, a product or a photo is open, so it never sits on their buttons. */
body:has(.drawer.open) #shop-chat, body:has(.pd.open) #shop-chat, body:has(.lb.open) #shop-chat { display: none; }
.drawer header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--rule); }
.drawer header h3 { font-size: 1.3rem; }
.drawer .body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer .x { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--rule); background: var(--panel); color: var(--ink); font-size: 1.2rem; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.line .nm { font-weight: 600; min-width: 0; }
.line .qty { gap: 8px; }
.line .qty button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--edge); background: none; color: var(--ink); }
.line .amt { text-align: right; font-variant-numeric: tabular-nums; }
.sum { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-top: 14px; font-variant-numeric: tabular-nums; }
.sum .total { font-weight: 700; font-size: 1.1rem; }
.sum .disc { color: var(--open); }
.promo { display: flex; gap: 8px; margin-top: 14px; }
.promo input { flex: 1; min-width: 0; text-transform: uppercase; border-radius: 999px; }
.promo input::placeholder { text-transform: none; }
.promo-msg { margin: 8px 0 0; font-size: .92rem; }
.promo-msg.ok { color: var(--open); }
.promo-msg .link { margin-left: 6px; }
.form { display: grid; gap: 12px; margin-top: 14px; }
.form label { display: grid; gap: 4px; font-size: .92rem; color: var(--dim); }
.form input, .form select, .form textarea { width: 100%; }
.form .check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-size: .95rem; }
.form .check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.err { color: var(--error); font-weight: 600; margin: 0; }
.ok-msg { color: var(--open); font-weight: 600; }

/* the order page */
.order-body main { padding-block: 32px 56px; }
.order-wrap { max-width: 640px; }
.order-wrap h2 { margin-bottom: .4em; }
.pill { display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 700; background: var(--panel); color: var(--ink); border: 1px solid var(--rule); }
.pill.ready { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pill.cancelled { color: var(--closed); }
.order-card { background: var(--panel); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.order-card .code { font-family: var(--head); font-weight: var(--head-weight); font-size: 2.2rem; letter-spacing: .08em; line-height: 1.1; }
.order-body .btns { margin-top: 10px; }

/* a product's own page (/p/<id>-<name>) */
.pp { max-width: 980px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.pp img.main { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #000; border-radius: var(--radius); display: block; }
.pp.nopic { max-width: 640px; }
.pp h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.2rem); margin: 6px 0 10px; }
.pp .price { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pp .crumb, .pp .stock { color: var(--dim); }
.pp .crumb { margin: 0; font-size: .95rem; }
.pp .go.off { opacity: .6; pointer-events: none; border-color: var(--edge); background: var(--panel); color: var(--dim); }
.pp .thumbs a { display: inline-block; }
.pp .thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; margin: 8px 8px 0 0; background: var(--panel); }
@media (min-width: 701px) { .pp:not(.nopic) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; } }

/* the page that is not there */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 24px 16px; }
.lost h1 { font-size: clamp(1.8rem, 1.3rem + 2.4vw, 2.6rem); margin-bottom: 10px; }

/* motion: only for those who have not asked for less */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .btn, .chip, .cart-btn, #nav a { transition: box-shadow .15s, background-color .15s; }
  /* Closing: fade or slide out, then hide (visibility waits for the end). Opening: visible at once, with no
     visibility transition, so the close button can take the keyboard's focus in the same moment it opens. */
  .pd, .lb, .drawer-bg { transition: opacity .2s, visibility .2s; }
  .pd.open, .lb.open, .drawer-bg.open { transition: opacity .2s; }
  .pd .sheet { transform: translateY(12px); transition: transform .2s; }
  .pd.open .sheet { transform: none; }
  .drawer { transition: transform .3s cubic-bezier(.2, .7, .2, 1), visibility .3s; }
  .drawer.open { transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
  .mbox .lid { transition: transform .5s cubic-bezier(.3, 1.4, .4, 1); }
  .mbox .q { transition: opacity .3s; }
  .mbox .prize { transition: opacity .35s .25s; }
  .mbox.shake .crate { animation: shake .5s; }
  @keyframes shake { 20% { transform: rotate(3deg) } 40% { transform: rotate(-4deg) } 60% { transform: rotate(3deg) } 80% { transform: rotate(-2deg) } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
