/* ============================================================
   Maroon Door eStore
   One typeface. One accent. Everything else is space.
   ============================================================ */

:root {
  --ground: #FFFFFF;
  --surface: #FFFFFF;
  --sunken: #F4F2F1;
  --line: #E6E2E0;
  --line-soft: #F0EDEB;

  --ink: #1A1214;
  --ink-mid: #6B6266;
  --ink-soft: #908789;

  --accent: #8E1220;
  --accent-hover: #6E0B18;
  --on-accent: #FFFFFF;

  /* product drawings */
  --art-bg: #F4F2F1;
  --art-line: #4A3C3E;
  --art-cream: #FFFFFF;
  --art-gold: #C7A75C;
  --art-maroon: #9C2531;
  --art-soft: #E4DFDC;

  --brand-dark: #4A0E16;
  --brand-dark-2: #611320;
  --gold: #E6C575;
  --gold-soft: #C9A85E;
  --gold-dark: #96741F;
  --brand-cream: #F6EAD2;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;

  --header-h: 88px;
  --max: 1080px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-dark: #3A0A11;
    --brand-dark-2: #4E0F19;
    --gold: #E6C575;
    --gold-soft: #C9A85E;
  --gold-dark: #96741F;
    --brand-cream: #F6EAD2;
    --ground: #121011;
    --surface: #1A1718;
    --sunken: #201C1E;
    --line: #2E2A2B;
    --line-soft: #242021;

    --ink: #F4F1EF;
    --ink-mid: #A69C9E;
    --ink-soft: #857B7D;

    --accent: #E4707F;
    --accent-hover: #F08F9B;
    --on-accent: #1A0207;

    --art-bg: #201C1E;
    --art-line: #D6CFCC;
    --art-gold: #D9BE7C;
    --art-maroon: #E4707F;
    --art-cream: #E9E4E1;
    --art-soft: #332E30;
  }
}

:root[data-theme="dark"] {
    --brand-dark: #3A0A11;
    --brand-dark-2: #4E0F19;
    --gold: #E6C575;
    --gold-soft: #C9A85E;
  --gold-dark: #96741F;
    --brand-cream: #F6EAD2;
  --ground: #121011;
  --surface: #1A1718;
  --sunken: #201C1E;
  --line: #2E2A2B;
  --line-soft: #242021;

  --ink: #F4F1EF;
  --ink-mid: #A69C9E;
  --ink-soft: #857B7D;

  --accent: #E4707F;
  --accent-hover: #F08F9B;
  --on-accent: #1A0207;

  --art-bg: #201C1E;
  --art-line: #D6CFCC;
  --art-gold: #D9BE7C;
  --art-maroon: #E4707F;
  --art-cream: #E9E4E1;
  --art-soft: #332E30;
}

* { box-sizing: border-box; }

/* The hidden attribute must beat any display rule set on a class below.
   Without this, a panel JS hides with .hidden = true stays on screen. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.022em; text-wrap: balance; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.tnum { font-variant-numeric: tabular-nums; }

/* ---------- announcement ---------- */

.promo {
  background: var(--sunken);
  color: var(--ink-mid);
  font-size: 12px;
  letter-spacing: .01em;
}

.promo .shell {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-block: 9px;
  text-align: center;
}

.promo .dot { color: var(--ink-soft); }

/* ---------- header ---------- */

.header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--line-soft);
}

.header .shell {
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--header-h);
}

.wordmark { display: inline-flex; align-items: center; gap: 13px; flex: none; }
.wordmark img.lockup { height: 68px; width: auto; border-radius: 0; flex: none; }
.wordmark-text { display: flex; flex-direction: column; line-height: 1; }

.wordmark-name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.012em;
  white-space: nowrap;
  color: var(--gold-dark);
}

.wordmark-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .28em;
  color: var(--accent);
  margin-top: 6px;
}


.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }

.search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  width: 210px;
  background: var(--sunken);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);transition: border-color .16s ease, width .18s ease;
}

.search:focus-within { border-color: var(--line); width: 250px; }
.search svg { flex: none; color: var(--ink-soft); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 13.5px; }
.search input::placeholder { color: var(--ink-soft); }

.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: none;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .16s ease, background .16s ease;
}

