/* ==========================================================================
   Storefront base styles.
   Every colour, font and size comes from theme variables generated from
   themes/{name}/theme.md (see /theme.css). Don't hard-code brand values here.
   ========================================================================== */

:root {
  /* Fallbacks so the site still renders if a theme omits a token. */
  --color-background: #fff;
  --color-surface: #f6f6f4;
  --color-surface-alt: #ecece8;
  --color-text: #16161a;
  --color-muted: #6b6b76;
  --color-border: #e2e2de;
  --color-primary: #16161a;
  --color-primary-text: #fff;
  --color-accent: #e85d2a;
  --color-accent-text: #fff;
  --color-sale: #d92d20;
  --color-success: #12805c;
  --color-warning: #b54708;
  --color-danger: #d92d20;
  --color-header-background: var(--color-background);
  --color-header-text: var(--color-text);
  --color-footer-background: var(--color-surface);
  --color-footer-text: var(--color-muted);
  --font-heading: system-ui, sans-serif;
  --font-body: system-ui, sans-serif;
  --radius: 10px;
  --layout-container-width: 1240px;
  --cards-image-ratio: 1 / 1;
  --heading-weight: 700;
  --heading-letter-spacing: 0;
  --radius-button: var(--radius);
  --gutter: clamp(16px, 4vw, 32px);
  --section-space: clamp(48px, 7vw, 96px);
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px -12px rgba(0,0,0,.18);
}

body[data-buttons="pill"] { --radius-button: 999px; }
body[data-buttons="square"] { --radius-button: 0; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-letter-spacing);
  line-height: 1.15;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.muted { color: var(--color-muted); }
.small { font-size: .875rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--layout-container-width); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 760px; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .8em 1.5em; border-radius: var(--radius-button);
  border: 2px solid transparent; font: inherit; font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; transition: transform .15s, background .15s, color .15s, border-color .15s, opacity .15s;
  line-height: 1.2; white-space: nowrap;
}
body[data-uppercase="true"] .btn { text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-primary); color: var(--color-primary-text); }
.btn-primary:hover { opacity: .9; }
.btn-accent { background: var(--color-accent); color: var(--color-accent-text); }
.btn-outline { border-color: currentColor; background: transparent; color: inherit; }
.btn-outline:hover { background: var(--color-text); color: var(--color-background); border-color: var(--color-text); }
.btn-ghost { background: transparent; color: inherit; padding-inline: .6em; }
.btn-block { width: 100%; }
.btn-lg { padding: 1em 2em; font-size: 1.05rem; }
.btn-sm { padding: .5em .9em; font-size: .85rem; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

input, select, textarea {
  font: inherit; color: var(--color-text); background: var(--color-background);
  border: 1px solid var(--color-border); border-radius: calc(var(--radius) * .6);
  padding: .7em .9em; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; border-color: transparent; }
label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: .35em; }
.field { margin-bottom: 1rem; }
.field-error, .validation-summary-errors { color: var(--color-danger); font-size: .875rem; }
.validation-summary-errors ul { margin: 0; padding-left: 1.2em; }

/* ---------- Announcement + header ---------- */
.announcement {
  background: var(--color-accent); color: var(--color-accent-text);
  text-align: center; font-size: .875rem; font-weight: 600; padding: .55em var(--gutter);
}
.announcement a { text-decoration: none; }

.site-header {
  background: var(--color-header-background); color: var(--color-header-text);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  z-index: 50;
}
body[data-sticky-header="true"] .site-header { position: sticky; top: 0; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-heading); font-weight: var(--heading-weight); font-size: 1.35rem; letter-spacing: var(--heading-letter-spacing); }
/* A fixed height, not max-height: the logo SVG has a viewBox but no size of its own, and in this flex row
   max-height alone let it collapse to 0x0 (invisible on every page until 2026-10-09). */
