/* ──────────────────────────────────────────────────────────────────────────
   B-shop preview — design tokens + components
   ──────────────────────────────────────────────────────────────────────── */

:root {
  /* type */
  --font-serif: "Cormorant Garamond", "Noto Serif TC", Georgia, serif;
  --font-sans:  "Inter", "Noto Sans TC", -apple-system, BlinkMacSystemFont,
                "Segoe UI", sans-serif;

  /* palette */
  --paper:      #FAFAF7;
  --paper-warm: #F2EFE8;
  --paper-deep: #E8E4D9;
  --ink:        #1A1A1A;
  --ink-soft:   #3A3A3A;
  --ink-mute:   #6F6A62;
  --line:       #D9D4C7;
  --line-soft:  #ECE7DA;
  --accent:     #2A2A28;          /* overridden per-vendor */
  --error:      #8C2D2D;
  /* Brand mark color — warm terracotta that sits well against the cream
     paper palette. Used as the highlight for hero copy and other
     attention-grabbing accents. */
  --brand:      #C2410C;

  /* spacing */
  --gutter:     28px;
  --gutter-lg:  64px;
  --rhythm:     96px;
  --rhythm-sm:  64px;

  /* type scale */
  --fs-display: clamp(2rem, 7vw, 4.4rem);
  --fs-h1:      clamp(1.75rem, 5vw, 3rem);
  --fs-h2:      clamp(1.4rem, 3.6vw, 2rem);
  --fs-h3:      1.25rem;
  --fs-body:    1rem;
  --fs-small:   0.875rem;
  --fs-eyebrow: 0.72rem;

  /* radii / motion */
  --r:          2px;
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ── layout primitives ──────────────────────────────────────────────────── */
.container {
  width: min(100%, 1280px);
  padding-inline: var(--gutter);
  margin-inline: auto;
}
@media (min-width: 768px) {
  .container { padding-inline: var(--gutter-lg); }
}

.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 1rem; }

/* ── typography ─────────────────────────────────────────────────────────── */
.serif    { font-family: var(--font-serif); font-weight: 300; letter-spacing: -0.005em; }
.eyebrow  {
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--ink-mute);
  font-weight: 500;
}
.display {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: var(--fs-display);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: 1.15;
  color: var(--ink);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 400; }

p { margin: 0; color: var(--ink-soft); }

.muted { color: var(--ink-mute); }
.tabular { font-variant-numeric: tabular-nums; }

.divider {
  height: 1px;
  width: 56px;
  background: var(--accent);
  border: 0;
  margin: 1.5rem 0;
}
.divider-soft {
  height: 1px;
  border: 0;
  background: var(--line);
}

/* ── nav / header ───────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  /* Tall enough to fit a 64px logo with breathing room */
  min-height: 80px;
}
.site-nav__left {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-shrink: 0;
}
/* Inline desktop nav links — hidden on mobile (the drawer covers them). */
.site-nav__links { display: none; }
@media (min-width: 960px) {
  .site-nav__links { display: flex; align-items: center; gap: 1.5rem; }
}
.site-nav__link {
  font-size: var(--fs-small);
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 0.3rem 0;
  position: relative;
  transition: color 200ms var(--ease);
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms var(--ease);
}
.site-nav__link:hover { color: var(--ink); }
.site-nav__link:hover::after { transform: scaleX(1); }

/* Persistent header search. Inline bar on desktop, hidden on mobile (replaced
   by the .nav-search-link icon, which jumps to the /search page). */
.nav-search { display: none; }
@media (min-width: 960px) {
  .nav-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 auto;
    max-width: 420px;
    margin-inline: auto;
    padding: 0 0.85rem;
    height: 42px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
  }
  .nav-search:focus-within {
    border-color: var(--ink);
    box-shadow: 0 1px 0 0 var(--ink);
  }
  .nav-search__icon { color: var(--ink-mute); flex-shrink: 0; }
  .nav-search__input {
    flex: 1;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: var(--fs-small);
    color: var(--ink);
    outline: none;
    padding: 0;
  }
  .nav-search__input::placeholder { color: var(--ink-mute); }
}
/* Mobile search shortcut icon — hidden once the inline bar appears. */
.nav-search-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  color: var(--ink-soft);
  border: 1px solid transparent;
  border-radius: var(--r);
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.nav-search-link:hover { border-color: var(--line); background: var(--paper-warm); }
@media (min-width: 960px) { .nav-search-link { display: none; } }
/* Break the navbar out of the centered .container so the logo + burger
   sit near the viewport edges on wide screens. Without this, on >1280px
   monitors the logo gets stranded far from the left corner because the
   container is centered at 1280px max-width. */
