/* =========================================================================
   Storefront core styles. Every colour, font and radius comes from tokens
   that each site's /css/theme.css overrides — keep components token-driven.
   ========================================================================= */
:root {
  --bg: #fbfaf7;
  --bg-2: #f3f1ec;
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --text: #17161a;
  --text-2: #5d5a66;
  --text-3: #8b8894;
  --border: #e6e3dc;
  --border-strong: #cfcbc2;
  --primary: #1f1b2e;
  --primary-ink: #ffffff;
  --primary-soft: #ece9f6;
  --accent: #ff6a3d;
  --accent-ink: #ffffff;
  --success: #138a52;
  --success-soft: #e3f5ec;
  --warning: #a86200;
  --warning-soft: #fdf1dc;
  --danger: #c23434;
  --danger-soft: #fbe6e6;
  --info-soft: #e7eefb;
  --font-display: ui-serif, Georgia, serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --display-weight: 700;
  --display-tracking: -0.02em;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --btn-radius: 999px;
  --shadow-sm: 0 1px 2px rgb(20 16 30 / 6%);
  --shadow: 0 6px 24px -8px rgb(20 16 30 / 18%);
  --shadow-lg: 0 24px 60px -20px rgb(20 16 30 / 30%);
  --header-bg: color-mix(in srgb, var(--bg) 86%, transparent);
  --header-ink: var(--text);
  --footer-bg: #141219;
  --footer-ink: #f2f0f5;
  --footer-muted: #a19dab;
  --media-ratio: 4 / 3;
  --media-bg: var(--bg-2);
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg, video, canvas { max-width: 100%; display: block; }
img, video { height: auto; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 1.12;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
code, kbd, .mono { font-family: var(--font-mono); }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.section { padding: clamp(48px, 8vw, 96px) 0; }
.section-tight { padding: clamp(32px, 5vw, 56px) 0; }
.section-alt { background: var(--bg-2); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .6rem; display: inline-block; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-2); max-width: 60ch; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); font-size: .9rem; }
.small { font-size: .875rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stack > * + * { margin-top: var(--stack, 1rem); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.icon { flex-shrink: 0; display: inline-block; vertical-align: -0.18em; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-ink: var(--text);
  --btn-border: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: .65em 1.3em;
  border-radius: var(--btn-radius);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg); color: var(--btn-ink);
  font: inherit; font-weight: 650; font-size: .95rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease, border-color .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { --btn-bg: var(--primary); --btn-ink: var(--primary-ink); --btn-border: var(--primary); }
.btn-primary:hover { --btn-bg: color-mix(in srgb, var(--primary) 88%, white); }
.btn-accent { --btn-bg: var(--accent); --btn-ink: var(--accent-ink); --btn-border: var(--accent); }
.btn-accent:hover { --btn-bg: color-mix(in srgb, var(--accent) 88%, white); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; }
.btn-ghost:hover { --btn-bg: color-mix(in srgb, var(--text) 6%, transparent); box-shadow: none; }
.btn-outline { --btn-bg: transparent; }
.btn-danger { --btn-bg: var(--danger); --btn-ink: #fff; --btn-border: var(--danger); }
.btn-lg { min-height: 54px; padding: .8em 1.7em; font-size: 1.05rem; }
.btn-sm { min-height: 34px; padding: .4em .9em; font-size: .85rem; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  color: var(--header-ink);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--header-ink) 10%, transparent);
}
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.3rem; letter-spacing: var(--display-tracking); white-space: nowrap; }
.brand img { width: 34px; height: 34px; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { white-space: nowrap; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: .94rem; font-weight: 550; color: color-mix(in srgb, var(--header-ink) 80%, transparent); transition: background .15s, color .15s; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--header-ink); background: color-mix(in srgb, var(--header-ink) 8%, transparent); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.header-search { position: relative; }
.header-search input { width: 220px; height: 40px; border-radius: 999px; padding: 0 14px 0 38px; border: 1px solid color-mix(in srgb, var(--header-ink) 14%, transparent); background: color-mix(in srgb, var(--header-ink) 5%, transparent); color: var(--header-ink); font: inherit; font-size: .9rem; }
.header-search input::placeholder { color: color-mix(in srgb, var(--header-ink) 50%, transparent); }
.header-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: .6; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; color: var(--header-ink); text-decoration: none; background: none; border: 0; cursor: pointer; }
.icon-btn:hover { background: color-mix(in srgb, var(--header-ink) 8%, transparent); }
.cart-count { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 800; display: grid; place-items: center; }
.menu-toggle { display: none; }
.mobile-nav { display: none; }
.header-signin .icon { display: none; }
/* Phones: "Sign in" collapses to an icon (it is also in the menu) so the full brand name fits beside the actions.
   Themes scale their wordmark here with `.site-header .brand { font-size: … }` inside the same breakpoint. */