.brand img { height: 44px; width: auto; }
.main-nav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.main-nav a { text-decoration: none; padding: .5em .85em; border-radius: var(--radius-button); font-weight: 500; font-size: .95rem; opacity: .85; }
.main-nav a:hover, .main-nav a[aria-current="page"] { opacity: 1; background: color-mix(in srgb, var(--color-header-text) 8%, transparent); }
.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; text-decoration: none; background: none; border: 0; color: inherit; cursor: pointer; }
.icon-btn:hover { background: color-mix(in srgb, var(--color-header-text) 8%, transparent); }
.icon-btn svg { width: 22px; height: 22px; }
.cart-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--color-accent); color: var(--color-accent-text); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.menu-toggle { display: none; }

body[data-header="centered"] .header-inner { flex-wrap: wrap; justify-content: center; padding: 12px 0; }
body[data-header="centered"] .brand { order: 0; width: 100%; justify-content: center; }
body[data-header="centered"] .main-nav { order: 2; flex-basis: 100%; }
body[data-header="centered"] .header-actions { position: absolute; right: var(--gutter); top: 16px; }
body[data-header="centered"] .header-inner { position: relative; }

.search-bar { display: none; padding: 12px 0 16px; }
.search-bar.open { display: block; }
.search-bar form { display: flex; gap: 8px; }

@media (max-width: 900px) {
  .menu-toggle { display: inline-grid; }
  .main-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; background: var(--color-background); border-bottom: 1px solid var(--color-border);
    padding: 8px var(--gutter) 16px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .8em 0; font-size: 1.05rem; }
  .site-header { position: relative; }
  body[data-header="centered"] .header-actions { position: static; }
  body[data-header="centered"] .brand { width: auto; }
  body[data-header="centered"] .header-inner { justify-content: space-between; flex-wrap: nowrap; }
}

/* ---------- Flash ---------- */
.flash { padding: .9em 1.1em; border-radius: var(--radius); margin: 16px 0; font-weight: 500; }
.flash-success { background: color-mix(in srgb, var(--color-success) 14%, transparent); color: var(--color-success); }
.flash-error { background: color-mix(in srgb, var(--color-danger) 14%, transparent); color: var(--color-danger); }
/* Neutral news that isn't a problem, e.g. "Checkout cancelled" after a shopper backs out on purpose. */
.flash-info { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }

