/* ==========================================================================
   shop.css
   The public website (views/shop.ejs + views/shop/*). Loaded after
   tokens.css and draws every color from it, so the storefront shares the
   wordmark palette with the staff app and follows the OS light/dark
   setting through the same body[data-theme] tokens. Deliberately does NOT
   load common.css: that's the staff workspace's component library, and the
   shop's needs (editorial type, product cards, checkout forms) share little
   with it.
   ========================================================================== */

@font-face { font-family: "Jost"; font-weight: 300; font-style: normal; font-display: swap; src: url("/fonts/jost-300.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/jost-400.woff2") format("woff2"); }

/* Threads of Everest palette: glacier slate and cool mists, with a wool-oat
   accent kept for small highlights. Declared on body.shop (and its dark
   twin), so the staff app keeps the tokens.css palette. */
body.shop {
    --color-primary: #3F6477;
    --color-primary-strong: #2C4452;
    --color-primary-soft-bg: #EAF0F2;
    --color-primary-soft-text: #2C4452;
    --color-primary-border: #C9D8DE;
    --color-on-primary: #ffffff;
    --color-primary-dark: var(--color-primary-strong);
    --color-primary-hover: var(--color-primary-strong);
    --color-brand-ink: #2C4452;
    --color-brand-seed: #8C6330;       /* wool oat, deepened so white text on it passes */
    --color-surface: #ffffff;
    --color-surface-muted: #F4F7F7;
    --color-surface-hover: #EBF0F0;
    --color-background: var(--color-surface-muted);
    --color-border: #DCE4E5;
    --color-border-strong: #C3CFD2;
    --border-color: var(--color-border);
    --color-text-primary: #1F2D34;
    --color-text-secondary: #3E525B;
    --color-text-muted: #5C717A;
    --color-text-main: var(--color-text-primary);

    --logo-ink: #2C4452;
    --logo-glacier: #8FAAB6;
    --logo-ridge: #5F7D8E;
    --logo-shade: #2C4452;

    --shop-on-band: #EEF3F4;
    --shop-on-band-soft: #C9D6DB;
    --shop-band-accent: #E3CFA6;
    --shop-max: 1240px;
    --shop-gutter: 24px;
    --shop-radius: 14px;
    --shop-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --shop-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --shop-sand: #E9EFF0;
    --shop-sand-deep: #D9E3E6;
    --shop-ink-band: #2C4452;

    margin: 0;
    background: var(--color-surface);
    color: var(--color-text-primary);
    font-family: var(--shop-sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body.shop[data-theme="dark"] {
    --color-primary: #8FB3C4;
    --color-primary-strong: #B4CEDA;
    --color-primary-soft-bg: #1B2A31;
    --color-primary-soft-text: #CFE0E7;
    --color-primary-border: #38505B;
    --color-on-primary: #0F181C;
    --color-brand-ink: #DCE8EC;
    --color-brand-seed: #D3B27C;
    --color-surface: #121A1E;
    --color-surface-muted: #0C1215;
    --color-surface-hover: #1B262C;
    --color-background: var(--color-surface);
    --color-border: #2A3A42;
    --color-border-strong: #3F535C;
    --color-text-primary: #E4ECEE;
    --color-text-secondary: #B2C3CA;
    --color-text-muted: #94A8B0;
    --logo-ink: #DCE8EC;
    --logo-glacier: #6F8E9C;
    --logo-ridge: #DCE8EC;
    --logo-shade: #A5BCC6;
    --shop-sand: #172228;
    --shop-sand-deep: #1E2D34;
    --shop-ink-band: #1F2F37;
}

body.shop *,
body.shop *::before,
body.shop *::after { box-sizing: border-box; }

body.shop img { max-width: 100%; display: block; }
/* :where() keeps this at zero specificity so .btn-solid etc. still set link colors. */
:where(body.shop) a { color: inherit; }
:where(body.shop) :is(h1, h2, h3) { font-family: var(--shop-serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; margin: 0; }
body.shop :focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 4px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--color-surface); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

.shop-container { width: 100%; max-width: var(--shop-max); margin: 0 auto; padding: 0 var(--shop-gutter); }
.shop-container.narrow { max-width: 780px; }

.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; font-weight: 700; color: var(--color-primary); margin: 0 0 12px; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 22px; border-radius: 999px;
    font: 600 15px/1 var(--shop-sans); text-decoration: none; cursor: pointer;
    border: 1.5px solid transparent; transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-solid { background: var(--color-brand-ink); color: #fff; }
.btn-solid:hover { background: var(--color-primary-strong); }
body.shop[data-theme="dark"] .btn-solid { background: var(--color-primary); color: var(--color-on-primary); }
body.shop[data-theme="dark"] .btn-solid:hover { background: var(--color-primary-strong); }
.btn-ghost { background: transparent; color: var(--color-text-primary); border-color: var(--color-border-strong); }
.btn-ghost:hover { border-color: var(--color-text-primary); }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.btn-lg { min-height: 54px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .55; cursor: not-allowed; }
.link-button { background: none; border: 0; padding: 0; color: var(--color-text-muted); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
.link-button:hover { color: var(--color-danger); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; text-decoration: none; color: var(--color-primary); }
.link-arrow:hover { text-decoration: underline; }

/* ---------- announcement + header ---------- */
.shop-announce { background: var(--shop-ink-band); color: var(--shop-on-band); text-align: center; font-size: 13px; letter-spacing: .02em; padding: 8px var(--shop-gutter); }
.shop-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--color-surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--color-border); }
.shop-header-inner { max-width: var(--shop-max); margin: 0 auto; padding: 0 var(--shop-gutter); height: 68px; display: flex; align-items: center; gap: 28px; }
.shop-brand { display: inline-flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.tof-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--logo-ink); line-height: 1; }
.tof-mark { height: 38px; width: 38px; flex: none; }
.tof-word { font: 400 19px/1 "Jost", "Avenir Next", "Century Gothic", "Segoe UI", sans-serif; letter-spacing: .07em; white-space: nowrap; }
.tof-of { font-weight: 300; opacity: .72; }
.tof-ring { fill: none; stroke: var(--logo-ink); }
.tof-back { fill: var(--logo-glacier); }
.tof-ridge { fill: var(--logo-ridge); }
.tof-front { fill: var(--logo-shade); }
.hero-tile-pattern .tof-mark { height: 120px; width: 120px; }
.shop-footer-brand .tof-mark { height: 44px; width: 44px; }
.shop-footer-brand .tof-word { font-size: 21px; }
@media (max-width: 480px) { .tof-word { font-size: 16px; } .tof-mark { height: 32px; width: 32px; } }
@media (max-width: 360px) { .shop-header .tof-word { display: none; } }
.shop-nav { display: flex; gap: 22px; flex: 1; overflow: hidden; }
.shop-nav a { text-decoration: none; font-size: 14px; font-weight: 500; color: var(--color-text-secondary); white-space: nowrap; padding: 6px 0; border-bottom: 2px solid transparent; }
.shop-nav a:hover, .shop-nav a.is-active { color: var(--color-text-primary); border-bottom-color: var(--color-primary); }
.shop-header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.shop-icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 999px; border: 0; background: transparent; color: var(--color-text-primary); cursor: pointer; text-decoration: none; }
.shop-icon-btn:hover { background: var(--color-surface-hover); }
.shop-cart-count { position: absolute; top: 3px; right: 1px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--color-primary); color: var(--color-on-primary); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.shop-cart-count[hidden] { display: none; }
.shop-cart-count.bump { animation: bump .4s ease; }
@keyframes bump { 40% { transform: scale(1.35); } }
.shop-search { display: flex; align-items: center; background: var(--color-surface-muted); border: 1px solid var(--color-border); border-radius: 999px; padding-left: 14px; margin-right: 6px; }
.shop-search input { border: 0; background: transparent; width: 150px; font: inherit; font-size: 14px; color: var(--color-text-primary); outline: none; }
.shop-search .shop-icon-btn { width: 36px; height: 36px; }
.shop-menu-toggle { display: none; }
.shop-mobile-nav { border-top: 1px solid var(--color-border); padding: 8px var(--shop-gutter) 16px; display: flex; flex-direction: column; }
.shop-mobile-nav[hidden] { display: none; }
.shop-mobile-nav a { padding: 12px 0; text-decoration: none; border-bottom: 1px solid var(--color-border); font-weight: 500; }
.shop-mobile-search input { width: 100%; margin: 8px 0; padding: 12px 14px; border: 1px solid var(--color-border-strong); border-radius: 10px; font: inherit; background: var(--color-surface); color: var(--color-text-primary); }

