:root {
  color-scheme: light;
  --ink: #16201d;
  --muted: #6a756f;
  --line: #e6eae6;
  --line-strong: #d7ddd7;
  --paper: #ffffff;
  --panel: #ffffff;
  --wash: #f5f7f5;
  --accent: #16201d;
  --pop: #ff5a3c;
  --ok: #1f9d57;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(22, 32, 29, 0.16);
  --shadow-soft: 0 8px 24px rgba(22, 32, 29, 0.08);
  --header-h: 76px;
}

* { box-sizing: border-box; }

/* Reserve the scrollbar gutter so resizing the product grid (which changes page
   height and toggles the scrollbar) never shifts the layout sideways. */
html { scroll-behavior: smooth; scrollbar-gutter: stable; interpolate-size: allow-keywords; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Geist, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.011em;
}

button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
}
.skip-link:focus { left: 12px; }

/* ---------- Header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  padding: 0 clamp(14px, 3vw, 36px);
  background:
    linear-gradient(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.62)),
    url("assets/camo.svg");
  background-size: auto, 320px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--ink); color: #fff;
  font-size: 14px; letter-spacing: 0.02em;
}
/* The logo is a mask rather than an <img>, so it takes the colour of whatever
   tile it sits in. Every theme paints .brand-mark differently (ink square,
   aurora circle, dead-black block) and sets a light `color` on it; the glyph
   inherits that with no per-theme rule. An <img> would render its own fixed
   ink and disappear on the dark tiles. */
.brand-glyph {
  width: 26px;
  height: 26px;
  background: currentColor;
  -webkit-mask: url(assets/logo-printer.svg) center / contain no-repeat;
  mask: url(assets/logo-printer.svg) center / contain no-repeat;
}
.brand-word { font-size: 18px; letter-spacing: 0.06em; }