/* ---------- Sections (blocks) ---------- */
.section { padding: var(--section-space) 0; }
.section[data-spacing="none"] { padding: 0; }
.section[data-spacing="sm"] { padding: calc(var(--section-space) * .45) 0; }
.section[data-spacing="lg"] { padding: calc(var(--section-space) * 1.4) 0; }
.section[data-bg="surface"] { background: var(--color-surface); }
.section[data-bg="primary"] { background: var(--color-primary); color: var(--color-primary-text); }
.section[data-bg="accent"] { background: var(--color-accent); color: var(--color-accent-text); }
.section[data-bg="dark"] { background: #0c0c10; color: #f3f3f6; }
.section + .section[data-bg="default"] { padding-top: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-heading h2 { margin: 0; }
.section-heading p { margin: .3em 0 0; color: var(--color-muted); }
.section-heading a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.section-heading a:hover { text-decoration: underline; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--color-accent); margin-bottom: .75em; }

/* Hero */
.hero { position: relative; display: grid; align-items: center; overflow: hidden; background: var(--color-surface); color: var(--color-text); }
.hero[data-height="sm"] { min-height: 320px; }
.hero[data-height="md"] { min-height: 460px; }
.hero[data-height="lg"] { min-height: 620px; }
.hero[data-height="full"] { min-height: calc(100vh - 72px); }
.hero.has-image { color: #fff; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: #000; }
.hero-content { position: relative; padding: 64px 0; max-width: 760px; }
.hero[data-align="center"] .hero-content { margin: 0 auto; text-align: center; }
.hero[data-align="right"] .hero-content { margin-left: auto; text-align: right; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); margin-bottom: .3em; }
.hero p { font-size: clamp(1.05rem, 1.6vw, 1.3rem); opacity: .9; max-width: 620px; }
.hero[data-align="center"] p { margin-inline: auto; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero[data-align="center"] .hero-actions { justify-content: center; }
.hero[data-align="right"] .hero-actions { justify-content: flex-end; }
.hero.has-image .btn-outline { color: #fff; }

/* Grids */
.grid { display: grid; gap: clamp(14px, 2vw, 24px); grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
@media (max-width: 1024px) { .grid:not([style*="--cols: 2"]) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid, .grid:not([style*="--cols: 2"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .grid.grid-text { grid-template-columns: 1fr; } }
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--cols, 4) - 1) * 20px) / var(--cols, 4)); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: thin; }
.carousel > * { scroll-snap-align: start; }
@media (max-width: 760px) { .carousel { grid-auto-columns: 70%; } }

/* ---------- Product cards ---------- */
.card { position: relative; display: flex; flex-direction: column; text-decoration: none; color: inherit; border-radius: var(--radius); min-width: 0; }
.card-media { position: relative; aspect-ratio: var(--cards-image-ratio); border-radius: var(--radius); overflow: hidden; background: var(--color-surface); isolation: isolate; }
.card-media > img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .35s; }
.card-media .img-alt { position: absolute; inset: 0; opacity: 0; }
.card:hover .card-media .img-alt { opacity: 1; }
/* A bundle's picture made from its contents: the covers fanned out like cases on a table. */
.card-media > .card-stack { position: absolute; inset: 0; overflow: hidden; background: var(--sleeve-color, #0d0f12); }
.card-stack img {
  position: absolute; top: 14%; width: 56%; height: auto; aspect-ratio: var(--cards-image-ratio); object-fit: cover;
  border-radius: 3px; box-shadow: 0 8px 18px -6px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.12); transition: transform .35s ease;
}
.card-stack[data-count="2"] img:nth-child(1) { left: 6%; transform: rotate(-7deg); }
.card-stack[data-count="2"] img:nth-child(2) { right: 6%; top: 20%; transform: rotate(6deg); }
.card-stack[data-count="3"] img { width: 50%; }
.card-stack[data-count="3"] img:nth-child(1) { left: 2%; top: 12%; transform: rotate(-10deg); }
.card-stack[data-count="3"] img:nth-child(2) { left: 25%; top: 18%; transform: rotate(0deg); z-index: 1; }
.card-stack[data-count="3"] img:nth-child(3) { right: 2%; top: 12%; transform: rotate(10deg); }
.card:hover .card-stack[data-count="2"] img:nth-child(1) { transform: rotate(-11deg) translateX(-4%); }
.card:hover .card-stack[data-count="2"] img:nth-child(2) { transform: rotate(10deg) translateX(4%); }
.card-media .placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--color-muted); font-size: 2.5rem; }
/* Banner across the top of the image (a product type field marked as banner, e.g. the console band). The image
   moves below it and is scaled to fit whole. Colours come per option from Admin > Product types. */