@media (max-width: 480px) {
  .header-inner { gap: 8px; }
  .site-header .brand { gap: 8px; }
  .site-header .brand img { width: 30px; height: 30px; }
  .header-actions { gap: 2px; }
  .site-header .header-signin { width: 42px; height: 42px; min-height: 42px; padding: 0; justify-content: center; }
  .header-signin span { display: none; }
  .header-signin .icon { display: block; }
}
/* Very small phones (320px): drop the logo mark beside the name; the name itself stays whole. */
@media (max-width: 350px) { .site-header .brand img { display: none; } }
@media (max-width: 1240px) { .header-search input { width: 170px; } .nav a { padding: 8px 9px; } }
@media (max-width: 1100px) {
  .nav, .header-search { display: none; }
  .menu-toggle { display: inline-grid; }
  .mobile-nav.open { display: block; border-top: 1px solid color-mix(in srgb, var(--header-ink) 10%, transparent); padding: 12px 0 18px; }
  .mobile-nav a { display: block; padding: 10px 0; text-decoration: none; font-weight: 600; }
  .mobile-nav form input { width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--border); padding: 0 14px; font: inherit; margin-bottom: 8px; }
}

/* ---------- Banners & flash ---------- */
.sandbox-bar { background: repeating-linear-gradient(-45deg, #fff3c4, #fff3c4 12px, #ffe89a 12px, #ffe89a 24px); color: #5b4400; font-size: .82rem; font-weight: 600; text-align: center; padding: 6px 12px; }
.flash-wrap { padding-top: 16px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; font-size: .95rem; margin-bottom: 10px; }
.alert .icon { margin-top: 2px; }
/* Alert colours are tokens so dark themes can override them in one place. */
:root { --success-ink: color-mix(in srgb, var(--success) 80%, black); --danger-ink: color-mix(in srgb, var(--danger) 80%, black); --info-ink: #23406e; --info-border: #c4d4f3; --warning-ink: #6e4300; --warning-border: #f0d29b; }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success-ink); }
.alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger-ink); }
.alert-info { background: var(--info-soft); border-color: var(--info-border); color: var(--info-ink); }
.alert-warning { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning-ink); }
.btn-wrap { white-space: normal; text-align: left; justify-content: flex-start; max-width: 100%; }
.alert ul { margin: 0; padding-left: 18px; }