.cart-btn:hover { border-color: var(--ink-soft); }
.cart-count { font-variant-numeric: tabular-nums; color: var(--ink-mid); }

/* ---------- hero ---------- */

.hero { background: var(--brand-dark); }
.hero .shell { border-radius: 0; }

.hero .shell {
  padding-block: 76px 78px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 5.4vw, 50px);
  line-height: 1.14;
  letter-spacing: -.012em;
  color: var(--gold);
  text-wrap: normal;
}

/* Two deliberate lines rather than a <br>, so they still behave if the
   viewport gets narrower than the second line. */
.hero h1 span { display: block; }

.hero-actions { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; justify-content: center; }

.link-cta {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.link-cta:hover { text-decoration: underline; text-underline-offset: 3px; }
.hero .link-cta { color: var(--gold); }

/* ---------- category nav ---------- */

.filters {
  position: sticky;
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  z-index: 30;
  background: var(--ground);
  border-bottom: 1px solid var(--line-soft);
}

.filters .shell {
  display: flex;
  align-items: center;
  justify-content: safe center;
  gap: 4px;
  padding-block: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters .shell::-webkit-scrollbar { display: none; }

.chips { display: contents; }

.chip {
  flex: none;
  border: 0;
  background: none;
  padding: 13px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-mid);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.sort {
  flex: none;
  height: 30px;
  padding: 0 22px 0 8px;
  border: 0;
  background: none;
  font-size: 13px;
  color: var(--ink-mid);
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 11px) 13px, calc(100% - 7px) 13px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

/* ---------- grid ---------- */

main { padding-block: 56px 96px; }

.grid-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 34px;
}

.grid-head h2 { font-size: 22px; }
.grid-head .count { font-size: 13px; color: var(--ink-soft); }
.grid-head-right { display: flex; align-items: center; gap: 16px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 44px 32px;
}

.card { display: flex; flex-direction: column; text-align: center; }

.card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  background: var(--art-bg);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
}

.card-media svg { display: block; width: 100%; height: 100%; }

.card-cat {
  font-size: 11.5px;
  color: var(--ink-soft);
  letter-spacing: .01em;
  margin-bottom: 5px;
}

.card h3 { font-size: 16px; font-weight: 600; line-height: 1.3; margin-bottom: 6px; }

.card .blurb {
  font-size: 13.5px;
  color: var(--ink-mid);
  line-height: 1.45;
  margin-bottom: 12px;
  flex: 1;
}

.price-row { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-bottom: 4px; }
.price { font-size: 15.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.price-was { font-size: 13.5px; color: var(--ink-soft); text-decoration: line-through; font-variant-numeric: tabular-nums; }

.meta { font-size: 12px; color: var(--ink-soft); min-height: 18px; margin-bottom: 14px; }

.add {
  align-self: center;
  height: 36px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .16s ease;
}

.add:hover { background: var(--accent-hover); }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-mid);
}

.empty strong { display: block; margin-bottom: 6px; color: var(--ink); font-weight: 600; }