.card--banner .card-label {
  display: grid; place-items: center; position: absolute; z-index: 1; top: 0; left: 0; right: 0; height: 10%;
  background: var(--label-bg, var(--color-surface-alt)); color: var(--label-color, var(--color-text));
  font: 700 clamp(.6rem, 1.1vw, .85rem) / 1 "Segoe UI", system-ui, Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase;
  border-bottom: 1px solid rgba(0,0,0,.35); overflow: hidden; white-space: nowrap;
}
.card--banner .card-media > img, .card--banner .card-media > .placeholder, .card--banner .card-media > .card-stack {
  position: absolute; top: 10%; left: 0; width: 100%; height: 90%; object-fit: contain; background: var(--sleeve-color, #0d0f12);
}
.card--banner .card-badges { top: calc(10% + 10px); }
.card-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; z-index: 3; }
.badge { display: inline-block; padding: .3em .65em; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--color-text); color: var(--color-background); line-height: 1.3; }
.badge-accent { background: var(--color-accent); color: var(--color-accent-text); }
.badge-sale { background: var(--color-sale); color: #fff; }
.badge-muted { background: var(--color-surface-alt); color: var(--color-muted); }
.badge-preorder { background: var(--color-primary); color: var(--color-primary-text); }
.card-body { padding: 12px 2px 0; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-weight: 600; font-size: 1rem; line-height: 1.35; margin: 0; }
.card-subtitle { font-size: .85rem; color: var(--color-muted); margin: 0; }
.card-attrs { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .78rem; color: var(--color-muted); margin: 2px 0 0; padding: 0; list-style: none; }
.card-attrs b { color: var(--color-text); font-weight: 600; }
.price { font-weight: 700; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price .compare { text-decoration: line-through; color: var(--color-muted); font-weight: 500; font-size: .9em; }
.price .from { font-weight: 500; color: var(--color-muted); font-size: .85em; }
.card-footer { margin-top: auto; padding-top: 10px; }
.card .stretched { position: absolute; inset: 0; z-index: 1; }
.card form, .card .btn { position: relative; z-index: 2; }
.stock-note { font-size: .78rem; font-weight: 600; color: var(--color-warning); }
.sold-out .card-media img { filter: grayscale(.7); opacity: .6; }

/* minimal: no extras, centred text */
.card--minimal .card-body { text-align: center; align-items: center; }
.card--minimal .card-attrs, .card--minimal .card-footer { display: none; }

/* detailed: framed card with attributes and full-width button */
.card--detailed { background: var(--color-surface); border: 1px solid var(--color-border); padding: 10px; }
.card--detailed .card-media { border-radius: calc(var(--radius) * .7); }
.card--detailed .card-body { padding: 12px 4px 4px; }

/* showcase: collectible-style framed card with glow, made for tall product shots */
.card--showcase { background: linear-gradient(180deg, var(--color-surface-alt), var(--color-surface)); border: 1px solid var(--color-border); padding: 10px; }
.card--showcase .card-media { border-radius: calc(var(--radius) * .7); background: radial-gradient(circle at 50% 30%, var(--color-surface-alt), var(--color-background)); }
.card--showcase .card-media > img { object-fit: contain; padding: 6%; }
.card--showcase .card-body { padding: 12px 6px 6px; }
.card--showcase .card-title { font-family: var(--font-heading); font-size: 1.05rem; }

/* hover effects */
body[data-card-effect="lift"] .card { transition: transform .25s ease, box-shadow .25s ease; }
body[data-card-effect="lift"] .card:hover { transform: translateY(-4px); }
body[data-card-effect="lift"] .card--detailed:hover, body[data-card-effect="lift"] .card--showcase:hover { box-shadow: var(--shadow); }
body[data-card-effect="zoom"] .card:hover .card-media > img { transform: scale(1.06); }
body[data-card-effect="holo"] .card { transition: transform .2s ease, box-shadow .3s ease; transform-style: preserve-3d; will-change: transform; }
body[data-card-effect="holo"] .card:hover { box-shadow: var(--glow, var(--shadow)); }
body[data-card-effect="holo"] .card-media::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .3s;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.35), transparent 45%),
    linear-gradient(115deg, transparent 20%, rgba(255,0,170,.22) 35%, rgba(0,255,230,.22) 50%, rgba(255,230,0,.2) 65%, transparent 80%);
  background-size: 100% 100%, 250% 250%;
  background-position: center, var(--hx, 50%) var(--hy, 50%);
  mix-blend-mode: color-dodge;
}
body[data-card-effect="holo"] .card:hover .card-media::after { opacity: 1; }

/* case: the image is a boxed product (game case, DVD, book). The art sits under a plastic bezel, tighter on the
   hinge side, with a soft sheen; on hover the box lifts and tilts towards the cursor with light sliding across the
   sleeve. The card text stays flat. Themes colour the plastic with --case-color, e.g. per platform via data-attr-*. */