/* ---------- Cards & badges ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow-sm); }
.card-flat { box-shadow: none; }
.card h3 { margin-top: 0; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge-accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.badge-primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; font-size: .9rem; font-weight: 600; color: var(--text-2); transition: all .15s; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }

/* ---------- Product cards ---------- */
.pcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.pcard-media { position: relative; aspect-ratio: var(--media-ratio); background: var(--media-bg); overflow: hidden; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.pcard:hover .pcard-media img { transform: scale(1.04); }
.pcard-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.pcard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pcard-cat { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.pcard-title { font-weight: 700; font-size: 1.02rem; line-height: 1.3; margin: 0; font-family: var(--font-body); letter-spacing: 0; }
.pcard-sub { font-size: .88rem; color: var(--text-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.price { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.price-from { font-size: .78rem; font-weight: 600; color: var(--text-3); margin-right: 3px; }
.price-was { color: var(--text-3); text-decoration: line-through; font-weight: 500; font-size: .88rem; margin-left: 6px; }
.stock-low { color: var(--warning); font-size: .8rem; font-weight: 650; }
.stock-out { color: var(--danger); font-size: .8rem; font-weight: 650; }

/* ---------- Page header ---------- */
.page-head { padding: clamp(36px, 6vw, 64px) 0 clamp(20px, 3vw, 32px); }
.page-head h1 { margin-bottom: .3em; }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: var(--text-3); margin-bottom: 14px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }

/* ---------- Shop toolbar ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.toolbar select { height: 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); padding: 0 14px; font: inherit; font-size: .9rem; color: var(--text); }
.empty { text-align: center; padding: 64px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-2); }

/* ---------- Product detail ---------- */
.pdp { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
@media (max-width: 860px) { .pdp { grid-template-columns: 1fr; } }
.pdp-media { position: sticky; top: 92px; border-radius: var(--radius-lg); overflow: hidden; background: var(--media-bg); aspect-ratio: var(--media-ratio); box-shadow: var(--shadow); }
@media (max-width: 860px) { .pdp-media { position: static; } }
.pdp-media img { width: 100%; height: 100%; object-fit: cover; }
.pdp h1 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
.pdp-price { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 12px 0 4px; }
.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 10px 0 18px; }
.variant { position: relative; }
.variant input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.variant span { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-weight: 650; font-size: .95rem; transition: border-color .15s, box-shadow .15s, background .15s; height: 100%; }
.variant small { font-weight: 500; color: var(--text-3); font-size: .78rem; }
.variant input:checked + span { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.variant input:focus-visible + span { box-shadow: var(--focus); }
.variant input:disabled + span { opacity: .45; text-decoration: line-through; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; background: var(--surface); }
.qty button { width: 40px; height: 44px; border: 0; background: none; font-size: 1.2rem; cursor: pointer; color: var(--text); }
.qty input { width: 44px; text-align: center; border: 0; font: inherit; font-weight: 700; background: none; color: var(--text); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.buy-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.assurances { display: grid; gap: 10px; margin: 22px 0; padding: 16px 18px; background: var(--surface-2); border-radius: var(--radius); border: 1px solid var(--border); }
.assurances div { display: flex; gap: 10px; align-items: center; font-size: .9rem; color: var(--text-2); }
.assurances .icon { color: var(--success); }
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; font-size: .92rem; margin: 0; }
.specs dt { color: var(--text-3); }
.specs dd { margin: 0; font-weight: 600; }
.prose { max-width: 70ch; }
.prose p, .prose li { color: var(--text-2); }
.prose h2 { font-size: 1.45rem; margin-top: 2em; }
.prose h3 { font-size: 1.1rem; margin-top: 1.6em; font-family: var(--font-body); letter-spacing: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose a { color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 1em 0 1.6em; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--text); background: var(--surface-2); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label, .label { font-size: .88rem; font-weight: 650; color: var(--text); }
.field .hint { font-size: .8rem; color: var(--text-3); }
.input, .field input[type='text'], .field input[type='email'], .field input[type='password'], .field input[type='tel'], .field input[type='number'], .field input[type='search'], .field input[type='url'], .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 1rem; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); flex-shrink: 0; }
.hp { position: absolute; left: -9999px; }
.auth-wrap { min-height: 70vh; display: grid; place-items: center; padding-top: 48px; padding-bottom: 48px; }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .contact-layout { grid-template-columns: 1fr; } }
.auth-card { width: min(460px, 100%); }
.auth-card h1 { font-size: 1.9rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Cart & checkout ---------- */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }
.line { display: grid; grid-template-columns: 84px 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.line:first-child { padding-top: 0; }
.line-thumb { width: 84px; aspect-ratio: var(--media-ratio); border-radius: var(--radius-sm); overflow: hidden; background: var(--media-bg); }
.line-thumb img { width: 100%; height: 100%; object-fit: cover; }
.line-title { font-weight: 700; text-decoration: none; }
.summary { position: sticky; top: 92px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: .95rem; }
.summary-total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 14px; font-size: 1.15rem; font-weight: 800; }
.pay-methods { display: grid; gap: 10px; }
.pay-method { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pay-method:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.pay-method input { margin-top: 4px; accent-color: var(--primary); width: 18px; height: 18px; }
.pay-method strong { display: block; }
.pay-method .pm-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.rtp-field { display: none; margin-top: 12px; }
.pay-method:has(input:checked) .rtp-field { display: block; }
.trust-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--text-3); margin-top: 14px; }
.trust-row span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Pay page ---------- */
.pay-wrap { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .pay-wrap { grid-template-columns: 1fr; } }
.qr-box { display: grid; place-items: center; gap: 14px; text-align: center; }
.qr-frame { position: relative; padding: 18px; background: #fff; border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.qr-frame img { width: min(280px, 70vw); height: auto; image-rendering: pixelated; }
.qr-frame::before { content: ''; position: absolute; inset: -6px; border-radius: 24px; border: 2px dashed color-mix(in srgb, var(--primary) 35%, transparent); pointer-events: none; }
.qr-amount { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.countdown { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 700; font-variant-numeric: tabular-nums; font-size: .9rem; }
.countdown.urgent { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pay-status { display: flex; align-items: center; gap: 10px; justify-content: center; font-weight: 650; color: var(--text-2); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--primary) 20%, transparent); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding: 3px 0 0 44px; min-height: 30px; font-size: .95rem; color: var(--text-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-weight: 800; font-size: .85rem; }
.tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); gap: 4px; }
.tabs button, .tabs a { border: 0; background: none; padding: 8px 16px; border-radius: 999px; font: inherit; font-weight: 650; font-size: .9rem; color: var(--text-2); cursor: pointer; text-decoration: none; }
.tabs .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.phone-mock { width: 220px; margin: 0 auto; padding: 22px 18px; border-radius: 30px; background: #111; color: #fff; text-align: center; box-shadow: var(--shadow-lg); }
.phone-mock .notif { background: #262626; border-radius: 14px; padding: 12px; font-size: .82rem; text-align: left; animation: pop 1.6s ease infinite alternate; }
@keyframes pop { from { transform: translateY(0); } to { transform: translateY(-4px); } }

/* ---------- Order / delivery ---------- */
.success-hero { text-align: center; padding: 28px 0 8px; }
.success-hero .tick { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.code-list { display: grid; gap: 10px; }
.code-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.code-value { font-family: var(--font-mono); font-size: 1.02rem; font-weight: 700; letter-spacing: .06em; word-break: break-all; }
.code-meta { font-size: .8rem; color: var(--text-3); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.status-fulfilled, .status-succeeded, .status-approved, .status-paid { background: var(--success-soft); color: var(--success); }
.status-awaiting_payment, .status-pending, .status-open, .status-new { background: var(--warning-soft); color: var(--warning); }
.status-needs_attention, .status-failed, .status-amount_mismatch, .status-denied, .status-payment_review { background: var(--danger-soft); color: var(--danger); }
.status-refunding { background: var(--warning-soft); color: var(--warning); }
.status-expired, .status-cancelled, .status-refunded, .status-closed, .status-void, .status-withdrawn { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }

/* ---------- Account ---------- */
.account-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; align-items: start; padding-top: 40px; padding-bottom: 80px; }
@media (max-width: 860px) { .account-layout { grid-template-columns: 1fr; } }
.side-nav { display: grid; gap: 2px; position: sticky; top: 92px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--text-2); font-size: .95rem; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.active { background: var(--primary); color: var(--primary-ink); }
@media (max-width: 860px) { .side-nav { position: static; grid-auto-flow: column; overflow-x: auto; } .side-nav a { white-space: nowrap; } }
.stat { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stat b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--text-3); font-size: .85rem; }

/* ---------- Legal ---------- */
.legal-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; padding-top: 40px; padding-bottom: 96px; align-items: start; }
@media (max-width: 900px) { .legal-layout { grid-template-columns: 1fr; gap: 24px; } }
.legal-nav { position: sticky; top: 92px; display: grid; gap: 2px; font-size: .92rem; }
.legal-nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text-2); }
.legal-nav a.active, .legal-nav a:hover { background: var(--surface-2); color: var(--text); font-weight: 650; }
@media (max-width: 900px) { .legal-nav { position: static; grid-auto-flow: column; overflow-x: auto; } .legal-nav a { white-space: nowrap; } }
.legal-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--text-3); padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.callout { padding: 16px 18px; border-radius: var(--radius-sm); background: var(--surface-2); border-left: 4px solid var(--accent); margin: 1.2em 0; font-size: .95rem; }