/* ---------- cart ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 16, 17, .32);
  opacity: 0;
  transition: opacity .24s ease;
}

.scrim.open { opacity: 1; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 51;
  width: min(430px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--ground);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.32, .72, 0, 1);
}

.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  padding-top: calc(22px + env(safe-area-inset-top, 0px));
}

.drawer-head h2 { font-size: 18px; }

.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; background: none; cursor: pointer;
  color: var(--ink-mid); border-radius: var(--radius-pill);
}

.icon-btn:hover { color: var(--ink); background: var(--sunken); }

.ship-meter { padding: 0 26px 18px; }
.ship-meter p { font-size: 12.5px; color: var(--ink-mid); margin-bottom: 8px; }
.ship-meter strong { color: var(--ink); font-weight: 600; }
.meter { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ink); transition: width .4s cubic-bezier(.32, .72, 0, 1); }
.ship-meter.done p, .ship-meter.done strong { color: var(--ink); }

.drawer-body { flex: 1; overflow-y: auto; padding: 0 26px; }

.line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
}

.line:first-child { border-top: 0; }
.line-thumb { width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; background: var(--art-bg); }
.line-thumb svg { display: block; width: 100%; height: 100%; padding: 9%; box-sizing: border-box; }
.line h4 { font-size: 14px; font-weight: 500; line-height: 1.35; margin-bottom: 3px; }
.line .each { font-size: 12.5px; color: var(--ink-soft); }
.line .upc { display: none; }
.line-right { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; }
.line .line-total { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button {
  width: 26px; height: 26px; border: 0; background: none; cursor: pointer;
  color: var(--ink-mid); font-size: 15px; line-height: 1; border-radius: var(--radius-pill);
}
.stepper button:hover { background: var(--sunken); color: var(--ink); }
.stepper .qty { min-width: 22px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }

.cart-empty { text-align: center; padding: 80px 16px; color: var(--ink-mid); }
.cart-empty h3 { font-size: 16px; margin-bottom: 6px; }
.cart-empty p { font-size: 13.5px; }

.drawer-foot {
  border-top: 1px solid var(--line);
  padding: 22px 26px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 18px;
}

.totals { display: grid; gap: 8px; font-size: 13.5px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals .muted { color: var(--ink-mid); }
.totals .free { color: var(--ink); }
.totals .grand { padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 16px; font-weight: 600; }

.pay { display: grid; gap: 9px; }

.pay-btn {
  height: 46px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background .16s ease, border-color .16s ease;
}

.pay-btn[disabled] { opacity: .4; cursor: not-allowed; }
.pay-card { background: var(--accent); color: var(--on-accent); }
.pay-card:hover:not([disabled]) { background: var(--accent-hover); }
.pay-paypal { background: none; border-color: var(--line); color: var(--ink); }
.pay-paypal:hover:not([disabled]) { border-color: var(--ink-soft); }
.pay-paypal .pp { font-weight: 700; font-style: italic; letter-spacing: -.02em; }

.pay-note { font-size: 11.5px; color: var(--ink-soft); text-align: center; }

.notice {
  font-size: 12.5px;
  line-height: 1.45;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--sunken);
  color: var(--ink-mid);
}

.notice[hidden] { display: none !important; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 160%);
  z-index: 60;
  background: var(--ink);
  color: var(--ground);
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  transition: transform .32s cubic-bezier(.32, .72, 0, 1);
  max-width: calc(100vw - 32px);
}

.toast.show { transform: translate(-50%, 0); }

/* ---------- footer ---------- */

.footer { border-top: 1px solid var(--line-soft); }