.site-nav .site-nav__inner.container {
  width: 100%;
  max-width: none;
  padding-inline: 1rem;
}
@media (min-width: 768px) {
  .site-nav .site-nav__inner.container { padding-inline: 1.5rem; }
}
.brand {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.brand-mark__logo {
  /* Navbar is now full-bleed (see .site-nav__inner override), so the
     logo only needs a small negative nudge to absorb the PNG's own
     internal whitespace — not to escape any container padding. */
  height: 56px;
  width: auto;
  display: block;
  margin-left: -10px;
}
@media (max-width: 600px) {
  .brand-mark__logo { height: 48px; margin-left: -8px; }
}
.nav-user, .nav-link--always {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 14ch;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.nav-user__name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-actions { display: flex; align-items: center; gap: 1.25rem; }
.nav-link {
  font-size: var(--fs-small);
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  transition: color 200ms var(--ease);
}
.nav-link:hover { color: var(--ink); }
.nav-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--r);
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.nav-cart:hover { border-color: var(--line); background: var(--paper-warm); }
.nav-cart__count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--paper);
  background: var(--accent);
  border-radius: 999px;
}

/* ── Landing 更多商品 / 更多店家 load-more button ───────────────────────── */
.load-more {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}
.load-more__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 44px;
  padding: 0 1.4rem;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: background 180ms var(--ease), border-color 180ms var(--ease);
}
.load-more__btn:hover {
  background: var(--paper-warm);
  border-color: var(--ink);
}
.load-more__btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* ── Storefront hamburger + drawer ───────────────────────────────────────── */
.nav-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.nav-burger:hover { border-color: var(--ink); background: var(--paper-warm); }

.site-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms var(--ease);
  z-index: 90;
}
.site-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(86vw, 320px);
  background: var(--paper);
  border-left: 1px solid var(--line-soft);
  box-shadow: -12px 0 28px rgba(0,0,0,0.08);
  transform: translateX(100%);
  transition: transform 320ms var(--ease);
  z-index: 100;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
body.site-drawer-open .site-drawer { transform: translateX(0); }
body.site-drawer-open .site-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}
body.site-drawer-open { overflow: hidden; }

.site-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--line-soft);
}
.site-drawer__user {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
}
.site-drawer__user--anon { color: var(--ink-mute); font-weight: 400; }
.site-drawer__user-name {
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-drawer__close {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--r);
  cursor: pointer;
  color: var(--ink-mute);
}
.site-drawer__close:hover { background: var(--paper-warm); color: var(--ink); }

.site-drawer__nav {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0;
}
.site-drawer__section {
  padding: 1rem 1.2rem 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0;
}
.site-drawer__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.2rem;
  color: var(--ink);
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 180ms var(--ease);
}
.site-drawer__link:hover { background: var(--paper-warm); }
.site-drawer__link--sub {
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.site-drawer__lang {
  display: flex;
  gap: 0.4rem;
  padding: 0.4rem 1.2rem 1.2rem;
}
.site-drawer__lang-btn {
  flex: 0 0 auto;
  padding: 0.4rem 0.85rem;
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.site-drawer__lang-btn.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ── hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  isolation: isolate;
  background-color: var(--paper-warm);
  background-image:
    linear-gradient(180deg,
      rgba(250, 250, 247, 0.78) 0%,
      rgba(250, 250, 247, 0.55) 45%,
      rgba(250, 250, 247, 0.95) 100%),
    url('/static/img/hero/bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding-block: 6rem 5rem;
}
@media (min-width: 960px) {
  .hero { padding-block: 9rem 7rem; }
}
.hero__body { max-width: 46ch; }

/* Slim hero — products-forward landing. Compact band so the product grid is
   visible almost immediately; smaller headline keeps it elegant, not shouty.
   Compound `.hero.hero--slim` selector beats the single-class `.hero` media
   queries regardless of source order. */
.hero.hero--slim { padding-block: 3rem 2rem; }
@media (min-width: 960px) { .hero.hero--slim { padding-block: 4.5rem 3rem; } }
.hero--slim .hero__display { font-size: clamp(2rem, 5vw, 3.3rem); }
.hero--slim .hero__intro {
  margin-top: 1.1rem;
  font-size: 1rem;
  font-weight: 400;
  max-width: 52ch;
}

/* Hero headline — heavier weight + tighter tracking + brand-color
   highlight on the second line, so the page reads with deliberate
   editorial confidence instead of a quiet sans whisper. */
.hero__display {
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: clamp(2.4rem, 8vw, 5rem);
  line-height: 1.02;
}
.hero__display-line1,
.hero__display-line2 {
  display: block;
}
.hero__display-line1 {
  color: var(--ink);
}
.hero__display-line2 {
  color: var(--brand);
  font-weight: 700;
  font-style: italic;
}

.hero__intro {
  margin: 1.8rem 0 0;
  max-width: 42ch;
  /* Sans body face but bumped up so it carries weight against the big
     headline. Ink (not ink-soft) so contrast pops. */
  font-family: var(--font-sans, inherit);
  font-weight: 500;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.65;
  letter-spacing: -0.005em;
  color: var(--ink);
  /* A thicker rule in the brand color stitches the paragraph back to
     the highlighted second headline line. */
  border-left: 4px solid var(--brand);
  padding-left: 1.2rem;
}
@media (max-width: 600px) {
  .hero__display { font-size: clamp(2rem, 9.5vw, 3rem); }
  .hero__intro {
    font-size: 1rem;
    padding-left: 0.95rem;
    line-height: 1.6;
    border-left-width: 3px;
  }
}

/* ── buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  height: 52px;
  padding: 0 1.6rem;
  font-size: var(--fs-small);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  border-radius: var(--r);
  transition: all 220ms var(--ease);
  text-decoration: none;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.btn--primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, black);
  color: var(--paper);
}
.btn--ghost {
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn--ghost:hover { border-color: var(--ink); background: transparent; color: var(--ink); }
.btn--block { width: 100%; }
.btn--lg { height: 56px; }

.btn .arrow { transition: transform 240ms var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-small);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: opacity 200ms var(--ease);
}
.text-link:hover { opacity: 0.65; }

/* ── vendor cards ───────────────────────────────────────────────────────── */
.vendor-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .vendor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem; }
}
@media (min-width: 960px) {
  .vendor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
}