.pillnav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.pill:hover { background: var(--wash); }
.pill.is-active { background: var(--ink); color: #fff; }
.pill.is-active:hover { background: #000; }
.pill-cart { padding-right: 12px; }
.cart-badge {
  display: grid; place-items: center;
  min-width: 24px; height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--pop); color: #fff;
  font-size: 12px; font-weight: 600;
}
.pill.is-active .cart-badge { background: #fff; color: var(--ink); }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px clamp(14px, 3vw, 36px) 8px;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 280px;
  max-width: 420px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
}
.search input {
  flex: 1; min-width: 0;
  min-height: 44px;
  border: none; background: transparent;
  outline: none;
}
/* Hide the browser's native search clear (✕) — we render our own .search-clear. */
.search input[type="search"]::-webkit-search-cancel-button,
.search input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.count { color: var(--muted); font-size: 14px; }
.count strong { color: var(--ink); }
.density {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto;
  color: var(--muted);
}
.density input[type="range"] { width: 120px; accent-color: var(--ink); cursor: pointer; }

/* ---------- Product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
  padding: 12px clamp(14px, 3vw, 36px) 40px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.card-img {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--wash);
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-add {
  position: absolute;
  right: 10px; bottom: 10px;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.16s ease;
}
/* Reveal on hover, or on keyboard focus of the button itself (:focus-visible,
   not :focus-within — a mouse click focuses the button but must NOT pin it open
   after the pointer leaves). */
.card:hover .card-add, .card-add:focus-visible { opacity: 1; transform: translateY(0) scale(1); }
.card-add:hover { background: #000; }
.card-add:active { transform: scale(0.92); }
/* On add, swap the + glyph for a ✓ tick (green) for ~1.5s, then revert. */
.card-add.added { background: var(--ok); }
.card-add.added > svg { display: none; }
.card-add.added::after { content: "✓"; font-size: 20px; font-weight: 800; line-height: 1; }
.card-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 4px 6px;
}
.card-name { font-weight: 700; font-size: 14px; line-height: 1.3; min-width: 0; }
.card-price { font-weight: 700; font-size: 15px; white-space: nowrap; }
.empty-grid { grid-column: 1 / -1; padding: 60px 0; text-align: center; color: var(--muted); }

/* touch + small screens: no hover Add button — tap the product to open detail (S1).
   Customisation flow is coming, so no direct add-to-cart on mobile cards. */
@media (hover: none), (max-width: 860px) {
  .card-add { display: none; }
  .card { cursor: pointer; }
  .card:active { transform: scale(0.97); }
}

/* ---------- Media carousel (cards + detail) ---------- */
/* Horizontal swipe track: slides sit side-by-side, the track translates. touch-action
   pan-y lets the browser keep vertical scroll while JS owns horizontal swipes. */
.carousel { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; touch-action: pan-y; }
.carousel.is-single { position: relative; }
.carousel-track {
  display: flex; width: 100%; height: 100%;
  will-change: transform;
  transition: transform 0.42s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.carousel.is-dragging .carousel-track { transition: none; }
.slide { position: relative; flex: 0 0 100%; width: 100%; height: 100%; }
.slide-media { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.slide.broken { background: var(--wash); }
.slide.broken .slide-media { visibility: hidden; }
.dots {
  position: absolute; left: 0; right: 0; bottom: 9px; z-index: 2;
  display: flex; gap: 6px; justify-content: center;
  pointer-events: none;
}
.dot {
  width: 7px; height: 7px; padding: 0; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 1px rgba(22, 32, 29, 0.18);
  cursor: pointer; pointer-events: auto; transition: background 0.16s ease, transform 0.16s ease;
}
.dot.is-active { background: #fff; transform: scale(1.25); }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  display: grid; place-items: center; width: 38px; height: 38px;
  border: none; border-radius: 50%; background: rgba(255, 255, 255, 0.9);
  color: var(--ink); cursor: pointer; box-shadow: var(--shadow-soft);
  opacity: 0; transition: opacity 0.16s ease, background 0.16s ease;
}
.carousel-arrow.prev { left: 12px; }
.carousel-arrow.next { right: 12px; }
.carousel:hover .carousel-arrow, .carousel:focus-within .carousel-arrow { opacity: 1; }
.carousel-arrow:hover { background: #fff; }
@media (hover: none) { .carousel-arrow { opacity: 1; } }
.mute-btn {
  position: absolute; right: 10px; top: 10px; z-index: 3;
  display: grid; place-items: center; width: 34px; height: 34px;
  border: none; border-radius: 50%;
  background: rgba(22, 32, 29, 0.6); color: #fff; cursor: pointer;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: background 0.16s ease;
}
.mute-btn:hover { background: rgba(22, 32, 29, 0.88); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer-wordmark {
  padding: 28px 0 4px;
  text-align: center;
  font-size: clamp(48px, 16vw, 220px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #4f5753;
  line-height: 0.9;
  overflow: hidden;
  user-select: none;
}
.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px clamp(14px, 3vw, 36px) 28px;
  color: var(--muted);
  font-size: 14px;
}
.footer-bar nav { display: flex; gap: 18px; align-items: center; }
.link-btn { border: none; background: none; cursor: pointer; color: #4f5753; font-weight: 600; }
.link-btn:hover, .footer-bar a:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }
.btn-ghost { background: var(--panel); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--wash); }
.btn-block { width: 100%; }

/* ---------- Overlays (drawer + modal) ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
}
.overlay[hidden] { display: none; }
.overlay-scrim {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(22, 32, 29, 0.42);
  cursor: pointer;
  animation: fade 0.18s ease;
}
@keyframes fade { from { opacity: 0; } }
@keyframes slidein { from { transform: translateX(100%); } }
@keyframes popin { from { transform: translateY(12px) scale(0.98); opacity: 0; } }

/* Grid-density change cross-fade (View Transitions API) — see init() in script.js. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.3s; }

/* Drawer */
.drawer {
  position: relative;
  margin-left: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(440px, 100%);
  height: 100%;
  background: var(--panel);
  box-shadow: var(--shadow);
  overscroll-behavior: contain;
  animation: slidein 0.22s ease;
}
.drawer-head, .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2, .modal-head h2 { font-size: 20px; }
.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
}
.icon-btn:hover { background: var(--wash); }
.drawer-items { overflow: auto; padding: 12px 22px; display: grid; gap: 12px; align-content: start; }
.cart-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.cart-item img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--wash); }
.cart-item h3 { font-size: 14px; }
.cart-item p { color: var(--muted); font-size: 13px; }
.cart-qty { display: flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  font-weight: 600;
}
.qty-btn:hover { background: var(--wash); }
.cart-qty strong { min-width: 20px; text-align: center; }
.empty-cart { color: var(--muted); text-align: center; padding: 48px 0; }
.drawer-foot { padding: 18px 22px; border-top: 1px solid var(--line); display: grid; gap: 14px; }

/* Modal — Vercel-inspired form taste */
.modal {
  position: relative;
  margin: auto;
  width: min(496px, 100%);
  max-height: calc(100% - 32px);
  overflow: auto;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: popin 0.2s ease;
  overscroll-behavior: contain;
}
.modal .modal-head { padding: 24px 28px 20px; }
.modal-head h2 { font-size: 22px; letter-spacing: -0.02em; }
.checkout-form { display: grid; gap: 20px; padding: 24px 28px 28px; }
.checkout-form label { display: grid; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink); }
/* Text fields only. A radio/checkbox picking up the 44px box, padding, border and
   focus glow below is what drew a tall rectangle around the shipping radio. */