.shop-main { min-height: 50vh; }

/* ---------- flash / toast ---------- */
.shop-flash { padding: 12px 16px; border-radius: 10px; margin: 18px 0; font-size: 14px; border: 1px solid transparent; }
.shop-flash-success { background: var(--color-success-bg); color: var(--color-success-strong); }
.shop-flash-error { background: var(--color-danger-bg); color: var(--color-danger-strong); }
.shop-flash-info { background: var(--color-primary-soft-bg); color: var(--color-primary-soft-text); border-color: var(--color-primary-border); }
.shop-toast { position: fixed; right: 20px; bottom: 20px; z-index: 200; width: min(360px, calc(100vw - 32px)); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--shop-radius); box-shadow: 0 18px 40px rgba(20, 14, 8, .18); padding: 16px; animation: toastIn .25s ease; }
.shop-toast[hidden] { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
.toast-row { display: flex; gap: 12px; align-items: center; }
.toast-row img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.toast-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; color: var(--color-success-strong); }
.toast-item { font-size: 14px; color: var(--color-text-secondary); }
.toast-actions { display: flex; gap: 8px; margin-top: 12px; }
.toast-actions .btn { flex: 1; min-height: 40px; font-size: 14px; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(180deg, var(--shop-sand) 0%, var(--color-surface) 100%); padding: 56px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.2vw, 64px); margin-bottom: 18px; color: var(--color-brand-ink); }
body.shop[data-theme="dark"] .hero h1 { color: var(--color-text-primary); }
.hero-lede { font-size: 18px; color: var(--color-text-secondary); max-width: 34em; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-mosaic { display: grid; gap: 14px; grid-template-columns: 1.3fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1.1; }
.hero-tile { display: block; overflow: hidden; border-radius: var(--shop-radius); background: var(--shop-sand-deep); }
.hero-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.hero-tile:hover img { transform: scale(1.04); }
.hero-tile-0 { grid-row: 1 / 3; }
.hero-mosaic-1 .hero-tile-0, .hero-mosaic-0 .hero-tile { grid-column: 1 / 3; }
.hero-mosaic-2 .hero-tile-1 { grid-row: 1 / 3; }
.hero-tile-pattern { grid-column: 1 / 3; grid-row: 1 / 3; display: flex; align-items: center; justify-content: center; color: var(--logo-ink); background: radial-gradient(circle at 30% 30%, var(--shop-sand) 0, var(--shop-sand-deep) 70%); }

/* ---------- value strip ---------- */
.value-strip { border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.value-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.value-item { display: flex; gap: 12px; align-items: center; padding: 22px 16px; color: var(--color-primary); }
.value-item + .value-item { border-left: 1px solid var(--color-border); }
.value-item div { display: flex; flex-direction: column; color: var(--color-text-primary); }
.value-item strong { font-size: 14px; }
.value-item span { font-size: 13px; color: var(--color-text-muted); }

/* ---------- sections ---------- */
.shop-section { padding: 56px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { font-size: clamp(26px, 3vw, 34px); }
.empty-note { color: var(--color-text-muted); }

.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.category-tile { position: relative; display: block; text-decoration: none; border-radius: var(--shop-radius); overflow: hidden; background: var(--shop-sand-deep); aspect-ratio: 4 / 5; }
.category-tile-media, .category-tile-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.category-tile-media img { transition: transform .6s ease; }
.category-tile:hover .category-tile-media img { transform: scale(1.05); }
.category-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(17, 29, 35, .72) 100%); }
.category-tile-name, .category-tile-count { position: absolute; left: 18px; z-index: 1; color: #fff; }
.category-tile-name { bottom: 36px; font-family: var(--shop-serif); font-size: 22px; font-weight: 600; }
.category-tile-count { bottom: 16px; font-size: 13px; opacity: .85; }

/* ---------- product cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 20px; }
.product-grid-3 { grid-template-columns: repeat(3, 1fr); }
.product-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.product-card-media { position: relative; aspect-ratio: 4 / 5; border-radius: var(--shop-radius); overflow: hidden; background: var(--color-surface-muted); border: 1px solid var(--color-border); }
.product-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.product-card:hover .product-card-media img { transform: scale(1.04); }
.product-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--color-primary); background: var(--shop-sand); }
.product-badge { position: absolute; top: 12px; left: 12px; background: var(--color-surface); color: var(--color-text-primary); font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.product-badge-low { background: var(--color-primary); color: var(--color-on-primary); }
.product-card.is-sold-out .product-card-media img { opacity: .55; filter: grayscale(.4); }
.product-card-body { padding: 14px 2px 0; display: flex; flex-direction: column; gap: 3px; }
.product-card-type { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--color-text-muted); font-weight: 600; }
.product-card-name { font-family: var(--shop-sans); font-size: 16px; font-weight: 600; line-height: 1.3; }
.cart-line-name::first-letter, .mini-name::first-letter, .product-card-name::first-letter { text-transform: uppercase; }
.product-card:hover .product-card-name { text-decoration: underline; text-underline-offset: 3px; }
.product-card-meta { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--color-text-muted); }
.product-card-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 4px; }
.price { font-weight: 700; font-size: 16px; }
.product-card-sizes { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swatch { width: 14px; height: 14px; border-radius: 999px; border: 1px solid rgba(0, 0, 0, .15); flex-shrink: 0; display: inline-block; }
.swatch-lg { width: 22px; height: 22px; }

/* ---------- story band ---------- */
.story-band { background: var(--shop-ink-band); color: var(--shop-on-band); margin-top: 64px; padding: 72px 0; }
.story-band .eyebrow { color: var(--shop-band-accent); }
.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.story-band h2 { font-size: clamp(28px, 3.4vw, 40px); color: var(--shop-on-band); }
.story-band p { color: var(--shop-on-band-soft); font-size: 17px; margin: 0 0 22px; }
.story-band .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .4); }
.story-band .btn-ghost:hover { border-color: #fff; }

/* ---------- page heads / crumbs ---------- */
.page-head { background: var(--shop-sand); padding: 40px 0 34px; margin-bottom: 36px; }
.page-head-tight { padding: 28px 0 24px; margin-bottom: 28px; }
.page-head-center { text-align: center; }
.page-head h1 { font-size: clamp(30px, 4vw, 46px); }
.page-sub { color: var(--color-text-secondary); margin: 10px 0 0; font-size: 17px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--color-text-muted); margin: 0 0 12px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; color: var(--color-text-primary); }
.shop-container > .crumbs { margin-top: 24px; }