.vendor-card {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--paper-warm);
  transition: box-shadow 360ms var(--ease), transform 360ms var(--ease);
  will-change: transform;
}
.vendor-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px -26px rgba(26, 26, 26, 0.5);
}
.vendor-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.vendor-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1100ms var(--ease);
}
/* When no cover photo is set, render the default placeholder uncropped
   so the editorial illustration shows fully — matches the catalog +
   product-detail behaviour. */
.vendor-card__media img[src*="default_image"] { object-fit: contain; }
.vendor-card:hover .vendor-card__media img { transform: scale(1.04); }

.vendor-card__veil {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.3rem 1.4rem;
  /* Stronger gradient so white text always passes contrast over
     light-toned cover images. Previously the veil started at 35% with
     a soft 55% terminal opacity — barely visible against the cream
     default cover. Now starts higher and ends darker. */
  background: linear-gradient(180deg,
    rgba(20,20,20,0.0) 0%,
    rgba(20,20,20,0.25) 30%,
    rgba(20,20,20,0.78) 100%);
  color: var(--paper);
}
.vendor-card__veil .eyebrow {
  color: rgba(255,255,255,0.90);
  text-shadow: 0 1px 2px rgba(0,0,0,0.55);
}
.vendor-card__name {
  /* 標楷體 (Kai) — falls through Windows/macOS/Linux variants and
     finally serif. Bold weight + drop shadow keep it legible against
     the cover image. */
  font-family: "DFKai-SB", "BiauKai", "Kaiti TC", "標楷體",
               "Noto Serif TC", serif;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.15;
  margin-top: 0.3rem;
  color: var(--paper);
  text-shadow:
    0 2px 6px rgba(0,0,0,0.55),
    0 1px 2px rgba(0,0,0,0.65);
  letter-spacing: -0.005em;
}
.vendor-card__tagline {
  font-size: var(--fs-small);
  color: rgba(255,255,255,0.92);
  margin-top: 0.4rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.55);
}

/* ── scroll-reveal (cards fade up as they enter the viewport) ────────────── */
@media (prefers-reduced-motion: no-preference) {
  .reveal-item {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 650ms var(--ease), transform 650ms var(--ease);
  }
  .reveal-item.is-revealed { opacity: 1; transform: none; }
}

/* ── product grid + cards ───────────────────────────────────────────────── */
.product-grid {
  display: grid;
  gap: 3rem 1.5rem;
  /* `minmax(0, 1fr)` (not bare `1fr`) is required — bare `1fr` is
     `minmax(auto, 1fr)`, which lets a column grow past its share when
     intrinsic content is wider, producing unequal column widths. */
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 600px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Grid cells already auto-equalize per-row (align-items: stretch is the
   default), but only if the cards themselves stretch with the cell. We
   make the card a flex column so its inner pieces fill the cell exactly,
   which keeps every block in a row the same visible height regardless
   of name length. */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.product-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper-warm);
  border-radius: var(--r);
  flex: 0 0 auto;
  /* Card lift target. The media holds the shadow so it hugs the image. */
  transition: box-shadow 360ms var(--ease), transform 360ms var(--ease);
  will-change: transform;
}
.product-card__media img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1100ms var(--ease), opacity 500ms var(--ease);
}
/* Second image (when present) sits on top, revealed on hover — the
   signature high-end "alternate shot" swap. */
