/* FGCK Books & Gifts shop: a calm, quiet palette. White page, a slate header and footer, one muted
   denim blue for actions, a soft sand for the few highlights. Light by default; visitors can switch to
   dark with the moon button (kept in their browser by static/js/theme.js, which sets data-theme="dark"
   on <html>). System fonts only. tests/test_storefront_design.py checks the text colours in BOTH token
   blocks for contrast: change a colour here and that test tells you if it became hard to read. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f6f9;      /* soft grey wash for sections and wells */
  --ink: #1b2333;
  --muted: #566074;
  --line: #e2e6ee;
  --royal: #3f5b8c;          /* the one action colour: a muted denim blue */
  --royal-hover: #324a75;
  --royal-deep: #26344f;     /* the floating cart bar */
  --link: #34508a;           /* blue text on light surfaces */
  --royal-tint: #edf0f6;
  --on-royal: #ffffff;
  --gold: #dcc48e;           /* soft sand: the few highlights (badges, cart count) */
  --gold-ink: #3a2c0e;
  --gold-tint: #f8f3e6;
  --gold-text: #5e4710;
  --mint-tint: #e9f4ee;
  --ok-text: #0b6b36;
  --ok-bg: #dcf5e6;
  --warn-text: #7a4a00;
  --warn-bg: #fdf0d4;
  --bad-text: #a11d12;
  --bad-bg: #fde4e1;
  --focus: #2a4a8f;
  --shadow: 0 1px 2px rgb(27 35 51 / .05), 0 6px 18px rgb(27 35 51 / .06);
  --shadow-lift: 0 4px 8px rgb(27 35 51 / .08), 0 18px 36px rgb(27 35 51 / .14);
  --radius: 16px;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --header-bg: #222c42;      /* header and footer: dark slate in both themes */
  --header-ink: #f3f5f9;
  --header-muted: #bcc4d4;
  --header-hover: rgb(255 255 255 / .11);
  --header-field: rgb(255 255 255 / .1);
  --header-line: rgb(255 255 255 / .16);
  --accent-text: #7a5a24;    /* the highlighted words in the headline: warm bronze, set in italics */
  --hero-bg: #f7f1e6;        /* the hero: warm paper, to go with the photo */
  --hero-ink: #4a3122;
  --hero-muted: #6b5646;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10151f;
  --surface: #171e2c;
  --surface-2: #1d2535;
  --ink: #eceff5;
  --muted: #a9b2c5;
  --line: #2b3447;
  --royal: #4a68a0;
  --royal-hover: #3d5990;
  --royal-deep: #0f1623;
  --link: #a3b8e2;
  --royal-tint: #222c42;
  --gold-tint: #342c18;
  --gold-text: #e8d29b;
  --mint-tint: #12301f;
  --ok-text: #86e6ac;
  --ok-bg: #0f3a22;
  --warn-text: #f2d08f;
  --warn-bg: #3a2c0c;
  --bad-text: #ffb4ac;
  --bad-bg: #4a1511;
  --focus: #b8c8ee;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 6px 18px rgb(0 0 0 / .3);
  --shadow-lift: 0 4px 8px rgb(0 0 0 / .5), 0 18px 36px rgb(0 0 0 / .45);
  --header-bg: #0c111b;
  --accent-text: #dcc48e;
  --hero-bg: #2a211b;
  --hero-ink: #f1e6d5;
  --hero-muted: #d0bfa9;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--ink);
}
img { max-width: 100%; }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6rem; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.1rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 50; background: var(--surface); padding: .6rem 1rem; border-radius: 8px; }
.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; flex: none; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.container { width: 100%; max-width: none; margin: 0 auto; padding: 0 clamp(1rem, 3.2vw, 3.5rem); }
.narrow { max-width: 56rem; padding-top: 1.5rem; padding-bottom: 3rem; }