/* ---------- Features / steps blocks ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 20px; }
.feature { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.feature .ficon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 14px; }
.feature h3 { font-size: 1.05rem; font-family: var(--font-body); letter-spacing: 0; margin-bottom: .35em; }
.feature p { color: var(--text-2); font-size: .93rem; margin: 0; }
.faq details { border-bottom: 1px solid var(--border); padding: 4px 0; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 36px 16px 0; font-weight: 650; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 6px; top: 12px; font-size: 1.4rem; font-weight: 400; color: var(--text-3); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-2); margin: 0 0 16px; }

/* ---------- Plans ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.plan.best { border: 2px solid var(--accent); box-shadow: var(--shadow-lg); }
.plan .ribbon { position: absolute; top: -12px; left: 28px; }
.plan-price { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.plan-price small { font-size: .95rem; font-weight: 600; color: var(--text-3); }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: .94rem; color: var(--text-2); }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li .icon { color: var(--success); margin-top: 3px; }
.plan form { margin-top: auto; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); padding: 64px 0 28px; margin-top: auto; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 36px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
.site-footer h4 { font-family: var(--font-body); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--footer-muted); margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--footer-ink); text-decoration: none; opacity: .88; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }
.footer-brand p { color: var(--footer-muted); max-width: 40ch; }
.biz { color: var(--footer-muted); font-size: .84rem; line-height: 1.7; font-style: normal; }
.pay-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pay-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--footer-ink) 20%, transparent); font-size: .78rem; font-weight: 700; color: var(--footer-ink); }
.footer-bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid color-mix(in srgb, var(--footer-ink) 12%, transparent); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--footer-muted); font-size: .82rem; }

/* ---------- Cookie notice ---------- */
.cookie { position: fixed; z-index: 80; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin-left: auto; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg); display: none; gap: 12px; font-size: .9rem; }
.cookie.show { display: grid; }
.cookie p { margin: 0; color: var(--text-2); }

