/* Balconit — base tokens & RTL editorial system */

/* Discovery FS — Light / Demibold / Black, mapped across the weight range */
@font-face {
  font-family: 'Discovery FS';
  src: url('../fonts/Discovery_Fs-Light.woff2') format('woff2');
  font-weight: 100 450;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Discovery FS';
  src: url('../fonts/Discovery_Fs-Demibold.woff2') format('woff2');
  font-weight: 451 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Discovery FS';
  src: url('../fonts/Discovery_Fs-Black.woff2') format('woff2');
  font-weight: 701 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surface */
  --bone: #FAF8F4;
  --bone-2: #F2EEE6;
  --surface: #FFFFFF;
  --ink: #1F1B16;
  --ink-2: #4A433B;
  --ink-3: #7A7167;
  --rule: rgba(31, 27, 22, 0.10);
  --rule-soft: rgba(31, 27, 22, 0.06);

  /* Accent — overridden by Tweaks */
  --accent: oklch(0.62 0.11 45);     /* terracotta */
  --accent-ink: #FFFFFF;
  --accent-soft: oklch(0.94 0.03 45);

  /* Type — Discovery FS (Light / Demibold / Black) with system fallback. */
  --font-display: 'Discovery FS', system-ui, sans-serif;
  --font-body: 'Discovery FS', system-ui, sans-serif;
  --font-mono: 'Discovery FS', system-ui, sans-serif;

  /* Density — overridden by Tweaks */
  --section-y: 128px;
  --grid-gap: 28px;
  --card-radius: 4px;

  /* Static */
  --pill: 9999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* ===== Storefront foundation (Wave 0) ===== */
  /* Spacing scale — derived from existing px literals; --space-4 = 16px base */
  --space-0:0; --space-px:1px; --space-0-5:2px; --space-1:4px; --space-1-5:6px;
  --space-2:8px; --space-2-5:10px; --space-3:12px; --space-3-5:14px; --space-4:16px;
  --space-5:18px; --space-6:20px; --space-7:24px; --space-8:28px; --space-9:32px;
  --space-10:40px; --space-12:48px; --space-14:56px; --space-16:64px; --space-18:72px;
  --space-24:96px; --space-32:128px;

  /* Radius scale — reconciles 2/4/6/8/18/28 → 4 tokens + pill.
     --card-radius & --pill re-pointed value-preserving; --radius declared first. */
  --radius-sm:3px; --radius:4px; --card-radius:var(--radius); --radius-md:8px; --radius-lg:20px; --pill:9999px;

  /* Shadow scale — tokenized from the warm ink-tinted literals */
  --shadow-xs:0 1px 0 rgba(31,27,22,.04);
  --shadow-sm:0 4px 12px rgba(31,27,22,.05);
  --shadow-md:0 8px 24px rgba(31,27,22,.08);
  --shadow-lg:0 12px 32px rgba(31,27,22,.18);
  --shadow-xl:0 30px 70px -40px rgba(31,27,22,.45);
  --shadow-focus:0 0 0 3px color-mix(in oklch, var(--accent) 28%, transparent);

  /* Caption / small tier — the theme pins everything ≥16px; add the sub-16 steps */
  --text-caption:14px; --leading-caption:1.45;
  --text-small:13px;   --leading-small:1.4;
  --text-micro:12px;   --leading-micro:1.35;
  --weight-caption:500;

  /* Semantic colors — oklch, harmonized to bone/ink/terracotta; each -ink + -soft */
  --success:oklch(.66 .13 150); --success-ink:oklch(.40 .10 150); --success-soft:oklch(.95 .03 150);
  --warning:oklch(.74 .13 75);  --warning-ink:oklch(.45 .10 75);  --warning-soft:oklch(.95 .04 80);
  --error:oklch(.58 .16 28);    --error-ink:oklch(.45 .15 28);    --error-soft:oklch(.95 .03 30);
  --info:oklch(.62 .08 240);    --info-ink:oklch(.42 .08 240);    --info-soft:oklch(.95 .025 240);
  --price-sale:var(--accent); --price-was:var(--ink-3);

  /* Focus-visible system — pill-safe box-shadow ring + bone/ink-surface variants */
  --focus-ring-width:3px; --focus-ring-offset:2px; --focus-ring-color:var(--accent);
  --focus-ring:0 0 0 var(--focus-ring-offset) var(--bone),
               0 0 0 calc(var(--focus-ring-offset) + var(--focus-ring-width)) var(--focus-ring-color);
}