.checkout-form input:not([type="radio"]):not([type="checkbox"]), .checkout-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.checkout-form input::placeholder, .checkout-form textarea::placeholder { color: #9aa39d; }
.checkout-form input:not([type="radio"]):not([type="checkbox"]):focus, .checkout-form textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(22, 32, 29, 0.09);
}
.checkout-form textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.checkout-form input[aria-invalid="true"], .checkout-form textarea[aria-invalid="true"] { border-color: var(--pop); }
.checkout-form input[aria-invalid="true"]:focus, .checkout-form textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(255, 90, 60, 0.14);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.discount-field { gap: 8px; }

.shipping-field { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; display: grid; gap: 8px; }
.shipping-field legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 4px; }
.shipping-option { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--bg); }
.shipping-option:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.shipping-option input { accent-color: var(--brand); width: 18px; height: 18px; flex: 0 0 auto; cursor: pointer; }
.shipping-option-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.shipping-option-main strong { font-size: 14px; font-weight: 600; color: var(--ink); }
.shipping-option-main .muted { font-size: 12.5px; color: var(--muted); }
.shipping-option-price { font-size: 14px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.discount-row { display: flex; gap: 8px; }
.discount-row input { flex: 1; }
.discount-row .btn { min-height: 44px; flex: 0 0 auto; border-radius: 8px; }
.summary { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--wash); font-size: 14px; }
.line { display: flex; align-items: center; justify-content: space-between; }
.line span { color: var(--muted); }
.line strong { font-weight: 600; color: var(--ink); }
.line-total { padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--line-strong); font-size: 16px; }
.line-total span, .line-total strong { color: var(--ink); font-weight: 700; }
[data-discount-amt] { color: var(--ok) !important; }
.checkout-form .btn-primary { border-radius: 999px; min-height: 50px; font-size: 15px; margin-top: 2px; }
.form-msg { min-height: 20px; font-weight: 600; font-size: 14px; text-align: center; }
/* No reserved space (or grid gap) when there's no status message — keeps the
   Pay button and the secure note close together. */