/* ---------- catalogue ---------- */
.catalogue-layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; }
.catalogue-filters { position: sticky; top: 92px; }
.filter-title { font-family: var(--shop-sans); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--color-text-muted); margin-bottom: 10px; }
.filter-list { list-style: none; margin: 0; padding: 0; }
.filter-list a { display: flex; justify-content: space-between; padding: 8px 10px; margin: 0 -10px; border-radius: 8px; text-decoration: none; font-size: 15px; color: var(--color-text-secondary); }
.filter-list a span { color: var(--color-text-muted); font-size: 13px; }
.filter-list a:hover { background: var(--color-surface-hover); }
.filter-list a.is-active { background: var(--color-primary-soft-bg); color: var(--color-primary-soft-text); font-weight: 600; }
.catalogue-main { min-width: 0; }
.catalogue-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.toolbar-search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--color-border-strong); border-radius: 999px; padding: 0 16px; color: var(--color-text-muted); background: var(--color-surface); }
.toolbar-search input { flex: 1; border: 0; outline: none; background: transparent; height: 44px; font: inherit; color: var(--color-text-primary); }
.toolbar-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.toolbar-sort select { height: 44px; border: 1px solid var(--color-border-strong); border-radius: 999px; padding: 0 14px; font: inherit; font-size: 14px; background: var(--color-surface); color: var(--color-text-primary); }
.category-chips { display: none; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; scrollbar-width: none; }
.chip { flex-shrink: 0; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--color-border-strong); text-decoration: none; font-size: 14px; }
.chip.is-active { background: var(--color-brand-ink); border-color: var(--color-brand-ink); color: #fff; }
body.shop[data-theme="dark"] .chip.is-active { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
.pager { display: flex; justify-content: center; align-items: center; gap: 22px; margin: 44px 0 12px; font-size: 15px; }
.pager a { font-weight: 600; text-decoration: none; }
.pager a:hover { text-decoration: underline; }
.pager .is-disabled { color: var(--color-text-muted); opacity: .6; }
.pager-status { color: var(--color-text-muted); }
.empty-state { text-align: center; padding: 64px 16px; color: var(--color-text-secondary); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-state h1, .empty-state h2 { font-size: 28px; color: var(--color-text-primary); }
.empty-state .shop-icon { color: var(--color-primary); }
.empty-state .btn { margin-top: 8px; }

/* ---------- product detail ---------- */
.pdp { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; margin: 8px 0 24px; align-items: start; }
.pdp-gallery { position: sticky; top: 92px; }
.pdp-main-image { border-radius: var(--shop-radius); overflow: hidden; background: var(--color-surface-muted); border: 1px solid var(--color-border); aspect-ratio: 4 / 5; }
.pdp-zoom { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.pdp-zoom img { width: 100%; height: 100%; object-fit: cover; }
.pdp-placeholder { aspect-ratio: 4 / 5; }
.pdp-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; }
.pdp-thumb { flex: 0 0 76px; height: 92px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--color-surface-muted); cursor: pointer; }
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp-thumb.is-active { border-color: var(--color-brand-ink); }
body.shop[data-theme="dark"] .pdp-thumb.is-active { border-color: var(--color-primary); }
.pdp-title { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 12px; }
.pdp-title::first-letter { text-transform: uppercase; }
.pdp-price { font-size: 24px; font-weight: 700; margin: 0 0 18px; }
.pdp-price span { font-size: 13px; font-weight: 500; color: var(--color-text-muted); }
.pdp-colour { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.size-picker { border: 0; padding: 0; margin: 0 0 14px; }
.size-picker legend { font-weight: 600; margin-bottom: 10px; padding: 0; }
.size-hint { font-weight: 400; color: var(--color-text-muted); font-size: 14px; margin-left: 6px; }
.size-options { display: flex; flex-wrap: wrap; gap: 8px; }
.size-option { position: relative; }
.size-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.size-option span { display: inline-flex; align-items: center; justify-content: center; min-width: 54px; height: 46px; padding: 0 14px; border: 1.5px solid var(--color-border-strong); border-radius: 10px; font-weight: 600; font-size: 15px; background: var(--color-surface); }
.size-option input:hover + span { border-color: var(--color-text-primary); }
.size-option input:checked + span { background: var(--color-brand-ink); color: #fff; border-color: var(--color-brand-ink); }
body.shop[data-theme="dark"] .size-option input:checked + span { background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary); }
.size-option input:focus-visible + span { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.size-option.is-unavailable span { color: var(--color-text-muted); background: repeating-linear-gradient(135deg, transparent 0 7px, var(--color-surface-hover) 7px 8px); text-decoration: line-through; cursor: not-allowed; }
.stock-line { font-size: 14px; color: var(--color-text-secondary); margin: 0 0 18px; display: flex; align-items: center; gap: 8px; }
.dot-ok { width: 8px; height: 8px; border-radius: 999px; background: var(--color-success); display: inline-block; }
.pdp-buy { display: flex; gap: 12px; }
.pdp-buy .btn { flex: 1; min-height: 52px; }
.qty-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--color-border-strong); border-radius: 999px; overflow: hidden; background: var(--color-surface); }
.qty-stepper button { width: 42px; height: 50px; border: 0; background: transparent; color: var(--color-text-primary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.qty-stepper button:hover:not([disabled]) { background: var(--color-surface-hover); }
.qty-stepper button[disabled] { opacity: .35; cursor: not-allowed; }
.qty-stepper input { width: 38px; border: 0; text-align: center; font: 600 16px var(--shop-sans); background: transparent; color: var(--color-text-primary); -moz-appearance: textfield; }
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty-stepper-sm button { width: 34px; height: 36px; }
.qty-value { min-width: 26px; text-align: center; font-weight: 600; }
.form-error { color: var(--color-danger-strong); font-size: 14px; margin: 10px 0 0; }
.pdp-points { list-style: none; padding: 20px 0; margin: 24px 0 8px; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); display: grid; gap: 12px; font-size: 14px; color: var(--color-text-secondary); }
.pdp-points li { display: flex; gap: 10px; align-items: flex-start; }
.pdp-points .shop-icon { color: var(--color-primary); flex-shrink: 0; margin-top: 1px; }
.pdp-details { border-bottom: 1px solid var(--color-border); padding: 4px 0; }
.pdp-details summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; }
.pdp-details summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--color-text-muted); }
.pdp-details[open] summary::after { content: "–"; }
.pdp-details summary::-webkit-details-marker { display: none; }
.pdp-details dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; margin: 0 0 16px; font-size: 14px; }
.pdp-details dt { color: var(--color-text-muted); }
.pdp-details dd { margin: 0; }
.pdp-details p { font-size: 14px; color: var(--color-text-secondary); margin: 0 0 16px; }