/* Focus-visible baseline (Wave 0) — replaces the ad-hoc accent outline */
:focus { outline: none; }
:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
  border-radius: inherit;
}
@media (prefers-contrast: more) {
  :focus-visible { outline-width: 4px; outline-color: var(--ink); }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[dir="rtl"] {
  font-feature-settings: "kern" 1;
}

img { display: block; max-width: 100%; }

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  padding: 0;
}

a { color: inherit; text-decoration: none; }

/* Layout */
.wrap {
  max-width: 1920px;
  margin: 0 auto;
  padding-inline: clamp(24px, 4vw, 64px);
}
.wrap-tight {
  max-width: 1100px;
  margin: 0 auto;
  padding-inline: clamp(24px, 4vw, 64px);
}

/* Typography */
.eyebrow {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-block;
}
.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1.02;
  letter-spacing: normal;
  margin: 0;
  text-wrap: pretty;
}
.h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: normal;
  margin: 0;
  text-wrap: balance;
}
.h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: normal;
  margin: 0;
}
.lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0;
  text-wrap: pretty;
}
.muted { color: var(--ink-3); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 500;
  border-radius: var(--pill);
  transition: all 220ms var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--bone);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-ghost {
  border: 1px solid var(--rule);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-link {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}
.btn-link:hover { color: var(--accent); border-color: var(--accent); }

/* Header */
.hdr {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #FFFFFF;
  border-bottom: 1px solid var(--rule-soft);
}
.hdr-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 108px;
}
.hdr-logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: normal;
}
.hdr-nav {
  display: flex;
  gap: 32px;
  justify-content: center;
  font-size: 18px;
}
.hdr-nav a {
  color: var(--ink-2);
  transition: color 180ms var(--ease);
}
.hdr-nav a:hover { color: var(--ink); }
.hdr-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
}
.cart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  padding: 8px 14px;
  border-radius: var(--pill);
  transition: background 180ms var(--ease);
}
.cart-btn:hover { background: var(--bone-2); }
.cart-count {
  background: var(--ink);
  color: var(--bone);
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  transition: transform 220ms var(--ease);
}
.cart-bump { animation: bump 360ms var(--ease); }
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); background: var(--accent); }
  100% { transform: scale(1); }
}

/* Section */
section { padding-block: var(--section-y); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 56px;
}
.section-head-stacked {
  margin-bottom: 56px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Image placeholder fallback */
.img-fallback {
  background:
    repeating-linear-gradient(135deg, rgba(31,27,22,0.04) 0 8px, transparent 8px 16px),
    var(--bone-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Discovery FS', system-ui, sans-serif;
  font-size: 16px;
  color: var(--ink-3);
}
.img-frame {
  position: relative;
  overflow: hidden;
  background: var(--bone-2);
  border-radius: var(--card-radius);
}
.img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease);
}

/* Cart drawer */
.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(31, 27, 22, 0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms var(--ease);
  z-index: 100;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  inset-inline-end: 0; /* RTL: anchors to LEFT edge visually */
  height: 100vh;
  width: min(440px, 92vw);
  background: var(--bone);
  z-index: 101;
  transform: translateX(-100%); /* off-screen left when closed */
  transition: transform 380ms var(--ease);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--rule-soft);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 28px;
}
.drawer-foot {
  padding: 24px 28px;
  border-top: 1px solid var(--rule-soft);
  background: var(--surface);
}
.drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 180ms var(--ease);
}
.drawer-close:hover { background: var(--bone-2); }