.product-card__media-hover { opacity: 0; }
.product-card:hover .product-card__media-hover { opacity: 1; }
/* When a product has no real photo we render the global default — show
   it fully (no edge cropping) so the placeholder reads as a deliberate
   neutral image, not a poorly framed photo. */
.product-card__media img[src*="default_image"] {
  object-fit: contain;
}
.product-card:hover .product-card__media {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -22px rgba(26, 26, 26, 0.45);
}
.product-card:hover .product-card__media img { transform: scale(1.05); }

.product-card__body {
  margin-top: 1rem;
  flex: 1 1 auto;        /* fill the remaining cell height */
  display: flex;
  flex-direction: column;
}
.product-card__name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.25;
  margin: 0;
  /* Clamp the name to 2 lines so every card body has the same visual
     weight even when names vary in length. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
  min-height: 2.5em;
  transition: color 200ms var(--ease);
}
.product-card:hover .product-card__name { color: var(--ink-soft); }
.product-card__price {
  font-size: var(--fs-small);
  color: var(--ink);
  font-weight: 500;
  margin-top: 0.35rem;
  letter-spacing: 0.02em;
}

.product-card__badge {
  position: absolute;
  z-index: 2;
  top: 0.7rem; left: 0.7rem;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 5px 9px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(6px);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  color: var(--ink);
  border-radius: 999px;
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}
/* On hover-capable devices the vendor badge fades in on hover (cleaner
   resting card); touch devices keep it always visible. */
@media (hover: hover) {
  .product-card__badge { opacity: 0; transform: translateY(-4px); }
  .product-card:hover .product-card__badge { opacity: 1; transform: translateY(0); }
}
.product-card__soldout {
  position: absolute;
  z-index: 2;
  top: 0.7rem; right: 0.7rem;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  padding: 4px 9px;
  background: rgba(20, 20, 20, 0.7);
  color: #fff;
  border-radius: 999px;
}

/* ── product detail ─────────────────────────────────────────────────────── */
.pdp {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
  padding-block: 3rem var(--rhythm);
}
@media (min-width: 960px) {
  .pdp { grid-template-columns: 1.05fr 1fr; gap: 5rem; }
}

.gallery__main {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper-warm);
  border-radius: var(--r);
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
/* When the gallery falls back to the global default placeholder, show
   it fully (no crop) — matches the catalog card behaviour. */
