/* Petal & Wing design system
 * Soft blush, ivory and deep plum. Serif display, clean sans body.
 * Fonts are optional: pages may add the Google Fonts <link> shown in
 * store/STYLE.md; without it the system serif/sans stacks are used.
 * Documentation and HTML snippets: store/STYLE.md
 */

/* ---------- 1. Tokens (light) ---------- */
:root {
  color-scheme: light;

  /* palette */
  --pw-ivory: #fbf7f2;
  --pw-blush-50: #fbf0ee;
  --pw-blush-100: #f5e1de;
  --pw-blush-300: #e6b9b3;
  --pw-plum-700: #5a2a4e;
  --pw-plum-800: #47203e;
  --pw-ink-900: #2a2027;
  --pw-sage: #5f7a64;
  --pw-gold: #a5813f;        /* decoration only: 3.4:1 on ivory, too low for text */
  --pw-rose-err: #a3343f;

  /* semantic colours */
  --bg: var(--pw-ivory);
  --bg-tint: var(--pw-blush-50);
  --surface: #ffffff;
  --surface-2: #fdfaf7;
  --ink: var(--pw-ink-900);
  --ink-soft: #5e5159;
  --muted: #776a72;          /* 4.9:1 on --bg */
  --line: #eadfd9;
  --line-strong: #d6c6bf;
  --accent: var(--pw-plum-700);
  --accent-hover: var(--pw-plum-800);
  --accent-ink: #ffffff;
  --accent-soft: var(--pw-blush-100);
  --accent-soft-ink: var(--pw-plum-800);
  --blush: var(--pw-blush-300);
  --success: #4d6652;        /* 4.5:1+ on --success-soft; --pw-sage is decoration only */
  --success-soft: #e7efe7;
  --warning: #8a5a12;
  --warning-soft: #f8ecd7;
  --danger: var(--pw-rose-err);
  --danger-soft: #f8e3e4;
  --focus: #9a4c84;
  --flat-bg: #ffffff;        /* flat sketches are drawn dark-on-white */
  --flat-ink: #2a2027;
  --overlay: rgba(42, 32, 39, 0.42);

  /* type */
  --font-display: "Cormorant Garamond", "Cormorant", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem);
  --fs-2xl: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  --fs-3xl: clamp(2.2rem, 1.6rem + 2.6vw, 3.5rem);
  --lh-tight: 1.15;
  --lh-body: 1.6;
  --tracking-caps: 0.12em;

  /* space, radius, shadow, motion */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;
  --gutter: 16px;
  --maxw: 1200px;
  --maxw-text: 68ch;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(71, 32, 62, 0.06), 0 1px 1px rgba(71, 32, 62, 0.04);
  --shadow-2: 0 6px 20px -8px rgba(71, 32, 62, 0.18), 0 2px 6px rgba(71, 32, 62, 0.06);
  --shadow-3: 0 24px 60px -20px rgba(71, 32, 62, 0.35);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 160ms;
  --header-h: 60px;
}

/* ---------- 2. Tokens (dark) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17121a;
    --bg-tint: #1f1720;
    --surface: #211a23;
    --surface-2: #1c161e;
    --ink: #f3ebee;
    --ink-soft: #d6c8cf;
    --muted: #ab9ca5;
    --line: #372c37;
    --line-strong: #4a3c49;
    --accent: #e3b3cf;
    --accent-hover: #efc9df;
    --accent-ink: #2a1426;
    --accent-soft: #3a2436;
    --accent-soft-ink: #f2d3e3;
    --blush: #8f5d6c;
    --success: #9cc0a1;
    --success-soft: #213025;
    --warning: #e8c07a;
    --warning-soft: #33281a;
    --danger: #f0a0a7;
    --danger-soft: #3a1f24;
    --focus: #e9a9d0;
    --flat-bg: #f7f2ee;
    --overlay: rgba(6, 3, 8, 0.6);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 8px 24px -10px rgba(0, 0, 0, 0.6);
    --shadow-3: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17121a;
  --bg-tint: #1f1720;
  --surface: #211a23;
  --surface-2: #1c161e;
  --ink: #f3ebee;
  --ink-soft: #d6c8cf;
  --muted: #ab9ca5;
  --line: #372c37;
  --line-strong: #4a3c49;
  --accent: #e3b3cf;
  --accent-hover: #efc9df;
  --accent-ink: #2a1426;
  --accent-soft: #3a2436;
  --accent-soft-ink: #f2d3e3;
  --blush: #8f5d6c;
  --success: #9cc0a1;
  --success-soft: #213025;
  --warning: #e8c07a;
  --warning-soft: #33281a;
  --danger: #f0a0a7;
  --danger-soft: #3a1f24;
  --focus: #e9a9d0;
  --flat-bg: #f7f2ee;
  --overlay: rgba(6, 3, 8, 0.6);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 8px 24px -10px rgba(0, 0, 0, 0.6);
  --shadow-3: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
}

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute always wins over component display rules. */
[hidden] { display: none !important; }
/* Explicit per-component rules too, so a component's own display value can
   never outrank [hidden] even without the !important above (the site's
   built-page check reads them per class). */