body[data-card-effect="case"] .card-media {
  padding: 4px; border-radius: 6px 12px 12px 6px; background: var(--case-color, rgba(255,255,255,.22));
  transition: transform .4s cubic-bezier(.25, 1, .5, 1), box-shadow .4s; will-change: transform;
  box-shadow: inset 0 0 12px rgba(255,255,255,.12), 0 0 0 1px rgba(0,0,0,.4), 0 10px 22px -10px rgba(0,0,0,.6);
}
body[data-card-effect="case"] .card-media > img, body[data-card-effect="case"] .card-media > .placeholder, body[data-card-effect="case"] .card-media > .card-stack { border-radius: 3px 9px 9px 3px; }
/* Inside a case the banner and the art sit within the 4px bezel. */
body[data-card-effect="case"] .card--banner .card-label { top: 4px; left: 4px; right: 4px; border-radius: 3px 9px 0 0; }
body[data-card-effect="case"] .card--banner .card-media > img, body[data-card-effect="case"] .card--banner .card-media > .placeholder, body[data-card-effect="case"] .card--banner .card-media > .card-stack {
  top: calc(4px + 10%); left: 4px; width: calc(100% - 8px); height: calc(90% - 8px); border-radius: 0 0 9px 3px;
}
body[data-card-effect="case"] .card:hover .card-media {
  box-shadow: inset 0 0 12px rgba(255,255,255,.12), 0 0 0 1px rgba(0,0,0,.4), var(--sx, 0px) var(--sy, 22px) 36px -10px rgba(0,0,0,.75);
}
/* Resting sheen on the plastic sleeve: light from the top left, a little shade bottom right. */
body[data-card-effect="case"] .card-media::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  background: linear-gradient(125deg, rgba(255,255,255,.15) 0%, rgba(255,255,255,0) 40%, rgba(0,0,0,.2) 100%);
}
body[data-card-effect="case"] .card-media::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .3; transition: opacity .3s;
  background:
    linear-gradient(115deg, transparent 30%, rgba(255,255,255,.32) 45%, rgba(255,255,255,.08) 52%, transparent 60%),
    radial-gradient(circle at var(--mx, 50%) var(--my, 25%), rgba(255,255,255,.22), transparent 42%);
  background-size: 250% 250%, 100% 100%;
  background-position: var(--gx, 100%) 0, center;
  mix-blend-mode: screen;
}
body[data-card-effect="case"] .card:hover .card-media::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .card, .card-media > img { transition: none !important; transform: none !important; } }

/* ---------- Collection tiles ---------- */
.tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; background: var(--color-surface); }
.tile-media { aspect-ratio: 4 / 3; background: var(--color-surface-alt); }
.tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.tile:hover img { transform: scale(1.05); }
.tile-label { padding: 14px 4px; font-weight: 700; font-family: var(--font-heading); font-size: 1.15rem; display: flex; justify-content: space-between; }
.tile--overlay .tile-label { position: absolute; inset: auto 0 0 0; padding: 48px 18px 16px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); }

/* ---------- Content blocks ---------- */
.prose { max-width: 72ch; }
.prose.wide { max-width: none; }
.prose[data-align="center"] { margin-inline: auto; text-align: center; }
.prose img { border-radius: var(--radius); }
.prose a { color: var(--color-accent); }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { border-bottom: 1px solid var(--color-border); padding: .5em; text-align: left; }
.section .container > .prose:not([data-align="center"]) { margin-inline: auto; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: center; }
.split.image-right > .split-media { order: 2; }
.split-media img { border-radius: var(--radius); width: 100%; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } .split.image-right > .split-media { order: 0; } }

.banner { position: relative; overflow: hidden; border-radius: var(--radius); padding: clamp(28px, 5vw, 56px); display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--color-surface); }
.banner.has-image { color: #fff; }
.banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.banner.has-image::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.45); z-index: 1; }
.banner > div, .banner > a { position: relative; z-index: 2; }
.banner h2 { margin: 0 0 .2em; }
.banner p { margin: 0; opacity: .9; }