.gallery__main img[src*="default_image"] { object-fit: contain; }
.gallery__thumbs {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.6rem;
}
.gallery__thumb {
  width: 72px; height: 72px;
  border-radius: var(--r);
  overflow: hidden;
  opacity: 0.55;
  transition: opacity 200ms var(--ease), outline 200ms var(--ease);
  background: none; border: 0; padding: 0;
  outline: 1px solid transparent;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb:hover { opacity: 0.85; }
.gallery__thumb.is-active { opacity: 1; outline-color: var(--ink); }

.pdp__info { display: flex; flex-direction: column; }
.pdp__name {
  /* Sized below the hero display style (--fs-display reaches 4.4rem
     which is too loud for a product card title). Tight tracking +
     line-height to keep multi-line names compact. */
  font-size: clamp(1.45rem, 3.2vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin-top: 0.4rem;
  color: var(--ink);
}
.pdp__price {
  margin-top: 1rem;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.pdp__desc {
  margin-top: 0.3rem;
  white-space: pre-line;
  color: var(--ink-soft);
  line-height: 1.7;
  font-size: 0.95rem;
}
.pdp__specs-picker {
  border: none;
  margin: 0.9rem 0 0;
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--line-soft);
}
.pdp__specs-legend {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.6rem;
  padding: 0;
}
.pdp__specs-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pdp__spec-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.2;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.pdp__spec-pill:hover {
  border-color: var(--ink);
}
.pdp__spec-pill input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pdp__spec-pill:has(input[type="radio"]:checked) {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.pdp__spec-pill-name {
  font-weight: 500;
}
.pdp__spec-pill-price {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r);
  height: 52px;
  overflow: hidden;
}
.qty__btn {
  width: 48px; height: 100%;
  background: transparent;
  border: 0;
  display: grid; place-items: center;
  color: var(--ink-soft);
  transition: background 180ms var(--ease);
}
.qty__btn:hover { background: var(--paper-warm); color: var(--ink); }
.qty__value {
  width: 56px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-small);
  letter-spacing: 0.06em;
}

.pdp__actions {
  margin-top: 2.5rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: auto 1fr;
}
@media (max-width: 520px) {
  .pdp__actions { grid-template-columns: 1fr; }
  .qty { width: 100%; justify-content: space-between; }
}

.pdp__meta {
  margin-top: 2.5rem;
  display: grid;
  gap: 0.8rem;
  font-size: var(--fs-small);
  color: var(--ink-mute);
}
.pdp__meta-row {
  display: flex; gap: 0.75rem; align-items: flex-start;
}

/* ── cart ───────────────────────────────────────────────────────────────── */
.cart {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
  padding-block: 3rem var(--rhythm);
}
@media (min-width: 960px) { .cart { grid-template-columns: 1.4fr 1fr; gap: 5rem; } }

.cart__list { display: flex; flex-direction: column; }
.cart-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 1.2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.cart-row:first-child { border-top: 1px solid var(--line-soft); }
.cart-row__media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper-warm);
  border-radius: var(--r);
}
.cart-row__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-row__info { display: flex; flex-direction: column; gap: 0.35rem; }
.cart-row__name { font-family: var(--font-serif); font-weight: 300; font-size: 1.25rem; }
.cart-row__vendor { font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-mute); }
.cart-row__spec {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.cart-row__spec::before {
  content: "規格 · ";
  color: var(--ink-mute);
}
.cart-row__qty-line { display: flex; gap: 1rem; align-items: center; margin-top: auto; }
.cart-row__remove {
  background: none; border: 0; padding: 0;
  font-size: var(--fs-small);
  color: var(--ink-mute);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cart-row__remove:hover { color: var(--error); }
.cart-row__price {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.summary {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}
.summary__row {
  display: flex; justify-content: space-between;
  padding: 0.5rem 0;
  font-size: var(--fs-body);
  color: var(--ink-soft);
}
.summary__row--total {
  border-top: 1px solid var(--line);
  margin-top: 0.5rem; padding-top: 1rem;
  font-size: 1.1rem;
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.summary__cta { margin-top: 1.5rem; }
.summary__note { margin-top: 1rem; font-size: 0.78rem; color: var(--ink-mute); line-height: 1.6; }

.empty {
  text-align: center;
  padding-block: 6rem;
}
.empty .display { margin-bottom: 1rem; }

/* ── forms ──────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1.6rem; }
.form__group { display: flex; flex-direction: column; gap: 0.4rem; }
.form__row {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .form__row--2 { grid-template-columns: 1fr 1fr; } }

.label {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.input, .textarea, .select {
  font: inherit;
  height: 52px;
  padding: 0 0 6px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  border-radius: 0;
  transition: border-color 220ms var(--ease);
  width: 100%;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.textarea { height: auto; min-height: 96px; padding-top: 12px; resize: vertical; line-height: 1.6; }
/* Read-only field — visually quieter so the user understands it's not
   editable, without going so light that the value is hard to read. */
.input--locked {
  color: var(--ink-mute);
  border-bottom-style: dashed;
  cursor: not-allowed;
}
.input--locked:focus { border-bottom-color: var(--line); }

.fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.legend {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.option:hover { border-color: var(--ink); }
.option input { accent-color: var(--accent); margin-top: 4px; }
.option__title { font-weight: 500; font-size: var(--fs-body); }
.option__desc { font-size: var(--fs-small); color: var(--ink-mute); margin-top: 0.2rem; }
.option.is-disabled { opacity: 0.45; cursor: not-allowed; }

/* ── checkout layout ────────────────────────────────────────────────────── */
.checkout {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
  padding-block: 3rem var(--rhythm);
}
@media (min-width: 960px) { .checkout { grid-template-columns: 1.3fr 1fr; gap: 5rem; align-items: start; } }

.summary-card {
  background: var(--paper-warm);
  padding: 2rem;
  border-radius: var(--r);
  position: sticky;
  top: 88px;
}

/* ── order confirmation ─────────────────────────────────────────────────── */
.confirmation {
  text-align: center;
  padding-block: var(--rhythm);
  max-width: 640px;
  margin: 0 auto;
}
.confirmation__mark {
  width: 72px; height: 72px;
  margin: 0 auto 1.5rem;
  display: grid; place-items: center;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
}
.confirmation__details {
  margin-top: 3rem;
  text-align: left;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.confirmation__row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-small);
}
.confirmation__row:last-child { border-bottom: 0; }
.confirmation__row dt { color: var(--ink-mute); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.72rem; padding-top: 2px; }
.confirmation__row dd { margin: 0; color: var(--ink); }

/* ── footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: var(--rhythm);
  padding: 3rem 0 4rem;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-small);
  color: var(--ink-mute);
}
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: baseline;
}

/* ── language switcher ──────────────────────────────────────────────────── */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.lang-switch form { margin: 0; }
.lang-switch__btn {
  background: transparent;
  border: 0;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}
.lang-switch__btn:hover { color: var(--ink); }
.lang-switch__btn.is-active {
  background: var(--ink);
  color: var(--paper);
}
@media (max-width: 520px) {
  .lang-switch__btn { padding: 6px 8px; font-size: 0.68rem; }
}

/* utility */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.section { padding-block: var(--rhythm-sm); }
/* First section on a page with no hero — add headroom under the sticky nav. */
.section--top { padding-top: 3.5rem; }
@media (min-width: 768px) { .section--top { padding-top: 5rem; } }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 2rem; gap: 1.5rem; flex-wrap: wrap; }

/* ── Merchant zone (店家專區) ─────────────────────────────────────────────── */
.merchant-card {
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  padding: 2rem;
  margin-top: 1.5rem;
}
@media (min-width: 768px) { .merchant-card { padding: 2.75rem 3rem; } }
.merchant-card__h {
  font-family: var(--font-serif);
  font-size: var(--fs-h2);
  margin-bottom: 0.6rem;
}
.merchant-card__d { max-width: 56ch; color: var(--ink-soft); }
.merchant-steps {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 720px) {
  .merchant-steps { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}
.merchant-steps li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: var(--fs-small);
  color: var(--ink-soft);
}
.merchant-steps__n {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--paper);
  background: var(--accent);
  border-radius: 999px;
}
.merchant-card--manage {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 820px) {
  .merchant-card--manage { grid-template-columns: 1fr 1.2fr; align-items: center; gap: 2.5rem; }
}
.merchant-card__shops { display: grid; gap: 0.6rem; }
.merchant-shop-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink);
  transition: border-color 200ms var(--ease), transform 200ms var(--ease);
}
.merchant-shop-link:hover { border-color: var(--ink); transform: translateX(2px); }
.merchant-shop-link span { flex: 1; }
.merchant-shop-link__arrow { color: var(--ink-mute); }