.line-item {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule-soft);
  align-items: flex-start;
}
.line-item:last-child { border-bottom: none; }
.line-thumb {
  width: 84px;
  height: 100px;
  background: var(--bone-2);
  border-radius: 2px;
  overflow: hidden;
}
.line-thumb img { width: 100%; height: 100%; object-fit: cover; }
.line-name { font-weight: 500; font-size: 16px; }
.line-meta { color: var(--ink-3); font-size: 16px; margin-top: 4px; }
.line-price { font-size: 16px; font-variant-numeric: tabular-nums; }
.qty {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: var(--pill);
  height: 30px;
}
.qty button {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font-size: 16px;
  transition: color 160ms var(--ease);
}
.qty button:hover { color: var(--accent); }
.qty span {
  min-width: 24px;
  text-align: center;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.line-remove {
  font-size: 16px;
  color: var(--ink-3);
  margin-top: 8px;
  border-bottom: 1px solid transparent;
  transition: all 160ms var(--ease);
}
.line-remove:hover { color: var(--ink); border-color: var(--rule); }

.drawer-empty {
  padding: 80px 28px;
  text-align: center;
  color: var(--ink-3);
}

.subtotal-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  margin-bottom: 8px;
}
.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 500;
  margin: 16px 0 20px;
}
.btn-checkout {
  width: 100%;
  justify-content: center;
  font-size: 16px;
  padding: 16px;
}
.shipping-progress {
  font-size: 16px;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.shipping-bar {
  height: 3px;
  background: var(--rule-soft);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.shipping-bar > div {
  height: 100%;
  background: var(--accent);
  transition: width 380ms var(--ease);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  background: var(--ink);
  color: var(--bone);
  padding: 14px 20px;
  border-radius: var(--pill);
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(120%);
  opacity: 0;
  transition: all 320ms var(--ease);
  z-index: 90;
  box-shadow: 0 12px 32px rgba(31,27,22,0.18);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* =========== Footer =========== */
footer.foot {
  padding-block: 0 32px;
  background: var(--bone-2);
  position: relative;
  overflow: hidden;
}

/* Top newsletter CTA strip — inverted ink panel, the loudest moment of the footer */
.foot-cta {
  background: var(--ink);
  color: var(--bone);
  padding-block: clamp(56px, 7vw, 96px);
  margin-bottom: clamp(48px, 6vw, 88px);
  position: relative;
}
.foot-cta::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}
.foot-cta-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: center;
}
.foot-cta-text .eyebrow { color: rgba(250, 248, 244, 0.55); }
.foot-cta-title {
  color: var(--bone);
  margin: 18px 0 16px;
  font-size: clamp(36px, 4vw, 56px);
}
.foot-cta-body {
  color: rgba(250, 248, 244, 0.72);
  font-size: 18px;
  line-height: 1.55;
  max-width: 46ch;
  margin: 0;
}
.foot-cta-form {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 520px;
  justify-self: end;
}
.foot-cta-input {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--bone);
  font: inherit;
  font-size: 17px;
  border-radius: var(--pill);
  padding: 16px 24px;
  outline: none;
  transition: border-color 220ms var(--ease), background 220ms var(--ease);
}
.foot-cta-input::placeholder { color: rgba(250, 248, 244, 0.42); }
.foot-cta-input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.10);
}
.foot-cta-btn {
  background: var(--bone);
  color: var(--ink);
  align-self: stretch;
  padding-inline: 28px;
}
.foot-cta-btn:hover { background: var(--accent); color: var(--accent-ink); }
.foot-cta-thanks {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  color: var(--bone);
  padding: 18px 24px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--pill);
}
/* The class rule above defeats the [hidden] UA display:none; restore it so the
   "thanks" state stays hidden until the newsletter form is submitted. */