.notice[hidden], .split[hidden], .card[hidden], .home-lookbook[hidden],
.btn[hidden], .badge[hidden], .sticky-bar[hidden] { display: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-md)/var(--lh-body) var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
body > main { flex: 1 0 auto; }
img, svg, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: 0.005em;
  margin: 0 0 var(--s-3);
  color: var(--ink);
}
h1 { font-size: var(--fs-3xl); font-weight: 400; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--s-4); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
small, .small { font-size: var(--fs-sm); }
.muted { color: var(--muted); }
.eyebrow {
  font: 600 var(--fs-xs)/1.3 var(--font-body);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--muted);
  margin: 0 0 var(--s-2);
}
.lede { font-size: var(--fs-lg); color: var(--ink-soft); max-width: var(--maxw-text); }
code, kbd { font-family: var(--font-mono); font-size: 0.9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-6) 0; }
::selection { background: var(--accent-soft); color: var(--accent-soft-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s-2); top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm); text-decoration: none;
}
.skip-link:focus { top: var(--s-2); }

/* ---------- 4. Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.prose { max-width: var(--maxw-text); }
.section { padding-block: var(--s-7); }
.section--tint { background: var(--bg-tint); }
.stack > * + * { margin-top: var(--s-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.split { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.grid--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.sticky { position: sticky; top: calc(var(--header-h) + var(--s-3)); }
.hero { padding-block: var(--s-7) var(--s-6); }
.hero h1 { max-width: 18ch; }
.ornament {
  /* a small petal-and-wing flourish between sections */
  display: block; width: 56px; height: 12px; margin: var(--s-4) 0; color: var(--blush);
  background:
    radial-gradient(ellipse 10px 5px at 50% 50%, currentColor 98%, transparent) center / 20px 12px no-repeat,
    linear-gradient(currentColor, currentColor) left center / 16px 1px no-repeat,
    linear-gradient(currentColor, currentColor) right center / 16px 1px no-repeat;
}

/* ---------- 5. Header and nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; gap: var(--s-4);
  min-height: var(--header-h);
  max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter);
}
.brand {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font: 500 1.45rem/1 var(--font-display); letter-spacing: 0.02em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand__amp { font-style: italic; color: var(--accent); }
.brand__mark { width: 26px; height: 26px; color: var(--accent); flex: none; }
.nav { margin-left: auto; }
.nav__list { display: flex; gap: var(--s-1); list-style: none; margin: 0; padding: 0; }
.nav__link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s-3);
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-soft); text-decoration: none;
  border-radius: var(--r-pill);
}
.nav__link:hover { color: var(--ink); background: var(--accent-soft); }
.nav__link[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav__cart { position: relative; }
.nav__count {
  margin-left: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink);
  font: 600 11px/20px var(--font-body); text-align: center;
}
.nav__toggle { display: none; }
@media (max-width: 760px) {
  .nav__toggle {
    display: inline-flex; margin-left: auto; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--r-pill);
    background: var(--surface); color: var(--ink); cursor: pointer;
  }
  .nav { position: absolute; inset: 100% 0 auto 0; margin: 0; display: none;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-2); }
  .nav[data-open="true"], .nav__toggle[aria-expanded="true"] + .nav { display: block; }
  .nav__list { flex-direction: column; padding: var(--s-2) var(--gutter) var(--s-3); }
  .nav__link { width: 100%; min-height: 44px; border-radius: var(--r-md); font-size: var(--fs-md); }
}

/* ---------- 6. Buttons ---------- */
.btn {
  --btn-bg: var(--surface); --btn-ink: var(--ink); --btn-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-5);
  font: 500 var(--fs-sm)/1 var(--font-body); letter-spacing: 0.02em;
  color: var(--btn-ink); background: var(--btn-bg);
  border: 1px solid var(--btn-line); border-radius: var(--r-pill);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover { --btn-bg: var(--accent-soft); --btn-line: var(--accent); color: var(--btn-ink); }