/* ---------- cart / summary ---------- */
.cart-layout, .checkout-layout, .order-layout { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; margin-bottom: 64px; }
.cart-lines { display: flex; flex-direction: column; }
.cart-line { display: grid; grid-template-columns: 104px 1fr auto; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--color-border); }
.cart-line:first-child { border-top: 1px solid var(--color-border); }
.cart-line-media { display: block; width: 104px; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--color-surface-muted); }
.cart-line-media img { width: 100%; height: 100%; object-fit: cover; }
.cart-line-name { font-weight: 600; text-decoration: none; font-size: 16px; }
.cart-line-name:hover { text-decoration: underline; }
.cart-line-meta, .cart-line-unit { margin: 4px 0 0; font-size: 14px; color: var(--color-text-muted); }
.cart-line-unit .low { color: var(--color-warning-strong); font-weight: 600; }
.cart-line-actions { display: flex; align-items: center; gap: 18px; margin-top: 12px; }
.cart-line-total { font-weight: 700; }
.cart-lines .link-arrow { margin-top: 20px; }
.summary-card { background: var(--color-surface-muted); border: 1px solid var(--color-border); border-radius: var(--shop-radius); padding: 24px; position: sticky; top: 92px; }
.summary-card h2 { font-size: 22px; margin-bottom: 16px; }
.summary-card h2:not(:first-child) { margin-top: 24px; }
.summary-card address { font-style: normal; font-size: 15px; line-height: 1.6; color: var(--color-text-secondary); }
.summary-rows { display: grid; grid-template-columns: 1fr auto; gap: 10px 0; margin: 14px 0; font-size: 15px; }
.summary-rows dt { color: var(--color-text-secondary); }
.summary-rows dd { margin: 0; padding-left: 12px; text-align: right; }
.summary-rows .summary-total { padding-top: 12px; border-top: 1px solid var(--color-border); font-weight: 700; font-size: 18px; color: var(--color-text-primary); }
.summary-note { font-size: 13px; color: var(--color-text-muted); margin: 8px 0 16px; }
.summary-pay { margin: 14px 0 0; text-align: center; }
.ship-progress p { margin: 0 0 8px; font-size: 14px; }
.ship-bar { height: 6px; border-radius: 999px; background: var(--color-border); overflow: hidden; }
.ship-bar span { display: block; height: 100%; background: var(--color-primary); border-radius: 999px; }
.ship-free { display: flex; align-items: center; gap: 6px; color: var(--color-success-strong); font-weight: 600; font-size: 14px; margin: 0; }
.mini-lines { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 14px; }
.mini-lines li { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; font-size: 14px; }
.mini-thumb { position: relative; width: 56px; height: 64px; border-radius: 8px; background: var(--color-surface-hover); border: 1px solid var(--color-border); }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.mini-qty { position: absolute; top: -8px; right: -8px; min-width: 21px; height: 21px; border-radius: 999px; background: var(--color-text-secondary); color: var(--color-surface); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.mini-name { display: flex; flex-direction: column; font-weight: 600; }
.mini-name small { font-weight: 400; color: var(--color-text-muted); font-size: 13px; }
.mini-price { font-weight: 600; }

/* ---------- forms ---------- */
.form-section { border: 0; padding: 0; margin: 0 0 30px; }
.form-section legend { font-family: var(--shop-serif); font-size: 22px; font-weight: 600; margin-bottom: 14px; padding: 0; }
.optional { font-family: var(--shop-sans); font-size: 13px; font-weight: 400; color: var(--color-text-muted); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; flex: 1; min-width: 0; }
.field label { font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; }
.field-link { font-weight: 500; font-size: 13px; color: var(--color-primary); }
.field input, .field select, .field textarea {
    width: 100%; font: inherit; font-size: 16px; color: var(--color-text-primary); background: var(--color-surface);
    border: 1.5px solid var(--color-border-strong); border-radius: 10px; padding: 12px 14px; min-height: 48px;
}
.field textarea { resize: vertical; min-height: 0; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft-bg); }
.field input[disabled] { background: var(--color-surface-muted); color: var(--color-text-muted); }
.field.has-error input, .field.has-error select { border-color: var(--color-danger); }
.field-error { color: var(--color-danger-strong); font-size: 13px; margin: 0; min-height: 0; }
.field-error:empty { display: none; }
.field-hint { font-size: 13px; color: var(--color-text-muted); margin: 0; }
.field-row { display: flex; gap: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 16px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--color-brand-ink); }
.stack-form { display: flex; flex-direction: column; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.checkout-signin { background: var(--color-primary-soft-bg); border: 1px solid var(--color-primary-border); color: var(--color-primary-soft-text); border-radius: 10px; padding: 12px 16px; font-size: 14px; margin: 0 0 26px; }
.pay-options { display: grid; gap: 12px; }
.pay-option { display: flex; gap: 14px; align-items: flex-start; border: 1.5px solid var(--color-border-strong); border-radius: 12px; padding: 16px; cursor: pointer; background: var(--color-surface); }
.pay-option:has(input:checked) { border-color: var(--color-brand-ink); box-shadow: 0 0 0 1px var(--color-brand-ink); }
body.shop[data-theme="dark"] .pay-option:has(input:checked) { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary); }
.pay-option input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--color-brand-ink); }
.pay-option-body { display: flex; flex-direction: column; gap: 4px; }
.pay-option-title { font-weight: 600; display: inline-flex; gap: 8px; align-items: center; }
.pay-option-desc { font-size: 14px; color: var(--color-text-muted); }