.foot-cta-thanks[hidden] {
  display: none;
}
.foot-cta-thanks-dot {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 24%, transparent);
}

/* Columns */
.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: clamp(28px, 3vw, 56px);
  margin-bottom: 72px;
}
.foot-col h4 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { margin-bottom: 14px; }
.foot-col a {
  color: var(--ink-2);
  font-size: 16px;
  transition: color 180ms var(--ease), padding 220ms var(--ease);
  display: inline-block;
}
.foot-col a:hover {
  color: var(--ink);
  padding-inline-start: 4px;
}

/* Brand column */
.foot-brand-tag {
  margin: 18px 0 24px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 36ch;
}
.foot-stat-row {
  display: flex;
  gap: 28px;
  padding: 18px 0;
  border-block: 1px solid var(--rule);
  margin-bottom: 22px;
}
.foot-stat { display: flex; flex-direction: column; gap: 2px; }
.foot-stat b {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  color: var(--ink);
}
.foot-stat span { font-size: 16px; color: var(--ink-3); }

.foot-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--ink);
  padding: 10px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--pill);
  background: var(--bone);
  transition: all 220ms var(--ease);
}
.foot-contact-link:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}
.foot-contact-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px color-mix(in oklch, #4ade80 28%, transparent);
}

/* Visit column */
.foot-address {
  font-style: normal;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 18px;
}
.foot-hours {
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.foot-hours > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 16px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.foot-hours dt { color: var(--ink-3); }
.foot-hours dd { margin: 0; color: var(--ink); }

.foot-socials {
  display: flex;
  gap: 8px;
}
.foot-socials a {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 500;
  font-family: var(--font-display);
  color: var(--ink-2);
  background: var(--bone);
  transition: all 220ms var(--ease);
}
.foot-socials a:hover {
  background: var(--ink);
  color: var(--bone);
  border-color: var(--ink);
  transform: translateY(-2px);
}

/* Fine print */
.foot-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  font-size: 16px;
  color: var(--ink-3);
}
.foot-bottom-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.foot-bottom-left a {
  color: var(--ink-3);
  transition: color 180ms var(--ease);
}
.foot-bottom-left a:hover { color: var(--ink); }
.foot-bottom-sep { opacity: 0.4; }
.foot-pay {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.foot-pay-label {
  font-size: 16px;
  color: var(--ink-3);
  margin-inline-end: 4px;
}
.foot-pay-chip {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 4px 10px;
  background: var(--bone);
  border: 1px solid var(--rule);
  border-radius: 4px;
  letter-spacing: normal;
}

/* Responsive */
@media (max-width: 1100px) {
  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .foot-col-visit { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; align-items: start; }
  .foot-col-visit h4 { grid-column: 1 / -1; }
  .foot-cta-inner { grid-template-columns: 1fr; gap: 36px; }
  .foot-cta-form { justify-self: stretch; }
}
@media (max-width: 700px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-col-brand { grid-column: 1 / -1; }
  .foot-col-visit { grid-template-columns: 1fr 1fr; }
  .foot-cta-form { flex-direction: column; }
  .foot-wordmark { flex-direction: column; align-items: flex-start; }
}

/* Density variants */
body.density-airy {
  --section-y: 144px;
  --grid-gap: 32px;
}
body.density-compact {
  --section-y: 80px;
  --grid-gap: 20px;
}
body.density-compact .display { font-size: clamp(36px, 5vw, 68px); }

/* Responsive */
@media (max-width: 900px) {
  .hdr-inner { grid-template-columns: auto 1fr auto; height: 84px; }
  .hdr .brand-logo { height: 56px !important; }
  .hdr-nav { display: none; }
  :root { --section-y: 80px; }
  .section-head { flex-direction: column; align-items: flex-start; }
}