.footer .shell {
  padding-block: 44px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.footer-logo img { width: 150px; height: auto; opacity: .95; }
.footer .links { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.footer .links a { color: var(--ink-mid); }
.footer .links a:hover { color: var(--ink); }

/* ---------- product drawings ---------- */

.art { display: block; width: 100%; height: 100%; padding: 13%; box-sizing: border-box; }
.art .stroke { fill: none; stroke: var(--art-line); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.art .thin { stroke-width: 1.6; }
.art .cream { fill: var(--art-cream); }
.art .gold { fill: var(--art-gold); }
.art .maroon { fill: var(--art-maroon); }
.art .soft { fill: var(--art-soft); }
.art .ink { fill: var(--art-line); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; }
  .filters .shell { justify-content: flex-start; }
}

@media (max-width: 660px) {
  :root { --gutter: 20px; --header-h: 70px; }

  /* The tab bar carries the bag on small screens, so the header does not
     need a second one — and the search gets the space back. */
  .header .cart-btn { display: none; }
  .search { max-width: none; }
  .hero .shell { padding-block: 56px 42px; }
  .header .shell { gap: 10px; }
  .search { flex: 1 1 auto; width: auto; min-width: 0; max-width: 200px; padding: 0 11px; }
  .search:focus-within { width: auto; }
  .filters .shell { justify-content: flex-start; }
  .wordmark img.lockup { height: 48px; }
  .wordmark-name { font-size: 17px; }
  .wordmark-sub { font-size: 8.5px; letter-spacing: .22em; margin-top: 4px; }
  main { padding-block: 40px 72px; }
  .grid { gap: 34px 18px; }
  .card .blurb { display: none; }
  .grid-head { margin-bottom: 24px; }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   Urgency, quietly
   The impulse cues stay — savings, stock, a running deal — but
   they are carried by small type and one accent colour instead
   of pills, ribbons and shadows.
   ============================================================ */

.save {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.meta.urgent { color: var(--accent); }

/* ---------- deal of the day ---------- */

.deal-band { padding-block: 40px 40px; }

.deal {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 34px;
  align-items: center;
  background: var(--sunken);
  border-radius: 20px;
  padding: 34px;
}

.deal-thumb {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ground);
}

.deal-thumb svg { display: block; width: 100%; height: 100%; padding: 11%; box-sizing: border-box; }

.deal-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }

.deal-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.deal-copy h2 { font-size: 24px; line-height: 1.2; }
.deal-copy .blurb { font-size: 14px; color: var(--ink-mid); max-width: 48ch; }
.deal-copy .price-row { justify-content: flex-start; margin: 2px 0 4px; }
.deal-copy .price { font-size: 22px; }
.deal-copy .price-was { font-size: 15px; }

.deal-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.deal-actions .add { height: 40px; padding: 0 24px; font-size: 14px; }

.countdown { font-size: 12.5px; color: var(--ink-mid); }
.countdown .clock { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }

@media (max-width: 760px) {
  .deal { grid-template-columns: 1fr; gap: 22px; padding: 24px; }
  .deal-thumb { width: 140px; aspect-ratio: 1 / 1; }
  .deal-copy h2 { font-size: 20px; }
}

/* ------------------------------------------------------------------
   The logo's wordmark is dark maroon — it only reads on a light ground.
   In dark mode it sits on a small cream plate rather than being
   recoloured, so the artwork itself is never altered.
   ------------------------------------------------------------------ */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wordmark img.lockup,
  :root:not([data-theme="light"]) .footer-logo img {
    background: var(--brand-cream);
    padding: 5px 11px;
    border-radius: 10px;
  }
}

:root[data-theme="dark"] .wordmark img.lockup,
:root[data-theme="dark"] .footer-logo img {
  background: var(--brand-cream);
  padding: 5px 11px;
  border-radius: 10px;
}

/* ==================================================================
   Permanent tab bar
   Edge to edge on a phone, a floating pill on a wide screen.
   ================================================================== */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--ground) 94%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
}

.tabbar-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 560px;
  margin: 0 auto;
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 4px 8px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .01em;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.tab svg { width: 23px; height: 23px; }
.tab:hover { color: var(--ink); }
.tab[aria-current="true"] { color: var(--accent); }

.tab-count {
  position: absolute;
  top: 4px;
  left: 50%;
  margin-left: 6px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 17px;
  text-align: center;
}

/* Clear the bar so the real footer is never hidden behind it. */
body { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }

@media (min-width: 720px) {
  .tabbar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    width: min(520px, calc(100% - 40px));
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    box-shadow: 0 10px 34px -12px rgba(26, 18, 20, .3);
    padding-bottom: 0;
    overflow: hidden;
  }
  body { padding-bottom: 104px; }
}

/* ---------- the "Me" sheet ---------- */

.sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 52;
  background: rgba(20, 16, 17, .32);
  opacity: 0;
  transition: opacity .22s ease;
}

.sheet-scrim.open { opacity: 1; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 53;
  width: min(460px, 100%);
  transform: translate(-50%, 110%);
  background: var(--ground);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  padding: 10px 26px calc(26px + env(safe-area-inset-bottom, 0px));
  visibility: hidden;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.32, .72, 0, 1), visibility .3s;
}

.sheet.open { transform: translate(-50%, 0); visibility: visible; pointer-events: auto; }
.sheet-grab { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 20px; }
.sheet h2 { font-size: 18px; margin-bottom: 10px; }
.sheet p { font-size: 14px; color: var(--ink-mid); line-height: 1.6; margin-bottom: 20px; }

.sheet-links { display: grid; gap: 2px; margin-bottom: 20px; }

.sheet-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  font-size: 14.5px;
  border-bottom: 1px solid var(--line-soft);
}

.sheet-links a:first-child { border-top: 1px solid var(--line-soft); }
.sheet-links .chev { color: var(--ink-soft); font-size: 20px; line-height: 1; }

.sheet-close {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: none;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.sheet-close:hover { border-color: var(--ink-soft); }

@media (min-width: 720px) {
  .sheet { bottom: 96px; border-radius: 20px; border-bottom: 1px solid var(--line); padding-bottom: 26px; }
  .sheet.open { transform: translate(-50%, 0); }
}

/* ==================================================================
   Welcome offer, category panel, offers page
   ================================================================== */

.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 16, 17, .42);
  opacity: 0;
  transition: opacity .24s ease;
}