/* ---------- order status ---------- */
.status-card { border: 1px solid var(--color-border); border-radius: var(--shop-radius); padding: 24px; margin-bottom: 24px; }
.status-label { font-weight: 700; font-size: 18px; margin: 0 0 18px; }
.status-cancelled .status-label, .status-refunded .status-label { color: var(--color-text-muted); }
.steps { list-style: none; display: flex; padding: 0; margin: 0 0 20px; gap: 0; counter-reset: s; }
.steps li { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--color-text-muted); position: relative; }
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 11px; left: 26px; right: 4px; height: 2px; background: var(--color-border); }
.steps li.is-done { color: var(--color-text-primary); font-weight: 600; }
.steps li.is-done:not(:last-child)::after { background: var(--color-success); }
.step-dot { width: 24px; height: 24px; border-radius: 999px; border: 2px solid var(--color-border-strong); background: var(--color-surface); display: inline-flex; align-items: center; justify-content: center; }
.steps li.is-done .step-dot { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.bank-box { background: var(--color-primary-soft-bg); border: 1px solid var(--color-primary-border); border-radius: 12px; padding: 18px 20px; }
.bank-box h2 { font-size: 20px; margin-bottom: 12px; }
.bank-box dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px; margin: 0 0 6px; font-size: 15px; }
.bank-box dt { color: var(--color-text-secondary); }
.bank-box dd { margin: 0; }
.account-nudge { background: var(--color-surface); border: 1px dashed var(--color-border-strong); border-radius: 10px; padding: 14px; margin: 18px 0; font-size: 14px; }
.account-nudge p { margin: 0 0 10px; }
.order-layout .summary-card .btn-block { margin-top: 12px; }