/* ---- header ------------------------------------------------------------------------------ */
header.site { background: var(--header-bg); color: var(--header-ink); border-bottom: 1px solid var(--header-line); box-shadow: 0 6px 22px rgb(15 20 35 / .2); position: sticky; top: 0; z-index: 20; }
header.site .container { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding-top: .7rem; padding-bottom: .7rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
header.site .brand { color: var(--header-ink); }
.brand-mark { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 11px; background: var(--royal); color: var(--on-royal); }
.brand small { display: block; font-weight: 500; font-size: .7rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; line-height: 1; margin-top: .15rem; }
header.site .brand small { color: var(--header-muted); }
.search { flex: 1 1 100%; order: 3; display: flex; position: relative; }
.search input { width: 100%; padding: .65rem 1rem .65rem 2.6rem; border-radius: 999px; border: 1px solid var(--header-line); background: var(--header-field); color: var(--header-ink); font: inherit; }
.search input::placeholder { color: var(--header-muted); }
.search input:focus { background: rgb(255 255 255 / .2); border-color: #fff; }
.search .icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--header-muted); pointer-events: none; }
.nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.nav a { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .8rem; border-radius: 999px; text-decoration: none; font-weight: 600; color: var(--header-ink); }
.nav a:hover { background: var(--header-hover); }
.nav a[aria-current="page"] { background: var(--header-hover); color: #fff; box-shadow: inset 0 -2px 0 var(--gold); }
.nav .label-long { display: none; }
.theme-toggle { display: none; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1px solid var(--header-line); background: transparent; color: var(--header-ink); cursor: pointer; }
.js .theme-toggle { display: grid; }
.theme-toggle:hover { background: var(--header-hover); }
.theme-toggle .moon, html[data-theme="dark"] .theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: inline-block; }
header.site :focus-visible, footer.site :focus-visible { outline-color: #e6d3a6; }
.badge-count { display: inline-block; min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; text-align: center; background: var(--gold); color: var(--gold-ink); font-size: .78rem; line-height: 1.4rem; font-weight: 700; }
@media (min-width: 760px) {
  .search { order: 0; flex: 1 1 22rem; max-width: 34rem; margin: 0 auto 0 1rem; }
  .nav .label-long { display: inline; }
}

/* ---- layout with the category menu ------------------------------------------------------- */
.shell { display: block; padding-top: 1.25rem; padding-bottom: 3rem; }
.sidebar { display: none; }
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: 2rem; align-items: start; }
  .sidebar { display: block; position: sticky; top: 5.2rem; }
  .chips { display: none !important; }
}
.catnav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; box-shadow: var(--shadow); }
.catnav h2 { font-size: .75rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: .5rem .6rem .4rem; }
.catnav ul { list-style: none; margin: 0; padding: 0; }
.catnav a { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .55rem .7rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.catnav a:hover { background: var(--royal-tint); }
.catnav a[aria-current="page"] { background: var(--royal); color: var(--on-royal); font-weight: 700; }
.catnav .count { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.catnav a[aria-current="page"] .count { color: var(--on-royal); }
.catnav hr { border: 0; border-top: 1px solid var(--line); margin: .5rem .4rem; }
.chips { display: flex; gap: .5rem; overflow-x: auto; padding: 0 0 .9rem; margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; scrollbar-width: thin; }
.chips a { flex: none; padding: .45rem .95rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.chips a[aria-current="page"] { background: var(--royal); border-color: var(--royal); color: var(--on-royal); }

/* ---- messages, buttons, forms ------------------------------------------------------------ */
.messages { list-style: none; margin: 0 0 1rem; padding: 0; }
.messages li { padding: .7rem 1rem; border-radius: 10px; margin-bottom: .5rem; background: var(--warn-bg); color: var(--warn-text); font-weight: 500; }
.messages .success { background: var(--ok-bg); color: var(--ok-text); }
.messages .error { background: var(--bad-bg); color: var(--bad-text); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 700; padding: .7rem 1.2rem; border-radius: 999px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; text-align: center; transition: background .15s, box-shadow .15s, transform .15s; }
.btn:hover { background: var(--royal-tint); }
.btn-primary { background: var(--royal); border-color: var(--royal); color: var(--on-royal); box-shadow: 0 2px 6px rgb(40 60 100 / .22); }
.btn-primary:hover { background: var(--royal-hover); border-color: var(--royal-hover); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { filter: brightness(1.06); background: var(--gold); }
.btn-light { background: #fff; border-color: #fff; color: #26344f; }
.btn-light:hover { background: #eef1f6; }
.btn-outline-light { background: transparent; border-color: rgb(255 255 255 / .7); color: #fff; }
.btn-outline-light:hover { background: rgb(255 255 255 / .14); }
.btn-sm { padding: .45rem .85rem; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-link { background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
input, select, textarea { font: inherit; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); width: 100%; }
input:focus, select:focus { border-color: var(--royal); }
label { font-weight: 600; display: block; margin-bottom: .25rem; }
.field { margin-bottom: 1rem; } .help { color: var(--muted); font-size: .875rem; margin: .25rem 0 0; }
.errorlist { list-style: none; padding: 0; margin: .3rem 0 0; color: var(--bad-text); font-size: .9rem; font-weight: 500; }
.radios { list-style: none; padding: 0; margin: 0; } .radios li { margin-bottom: .5rem; }
.radios label, .check label { font-weight: 400; display: flex; gap: .6rem; align-items: flex-start; }
.radios input, .check input { width: auto; margin-top: .3rem; accent-color: var(--royal); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.notice { background: var(--warn-bg); color: var(--warn-text); border-radius: 10px; padding: .7rem 1rem; font-weight: 500; }
.tag { display: inline-block; padding: .12rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.tag.out { background: var(--bad-bg); color: var(--bad-text); }
.tag.low { background: var(--warn-bg); color: var(--warn-text); }
.tag.ok { background: var(--ok-bg); color: var(--ok-text); }
.tag.info { background: var(--royal-tint); color: var(--link); }

/* ---- hero -------------------------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; border-radius: 20px; margin-bottom: 1.5rem; background: var(--hero-bg); border: 1px solid var(--line); }
.hero-text { position: relative; z-index: 1; align-self: center; padding: 1rem 1.25rem 1.2rem; }
.hero h1 { font-family: var(--serif); font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem); font-weight: 600; letter-spacing: -.01em; line-height: 1.12; margin: 0; color: var(--hero-ink); }
.hero h1 .amp { font-style: italic; }
.hero h1::after { content: ""; display: block; width: 3.5rem; height: 1px; margin: .65rem 0 .55rem; background: var(--hero-muted); }
.hero-tag { margin: 0 0 .35rem; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--hero-muted); }
.hero-sub { margin: 0; font-size: .98rem; color: var(--hero-muted); }
.hero .actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.hero-photo { order: -1; display: block; width: 100%; height: 7.5rem; object-fit: cover; object-position: center 45%; }
html[data-theme="dark"] .hero-photo { filter: brightness(.82); }
@media (min-width: 760px) {
  .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .hero-text { padding: 1.3rem 1.5rem 1.4rem 1.75rem; }
  .hero-photo { order: 0; height: 100%; min-height: 11rem; max-height: 14.5rem; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 30%); mask-image: linear-gradient(to right, transparent 0, #000 30%); }
}

/* ---- sections ---------------------------------------------------------------------------- */
.section { margin-bottom: 2.25rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .9rem; }
.section-head h2 { display: flex; align-items: center; gap: .5rem; margin: 0; }
.section-head h2 .icon { color: var(--royal); }
.section-head a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.section-head a:hover { text-decoration: underline; }
.notices { display: grid; gap: .8rem; }
@media (min-width: 760px) { .notices { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); } }
.notice-card { display: flex; gap: .9rem; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--royal); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.notice-card .icon { width: 1.5rem; height: 1.5rem; color: var(--royal); margin-top: .1rem; }
.notice-card h3 { margin-bottom: .25rem; }
.notice-card p { margin: 0 0 .4rem; color: var(--muted); }
.notice-card.important { border-left-color: var(--gold); background: var(--gold-tint); }
.notice-card.important .icon { color: var(--gold-text); }
.notice-card.important p { color: var(--gold-text); }
.notice-card a { font-weight: 700; }

.spotlight { position: relative; display: grid; gap: 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 1.25rem; box-shadow: var(--shadow); overflow: hidden; }
.spotlight::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--gold); }
@media (min-width: 700px) { .spotlight { grid-template-columns: 13rem 1fr; padding: 1.5rem 1.75rem 1.5rem 2rem; gap: 2rem; align-items: center; } }
.spotlight .media { position: relative; border-radius: 12px; overflow: hidden; background: var(--surface-2); aspect-ratio: 3 / 4; max-width: 13rem; box-shadow: var(--shadow-lift); }
.spotlight .media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ribbon { display: inline-flex; align-items: center; gap: .4rem; background: var(--gold); color: var(--gold-ink); font-weight: 800; font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; padding: .3rem .75rem; border-radius: 999px; margin-bottom: .7rem; }
.spotlight h2 { font-family: var(--serif); font-size: clamp(1.4rem, 1rem + 1.6vw, 2rem); margin-bottom: .2rem; }
.spotlight .byline { color: var(--muted); margin-bottom: .8rem; }
.spotlight blockquote { margin: 0 0 1rem; padding: 0 0 0 1rem; border-left: 3px solid var(--royal-tint); font-size: 1.05rem; }
.spotlight .buy { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; }
.price { font-weight: 800; color: var(--link); font-variant-numeric: tabular-nums; }
.spotlight .price { font-size: 1.5rem; }

.steps-row { display: grid; gap: .9rem; }
@media (min-width: 760px) { .steps-row { grid-template-columns: repeat(3, 1fr); } }
.step { display: flex; gap: .9rem; background: var(--surface-2); border-radius: var(--radius); padding: 1rem 1.1rem; }
.step .num { flex: none; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--royal); color: var(--on-royal); font-weight: 800; }
.step h3 { margin-bottom: .15rem; } .step p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---- products ---------------------------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1560px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1920px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.product { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.product:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.product-media { position: relative; display: block; aspect-ratio: 3 / 4; background: var(--surface-2); text-decoration: none; overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.product:hover .product-media img { transform: scale(1.04); }
.cover-fallback { display: grid; place-items: center; height: 100%; padding: 1rem; text-align: center; font-family: var(--serif); font-weight: 700; font-size: 1.15rem; line-height: 1.25; color: #fff; background: linear-gradient(150deg, #44608f, #2b3f66); }
.cover-fallback.gold { background: linear-gradient(150deg, #e2cd9a, #c4a766); color: var(--gold-ink); }
.cover-fallback.teal { background: linear-gradient(150deg, #567469, #3a544c); }
.cover-fallback.plum { background: linear-gradient(150deg, #76688f, #4d4366); }
.badges { position: absolute; left: .6rem; top: .6rem; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; }
.badge { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 800; letter-spacing: .02em; box-shadow: 0 1px 3px rgb(0 0 0 / .25); }
.badge.out { background: #1f2937; color: #fff; }
.badge.low { background: var(--gold); color: var(--gold-ink); }
.badge.star { background: var(--royal); color: var(--on-royal); }
.product-body { display: flex; flex-direction: column; gap: .15rem; padding: .8rem .9rem .9rem; flex: 1; }
.product-cat { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.product-title { font-weight: 700; line-height: 1.3; color: var(--ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-title:hover { color: var(--link); }
.product-author { font-size: .88rem; color: var(--muted); }
.product-foot { margin-top: auto; padding-top: .6rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .6rem; }
.product-foot .price { font-size: 1.1rem; }
.product-foot form { margin: 0; }
.add-result { font-size: .85rem; margin: 0 0 .3rem; font-weight: 600; }
.sold-out-note { font-size: .85rem; font-weight: 700; color: var(--bad-text); }

.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1rem; margin-bottom: 1rem; }
.results-head h1 { margin: 0; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: .4rem; } .crumbs a { color: var(--muted); }
.sorts { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: 1.1rem; font-size: .9rem; }
.sorts a { padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; }
.sorts a[aria-current="true"] { background: var(--royal-tint); border-color: var(--royal); color: var(--link); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .icon { width: 2.5rem; height: 2.5rem; color: var(--royal); margin-bottom: .6rem; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; gap: 1rem; }

/* ---- item page --------------------------------------------------------------------------- */
.detail { display: grid; gap: 1.5rem; margin-bottom: 2rem; }
@media (min-width: 760px) { .detail { grid-template-columns: 17rem minmax(0, 1fr); gap: 2rem; } }
.detail-media { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); aspect-ratio: 3 / 4; box-shadow: var(--shadow-lift); max-width: 20rem; }
.detail-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail h1 { font-family: var(--serif); }
.detail .price { font-size: 1.7rem; display: block; margin: .6rem 0; }
.perks { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; font-size: .95rem; }
.perks li { display: flex; gap: .6rem; align-items: flex-start; color: var(--muted); }
.perks .icon { color: var(--royal); margin-top: .2rem; }

/* ---- cart, checkout, orders -------------------------------------------------------------- */
table.lines { width: 100%; border-collapse: collapse; }
table.lines th, table.lines td { text-align: left; padding: .7rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.lines th { font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
table.lines td.num, table.lines th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.lines tfoot td { font-weight: 800; border-bottom: 0; font-size: 1.05rem; }
.qty { width: 4.5rem; display: inline-block; padding: .4rem .5rem; }
.inline { display: inline; }
.ref { font: 800 1.7rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; color: var(--link); }
.steps { padding-left: 1.2rem; margin: .5rem 0; }
.stepper { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.2rem; font-size: .9rem; font-weight: 600; color: var(--muted); }
.stepper .on { color: var(--link); } 

/* ---- footer ------------------------------------------------------------------------------ */
footer.site { background: var(--header-bg); color: var(--header-muted); border-top: 3px solid var(--gold); margin-top: 2rem; padding: 2.4rem 0 1.4rem; }
footer.site a { color: #fff; }
.footer-grid { display: grid; gap: 1.6rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr; } }
footer.site h2 { font-size: .8rem; letter-spacing: .09em; text-transform: uppercase; color: #e6d3a6; }
footer.site ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
footer.site .brand { color: var(--header-ink); margin-bottom: .6rem; }
footer.site .fine { border-top: 1px solid var(--header-line); margin-top: 1.6rem; padding-top: 1rem; font-size: .85rem; color: var(--header-muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } .product:hover { transform: none; } }
@media print { header.site, footer.site, .sidebar, .chips, .no-print { display: none !important; } body { background: #fff; } }

/* ---- small helpers (no inline styles: the CSP forbids them being relied on) ---------------- */
.sprite { display: none; }
.gap-top { margin-top: 1rem; }
.flush { margin: 0; }
.ref { margin: .25rem 0; }
.form-narrow { max-width: 26rem; }
.panel h2 { margin-top: 0; }

/* ---- cart, checkout and the floating "added" bar: built phone-first ------------------------ */
.narrow.wide { max-width: 84rem; }
.cart-layout, .checkout-layout { display: grid; gap: 1rem; align-items: start; }
.cart-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.cart-line { display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto; grid-template-areas: "thumb main total" "ctl ctl ctl"; gap: .5rem .9rem; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; box-shadow: var(--shadow); }
.line-thumb { grid-area: thumb; display: block; width: 4rem; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.line-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-fallback.mini { font-size: 1.4rem; padding: 0; }
.line-main { grid-area: main; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.line-title { font-weight: 700; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.line-title:hover { color: var(--link); }
.line-total { grid-area: total; margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.line-controls { grid-area: ctl; display: flex; justify-content: space-between; align-items: center; gap: .75rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.line-controls form { margin: 0; }
.qty-form { display: flex; align-items: center; gap: .5rem; }
.qty { width: 4.5rem; padding: .45rem .6rem; text-align: center; }
.cart-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); display: grid; gap: .75rem; }
.cart-summary h2 { margin: 0; }
.cart-summary .perks { margin: .25rem 0 0; }
.sum-rows { margin: 0; display: grid; gap: .4rem; }
.sum-rows div { display: flex; justify-content: space-between; gap: 1rem; }
.sum-rows dt { color: var(--muted); } .sum-rows dd { margin: 0; font-variant-numeric: tabular-nums; }
.sum-total { border-top: 1px solid var(--line); padding-top: .6rem; font-size: 1.2rem; font-weight: 800; }
.sum-total dt { color: var(--ink); }
.sum-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.sum-lines li, .sum-total-row { display: flex; justify-content: space-between; gap: 1rem; }
.sum-lines span:first-child { min-width: 0; overflow-wrap: anywhere; }
.sum-lines .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sum-total-row { margin: 0; border-top: 1px solid var(--line); padding-top: .6rem; font-size: 1.2rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.checkout-form { margin-bottom: 0; }
.bar-spacer { height: 5rem; }
.checkout-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgb(15 25 70 / .12); }
.checkout-bar div { display: flex; flex-direction: column; line-height: 1.15; }
.checkout-bar strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
@media (min-width: 860px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr) 21rem; gap: 1.5rem; }
  .checkout-layout { grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.5rem; }
  .checkout-layout .cart-summary { order: 2; position: sticky; top: 5.5rem; }
  .cart-summary { position: sticky; top: 5.5rem; }
  .cart-line { grid-template-columns: 5rem minmax(0, 1fr) auto auto; grid-template-areas: "thumb main ctl total"; align-items: center; padding: 1rem 1.2rem; }
  .line-thumb { width: 5rem; }
  .line-controls { border-top: 0; padding-top: 0; flex-direction: column; align-items: flex-end; gap: .4rem; }
  .line-total { min-width: 6.5rem; }
  .checkout-bar, .bar-spacer { display: none; }
}

#cart-toast:empty { display: none; }
.cart-toast { position: fixed; z-index: 40; left: .75rem; right: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom)); max-width: 44rem; margin: 0 auto; display: grid; gap: .7rem; background: var(--royal-deep); color: #fff; border-radius: 18px; padding: .9rem 3rem .9rem 1rem; box-shadow: 0 10px 40px rgb(10 20 80 / .45); border: 1px solid rgb(255 255 255 / .18); animation: toast-in .25s ease-out; }
@keyframes toast-in { from { transform: translateY(1.2rem); opacity: 0; } to { transform: none; opacity: 1; } }
.toast-msg { display: flex; gap: .7rem; align-items: flex-start; min-width: 0; }
.toast-msg .icon { width: 1.5rem; height: 1.5rem; color: #b9d8c4; margin-top: .1rem; }
.toast-msg strong { display: block; }
.toast-sub { display: block; font-size: .88rem; color: #cfd6e4; overflow-wrap: anywhere; }
.toast-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.toast-actions .btn { flex: 1 1 auto; background: #fff; border-color: #fff; color: #26344f; }
.toast-actions .btn:hover { background: #eef1f6; }
.toast-actions .btn-gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.toast-close { position: absolute; top: .55rem; right: .55rem; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; background: transparent; border: 0; color: #fff; border-radius: 50%; cursor: pointer; }
.toast-close:hover { background: rgb(255 255 255 / .15); }
.toast-close:focus-visible, .cart-toast a:focus-visible { outline-color: #e6d3a6; }
@media (min-width: 700px) {
  .cart-toast { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding-right: 3.2rem; }
  .toast-actions .btn { flex: 0 0 auto; }
}

/* comfortable tap targets on touch screens */
@media (pointer: coarse) {
  .btn, .btn-sm, .sorts a, .chips a, .catnav a { min-height: 2.75rem; }
  .btn-link { padding: .6rem .3rem; }
}
@media (max-width: 380px) {
  .brand small, .brand-mark + span small { display: none; }
  .hero { border-radius: 16px; }
  .grid { gap: .6rem; }
  .product-foot { flex-direction: column; align-items: stretch; }
  .product-foot .btn { width: 100%; }
}