.modal-scrim.open { opacity: 1; }

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 61;
  width: min(420px, calc(100% - 32px));
  transform: translate(-50%, -46%) scale(.97);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 30px 28px;
  text-align: center;
  box-shadow: 0 30px 70px -28px rgba(26, 18, 20, .55);
  transition: transform .26s cubic-bezier(.32, .72, 0, 1), opacity .2s ease, visibility .26s;
}

.modal.open { transform: translate(-50%, -50%) scale(1); opacity: 1; visibility: visible; pointer-events: auto; }

.modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  cursor: pointer;
}

.modal-x:hover { background: var(--sunken); color: var(--ink); }

.modal-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.modal h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 27px;
  letter-spacing: -.015em;
  margin-bottom: 10px;
}

.modal-lede { color: var(--ink-mid); font-size: 14.5px; line-height: 1.55; margin-bottom: 22px; }

.modal form { display: grid; gap: 10px; }

.modal input {
  font: inherit;
  height: 46px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--ground);
  color: var(--ink);
  text-align: center;
}

.modal input:focus { outline: none; border-color: var(--accent); }
.modal .add { align-self: stretch; height: 46px; font-size: 14.5px; }
.modal-err { font-size: 12.5px; color: var(--accent); }
.modal-fine { font-size: 11.5px; color: var(--ink-soft); line-height: 1.5; margin-top: 16px; }

.modal .code {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent);
  background: var(--sunken);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  margin-bottom: 16px;
  word-break: break-all;
}

/* ---------- discount inside the bag ---------- */

.totals .discount { color: var(--accent); }

.codebox { display: grid; gap: 8px; }

.code-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--sunken);
  font-size: 13px;
}

.code-applied strong { color: var(--accent); font-weight: 600; letter-spacing: .03em; }
.code-applied button { border: 0; background: none; color: var(--ink-soft); font-size: 18px; cursor: pointer; line-height: 1; }
.code-applied button:hover { color: var(--ink); }

.code-entry { display: flex; gap: 8px; }
.code-entry[hidden] { display: none !important; }

.code-entry input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 13.5px;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--ground);
  color: var(--ink);
  text-transform: uppercase;
}

.code-entry input:focus { outline: none; border-color: var(--line-strong, var(--ink-soft)); }

.code-entry button {
  flex: none;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.code-entry button:hover { border-color: var(--ink-soft); }
.code-err { font-size: 12.5px; color: var(--accent); }

/* ---------- category panel ---------- */

.sheet-wide { width: min(560px, 100%); }

.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }

.cat-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.cat-tile:hover { border-color: var(--accent); background: var(--sunken); }
.cat-name { font-size: 14.5px; font-weight: 600; }
.cat-count { font-size: 12px; color: var(--ink-soft); }

/* ---------- offers page ---------- */

.offers-head { background: var(--brand-dark); }

.offers-head .shell { padding-block: 56px 58px; text-align: center; }

.offers-head h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(30px, 5.4vw, 46px);
  letter-spacing: -.02em;
  color: var(--gold);
  margin-bottom: 10px;
}

.offers-head p { color: var(--brand-cream); opacity: .8; font-size: 16px; }

@media (max-width: 480px) {
  .cat-grid { grid-template-columns: 1fr; }
  .modal { padding: 30px 22px 24px; }
  .modal h2 { font-size: 23px; }
}

/* ---------- account screen ---------- */

.acct-lede { font-size: 14px; color: var(--ink-mid); line-height: 1.55; margin-bottom: 18px; }
.acct-lede strong { color: var(--ink); font-weight: 600; }

.acct-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--sunken);
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
}

.acct-toggle button {
  height: 36px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-mid);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.acct-toggle button.on { background: var(--ground); color: var(--ink); box-shadow: 0 1px 2px rgba(26,18,20,.12); }

#acctForm { display: grid; gap: 14px; margin-bottom: 16px; }
.acct-field { display: grid; gap: 6px; }
.acct-field span { font-size: 13px; font-weight: 500; }