.countdown-block { position: relative; text-align: center; overflow: hidden; border-radius: var(--radius); padding: clamp(32px, 6vw, 72px) 16px; background: var(--color-surface); }
.countdown-block.has-image { color: #fff; }
.countdown-block > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.countdown-block.has-image::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.55); z-index: 1; }
.countdown-block > *:not(img) { position: relative; z-index: 2; }
.countdown { display: inline-flex; gap: clamp(8px, 2vw, 18px); margin: 18px 0 24px; }
.countdown > div { min-width: clamp(64px, 12vw, 96px); padding: 14px 8px; border-radius: var(--radius); background: color-mix(in srgb, currentColor 10%, transparent); }
.countdown b { display: block; font-family: var(--font-heading); font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1; font-variant-numeric: tabular-nums; }
.countdown span { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; opacity: .75; }

.feature { padding: 4px; }
.feature-icon { font-size: 1.8rem; line-height: 1; margin-bottom: 12px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: var(--radius); background: color-mix(in srgb, var(--color-accent) 16%, transparent); }
/* Feature titles are h2 when the block has no heading of its own (keeps the outline in order), so size them as h3. */
.feature h2, .feature h3 { font-size: 1.2rem; margin-bottom: .3em; }
.feature p { color: var(--color-muted); margin: 0; }
.section[data-bg="primary"] .feature p, .section[data-bg="accent"] .feature p, .section[data-bg="dark"] .feature p { color: inherit; opacity: .8; }

.faq { max-width: 820px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--color-border); padding: 4px 0; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 32px 16px 0; font-weight: 600; font-size: 1.05rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.5rem; font-weight: 400; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 0 16px; color: var(--color-muted); }