/* ---------- Media pages ---------- */
.player-shell { background: #000; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.player-shell video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.game-shell { position: relative; background: #0b0b12; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); display: grid; place-items: center; }
/* Keep the canvas's aspect ratio when the height cap applies (no stretching). */
.game-shell canvas { width: auto; height: auto; max-width: 100%; max-height: 78vh; touch-action: none; }
.reader-shell { display: grid; grid-template-rows: auto 1fr; height: calc(100vh - 68px); }
.reader-bar { display: flex; align-items: center; gap: 10px; padding: 10px var(--gutter); border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.reader-frame { width: 100%; height: 100%; border: 0; background: var(--surface); }

/* ---------- Utility motion ---------- */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Print (receipts) ---------- */
@media print {
  /* Receipts always print dark-on-white, whatever the site theme. */
  :root { --bg: #fff; --bg-2: #fff; --surface: #fff; --surface-2: #f4f4f4; --text: #111; --text-2: #333; --text-3: #555; --border: #ccc; --border-strong: #999; color-scheme: light; }
  .site-header, .site-footer, .cookie, .sandbox-bar, .no-print, .side-nav { display: none !important; }
  body { background: #fff; color: #111; }
  .card { box-shadow: none; border-color: #ccc; background: #fff; color: #111; }
}