/* ── Shop page cover banner ──────────────────────────────────────────────── */
.shop-hero {
  background: var(--paper-warm);
  border-bottom: 1px solid var(--line-soft);
}
.shop-hero__inner {
  padding-block: 3rem 2.25rem;
}
@media (min-width: 768px) { .shop-hero__inner { padding-block: 3.5rem 2.5rem; } }
.shop-hero__loc { margin-top: 1rem; }
.shop-hero__name { margin-top: 0.6rem; }
.shop-hero__tagline { margin-top: 0.9rem; max-width: 56ch; }

/* With a real cover image: full-bleed photo + dark veil + light text. */
.shop-hero--cover {
  background:
    linear-gradient(180deg, rgba(20, 18, 16, 0.30) 0%, rgba(20, 18, 16, 0.62) 100%),
    var(--shop-cover) center / cover no-repeat;
  border-bottom: 0;
}
.shop-hero--cover .shop-hero__inner { padding-block: 5rem 3.5rem; }
@media (min-width: 768px) { .shop-hero--cover .shop-hero__inner { padding-block: 7rem 4.5rem; } }
.shop-hero--cover .shop-hero__name { color: #fff; }
.shop-hero--cover .shop-hero__tagline { color: rgba(255, 255, 255, 0.9); }
.shop-hero--cover .shop-hero__loc { color: rgba(255, 255, 255, 0.82); }
.shop-hero--cover .crumbs,
.shop-hero--cover .crumbs a { color: rgba(255, 255, 255, 0.85); }
.shop-hero--cover .crumbs a:hover { color: #fff; }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.crumbs a { color: var(--ink-mute); transition: color 180ms var(--ease); }
.crumbs a:hover { color: var(--ink); }
.crumbs__sep { opacity: 0.5; }
.crumbs__here { color: inherit; opacity: 0.85; }

/* ── Sticky mobile buy bar (PDP) ─────────────────────────────────────────── */
.pdp-buybar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-top: 1px solid var(--line);
  transform: translateY(120%);
  transition: transform 300ms var(--ease);
}
.pdp-buybar.is-visible { transform: translateY(0); }
.pdp-buybar__price { font-size: 1.1rem; font-weight: 600; white-space: nowrap; }
.pdp-buybar__btns { display: flex; gap: 0.5rem; flex: 1; justify-content: flex-end; }
.pdp-buybar__btn { height: 46px; padding: 0 0.9rem; flex: 1 1 0; max-width: 46%; }
/* Desktop keeps the inline buttons; the sticky bar is mobile-only. */
@media (min-width: 960px) { .pdp-buybar { display: none; } }

/* ── Sort / filter toolbar ───────────────────────────────────────────────── */
.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line-soft);
}
.sort-bar__count { font-size: var(--fs-small); color: var(--ink-mute); }
.sort-bar__controls { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.sort-bar__check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--fs-small);
  color: var(--ink-soft);
  cursor: pointer;
}
.sort-bar__check input { accent-color: var(--ink); width: 15px; height: 15px; }
.sort-bar__field { display: inline-flex; align-items: center; gap: 0.5rem; }
.sort-bar__label { font-size: var(--fs-small); color: var(--ink-mute); }
.sort-bar__select {
  font: inherit;
  font-size: var(--fs-small);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.45rem 1.8rem 0.45rem 0.7rem;
  cursor: pointer;
  /* native arrow + a touch of room */
  appearance: auto;
}
.sort-bar__select:hover { border-color: var(--ink); }