.btn:active { transform: translateY(1px); }
.btn--primary { --btn-bg: var(--accent); --btn-ink: var(--accent-ink); --btn-line: var(--accent); }
.btn--primary:hover { --btn-bg: var(--accent-hover); --btn-line: var(--accent-hover); }
.btn--soft { --btn-bg: var(--accent-soft); --btn-ink: var(--accent-soft-ink); --btn-line: transparent; }
.btn--ghost { --btn-bg: transparent; --btn-line: transparent; color: var(--accent); }
.btn--ghost:hover { --btn-bg: var(--accent-soft); --btn-line: transparent; }
.btn--danger { --btn-bg: transparent; --btn-ink: var(--danger); --btn-line: var(--danger); }
.btn--danger:hover { --btn-bg: var(--danger-soft); --btn-line: var(--danger); }
.btn--sm { min-height: 36px; padding: 0 var(--s-3); font-size: var(--fs-xs); }
.btn--lg { min-height: 52px; padding: 0 var(--s-6); font-size: var(--fs-md); }
.btn--block { display: flex; width: 100%; }
.btn--icon { width: 44px; padding: 0; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }

/* ---------- 7. Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 36px; padding: 0 var(--s-3);
  font: 500 var(--fs-sm)/1 var(--font-body); color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill);
  cursor: pointer; text-decoration: none;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip[aria-pressed="true"], .chip[aria-selected="true"], .chip.is-active {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.chip__count { font-size: var(--fs-xs); opacity: 0.7; }
.chip--static { cursor: default; min-height: 28px; font-size: var(--fs-xs); background: var(--bg-tint); }
.swatch {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: var(--swatch, #ccc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.chip .swatch { width: 14px; height: 14px; }

/* ---------- 8. Cards ---------- */
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; color: inherit; text-decoration: none;
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
a.card:hover, .card--interactive:hover { box-shadow: var(--shadow-2); border-color: var(--line-strong); transform: translateY(-2px); }
.card.is-selected { outline: 2px solid var(--accent); outline-offset: -1px; }
.card__media {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  background: var(--bg-tint);
}
.card__media > img { width: 100%; height: 100%; object-fit: cover; }
.card__flat, .flat {
  display: flex; align-items: center; justify-content: center;
  background: var(--flat-bg); color: var(--flat-ink);
}
.card__flat { position: absolute; inset: 0; padding: 8%; }
.card__flat svg, .flat svg { width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
.flat { aspect-ratio: 3 / 4; border-radius: var(--r-md); border: 1px solid var(--line); padding: 6%; }
.flat-label {
  position: absolute; left: var(--s-2); bottom: var(--s-2);
  font: 500 10px/1 var(--font-body); letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: #776a72; background: rgba(255, 255, 255, 0.85); padding: 4px 6px; border-radius: 4px;
}
.card__body { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-3) var(--s-4) var(--s-4); flex: 1; }
.card__title { font: 500 var(--fs-lg)/1.25 var(--font-display); margin: 0; font-size: 1.2rem; }
.card__meta { font-size: var(--fs-sm); color: var(--muted); margin: 0; }
.card__foot { margin-top: auto; padding-top: var(--s-2); display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; }
.card--panel { padding: var(--s-5); }
.card--panel.card--tint { background: var(--bg-tint); }

/* ---------- 9. Price and badges ---------- */
.price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px var(--s-2); }
.price__amount {
  font: 500 1.25rem/1.1 var(--font-display); color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
}
.price--lg .price__amount { font-size: var(--fs-2xl); }
.price__from { font-size: var(--fs-xs); color: var(--muted); }
.price__note { flex-basis: 100%; font-size: var(--fs-xs); color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--r-pill);
  font: 600 10.5px/1.3 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--bg-tint); color: var(--ink-soft); border: 1px solid var(--line);
  white-space: nowrap;
}
.badge--estimate { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.badge--estimate::before { content: "\2248"; font-size: 12px; letter-spacing: 0; } /* ≈ */
.badge--success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge--accent { background: var(--accent-soft); color: var(--accent-soft-ink); border-color: transparent; }
.badge--danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* AI visualisation badge: required wherever an AI image appears */
.ai-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px 4px 7px; border-radius: var(--r-pill);
  font: 600 10.5px/1.2 var(--font-body); letter-spacing: 0.06em; text-transform: uppercase;
  color: #fff; background: rgba(42, 32, 39, 0.78);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.ai-badge::before {
  content: ""; width: 8px; height: 8px; border-radius: 50% 0 50% 0; /* a petal */
  background: #f2c6d6; transform: rotate(-20deg);
}
.card__media .ai-badge, .figure .ai-badge { position: absolute; top: var(--s-2); left: var(--s-2); z-index: 1; }
.figure { position: relative; margin: 0; }
.figure > img { border-radius: var(--r-md); width: 100%; }
.figure figcaption { font-size: var(--fs-xs); color: var(--muted); margin-top: var(--s-2); }