.quote-card { background: var(--color-surface); border-radius: var(--radius); padding: 28px; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.quote-card blockquote { margin: 0; font-size: 1.05rem; }
.quote-card .stars { color: #f5b301; letter-spacing: 2px; }
.quote-card figcaption { font-weight: 600; color: var(--color-muted); font-size: .9rem; }

.gallery-item { display: block; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; }
.gallery-item img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.gallery-item figcaption { padding: 8px 2px; font-size: .9rem; color: var(--color-muted); }

.newsletter { max-width: 620px; margin: 0 auto; text-align: center; }
.newsletter form { display: flex; gap: 8px; margin-top: 20px; }
@media (max-width: 520px) { .newsletter form { flex-direction: column; } }
.divider { border: 0; border-top: 1px solid var(--color-border); margin: 0; }
.spacer[data-size="sm"] { height: 24px; } .spacer[data-size="md"] { height: 48px; } .spacer[data-size="lg"] { height: 96px; } .spacer[data-size="xl"] { height: 160px; }

/* ---------- Listing page ---------- */
.page-header { padding: clamp(32px, 5vw, 56px) 0 24px; }
.page-header p { color: var(--color-muted); max-width: 70ch; }
.listing { display: grid; grid-template-columns: 240px 1fr; gap: 40px; padding-bottom: var(--section-space); }
@media (max-width: 900px) { .listing { grid-template-columns: 1fr; } .filters { order: -1; } }
.filters summary { display: none; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
@media (max-width: 900px) { .filters summary { display: inline-flex; } .filters details[open] summary { margin-bottom: 8px; } }
.filters h3 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--color-muted); margin: 20px 0 8px; }
.filters a { display: block; text-decoration: none; padding: 4px 0; font-size: .95rem; }
.filters a.active { font-weight: 700; color: var(--color-accent); }
.filters .check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.filters .check input { width: auto; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar select { width: auto; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 40px; }
.pagination a, .pagination span { padding: .5em .9em; border-radius: var(--radius-button); text-decoration: none; border: 1px solid var(--color-border); }
.pagination .current { background: var(--color-primary); color: var(--color-primary-text); border-color: var(--color-primary); }
.empty { text-align: center; padding: 64px 16px; color: var(--color-muted); }

/* ---------- Product page ---------- */
.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); padding: 32px 0 var(--section-space); }
@media (max-width: 860px) { .product { grid-template-columns: 1fr; } }
.gallery-main { aspect-ratio: var(--cards-image-ratio); background: var(--color-surface); border-radius: var(--radius); overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; }
.gallery-thumbs button { flex: 0 0 76px; height: 76px; padding: 0; border: 2px solid transparent; border-radius: calc(var(--radius) * .6); overflow: hidden; background: var(--color-surface); cursor: pointer; }
.gallery-thumbs button.active { border-color: var(--color-primary); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-info { position: sticky; top: 96px; align-self: start; }
.product-info h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin-bottom: .2em; }
.product-info .price { font-size: 1.5rem; margin: 12px 0 20px; }
.breadcrumbs { font-size: .85rem; color: var(--color-muted); margin-bottom: 12px; }
.breadcrumbs a { text-decoration: none; }
.variant-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.variant-options input { position: absolute; opacity: 0; width: 1px; }
.variant-options label { margin: 0; padding: .65em 1.1em; border: 1.5px solid var(--color-border); border-radius: var(--radius-button); cursor: pointer; font-weight: 500; display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.variant-options label small { font-weight: 500; color: var(--color-muted); font-size: .78rem; }
.variant-options input:checked + label { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
.variant-options input:disabled + label { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
.variant-options input:focus-visible + label { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.buy-row { display: flex; gap: 10px; }
.qty { display: flex; align-items: center; border: 1px solid var(--color-border); border-radius: var(--radius-button); overflow: hidden; }
.qty button { background: none; border: 0; width: 40px; height: 100%; font-size: 1.2rem; cursor: pointer; color: inherit; }
.qty input { width: 48px; border: 0; text-align: center; padding: .6em 0; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.buy-row .btn { flex: 1; }
.notice { padding: .9em 1.1em; border-radius: var(--radius); background: var(--color-surface); margin: 16px 0; font-size: .95rem; }
.notice-accent { background: color-mix(in srgb, var(--color-accent) 14%, transparent); }
.spec-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .95rem; }
.spec-table th, .spec-table td { text-align: left; padding: .6em 0; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.spec-table th { color: var(--color-muted); font-weight: 500; width: 40%; }
.bundle-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.bundle-list li { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius); background: var(--color-surface); }
.bundle-list img { width: 48px; height: 48px; object-fit: cover; border-radius: calc(var(--radius) * .5); }
.bundle-list .qty-pill { margin-left: auto; font-weight: 700; }

/* ---------- Cart & checkout ---------- */
.cart { display: grid; grid-template-columns: 1fr 380px; gap: 40px; padding-bottom: var(--section-space); align-items: start; }
@media (max-width: 900px) { .cart { grid-template-columns: 1fr; } }
.cart-line { display: grid; grid-template-columns: 88px 1fr auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--color-border); align-items: center; }
.cart-line img, .cart-line .placeholder { width: 88px; height: 88px; object-fit: cover; border-radius: calc(var(--radius) * .6); background: var(--color-surface); }
.cart-line h3 { font-size: 1rem; margin: 0 0 2px; }
.cart-line h3 a { text-decoration: none; }
.cart-line .line-controls { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.cart-line .line-controls select { width: auto; padding: .35em .6em; }
.cart-line .problem { color: var(--color-danger); font-weight: 600; font-size: .85rem; }
.summary { background: var(--color-surface); border-radius: var(--radius); padding: 24px; position: sticky; top: 96px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-row.total { font-size: 1.2rem; font-weight: 700; border-top: 1px solid var(--color-border); margin-top: 10px; padding-top: 14px; }
.inline-form { display: flex; gap: 8px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--color-muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; }

/* ---------- Account / orders ---------- */
.auth-card { max-width: 440px; margin: 56px auto; padding: 32px; background: var(--color-surface); border-radius: var(--radius); }
/* Account section: the menu across its pages, and forms sitting under it rather than centred on their own. */
.account-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 28px; border-bottom: 1px solid var(--color-border); }
.account-nav a { padding: 10px 14px; text-decoration: none; color: var(--color-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.account-nav a:hover { color: var(--color-text); }
.account-nav a[aria-current="page"] { color: var(--color-text); border-bottom-color: var(--color-primary); font-weight: 600; }
.account-form { max-width: 480px; }
/* Saved addresses: the "Deliver to" choice in the basket and the list on the account's Addresses page. */
.address-pick { border: 0; padding: 0; margin: 0 0 16px; }
.address-pick legend { font-weight: 600; margin-bottom: 8px; }
.address-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--color-border); border-radius: var(--radius); cursor: pointer; }
.address-option:has(input:checked) { border-color: var(--color-primary); }
.address-option input { width: auto; margin-top: 4px; }
.address-option > span { display: grid; gap: 2px; }
.address-card { padding: 16px; border: 1px solid var(--color-border); border-radius: var(--radius); }
.address-card .actions { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; align-items: center; }
.address-card form { display: inline; }
/* The order page's "Delivering to" and "Delivery" panel, next to the progress tracker. */
.delivery-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 32px; padding: 18px 20px; margin-bottom: 28px; background: var(--color-surface); border-radius: var(--radius); }
.delivery-panel h2 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--color-muted); margin: 0 0 8px; }
.delivery-panel p { margin: 0; line-height: 1.5; }
/* For actions that can't be undone, like deleting an account. */
.btn-danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .75em .5em; border-bottom: 1px solid var(--color-border); text-align: left; }
.table th { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted); font-weight: 600; }
.status { display: inline-block; padding: .2em .7em; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--color-surface-alt); }
.status-Paid, .status-Processing { background: color-mix(in srgb, var(--color-warning) 18%, transparent); color: var(--color-warning); }
.status-Shipped, .status-Delivered { background: color-mix(in srgb, var(--color-success) 18%, transparent); color: var(--color-success); }
.status-Cancelled, .status-Refunded, .status-Abandoned { background: color-mix(in srgb, var(--color-danger) 14%, transparent); color: var(--color-danger); }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-footer-background); color: var(--color-footer-text); padding: 56px 0 32px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.5fr; gap: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer .brand { color: #fff; color: color-mix(in srgb, var(--color-footer-text) 30%, #fff); margin-bottom: 12px; }
.site-footer h2 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; opacity: .8; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
/* 28px-tall links for thumbs (over the 24px minimum); the padding replaces the old 8px gap, so the spacing is unchanged. */
.site-footer li a { display: inline-block; padding: 4px 0; }
.site-footer a { text-decoration: none; opacity: .85; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }
.site-footer form { display: flex; gap: 8px; }
.site-footer input { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--color-footer-text) 35%, transparent); }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid color-mix(in srgb, var(--color-footer-text) 20%, transparent); font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* Bare layout for focused landing pages */
.bare-header { padding: 20px 0; text-align: center; }

/* A grade's own condition note, and the tag on a one-off copy. */
/* What the picked grade means (from the product type), and the grade name when there's only one to pick. */
.grade-desc { margin: 10px 0 0; font-size: .92rem; color: var(--color-muted); }
.single-option { margin: 0 0 4px; }
.condition-note { margin: 4px 0 0; padding: 8px 12px; border-left: 3px solid var(--color-accent); background: var(--color-surface); border-radius: 0 var(--radius) var(--radius) 0; font-size: .92rem; }
.oneoff-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; font-size: .7rem; font-weight: 700; letter-spacing: .04em; background: var(--color-accent); color: var(--color-accent-text); vertical-align: middle; }