/* ── Category nav / filter chips ─────────────────────────────────────────── */
.cat-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: 1.25rem;
}
.cat-nav__label {
  flex-shrink: 0;
  font-size: var(--fs-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
}
.cat-nav__chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.cat-nav__chips::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 1rem;
  font-size: var(--fs-small);
  white-space: nowrap;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease);
}
.cat-chip:hover { border-color: var(--ink); color: var(--ink); }
.cat-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.cat-nav--filter { padding-top: 0; }
/* Lead cat-nav sits right under the slim hero as the primary browse row. */
.cat-nav--lead { padding-top: 1.5rem; padding-bottom: 0.25rem; }

/* First content section on the products-forward landing — minimal top gap so
   the grid surfaces near the top of the page. */
.section--lead { padding-top: 1.5rem; }
.center { text-align: center; }
.tight { line-height: 1.4; }

/* ── editorial chapter break — hairline rule with centered eyebrow ──────── */
.band-divider {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding-block: 1.5rem;
  margin-block: 1.5rem;
  color: var(--ink-mute);
}
.band-divider::before,
.band-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}
.band-divider__label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.band-divider__num {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-mute);
}

/* Bigger landing-only headings for the chapter sections */
.section-display {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0;
}

/* Denser product grid for the "browse the floor" retail-style section.
   Default is 2-up so mobile renders two products per row. */
.product-grid--dense {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 0.85rem;
}
@media (min-width: 640px)  { .product-grid--dense { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.4rem 1.1rem; } }
@media (min-width: 960px)  { .product-grid--dense { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .product-grid--dense { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2.6rem 1.25rem; } }
/* Denser cards read tighter: smaller serif name, condensed body. */
.product-grid--dense .product-card__name { font-size: 0.98rem; font-weight: 400; min-height: 2.6em; }
.product-grid--dense .product-card__body  { margin-top: 0.75rem; }
@media (max-width: 600px) {
  .product-grid--dense .product-card__name { font-size: 0.95rem; }
  .product-grid--dense .product-card__body  { margin-top: 0.6rem; }
  .product-grid--dense .product-card__badge { font-size: 0.58rem; padding: 3px 6px; }
}

/* ── Expansion placeholders ("more to come" cards) ──────────────────────── */
.placeholder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.55rem;
  background: var(--paper-warm);
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: 1.8rem 1.2rem;
  color: var(--ink-mute);
  transition: border-color 240ms var(--ease), background 240ms var(--ease);
}
.placeholder-card:hover {
  border-color: var(--ink-mute);
  background: color-mix(in srgb, var(--paper-warm) 70%, var(--paper-deep));
}
.placeholder-card__title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--ink-soft);
}
.placeholder-card__desc {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
  letter-spacing: 0.04em;
  max-width: 26ch;
}

/* The placeholder lives in a grid where neighbours drive the row height
   (media + body for products, media for vendors). Stretching with
   `align-self: stretch` rises to that height; we deliberately do NOT
   set `aspect-ratio` here, because aspect-ratio combined with stretched
   height forces the width to a value that ignores the column track and
   overflows the grid cell. With width clamped by the column and height
   driven by the row, the visual footprint matches automatically. */
.placeholder-card--product,
.placeholder-card--vendor {
  align-self: stretch;
  width: 100%;
  min-height: 100%;
}
.placeholder-card--vendor .placeholder-card__title { font-size: 1.5rem; }