/* ---------- 10. Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s-4); min-width: 0; }
.field__label { font-size: var(--fs-sm); font-weight: 500; color: var(--ink); }
.field__hint { font-size: var(--fs-xs); color: var(--muted); }
.field__error { font-size: var(--fs-xs); color: var(--danger); }
.field__row { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.input, .select, .textarea,
.field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px var(--s-3);
  font: 400 var(--fs-md)/1.3 var(--font-body); /* 16px stops iOS zoom */
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.textarea, .field textarea { min-height: 110px; resize: vertical; }
.select, .field select {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.input:focus, .select:focus, .textarea:focus,
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field [aria-invalid="true"] { border-color: var(--danger); }
.input-unit { position: relative; display: flex; align-items: center; }
.input-unit > input { padding-right: 48px; }
.input-unit__suffix { position: absolute; right: var(--s-3); font-size: var(--fs-sm); color: var(--muted); pointer-events: none; }
.check { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.options { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); border: 0; padding: 0; margin: 0 0 var(--s-4); }
.options legend { font-size: var(--fs-sm); font-weight: 500; margin-bottom: var(--s-2); padding: 0; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.option__box {
  display: flex; flex-direction: column; gap: 2px; height: 100%;
  padding: var(--s-3); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); font-size: var(--fs-sm);
}
.option__box small { color: var(--muted); font-size: var(--fs-xs); }
.option input:checked + .option__box { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.option input:focus-visible + .option__box { outline: 2px solid var(--focus); outline-offset: 2px; }

/* quantity stepper */
.qty {
  display: inline-flex; align-items: center; border: 1px solid var(--line-strong);
  border-radius: var(--r-pill); background: var(--surface); overflow: hidden;
}
.qty button { width: 40px; height: 40px; border: 0; background: none; color: var(--ink); font-size: 18px; cursor: pointer; }
.qty button:hover { background: var(--accent-soft); }
.qty input { width: 44px; height: 40px; border: 0; text-align: center; background: none; color: var(--ink); font: 500 var(--fs-md) var(--font-body); -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- 11. Progress stepper (checkout, measurements, order tracking) ---------- */
.stepper { display: flex; list-style: none; margin: 0 0 var(--s-5); padding: 0; counter-reset: step; overflow-x: auto; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper__item {
  counter-increment: step; position: relative; flex: 1 0 84px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  font-size: var(--fs-xs); color: var(--muted); padding: 0 4px;
}
.stepper__item::before {
  content: counter(step); position: relative; z-index: 1;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font: 600 12px/1 var(--font-body);
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted);
}
.stepper__item + .stepper__item::after {
  content: ""; position: absolute; top: 14px; right: calc(50% + 14px); width: calc(100% - 28px); height: 1px;
  background: var(--line-strong);
}
.stepper__item.is-done::before { content: "\2713"; background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.stepper__item.is-done + .stepper__item::after, .stepper__item.is-current::after { background: var(--accent); }
.stepper__item.is-current, .stepper__item[aria-current="step"] { color: var(--ink); font-weight: 600; }
.stepper__item.is-current::before, .stepper__item[aria-current="step"]::before { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* vertical variant for order tracking */
.stepper--vertical { flex-direction: column; overflow: visible; }
.stepper--vertical .stepper__item { flex: none; flex-direction: row; align-items: flex-start; text-align: left; gap: var(--s-3); padding: 0 0 var(--s-4); font-size: var(--fs-sm); }
.stepper--vertical .stepper__item::before { flex: none; }
.stepper--vertical .stepper__item + .stepper__item::after { top: auto; bottom: calc(100% - 4px); left: 13.5px; right: auto; width: 1px; height: calc(100% - 28px + var(--s-4) - 8px); }
.stepper__text { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.stepper__text small { color: var(--muted); font-weight: 400; }

/* ---------- 12. Dialogs ---------- */
dialog.dialog, .dialog {
  width: min(640px, calc(100% - 2 * var(--gutter)));
  max-height: calc(100dvh - 2 * var(--gutter));
  padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3);
  overflow: auto;
}
.dialog--wide { width: min(920px, calc(100% - 2 * var(--gutter))); }
dialog.dialog::backdrop { background: var(--overlay); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
dialog.dialog[open] { animation: pw-rise 220ms var(--ease); }
.dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); padding: var(--s-5) var(--s-5) var(--s-3); }
.dialog__title { margin: 0; font-size: var(--fs-xl); }
.dialog__body { padding: 0 var(--s-5) var(--s-5); }
.dialog__foot {
  position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: flex-end;
  padding: var(--s-3) var(--s-5); background: var(--surface-2); border-top: 1px solid var(--line);
}
.dialog__close { flex: none; }
@media (max-width: 560px) {
  /* bottom sheet on phones */
  dialog.dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92dvh; }
  .dialog__head, .dialog__body { padding-inline: var(--gutter); }
  .dialog__foot { padding-inline: var(--gutter); }
  .dialog__foot .btn { flex: 1; }
}

/* ---------- 13. Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 10px var(--s-3); text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th {
  font: 600 var(--fs-xs)/1.3 var(--font-body); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); background: var(--surface-2); white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-tint); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); border-bottom: 0; }
/* stack rows into cards on phones: add data-label to each td */
@media (max-width: 560px) {
  .table--stack thead { display: none; }
  .table--stack tr { display: block; padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
  .table--stack td { display: flex; justify-content: space-between; gap: var(--s-3); border: 0; padding: 4px var(--s-3); text-align: right; }
  .table--stack td::before { content: attr(data-label); color: var(--muted); text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; }
  .table--stack .num { text-align: right; }
}

/* summary list (cart totals, order summary) */
.summary { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: var(--s-2) var(--s-4); font-size: var(--fs-sm); }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.summary .summary__total { padding-top: var(--s-2); border-top: 1px solid var(--line); font: 500 1.25rem/1.2 var(--font-display); color: var(--ink); }

/* ---------- 14. Notices and toasts ---------- */
.notice {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  background: var(--bg-tint); border: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-soft);
}
.notice > :last-child { margin-bottom: 0; }
.notice--estimate, .notice--warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 25%, transparent); color: var(--ink); }
.notice--success { background: var(--success-soft); border-color: transparent; }
.notice--danger { background: var(--danger-soft); border-color: transparent; }

.toasts {
  position: fixed; z-index: 80; left: 50%; bottom: max(var(--s-4), env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(420px, calc(100% - 2 * var(--gutter)));
  display: flex; flex-direction: column; gap: var(--s-2); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-3);
  font-size: var(--fs-sm); animation: pw-rise 240ms var(--ease);
}
.toast__action { margin-left: auto; background: none; border: 0; color: inherit; font: 600 var(--fs-sm) var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px; }
.toast--success { border-left: 4px solid var(--success); }
.toast--danger { border-left: 4px solid var(--danger); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 200ms, transform 200ms; }

/* ---------- 15. Footer ---------- */
.site-footer {
  margin-top: var(--s-8); padding: var(--s-7) 0 var(--s-6);
  background: var(--bg-tint); border-top: 1px solid var(--line);
  font-size: var(--fs-sm); color: var(--ink-soft);
}
.site-footer__inner { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.site-footer__grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); margin-bottom: var(--s-5); }
.site-footer h2, .site-footer h3 { font: 600 var(--fs-xs)/1.3 var(--font-body); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--muted); margin-bottom: var(--s-3); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.disclaimer, .privacy-line { font-size: var(--fs-xs); color: var(--muted); max-width: var(--maxw-text); margin: 0 0 var(--s-2); }
.disclaimer { padding-top: var(--s-4); border-top: 1px solid var(--line); }
.theme-toggle { margin-top: var(--s-3); }

/* ---------- 16. Misc ---------- */
.empty { text-align: center; padding: var(--s-7) var(--s-4); color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty h3 { color: var(--ink); }
.placeholder { font-style: italic; color: var(--muted); } /* clearly marked placeholder text (e.g. unconfirmed maker) */
.skeleton { background: linear-gradient(90deg, var(--bg-tint), var(--line), var(--bg-tint)); background-size: 200% 100%; animation: pw-shimmer 1.4s linear infinite; border-radius: var(--r-sm); }
.sticky-bar {
  position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-3) var(--gutter) max(var(--s-3), env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
@media (min-width: 900px) { .sticky-bar--mobile { display: none; } }

@keyframes pw-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pw-shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer__grid, .toasts, .sticky-bar, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .table-wrap { break-inside: avoid; box-shadow: none; }
}