.form-msg:empty { display: none; }
.form-msg.error { color: var(--pop); }
.form-msg.ok { color: var(--ok); }
.secure-note { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: -8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  z-index: 80;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast[hidden] { display: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Search clear ---------- */
.search-clear {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border: none; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer; flex: 0 0 auto;
}
.search-clear:hover { background: var(--wash); color: var(--ink); }

/* ---------- Cart item layout (remove button + qty) ---------- */
.cart-item-main { min-width: 0; }
.cart-item-main h3 { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.remove-btn {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--muted); cursor: pointer;
}
.remove-btn:hover { background: var(--wash); color: var(--pop); border-color: var(--line-strong); }

/* ---------- Field errors / notes (S6) ---------- */
.field-err { color: var(--pop); font-size: 12.5px; font-weight: 600; min-height: 0; }
.field-err[hidden] { display: none !important; }
.field-note { font-size: 12.5px; font-weight: 600; min-height: 16px; }
.field-note.ok { color: var(--ok); }
.field-note.error { color: var(--pop); }
.btn-primary.loading::before {
  content: ""; width: 15px; height: 15px; margin-right: 2px;
  border: 2px solid rgba(255,255,255,0.5); border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Product detail (S1) ---------- */
.modal-detail { width: min(860px, 100%); position: relative; }
.detail-x { position: absolute; top: 14px; right: 14px; z-index: 2; background: rgba(255,255,255,0.9); }
.detail-grid { display: grid; grid-template-columns: 1.05fr 1fr; align-items: stretch; }
/* Fill the full column height (image stretches to match the taller info side) —
   no square letterboxing gap below the media. Mobile keeps a fixed ratio below. */
.detail-media { position: relative; overflow: hidden; background: var(--wash); min-height: 100%; }
.detail-media .slide-media { width: 100%; height: 100%; object-fit: cover; }
.detail-info { padding: 28px clamp(20px, 3vw, 32px); display: grid; gap: 14px; align-content: start; }
.detail-title { font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.02em; padding-right: 36px; }
.detail-price { font-size: 22px; font-weight: 800; }
.detail-desc { color: var(--muted); line-height: 1.55; font-size: 14.5px; }
.detail-buy { display: grid; gap: 12px; margin-top: 4px; }
.qty-select { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); max-width: 130px; }
.qty-select select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background-color: #fff;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.qty-select select:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-actions .btn { min-width: 0; border-radius: 999px; }
/* "Added" confirmation: the label slides up out of the (clipped) button while an
   animated checkmark draws + pops in, on the green --ok fill. Reverts with .added. */
.detail-add { position: relative; overflow: hidden; }
.detail-add .da-text { transition: opacity 0.22s ease, transform 0.22s ease; }
.detail-add .da-check {
  position: absolute; inset: 0; display: grid; place-items: center;
  opacity: 0; transform: scale(0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.detail-add .da-check path { stroke-dasharray: 26; stroke-dashoffset: 26; }
.detail-add.added { background: var(--ok); color: #fff; border-color: var(--ok); animation: da-pop 0.34s ease; }
.detail-add.added .da-text { opacity: 0; transform: translateY(-120%); }
.detail-add.added .da-check { opacity: 1; transform: scale(1); }
.detail-add.added .da-check path { animation: da-draw 0.4s ease 0.12s forwards; }
@keyframes da-draw { to { stroke-dashoffset: 0; } }
@keyframes da-pop { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }
.acc { border-top: 1px solid var(--line); padding: 12px 0 2px; }
.acc summary { cursor: pointer; font-weight: 700; font-size: 14px; padding: 6px 0; list-style: none; display: flex; justify-content: space-between; }
.acc summary::after { content: "+"; color: var(--muted); transition: transform 0.28s ease; }
.acc[open] summary::after { content: "−"; }
.acc summary::-webkit-details-marker { display: none; }
/* Smooth reveal for accordion bodies (Details / Shipping & returns). Falls back
   to an instant open where ::details-content / interpolate-size aren't supported. */
.acc::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.28s ease, content-visibility 0.28s ease allow-discrete;
}
.acc[open]::details-content { block-size: auto; }
.spec { list-style: none; padding: 4px 0 8px; margin: 0; display: grid; gap: 6px; }
.spec li { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.spec li span:first-child { color: var(--muted); }
.muted-p { color: var(--muted); font-size: 13.5px; line-height: 1.55; padding: 4px 0 8px; }
.muted-p a { text-decoration: underline; }
.footer-links { flex-wrap: wrap; }

/* ---------- Size / design / upload / personalization (posters) ---------- */
.opt-block { display: grid; gap: 8px; }
.opt-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.opt-optional { font-weight: 500; opacity: 0.8; }
/* The twin of .opt-optional, for a field the product actually requires (the name
   engraved on a Name on Pencil). Reads as a requirement, not as fine print. */
.opt-required { font-weight: 600; color: var(--pop); }
.size-options { display: flex; flex-wrap: wrap; gap: 8px; }
.size-opt {
  min-height: 44px;
  min-width: 72px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
  display: grid;
  gap: 2px;
  text-align: left;
  font: inherit;
  color: inherit;
}
.size-opt:hover { background: var(--wash); }
.size-opt.is-selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  background: var(--wash);
}
.size-opt:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.size-label { font-weight: 700; font-size: 14px; }
.size-price { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.design-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}
.design-opt {
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  display: grid;
  gap: 6px;
  justify-items: center;
  font: inherit;
  color: inherit;
}
.design-opt:hover { background: var(--wash); }
.design-opt.is-selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  background: var(--wash);
}
.design-opt:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.design-thumb {
  width: 72px; height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--wash);
  display: block;
}
.design-thumb-empty { border: 1px dashed var(--line-strong); }
.design-name { font-size: 12.5px; font-weight: 600; text-align: center; }
.artwork-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.artwork-input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.upload-preview { margin-top: 4px; }
.upload-preview img {
  width: 96px; height: 96px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--wash);
  border: 1px solid var(--line);
}
.personalize-field input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.personalize-field input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.cart-item-meta {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cart-item-main p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid { --cols: 3 !important; }
  .density { display: none; }
  .brand-word { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-media { aspect-ratio: 4 / 3; min-height: 0; }
  /* Stacked detail: media is full-width, so the top-right mute would sit under
     the close ✕ — move it to the top-left here. */
  .detail-media .mute-btn { left: 10px; right: auto; }
  .modal-detail { max-height: calc(100% - 24px); }
}
@media (max-width: 560px) {
  .grid { --cols: 2 !important; }
  .field-row { grid-template-columns: 1fr; }
  .toolbar { gap: 10px; }
  .pill { padding: 0 13px; }
  .footer-bar { justify-content: center; text-align: center; }
  .checkout-form input, .checkout-form textarea { font-size: 16px; } /* prevent iOS zoom */
  .modal .modal-head { padding: 20px 20px 16px; }
  .checkout-form { padding: 20px; }
  .search { flex: 1 1 0; min-width: 0; max-width: none; }
  .count { flex: 0 0 auto; white-space: nowrap; }
}