.acct-field input {
  font: inherit;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--ground);
  color: var(--ink);
}

.acct-field input:focus { outline: none; border-color: var(--accent); }
.acct-hint { font-size: 12px; color: var(--ink-soft); }
.acct-err { font-size: 12.5px; color: var(--accent); }
.acct-fine { font-size: 11.5px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 18px; }

.acct-orders { display: grid; gap: 2px; margin-bottom: 18px; }

.acct-order {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}

.acct-order:first-child { border-top: 1px solid var(--line-soft); }
.acct-order .ref { color: var(--ink-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.acct-order .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.acct-empty { font-size: 13.5px; color: var(--ink-soft); padding: 14px 0 4px; }

/* ==================================================================
   Product page
   ================================================================== */

.product .shell { padding-block: 34px 80px; }

.back { display: inline-block; font-size: 13.5px; color: var(--ink-mid); margin-bottom: 26px; }
.back:hover { color: var(--ink); }

.product-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 54px; align-items: start; }
.product-loading { color: var(--ink-soft); }

.product-media {
  aspect-ratio: 1 / 1;
  background: var(--art-bg);
  border-radius: 18px;
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.product-media svg, .product-media img { display: block; width: 100%; height: 100%; }
.product-media img { object-fit: cover; }

.product-cat { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
.product-brand { font-size: 13px; color: var(--ink-mid); margin-bottom: 4px; }

.product h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(25px, 3.4vw, 34px);
  line-height: 1.18;
  letter-spacing: -.015em;
  margin-bottom: 14px;
}

.product-price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.product-price .price { font-size: 24px; font-weight: 700; }
.product-price .price-was { font-size: 16px; }

.product-meta { font-size: 13px; color: var(--ink-soft); margin-bottom: 22px; min-height: 18px; }
.product-meta.urgent { color: var(--accent); }

.product-blurb { font-size: 15.5px; color: var(--ink-mid); line-height: 1.6; margin-bottom: 26px; }

.product .add { height: 48px; padding: 0 30px; font-size: 15px; margin-bottom: 30px; }
.product .add[disabled] { opacity: .45; cursor: not-allowed; }

.product-section { padding-top: 26px; border-top: 1px solid var(--line-soft); margin-bottom: 26px; }
.product-section h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }

.product-section ul { margin: 0; padding-left: 19px; color: var(--ink-mid); line-height: 1.65; }
.product-section li { margin-bottom: 7px; }
.product-section ol { margin: 0; padding-left: 19px; color: var(--ink-mid); line-height: 1.65; }
.product-section p { color: var(--ink-mid); line-height: 1.65; font-size: 14.5px; }

.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table th, .spec-table td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.spec-table th { font-weight: 500; color: var(--ink-mid); width: 44%; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

.product-note {
  background: var(--sunken);
  border-radius: var(--radius-sm);
  padding: 15px 17px;
  font-size: 13.5px;
  color: var(--ink-mid);
  line-height: 1.6;
}

.product-sources { font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.product-sources a { color: var(--ink-mid); text-decoration: underline; text-underline-offset: 2px; }
.product-sources a:hover { color: var(--ink); }

/* the whole card is a link on the grid */
.card-link { display: block; color: inherit; }
.card-link:hover .card-media { opacity: .92; }
.card-link:hover h3 { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 820px) {
  .product-grid { grid-template-columns: 1fr; gap: 28px; }
  .product-media { position: static; max-width: 420px; }
}


/* The same dark gold reads on both grounds, so the wordmark does not change
   between themes — it only lifts a touch in dark mode to stay crisp. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --gold-dark: #A8842C; }
}

:root[data-theme="dark"] { --gold-dark: #A8842C; }

/* ---------- product photo strip ----------
   Only appears when a product has more than one photo in public/images
   (810082557893.jpg plus 810082557893-2.jpg and so on). */

.product-shots { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 12px; }
.product-shots .product-media { position: static; }
.product-shots .product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.shot-strip { display: flex; gap: 10px; flex-wrap: wrap; }

.shot {
  width: 66px;
  height: 66px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--art-bg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s ease;
}

.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot:hover { border-color: var(--ink-soft); }
.shot.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

@media (max-width: 820px) {
  .product-shots { position: static; max-width: 420px; }
}