@media (max-width: 600px) {
  .placeholder-card { padding: 1.4rem 1rem; gap: 0.4rem; }
  .placeholder-card__title { font-size: 1.05rem; }
  .placeholder-card__desc { font-size: 0.72rem; }
  .placeholder-card--vendor .placeholder-card__title { font-size: 1.2rem; }
}

/* ── mobile pass (≤ 600px portrait phones) ──────────────────────────────── */
@media (max-width: 600px) {
  :root {
    --rhythm:    56px;
    --rhythm-sm: 44px;
  }

  /* Tighter nav so it doesn't eat half the viewport above the fold */
  .site-nav__inner { min-height: 64px; }
  .nav-actions { gap: 0.7rem; }
  /* Hide the redundant Home link on phones (it's just the logo). The
     login/account link is tagged `nav-link--always` so it stays visible. */
  .nav-link--home { display: none; }

  /* Hero — tighter on phones, smaller backdrop image saves bandwidth */
  .hero {
    padding-block: 4.5rem 3rem;
    background-image:
      linear-gradient(180deg,
        rgba(250, 250, 247, 0.72) 0%,
        rgba(250, 250, 247, 0.50) 45%,
        rgba(250, 250, 247, 0.96) 100%),
      url('/static/img/hero/bg-mobile.jpg');
  }
  .hero__body { max-width: none; }

  /* Section rhythm */
  .section { padding-block: 3rem; }
  .section-title { margin-bottom: 1.5rem; gap: 0.75rem; }
  .section-title h2 { font-size: 1.5rem; }

  /* Page-level layouts get less vertical padding */
  .pdp,
  .cart,
  .checkout { padding-block: 2rem 4rem; gap: 2.5rem; }

  /* Vendor + product cards — keep edge-to-edge media but cap tagline width */
  .vendor-card__veil { padding: 1.2rem 1.4rem; }
  .vendor-card__name { font-size: 1.6rem; }
  .product-grid { gap: 2.5rem 1rem; }

  /* Product detail typography */
  .pdp__name { font-size: clamp(1.35rem, 5.5vw, 1.7rem); }
  .pdp__price { font-size: 1.25rem; }
  .pdp__desc { font-size: 0.92rem; }
  .pdp__actions { grid-template-columns: 1fr; gap: 0.6rem; }
  .qty { width: 100%; justify-content: space-between; }

  /* Cart row: smaller image, allow long names to wrap, price drops below */
  .cart-row {
    grid-template-columns: 76px 1fr;
    grid-template-areas:
      "media info"
      "price price";
    column-gap: 1rem;
    row-gap: 0.8rem;
    padding: 1.25rem 0;
  }
  .cart-row__media { grid-area: media; }
  .cart-row__info  { grid-area: info; }
  .cart-row__price {
    grid-area: price;
    text-align: left;
    border-top: 1px dashed var(--line-soft);
    padding-top: 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
  }
  .cart-row__price p { margin: 0; }

  /* Summary card no longer sticky on mobile (would otherwise cover content) */
  .summary-card {
    position: static;
    padding: 1.5rem;
  }

  /* Forms: full-width single column */
  .form__row--2 { grid-template-columns: 1fr; }

  /* Confirmation page — narrower display, smaller key/value rows */
  .confirmation { padding-block: 3rem; }
  .confirmation__row { grid-template-columns: 1fr; gap: 0.4rem; padding: 0.9rem 0; }
  .confirmation__row dt { font-size: 0.66rem; }

  /* Buttons feel a touch smaller on phones */
  .btn { height: 48px; font-size: 0.78rem; padding: 0 1.2rem; letter-spacing: 0.16em; }
  .btn--lg { height: 52px; }

  /* Band divider tightens on phones (no overflow on iPhone SE) */
  .band-divider { gap: 0.9rem; padding-block: 0.5rem; margin-block: 0.5rem; }
  .band-divider__label { font-size: 0.66rem; letter-spacing: 0.24em; gap: 0.5rem; }
  .band-divider__num { font-size: 0.85rem; }
}

/* ── very small phones (iPhone SE, ≤ 380px) ─────────────────────────────── */
@media (max-width: 380px) {
  :root { --gutter: 22px; }
  .display { font-size: clamp(1.8rem, 9vw, 2.2rem); }
  .nav-cart__count { min-width: 16px; height: 16px; font-size: 0.62rem; }
  /* Drop the login text on the tiniest phones — the avatar icon alone
     keeps the nav from overflowing. Link stays fully tappable. */
  .nav-user__name { display: none; }
  .nav-user, .nav-link--always { gap: 0; }
}