/* ---------- content pages ---------- */
.prose { font-size: 17px; color: var(--color-text-secondary); padding-bottom: 64px; }
.prose h2 { font-size: 26px; color: var(--color-text-primary); margin: 36px 0 12px; }
.prose p, .prose ul { margin: 0 0 16px; }
.prose li { margin-bottom: 8px; }
.prose a:not(.btn) { color: var(--color-primary); }
.value-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 32px 0; }
.value-card { background: var(--shop-sand); border-radius: var(--shop-radius); padding: 22px; color: var(--color-text-primary); }
.value-card .shop-icon { color: var(--color-primary); }
.value-card h3 { font-size: 19px; margin: 12px 0 6px; }
.value-card p { font-size: 14px; margin: 0; color: var(--color-text-secondary); }
.policy-tabs { display: inline-flex; gap: 6px; margin-top: 20px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 999px; padding: 4px; flex-wrap: wrap; justify-content: center; }
.policy-tabs a { text-decoration: none; padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--color-text-secondary); }
.policy-tabs a.is-active { background: var(--color-brand-ink); color: #fff; }
body.shop[data-theme="dark"] .policy-tabs a.is-active { background: var(--color-primary); color: var(--color-on-primary); }
.contact-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; margin-bottom: 72px; align-items: start; }
.contact-card { border: 1px solid var(--color-border); border-radius: var(--shop-radius); padding: 28px; }
.contact-card .btn { align-self: flex-start; }
.contact-aside { display: grid; gap: 22px; padding-top: 8px; }
.contact-item { display: flex; gap: 14px; }
.contact-item .shop-icon { color: var(--color-primary); flex-shrink: 0; margin-top: 3px; }
.contact-item h3 { font-family: var(--shop-sans); font-size: 15px; margin-bottom: 4px; }
.contact-item p, .contact-item a { margin: 0; font-size: 15px; color: var(--color-text-secondary); }
.sent-state { text-align: center; padding: 28px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sent-state .shop-icon { color: var(--color-success); }
.sent-state .btn { align-self: center; }

/* ---------- auth + account ---------- */
.auth-wrap { display: flex; justify-content: center; padding: 56px var(--shop-gutter) 80px; }
.auth-card { width: 100%; max-width: 440px; border: 1px solid var(--color-border); border-radius: 18px; padding: 36px 32px; background: var(--color-surface); box-shadow: 0 20px 40px -24px rgba(40, 28, 16, .25); }
.auth-card h1 { font-size: 30px; margin-bottom: 6px; }
.auth-sub { color: var(--color-text-muted); margin: 0 0 22px; }
.auth-alt { text-align: center; font-size: 14px; margin: 18px 0 0; }
.auth-alt a { color: var(--color-primary); font-weight: 600; }
.auth-alt-muted { color: var(--color-text-muted); margin-top: 8px; }
.account-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.account-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin: 0 0 28px; overflow-x: auto; }
.account-tabs a { padding: 12px 16px; text-decoration: none; font-weight: 600; font-size: 15px; color: var(--color-text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.account-tabs a.is-active { color: var(--color-text-primary); border-bottom-color: var(--color-primary); }
.account-panel { max-width: 640px; margin-bottom: 64px; }
.account-panel .btn { align-self: flex-start; }
.verify-banner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.orders-list { display: flex; flex-direction: column; border: 1px solid var(--color-border); border-radius: var(--shop-radius); overflow: hidden; margin-bottom: 64px; }
.order-row { display: grid; grid-template-columns: 1.3fr 1fr auto 110px; gap: 16px; align-items: center; padding: 16px 20px; text-decoration: none; }
.order-row + .order-row { border-top: 1px solid var(--color-border); }
.order-row:hover { background: var(--color-surface-muted); }
.order-row-num { display: flex; flex-direction: column; }
.order-row-num small { color: var(--color-text-muted); }
.order-row-items { color: var(--color-text-secondary); font-size: 14px; }
.order-row-total { text-align: right; font-weight: 700; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill-ok { background: var(--color-success-bg); color: var(--color-success-strong); }
.pill-warn { background: var(--color-warning-bg); color: var(--color-warning-strong); }
.pill-info { background: var(--color-primary-soft-bg); color: var(--color-primary-soft-text); }
.pill-muted { background: var(--color-surface-hover); color: var(--color-text-muted); }

/* ---------- footer ---------- */
.shop-footer { margin-top: 72px; background: var(--shop-sand); border-top: 1px solid var(--color-border); padding: 56px 0 24px; font-size: 14px; }
.story-band + .shop-footer, .shop-main:has(> .story-band:last-child) + .shop-footer { margin-top: 0; }
.shop-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.shop-footer-brand p { color: var(--color-text-secondary); max-width: 32em; margin: 16px 0 0; }
.shop-footer h2 { font-family: var(--shop-sans); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--color-text-muted); margin-bottom: 14px; }
.shop-footer-grid a { display: block; text-decoration: none; padding: 4px 0; color: var(--color-text-secondary); }
.shop-footer-grid a:hover { color: var(--color-text-primary); text-decoration: underline; }
.shop-footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--color-border); color: var(--color-text-muted); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .shop-nav { gap: 16px; }
    .shop-search input { width: 110px; }
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .category-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    body.shop { --shop-gutter: 18px; }
    .shop-nav, .shop-search { display: none; }
    .shop-menu-toggle { display: inline-flex; }
    .shop-header-inner { gap: 8px; height: 60px; }
    .shop-brand { margin: 0 auto; }
    .shop-header-actions { margin-left: 0; }
    .hero { padding: 32px 0 40px; }
    .hero-grid, .story-grid, .pdp, .cart-layout, .checkout-layout, .order-layout, .contact-layout { grid-template-columns: 1fr; gap: 28px; }
    .hero-mosaic { aspect-ratio: 1.4; }
    .value-grid { grid-template-columns: 1fr 1fr; }
    .value-item:nth-child(3) { border-left: 0; }
    .value-item:nth-child(n+3) { border-top: 1px solid var(--color-border); }
    .catalogue-layout { grid-template-columns: 1fr; gap: 0; }
    .catalogue-filters { display: none; }
    .category-chips { display: flex; }
    .product-grid, .product-grid-3 { grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
    .pdp-gallery, .summary-card, .catalogue-filters { position: static; }
    .checkout-summary { order: -1; }
    .shop-footer-grid { grid-template-columns: 1fr 1fr; }
    .shop-footer-brand { grid-column: 1 / -1; }
    .value-cards { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    body.shop { --shop-gutter: 16px; }
    .shop-announce { font-size: 12px; }
    .hero h1 { font-size: 36px; }
    .hero-lede { font-size: 16px; }
    .hero-actions .btn { flex: 1; }
    .value-item { padding: 16px 8px; gap: 8px; }
    .value-item span { font-size: 12px; }
    .category-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .category-tile-name { font-size: 18px; bottom: 32px; left: 14px; }
    .category-tile-count { left: 14px; }
    .section-head h2 { font-size: 24px; }
    .product-card-name { font-size: 15px; }
    .product-card-sizes { display: none; }
    .field-row { flex-direction: column; gap: 0; }
    .cart-line { grid-template-columns: 84px 1fr; }
    .cart-line-media { width: 84px; }
    .cart-line-total { grid-column: 2; }
    .order-row { grid-template-columns: 1fr auto; }
    .order-row-items { display: none; }
    .auth-card { padding: 28px 20px; border: 0; box-shadow: none; }
    .auth-wrap { padding-top: 24px; }
    .catalogue-toolbar { gap: 10px; }
    .toolbar-search { flex-basis: 100%; }
    .bank-box dl { grid-template-columns: 1fr; gap: 2px; }
    .bank-box dd { margin-bottom: 8px; }
    .shop-toast { right: 16px; bottom: 16px; }
    .account-head { align-items: center; }
}

/* Dark: the active chip/size fills are the light logo ink, so their text must go dark. */
body.shop[data-theme="dark"] :is(.chip.is-active, .size-option input:checked + span) { color: var(--color-on-primary); }
body.shop[data-theme="dark"] .btn-solid { color: var(--color-on-primary); }
