/* ---- tokens.css ---- */
/* ==========================================================================
   SAKANA — design tokens (Editorial direction)
   Change brand colors, type and rhythm here only.
   Maps to Shopify theme settings later (see SHOPIFY_MIGRATION_PLAN.md).
   ========================================================================== */

:root {
  /* Color */
  --paper: #f4eee5;        /* page background */
  --paper-2: #ebe3d7;      /* image wells, footer */
  --cream: #fbf8f3;        /* raised surfaces, story band */
  --ink: #2a2320;          /* text, primary buttons */
  --ink-2: #3a312c;        /* image wells on dark */
  --soft: #6d6158;         /* secondary text (AA on paper) */
  --line: #d6cabb;         /* hairlines */
  --accent: #7a2d25;       /* oxblood */
  --accent-soft: #d9a796;  /* accent on dark backgrounds */
  --on-dark: #f4eee5;
  --on-dark-soft: rgba(244, 238, 229, 0.72);

  /* Type */
  --f-serif: "Frank Ruhl Libre", "Times New Roman", serif;
  --f-sans: "Assistant", system-ui, -apple-system, sans-serif;
  --f-latin: "Cormorant Garamond", "Frank Ruhl Libre", serif;

  --fs-xs: 13px;
  --fs-sm: 15px;
  --fs-base: 17px;
  --fs-lg: 19px;
  --fs-h3: clamp(22px, 2vw, 28px);
  --fs-h2: clamp(28px, 3.2vw, 44px);
  --fs-h1: clamp(36px, 4.6vw, 68px);
  --fs-mega: clamp(64px, 14vw, 240px);

  /* Space & layout */
  --g: clamp(18px, 4vw, 64px);          /* page gutter */
  --section: clamp(48px, 6vw, 96px);    /* vertical section rhythm (tightened in phase 1C) */
  --max: 1520px;
  --announce-h: 34px;
  --header-h: 64px;
  --header-h-compact: 56px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.3s;
  --t: 0.6s;
  --t-slow: 1.2s;

  /* Layers */
  --z-header: 50;
  --z-drawer: 80;
  --z-toast: 90;

  /* Direction. Layout uses logical properties (inline-start/end) and mirrors by
     itself; these cover the few physical values left: transforms and origins. */
  --dirx: 1;              /* +1 in Hebrew (RTL), −1 in English (LTR) — multiply X movement */
  --start-side: right;    /* physical side where a line of text starts */
}

:root[dir="ltr"] {
  --dirx: -1;
  --start-side: left;
}

/* English (British) typography: Cormorant Garamond carries the display type
   (Frank Ruhl Libre is a Hebrew face); Assistant stays for body text. */
:root:lang(en) {
  --f-serif: "Cormorant Garamond", "Times New Roman", serif;
  --f-latin: "Cormorant Garamond", "Times New Roman", serif;
}

/* ---- base.css ---- */
/* ==========================================================================
   SAKANA — base: reset, typography, buttons, links, motion primitives.
   RTL-first: logical properties only.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable; /* no layout jump when dialogs/drawers lock scrolling */
  overflow-anchor: none;
  touch-action: manipulation; /* no double-tap-zoom heuristics: quick successive taps all register (iOS) */    /* header compaction must not nudge scroll; keeps scroll restoration exact (Safari never anchors either) */
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: var(--fs-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
em { font-style: normal; color: var(--accent); }
s { text-decoration-thickness: 1px; }

::selection { background: var(--accent); color: var(--cream); }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; inset-inline-start: 8px; inset-block-start: -80px; z-index: 100;
  background: var(--ink); color: var(--cream); padding: 10px 16px;
}
.skip:focus { inset-block-start: 8px; }

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

.latin { font-family: var(--f-latin); font-style: italic; letter-spacing: 0.02em; }
/* Icons drawn for RTL (back/next arrows) point the other way on English pages. */
[dir="ltr"] .icon--dir { scale: -1 1; }
.kicker { font-size: var(--fs-xs); letter-spacing: 0.08em; color: var(--soft); }
.kicker .latin { font-size: 16px; color: var(--accent); margin-inline-end: 4px; }
/* English kickers: small, spaced capitals — the editorial convention in Latin type. */
:lang(en) .kicker { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; }
:lang(en) .kicker .latin { text-transform: none; letter-spacing: 0.02em; }

.display, .h1, .h2, .h3 { font-family: var(--f-serif); font-weight: 300; letter-spacing: -0.01em; }
.h1 { font-size: var(--fs-h1); line-height: 1.04; }
.h2 { font-size: var(--fs-h2); line-height: 1.08; }
.h3 { font-size: var(--fs-h3); line-height: 1.25; font-weight: 400; }
.mega { font-family: var(--f-serif); font-weight: 300; font-size: var(--fs-mega); line-height: 0.92; letter-spacing: -0.02em; }
.lede { font-size: var(--fs-lg); color: var(--soft); max-inline-size: 42ch; }

/* --------------------------------------------------------------------------
   Placeholder content — deliberately visible so it is never mistaken for real
   copy. Search the codebase for `ph-` to find every placeholder.
   -------------------------------------------------------------------------- */

.ph {
  color: var(--soft);
  text-decoration: underline dotted var(--accent);
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
.ph-block {
  position: relative;
  border-inline-start: 2px solid var(--accent);
  padding-inline-start: 18px;
  color: var(--soft);
}
.ph-block::before {
  content: "טקסט זמני";
  display: block;
  font-family: var(--f-sans); font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  color: var(--accent);
  margin-block-end: 6px;
}
.ph-block[data-label]::before { content: attr(data-label); }

/* --------------------------------------------------------------------------
   Buttons & links
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-block-size: 52px;
  padding: 14px 30px;
  background: var(--ink); color: var(--cream);
  border: 1px solid var(--ink); border-radius: 0;
  font-family: var(--f-sans); font-weight: 600; font-size: var(--fs-sm); letter-spacing: 0.03em;
  text-align: center;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}
@media (hover: hover) { .btn:hover { background: var(--accent); border-color: var(--accent); } }
.btn--ghost { background: transparent; color: var(--ink); }
@media (hover: hover) { .btn--ghost:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); } }
.btn--light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
@media (hover: hover) { .btn--light:hover { background: var(--accent); border-color: var(--accent); color: var(--cream); } }
.btn--block { display: flex; inline-size: 100%; }
.btn:active:not([disabled]) { opacity: 0.85; } /* touch feedback (hover styles are mouse-only) */
@media (hover: none) {
  .icon-btn:active, .chip:active, .opt:active:not(.is-out), .text-link:active, .lang__opt:active,
  .mnav__row:active, .pcard__ql:active, .stepper button:active:not(:disabled), .acc summary:active { opacity: 0.6; }
}
.btn[disabled], .btn[aria-disabled="true"] {
  background: transparent; color: var(--soft); border-color: var(--line); cursor: not-allowed;
}

.text-link {
  font-weight: 600; font-size: var(--fs-sm);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 7px;
  text-decoration-color: var(--line);
  transition: text-decoration-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
@media (hover: hover) { .text-link:hover { color: var(--accent); text-decoration-color: var(--accent); } }
button.text-link { background: none; border: 0; padding: 0; min-block-size: 44px; }

.icon-btn {
  display: inline-grid; place-items: center;
  min-inline-size: 44px; min-block-size: 44px;
  background: none; border: 0; padding: 0;
}

/* --------------------------------------------------------------------------
   Images (placeholder registry hydrates img[data-ph])
   -------------------------------------------------------------------------- */

img[data-ph] { opacity: 0; transition: opacity 1s var(--ease), transform 1.6s var(--ease); background: var(--paper-2); }
img[data-ph].is-loaded { opacity: 1; }
img[data-ph].is-broken { opacity: 0 !important; } /* failed load: show the neutral frame, not the browser's icon */
.frame { position: relative; overflow: hidden; background: var(--paper-2); }
.frame > img { inline-size: 100%; block-size: 100%; object-fit: cover; }

/* --------------------------------------------------------------------------
   Reveal on scroll — only elements JS marked .is-pending (below the fold) start
   hidden, so without JS (or with reduced motion) everything is simply visible.
   Opacity/transform only: no layout shift.
   -------------------------------------------------------------------------- */

[data-reveal]:not([data-reveal="img"]).is-pending { opacity: 0; transform: translateY(14px); }
[data-reveal]:not([data-reveal="img"]).is-in {
  transition: opacity 0.65s var(--ease), transform 0.8s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 70ms);
}
[data-reveal="img"] { overflow: hidden; }
[data-reveal="img"].is-pending { opacity: 0; }
[data-reveal="img"].is-pending img { transform: scale(1.06); }
[data-reveal="img"].is-in { transition: opacity 0.7s var(--ease); transition-delay: calc(var(--d, 0) * 70ms); }
[data-reveal="img"].is-in img { transition: opacity 0.8s var(--ease), transform 1.5s var(--ease-out); }
[data-reveal].is-instant, [data-reveal].is-instant img { transition: none; }

/* Cross-page transitions (progressive: browsers without support just navigate) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 0.28s var(--ease) both vt-out; }
::view-transition-new(root) { animation: 0.45s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  /* Only undo the reveal's own hidden state — never touch other images (e.g. a card's hover photo). */
  [data-reveal].is-pending, [data-reveal="img"].is-pending img { opacity: 1 !important; transform: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

/* Shown until JS renders a page that is built client-side (e.g. product page) */
.page-loading { min-block-size: 60vh; display: grid; place-items: center; color: var(--soft); font-size: var(--fs-sm); }

/* ---- layout.css ---- */
/* ==========================================================================
   SAKANA — site chrome: announcement, header + dropdowns, drawers
   (nested mobile menu, mini cart), footer, toast, page heads.
   ========================================================================== */

.icon { display: block; flex: none; }

/* Announcement ------------------------------------------------------------ */

.announce {
  position: relative; block-size: var(--announce-h); overflow: hidden;
  background: var(--accent); color: var(--cream);
  font-size: var(--fs-xs); letter-spacing: 0.04em;
}
.announce__msg {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding-inline: 16px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.announce__msg.is-on { opacity: 1; transform: none; }

/* Until layout.js inserts the announcement + header above <main>, keep exactly their
   space (34 + 64 + the header's 1px border), so the first paint doesn't move (audit F-01). */
.js body:not(.has-chrome) { padding-block-start: calc(var(--announce-h) + var(--header-h) + 1px); }

/* Header ------------------------------------------------------------------ */

.header {
  position: sticky; inset-block-start: 0; z-index: var(--z-header);
  background: var(--paper);
  border-block-end: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.header.is-scrolled, .header.has-mega { border-block-end-color: var(--line); }
.header__inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  block-size: var(--header-h); padding-inline: calc(var(--g) - 10px);
  transition: block-size 0.3s var(--ease);
}
.header.is-scrolled .header__inner { block-size: var(--header-h-compact); }

.header__start { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 0; min-inline-size: 0; }
.wordmark {
  grid-column: 2; grid-row: 1;
  font-family: var(--f-latin); font-weight: 500;
  font-size: 20px; letter-spacing: 0.3em; padding-inline-start: 0.3em; /* balances tracking */
  line-height: 1; white-space: nowrap;
}
.header__util { grid-column: 3; grid-row: 1; display: flex; justify-content: flex-end; align-items: center; gap: 0; }

.icon-btn { color: inherit; transition: color var(--t-fast); position: relative; }
@media (hover: hover) { .icon-btn:hover { color: var(--accent); } }
.hicon__count {
  position: absolute; inset-block-start: 5px; inset-inline-start: 2px;
  min-inline-size: 17px; block-size: 17px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--cream);
  font-size: 11px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums;
}
[dir="ltr"] .hicon__count { inset-inline: auto 2px; } /* badge sits top-right in both languages */
.hicon__count.bump, .mnav__count.bump { animation: bump 0.6s var(--ease); }
@keyframes bump { 40% { transform: translateY(-3px) scale(1.12); } }
.hicon[aria-current] { color: var(--accent); }

.header__nav { display: none; }
.header__search-lg { display: none; }

@media (min-width: 960px) {
  .header__inner { padding-inline: var(--g); }
  .header__menu, .header__search-sm { display: none; }
  .header__search-lg { display: inline-grid; }
  .header__nav { display: block; }
  .wordmark { font-size: 26px; letter-spacing: 0.4em; padding-inline-start: 0.4em; }
}

/* Desktop nav + dropdowns ------------------------------------------------- */

.nav { display: flex; align-items: center; gap: 28px; }
@media (max-width: 1099px) { .nav { gap: 16px; } } /* 960–1099px: English labels are longer — keep clear of the wordmark */
.nav__link {
  position: relative; display: inline-flex; align-items: center; gap: 4px;
  min-block-size: 44px; padding: 0; background: none; border: 0;
  font-size: var(--fs-sm); white-space: nowrap; transition: color var(--t-fast);
}
.nav__link::after {
  content: ""; position: absolute; inset-inline: 0; inset-block-end: 8px; block-size: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: var(--start-side);
  transition: transform 0.45s var(--ease);
}
.nav__link[aria-current], .nav__link[data-current], .nav__trigger[aria-expanded="true"] { color: var(--accent); }
@media (hover: hover) { .nav__link:hover { color: var(--accent); } }
.nav__link[aria-current]::after, .nav__link[data-current]::after, .nav__trigger[aria-expanded="true"]::after { transform: scaleX(1); }
@media (hover: hover) { .nav__link:hover::after { transform: scaleX(1); } }
.nav__trigger .icon { transition: transform 0.3s var(--ease); }
.nav__trigger[aria-expanded="true"] .icon { transform: rotate(180deg); }

.megamenu {
  position: absolute; inset-inline: 0; inset-block-start: 100%;
  background: var(--paper); border-block: 1px solid var(--line);
  box-shadow: 0 18px 30px -24px rgba(42, 35, 32, 0.35);
  animation: mega-in 0.32s var(--ease-out);
}
@keyframes mega-in { from { opacity: 0; transform: translateY(-6px); } }
.megamenu__inner {
  max-inline-size: var(--max); margin-inline: auto;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 220px; gap: 32px;
  padding: 28px var(--g) 32px;
}
.megamenu__title { font-size: var(--fs-xs); letter-spacing: 0.08em; color: var(--soft); margin-block-end: 10px; }
.megamenu__group a { display: inline-block; padding-block: 5px; font-family: var(--f-serif); font-size: 19px; transition: color var(--t-fast); }
@media (hover: hover) { .megamenu__group a:hover { color: var(--accent); } }
.megamenu__promo { display: grid; gap: 4px; }
.megamenu__promo-img { aspect-ratio: 4 / 3; margin-block-end: 6px; }
.megamenu__promo-title { font-family: var(--f-serif); font-size: 19px; }
.megamenu__promo-text { font-size: 14px; color: var(--soft); }
@media (hover: hover) { .megamenu__promo:hover .megamenu__promo-title { color: var(--accent); } }

.megamenu__inner--vibes { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; }
.vibe-link { display: grid; gap: 2px; }
.vibe-link__img { aspect-ratio: 4 / 3; margin-block-end: 8px; }
.vibe-link__img img { transition: transform 1.2s var(--ease); }
@media (hover: hover) { .vibe-link:hover .vibe-link__img img { transform: scale(1.04); } }
.vibe-link__label { font-family: var(--f-serif); font-size: 19px; transition: color var(--t-fast); }
@media (hover: hover) { .vibe-link:hover .vibe-link__label { color: var(--accent); } }
.vibe-link__tag { font-size: 13px; color: var(--soft); line-height: 1.45; }
.megamenu__all { grid-column: 1 / -1; justify-self: start; }

/* Drawers (nav = start side, cart = end side) --------------------------------- */

.drawer { position: fixed; inset: 0; z-index: var(--z-drawer); }
.drawer[hidden] { display: none; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(42, 35, 32, 0.38); opacity: 0; transition: opacity 0.4s var(--ease); }
.drawer__panel {
  position: absolute; inset-block: 0; inline-size: min(420px, 92vw);
  background: var(--paper); display: flex; flex-direction: column;
  transition: transform 0.45s var(--ease-out);
}
.drawer--start .drawer__panel { inset-inline-start: 0; transform: translateX(calc(100% * var(--dirx))); }
.drawer--end .drawer__panel { inset-inline-end: 0; transform: translateX(calc(-100% * var(--dirx))); }
.drawer.is-open .drawer__scrim { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-block-size: var(--header-h); padding-inline: 20px 10px;
  border-block-end: 1px solid var(--line);
}
.drawer__head .wordmark { font-size: 18px; }
.drawer__title { font-family: var(--f-serif); font-weight: 400; font-size: 22px; }
.drawer__foot {
  display: flex; flex-wrap: wrap; gap: 0 18px; padding: 12px 20px 20px;
  border-block-start: 1px solid var(--line); color: var(--soft); font-size: 14px;
}
.drawer__foot a { min-block-size: 40px; display: inline-flex; align-items: center; }

/* Nested mobile menu */
.mnav { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.mnav__panel { padding: 8px 20px 24px; animation: mnav-in 0.32s var(--ease-out); }
.mnav__panel.is-back { animation-name: mnav-back; }
@keyframes mnav-in { from { opacity: 0; transform: translateX(calc(-24px * var(--dirx))); } }
@keyframes mnav-back { from { opacity: 0; transform: translateX(calc(24px * var(--dirx))); } }
.mnav__list { border-block-end: 1px solid var(--line); }
.mnav__row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  inline-size: 100%; min-block-size: 58px; padding: 0;
  background: none; border: 0; border-block-end: 1px solid var(--line);
  font-family: var(--f-serif); font-weight: 300; font-size: 25px; text-align: start;
}
.mnav__list li:last-child .mnav__row { border-block-end: 0; }
@media (hover: hover) { .mnav__row:hover { color: var(--accent); } }
.mnav__count { font-family: var(--f-sans); font-size: 13px; background: var(--accent); color: var(--cream); padding: 1px 7px; margin-inline-start: auto; }
.mnav__quick { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 18px 0; }
.mnav__quick a { display: inline-flex; align-items: center; min-block-size: 40px; padding: 0 14px; border: 1px solid var(--line); font-size: 14px; }
.mnav__back {
  display: inline-flex; align-items: center; gap: 6px; min-block-size: 44px; padding: 0;
  background: none; border: 0; font-size: 14px; font-weight: 600; color: var(--soft);
}
@media (hover: hover) { .mnav__back:hover { color: var(--accent); } }
.mnav__title { font-family: var(--f-serif); font-weight: 300; font-size: 30px; margin-block: 4px 10px; }
.mnav__group { padding-block: 12px; border-block-start: 1px solid var(--line); }
.mnav__group-title { font-size: 12px; letter-spacing: 0.1em; color: var(--soft); margin-block-end: 2px; }
.mnav__group a { display: flex; align-items: center; min-block-size: 44px; font-size: 18px; }
@media (hover: hover) { .mnav__group a:hover { color: var(--accent); } }
.mnav__vibes { display: grid; gap: 4px; margin-block-end: 16px; }
.mnav__vibes a { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; padding-block: 6px; }
.mnav__vibes .frame { aspect-ratio: 1; }
.mnav__vibes strong { display: block; font-family: var(--f-serif); font-weight: 400; font-size: 19px; }
.mnav__vibes small { display: block; font-size: 13px; color: var(--soft); line-height: 1.4; }
@media (hover: hover) { .mnav__vibes a:hover strong { color: var(--accent); } }

/* Cart drawer body */
.mini-cart-body { flex: 1; min-block-size: 0; display: flex; flex-direction: column; }
.mini-cart { flex: 1; overflow-y: auto; padding: 4px 20px; }
.mini-cart__foot { padding: 16px 20px 20px; border-block-start: 1px solid var(--line); display: grid; gap: 10px; background: var(--cream); }
.mini-cart__foot .btn { min-block-size: 48px; }
.mini-cart__empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; padding: 24px; }
.mini-cart__empty p { font-family: var(--f-serif); font-weight: 300; font-size: 28px; line-height: 1.2; }

/* Footer -------------------------------------------------------------------- */

.footer { background: var(--paper-2); padding: 56px var(--g) 24px; overflow: hidden; margin-block-start: var(--section); }
.footer__top { display: grid; gap: 40px; }
.footer__letter { display: grid; gap: 8px; justify-items: start; max-inline-size: 460px; }
.footer__letter h2 { font-family: var(--f-serif); font-weight: 300; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.2; }
.letter-form { display: flex; inline-size: 100%; border-block-end: 1px solid var(--ink); margin-block-start: 8px; }
.letter-form input { flex: 1; min-inline-size: 0; border: 0; background: transparent; padding: 10px 2px; min-block-size: 46px; }
.letter-form input::placeholder { color: var(--soft); }
.letter-form input:focus-visible { outline: none; }
.letter-form:focus-within { border-color: var(--accent); }
.letter-form button { border: 0; background: none; font-weight: 600; padding: 10px 2px; transition: color var(--t-fast); }
@media (hover: hover) { .letter-form button:hover { color: var(--accent); } }
.letter-msg { min-block-size: 1.5em; font-size: 14px; color: var(--accent); }

.footer__nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
.footer__nav div { display: grid; gap: 0; align-content: start; justify-items: start; }
.footer__nav h3 { font-family: var(--f-serif); font-weight: 400; font-size: 17px; margin-block-end: 4px; }
.footer__nav a { font-size: var(--fs-sm); color: var(--soft); transition: color var(--t-fast); min-block-size: 34px; display: inline-flex; align-items: center; }
@media (hover: hover) { .footer__nav a:hover { color: var(--accent); } }

.footer__mark {
  font-family: var(--f-latin); font-weight: 400;
  font-size: 15vw; letter-spacing: 0.18em; padding-inline-start: 0.18em;
  text-align: center; line-height: 1; margin-block: 44px 20px;
  user-select: none;
}
.footer__base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  font-size: var(--fs-xs); color: var(--soft);
  padding-block-start: 16px; border-block-start: 1px solid var(--line);
}
.credits summary { list-style: none; cursor: pointer; min-block-size: 44px; display: flex; align-items: center; gap: 6px; }
.credits summary::-webkit-details-marker { display: none; }
.credits summary::before { content: "+"; font-size: 15px; }
.credits[open] summary::before { content: "−"; }
.credits li a { display: inline-block; padding-block: 6px; }
.credits p { margin-block: 8px 4px; max-inline-size: 64ch; }
.credits ul { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.credits a { text-decoration: underline; }

@media (min-width: 960px) {
  .footer__top { grid-template-columns: 4fr 8fr; gap: 6vw; }
  .footer__nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer__mark { font-size: 10vw; }
}

/* Toast --------------------------------------------------------------------- */

.toast {
  position: fixed; inset-block-end: 20px; inset-inline: 16px; margin-inline: auto; z-index: var(--z-toast);
  inline-size: fit-content; max-inline-size: calc(100vw - 32px); /* centred in either direction */
  transform: translateY(16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--cream); padding: 12px 20px; font-size: 14px;
  text-align: center;
  transition: opacity 0.35s var(--ease), transform 0.45s var(--ease);
}
.toast.is-on { opacity: 1; transform: none; }

/* Page shell --------------------------------------------------------------- */

main { display: block; }
.page-head { padding: clamp(28px, 4vw, 56px) var(--g) clamp(24px, 3vw, 40px); }
.page-head--compact { padding-block: clamp(20px, 3vw, 40px) clamp(16px, 2.4vw, 28px); }
.page-head .h1 { margin-block-start: 8px; }
.page-head .lede { margin-block-start: 10px; }
.page-head .kicker { margin-block-start: 12px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: var(--fs-xs); color: var(--soft); }
@media (hover: hover) { .crumbs a:hover { color: var(--accent); } }
.crumbs li + li::before { content: "/"; margin-inline-end: 8px; color: var(--line); }

/* Very narrow phones (≤ 359px): keep wordmark and four icons on one line */
@media (max-width: 359px) {
  .header__inner { padding-inline: 4px; }
  .header .icon-btn { min-inline-size: 38px; }
  .wordmark { font-size: 16px; letter-spacing: 0.2em; padding-inline-start: 0.2em; }
}

.drawer__panel:focus { outline: none; }

/* Language switch ("עברית | English") ---------------------------------------
   Desktop: in the header. Phones: in the menu drawer and the footer. */

.lang { display: inline-flex; align-items: center; font-size: 13px; white-space: nowrap; }
.lang__opt {
  display: inline-flex; align-items: center; min-block-size: 44px; padding-inline: 6px;
  font-family: var(--f-sans); color: var(--soft); transition: color var(--t-fast);
}
.lang__opt[aria-current] { color: var(--ink); font-weight: 600; }
@media (hover: hover) { .lang__opt:not([aria-current]):hover { color: var(--accent); } }
.lang__sep { color: var(--line); }
.lang--header { display: none; margin-inline-end: 10px; }
@media (min-width: 960px) { .lang--header { display: inline-flex; } }
.lang--menu { margin-block-start: 14px; margin-inline-start: -6px; font-size: 15px; }
.lang--footer { margin-inline-start: -6px; }
.lang--footer .lang__opt { min-block-size: 44px; }

/* TEMPORARY (Phase 1H): the To Do List header link only fits from 1280px; below that it is in the menu and footer. Remove at launch. */
.nav__item--wide { display: none; }
@media (min-width: 1280px) { .nav__item--wide { display: list-item; } }

/* ---- components.css ---- */
/* ==========================================================================
   SAKANA — reusable components: section heads, product cards, badges,
   forms, stepper, options, accordion, empty states, cart lines.
   ========================================================================== */

/* Section head ------------------------------------------------------------- */

.sec-head { display: grid; gap: 6px; padding-inline: var(--g); margin-block-end: 24px; justify-items: start; }
.sec-head h2 { font-family: var(--f-serif); font-weight: 300; font-size: var(--fs-h2); line-height: 1.1; }
.sec-head--row { grid-template-columns: 1fr auto; align-items: baseline; }
.sec-head--row > .text-link { justify-self: end; }
@media (min-width: 960px) {
  .sec-head:not(.sec-head--center):not(.sec-head--row) { grid-template-columns: 1fr auto; align-items: end; }
  .sec-head:not(.sec-head--center):not(.sec-head--row) > :not(.text-link) { grid-column: 1; }
  .sec-head:not(.sec-head--center):not(.sec-head--row) > .text-link { grid-column: 2; grid-row: 1 / 4; align-self: end; }
}

/* Badges --------------------------------------------------------------------- */

.badge {
  display: inline-block; padding: 3px 9px;
  background: var(--cream); color: var(--accent);
  font-size: 12px; letter-spacing: 0.04em; font-weight: 600; line-height: 1.4;
}
.badge--muted { color: var(--soft); }
.badge--sample { background: transparent; border: 1px dashed var(--accent); color: var(--accent); }

/* Buttons: small variant --------------------------------------------------- */

.btn--sm { min-block-size: 40px; padding: 8px 16px; font-size: 14px; }

/* Product grid & card ------------------------------------------------------ */

.pgrid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 12px; padding-inline: var(--g);
}
@media (min-width: 720px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 18px; } }
@media (min-width: 1100px) { .pgrid, .pgrid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 20px; } }

.pcard { position: relative; display: grid; align-content: start; gap: 10px; }
.pcard__media { aspect-ratio: 4 / 5; display: block; }
.pcard__media img {
  position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover;
  transition: opacity 0.7s var(--ease), transform 1.2s var(--ease);
}
.pcard__media img + img, .pcard__media img + img.is-loaded { opacity: 0; }
.pcard__media .badge { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; z-index: 2; }
.pcard__body { display: grid; gap: 1px; }
.pcard__link { color: inherit; }
/* Whole card is clickable; buttons below sit above this layer. */
.pcard__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pcard__link:focus-visible { outline: none; }
.pcard__link:focus-visible::after { outline: 1.5px solid var(--accent); outline-offset: 4px; }
.pcard__title { font-family: var(--f-serif); font-weight: 400; font-size: 17px; line-height: 1.3; transition: color var(--t-fast); }
.pcard__meta { font-size: 13px; color: var(--soft); }
.pcard__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-block-start: 2px; }
.pcard__price { font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.pcard__avail { font-size: 12px; color: var(--accent); }
.pcard__avail--sold-out { color: var(--soft); }
.pcard.is-sold .pcard__media img { opacity: 0.55; filter: saturate(0.3); }
.pcard.is-sold .pcard__price { color: var(--soft); font-weight: 400; }

/* Card buttons */
.fav {
  display: grid; place-items: center; inline-size: 40px; block-size: 40px; padding: 0;
  background: rgba(251, 248, 243, 0.92); border: 0; color: var(--ink);
  transition: color var(--t-fast), background var(--t-fast), transform 0.3s var(--ease);
}
@media (hover: hover) { .fav:hover { color: var(--accent); } }
.fav[aria-pressed="true"] { color: var(--accent); }
.fav[aria-pressed="true"] .icon { fill: currentColor; }
.fav:active { transform: scale(0.9); }
.pcard__fav { position: absolute; inset-block-start: 6px; inset-inline-end: 6px; z-index: 2; }
.fav--inline { background: transparent; inline-size: 44px; block-size: 44px; flex: none; }
/* Card heart / Quick Look are drawn small; their touch area is 44px. */
.pcard__fav::before, .pcard__ql::before { content: ""; position: absolute; inset: -4px; }

.pcard__ql {
  position: absolute; inset-block-end: 6px; inset-inline-end: 6px; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-inline-size: 40px; block-size: 40px; padding: 0 10px;
  background: rgba(251, 248, 243, 0.92); border: 0; font-size: 13px; font-weight: 600;
  transition: background var(--t-fast), color var(--t-fast);
}
.pcard__ql span { display: none; }
@media (hover: hover) { .pcard__ql:hover { background: var(--ink); color: var(--cream); } }
@media (hover: hover) and (min-width: 720px) {
  .pcard__ql { inset-inline: 8px; inset-block-end: 8px; opacity: 0; transform: translateY(6px); transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background var(--t-fast), color var(--t-fast); }
  .pcard__ql span { display: inline; }
  .pcard:hover .pcard__ql, .pcard__ql:focus-visible { opacity: 1; transform: none; }
  .pcard:hover .pcard__media img + img.is-loaded { opacity: 1; }
  .pcard:hover .pcard__media img { transform: scale(1.03); }
  .pcard:hover .pcard__title { color: var(--accent); }
}

.pcard__actions { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.pcard__actions .text-link { min-block-size: 40px; font-size: 14px; }

/* Compact card (recently viewed strip) */
.pcard--compact { gap: 6px; }
.pcard--compact .pcard__title { font-size: 14px; }
.pcard--compact .pcard__price { font-size: 13px; }
.pcard--compact .fav { inline-size: 34px; block-size: 34px; }
.pcard--compact .fav .icon { inline-size: 17px; block-size: 17px; }

/* Horizontal strip (recently viewed) */
.recent { padding-block: var(--section) 0; }
.strip__head { display: flex; justify-content: space-between; align-items: baseline; padding-inline: var(--g); margin-block-end: 14px; }
.strip__head h2 { font-family: var(--f-serif); font-weight: 400; font-size: 22px; }
.strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: 34vw; gap: 12px;
  overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--g);
  padding-inline: var(--g); padding-block-end: 6px; scrollbar-width: thin;
}
.strip > li { scroll-snap-align: start; }
@media (min-width: 720px) { .strip { grid-auto-columns: 150px; } }

/* Forms -------------------------------------------------------------------- */

.field { display: grid; gap: 6px; }
.field label, .field .label { font-size: 14px; font-weight: 600; }
.field .hint { font-size: 13px; color: var(--soft); }
.input, .select, .textarea {
  inline-size: 100%; min-block-size: 50px;
  padding: 12px 14px;
  /* Field boundary: the lightest tone between --line and --soft that reaches 3:1 against the
     paper/cream around it (WCAG 1.4.11, audit F-05). --line stays for dividers. */
  background: var(--cream); border: 1px solid #93877c; border-radius: 0;
  transition: border-color var(--t-fast);
}
.textarea { min-block-size: 160px; resize: vertical; line-height: 1.6; }
@media (hover: hover) { .input:hover, .select:hover, .textarea:hover { border-color: var(--soft); } }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.select {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: 18px 50%, 23px 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-inline-start: 14px; padding-inline-end: 40px; /* chevron sits at the inline end (left in RTL) */
}
[dir="ltr"] .select { background-position: right 23px center, right 18px center; }

.check { display: flex; align-items: center; gap: 12px; min-block-size: 40px; cursor: pointer; font-size: var(--fs-sm); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box {
  inline-size: 18px; block-size: 18px; flex: none; border: 1px solid var(--ink);
  display: grid; place-items: center; transition: background var(--t-fast);
}
.check__box::after { content: ""; inline-size: 8px; block-size: 8px; background: var(--cream); transform: scale(0); transition: transform 0.25s var(--ease); }
.check input:checked + .check__box { background: var(--ink); }
.check input:checked + .check__box::after { transform: scale(1); }
.check input:focus-visible + .check__box { outline: 1.5px solid var(--accent); outline-offset: 3px; }
.check__count { color: var(--soft); font-size: 13px; margin-inline-start: auto; }
.check:has(input:disabled) { opacity: 0.4; cursor: default; }

/* Option buttons (sizes, lengths) ------------------------------------------- */

.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  position: relative; min-inline-size: 56px; min-block-size: 48px; padding: 10px 16px;
  background: transparent; border: 1px solid var(--line);
  font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
@media (hover: hover) { .opt:hover { border-color: var(--ink); } }
.opt[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.opt.is-out { color: var(--soft); background: linear-gradient(to top left, transparent calc(50% - 0.5px), var(--line) 50%, transparent calc(50% + 0.5px)); }
.opt.is-out[aria-pressed="true"] { background: var(--paper-2); color: var(--soft); border-color: var(--soft); }

/* Quantity stepper ---------------------------------------------------------- */

.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); background: var(--cream); }
.stepper button { inline-size: 44px; min-block-size: 44px; background: none; border: 0; font-size: 18px; line-height: 1; }
@media (hover: hover) { .stepper button:hover:not(:disabled) { color: var(--accent); } }
.stepper button:disabled { color: var(--line); cursor: not-allowed; }
.stepper output, .stepper span {
  min-inline-size: 36px; display: grid; place-items: center;
  font-variant-numeric: tabular-nums; font-size: var(--fs-sm);
}

/* Accordion (details/summary) ---------------------------------------------- */

.acc { border-block-start: 1px solid var(--line); }
.acc details { border-block-end: 1px solid var(--line); }
.acc summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-block-size: 60px; padding-block: 14px;
  font-family: var(--f-serif); font-size: 19px; font-weight: 400;
  transition: color var(--t-fast);
}
.acc summary::-webkit-details-marker { display: none; }
@media (hover: hover) { .acc summary:hover { color: var(--accent); } }
.acc summary::after {
  content: ""; flex: none; inline-size: 12px; block-size: 12px;
  background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat,
              linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat;
  transition: transform 0.4s var(--ease);
}
.acc details[open] summary::after { transform: rotate(45deg); }
.acc__body { padding-block: 0 22px; color: var(--soft); max-inline-size: 64ch; }
.acc__body > * + * { margin-block-start: 0.8em; }
.acc details[open] .acc__body { animation: acc-in 0.5s var(--ease); }
@keyframes acc-in { from { opacity: 0; transform: translateY(-6px); } }

/* Empty state ------------------------------------------------------------------- */

.empty {
  display: grid; justify-items: center; gap: 18px; text-align: center;
  padding: clamp(56px, 10vw, 140px) var(--g);
}
.empty__mark { font-family: var(--f-latin); font-style: italic; font-size: 22px; color: var(--accent); }
.empty h2, .empty h3 { font-family: var(--f-serif); font-weight: 300; font-size: clamp(30px, 4vw, 52px); line-height: 1.15; max-inline-size: 18ch; }
.empty p { color: var(--soft); max-inline-size: 40ch; }

/* Cart line ------------------------------------------------------------------- */

.cline {
  display: grid; grid-template-columns: 88px 1fr; gap: 16px;
  padding-block: 20px; border-block-end: 1px solid var(--line);
}
.cline:last-child { border-block-end: 0; }
.cline__img { aspect-ratio: 4 / 5; }
.cline__info { display: grid; gap: 4px; align-content: start; }
.cline__title { font-family: var(--f-serif); font-size: 18px; line-height: 1.3; }
@media (hover: hover) { .cline__title a:hover { color: var(--accent); } }
.cline__meta { font-size: 14px; color: var(--soft); }
.cline__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-block-start: 10px; }
.cline__price { font-variant-numeric: tabular-nums; }
.cline__remove { background: none; border: 0; padding: 8px 0; min-block-size: 40px; font-size: 13px; color: var(--soft); text-decoration: underline; text-underline-offset: 4px; }
@media (hover: hover) { .cline__remove:hover { color: var(--accent); } }
.cline__note { font-size: 13px; color: var(--accent); }

.sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.sum-row--total { font-family: var(--f-serif); font-size: 22px; }
.sum-note { font-size: 13px; color: var(--soft); }
.checkout-note {
  font-size: 13px; color: var(--accent); line-height: 1.55;
  border: 1px dashed var(--accent); padding: 10px 12px; background: transparent;
}

/* Dialog ---------------------------------------------------------------------- */

.dialog { border: 0; padding: 0; background: var(--paper); color: var(--ink); max-inline-size: min(520px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(42, 35, 32, 0.45); }
.dialog__inner { padding: 36px 32px 28px; display: grid; gap: 16px; }
.dialog h2 { font-family: var(--f-serif); font-weight: 300; font-size: 30px; line-height: 1.2; }
.dialog p { color: var(--soft); }
.dialog[open] { animation: dialog-in 0.45s var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px); } }

/* Pill-free chips for active filters ------------------------------------------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-block-size: 36px; padding: 6px 12px;
  background: var(--cream); border: 1px solid var(--line); font-size: 14px;
}
@media (hover: hover) { .chip:hover { border-color: var(--accent); color: var(--accent); } }
.chip span[aria-hidden] { font-size: 16px; line-height: 1; }

/* ==========================================================================
   Shared product UI (product page + Quick Look)
   ========================================================================== */

/* Gallery ---------------------------------------------------------------------- */

.gallery { display: grid; gap: 10px; min-inline-size: 0; }
.gallery__main { position: relative; }
.gallery__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; aspect-ratio: 1 / 1; background: var(--paper-2);
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track:focus-visible { outline-offset: -3px; }
.gallery__slide { scroll-snap-align: start; position: relative; overflow: hidden; margin: 0; }
.gallery__slide img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.gallery__slide.is-sold img { opacity: 0.6; filter: saturate(0.35); }
.gallery__count {
  position: absolute; inset-block-end: 10px; inset-inline-start: 10px; z-index: 1;
  font-family: var(--f-latin); font-style: italic; font-size: 16px;
  background: rgba(251, 248, 243, 0.9); padding: 1px 9px; pointer-events: none;
}
.gallery__arrows { display: flex; position: absolute; inset-block-end: 8px; inset-inline-end: 8px; gap: 2px; z-index: 1; }
.gallery__arrows button {
  display: grid; place-items: center; inline-size: 40px; block-size: 40px; border: 0;
  background: rgba(251, 248, 243, 0.9); transition: background var(--t-fast), color var(--t-fast);
}
@media (hover: hover) { .gallery__arrows button:hover:not(:disabled) { background: var(--ink); color: var(--cream); } }
.gallery__arrows button:disabled { color: var(--line); cursor: default; }

.gallery__thumbs { order: 2; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-block-end: 4px; }
.gallery__thumbs button {
  flex: none; inline-size: 56px; aspect-ratio: 1; padding: 0; border: 1px solid transparent;
  background: var(--paper-2); opacity: 0.6; transition: opacity var(--t-fast), border-color var(--t-fast);
}
.gallery__thumbs button[aria-current="true"] { opacity: 1; border-color: var(--accent); }
@media (hover: hover) { .gallery__thumbs button:hover { opacity: 1; } }
.gallery__thumbs img { inline-size: 100%; block-size: 100%; object-fit: cover; }

/* Product info bits ---------------------------------------------------------- */

.pdp__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pdp__badges:empty { display: none; }
.pdp__meta { color: var(--soft); font-size: var(--fs-sm); }
.pdp__price { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pdp__price s { color: var(--soft); font-size: 18px; font-weight: 400; }

/* Buy box ----------------------------------------------------------------------- */

.buy { display: grid; gap: 16px; padding-block: 18px; border-block: 1px solid var(--line); }
.buy fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.buy legend { padding: 0; margin-block-end: 8px; font-size: 14px; font-weight: 600; display: flex; gap: 8px; inline-size: 100%; }
.buy legend [data-selected] { font-weight: 400; color: var(--soft); }
.buy legend a { margin-inline-start: auto; padding-block: 10px; font-weight: 400; font-size: 13px; color: var(--soft); text-decoration: underline; text-underline-offset: 4px; }
@media (hover: hover) { .buy legend a:hover { color: var(--accent); } }
.buy__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.buy__qty-label { font-size: 14px; font-weight: 600; }
.buy__error { font-size: 14px; color: var(--accent); min-block-size: 0; }
.buy__error:empty { display: none; }
.buy .opt { min-inline-size: 52px; min-block-size: 44px; }

.avail { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.avail i { inline-size: 7px; block-size: 7px; border-radius: 50%; background: #4f6b4a; flex: none; }
.avail--low i, .avail--unique i { background: var(--accent); }
.avail--out i { background: var(--line); }
.avail--out { color: var(--soft); }

/* Back link --------------------------------------------------------------------- */

.back-link {
  display: inline-flex; align-items: center; gap: 8px; min-block-size: 44px;
  font-weight: 600; font-size: var(--fs-sm); transition: color var(--t-fast);
}
@media (hover: hover) { .back-link:hover { color: var(--accent); } }
.back-link .icon { transition: transform 0.3s var(--ease); }
@media (hover: hover) { .back-link:hover .icon { transform: translateX(4px); } }

/* Chips (extra states) ---------------------------------------------------------- */

.chip { cursor: pointer; font: inherit; font-size: 14px; color: inherit; }
.chip[aria-pressed="true"], .chip[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.chip--remove span[aria-hidden] { color: var(--soft); }

/* Empty-state variants ---------------------------------------------------------- */

.empty--compact { padding-block: clamp(32px, 6vw, 72px); }
.empty__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 20px; }
.empty__icon { color: var(--accent); }
.empty .chips { justify-content: center; max-inline-size: 560px; }

/* ==========================================================================
   "Added to cart" notice
   ========================================================================== */

.added-host {
  position: fixed; z-index: var(--z-toast);
  inset-inline: 10px; inset-block-end: 10px;
  pointer-events: none; opacity: 0; transform: translateY(16px);
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease-out);
}
.added-host.is-on { opacity: 1; transform: none; pointer-events: auto; }
.added-host:empty { display: none; }
@media (min-width: 720px) {
  .added-host { inset-inline: auto 20px; inset-inline-start: auto; inset-inline-end: 20px; inset-block: calc(var(--header-h) + 44px) auto; inline-size: 360px; transform: translateY(-10px); }
}
.added { background: var(--cream); border: 1px solid var(--line); box-shadow: 0 18px 40px -20px rgba(42, 35, 32, 0.4); padding: 14px 16px 16px; display: grid; gap: 12px; }
.added__head { display: flex; justify-content: space-between; align-items: center; }
.added__title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent); }
.added__x { min-inline-size: 36px; min-block-size: 36px; margin-inline-end: -8px; }
.added__items { display: grid; gap: 8px; max-block-size: 200px; overflow-y: auto; }
.added__items li { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; }
.added__img { aspect-ratio: 1; }
.added__info { display: grid; line-height: 1.35; }
.added__name { font-family: var(--f-serif); font-size: 16px; }
.added__meta { font-size: 13px; color: var(--soft); }
.added__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.added__actions .btn { min-block-size: 44px; padding-inline: 10px; font-size: 14px; }
.ql .added { box-shadow: none; margin-block-start: 4px; }

/* ==========================================================================
   Quick Look (dialog)
   ========================================================================== */

.ql {
  border: 0; padding: 0; margin: 0; background: transparent; color: var(--ink);
  inline-size: 100%; max-inline-size: 100%; block-size: 100%; max-block-size: 100%;
}
.ql::backdrop { background: rgba(42, 35, 32, 0.45); }
.ql[open] { display: flex; align-items: flex-end; }
.ql__panel {
  inline-size: 100%; max-block-size: 92svh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); animation: ql-up 0.4s var(--ease-out);
}
@keyframes ql-up { from { transform: translateY(40px); opacity: 0; } }
.ql__bar {
  position: sticky; inset-block-start: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 8px 4px 16px; padding-inline: 16px 6px; background: var(--paper); border-block-end: 1px solid var(--line);
}
.ql__label { font-size: 13px; letter-spacing: 0.06em; color: var(--soft); }
.ql__body { display: grid; gap: 16px; padding: 14px 16px 20px; }
.ql__info { display: grid; gap: 10px; align-content: start; }
.ql__titlerow { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ql__title { font-family: var(--f-serif); font-weight: 300; font-size: 28px; line-height: 1.15; }
.ql__full { justify-self: start; }
.ql .gallery__track { aspect-ratio: 4 / 3; }
/* Phones: a slightly shorter photo and no thumbnail strip (swipe, arrows and the
   1/2 counter remain), so size and "add to basket" come into view sooner. */
@media (max-width: 719px) {
  .ql .gallery__track { aspect-ratio: 3 / 2; }
  .ql .gallery__thumbs { display: none; }
  .ql__title { font-size: 24px; }
}
@media (min-width: 720px) {
  .ql[open] { align-items: center; justify-content: center; }
  .ql__panel { inline-size: min(940px, calc(100vw - 48px)); max-block-size: min(86svh, 720px); animation-name: ql-in; }
  @keyframes ql-in { from { transform: translateY(12px) scale(0.99); opacity: 0; } }
  .ql__body { grid-template-columns: 1.05fr 1fr; gap: 28px; padding: 20px 24px 28px; }
  .ql .gallery__track { aspect-ratio: 1; }
}

/* ==========================================================================
   Search overlay
   ========================================================================== */

.search {
  border: 0; padding: 0; margin: 0; inline-size: 100%; max-inline-size: 100%;
  background: transparent; color: var(--ink); max-block-size: 100%;
}
.search::backdrop { background: rgba(42, 35, 32, 0.4); }
.search__panel {
  background: var(--paper); padding: 10px var(--g) 22px;
  max-block-size: 88svh; overflow-y: auto; animation: search-in 0.3s var(--ease-out);
  border-block-end: 1px solid var(--line);
}
@keyframes search-in { from { transform: translateY(-14px); opacity: 0; } }
.search__form { display: flex; align-items: center; gap: 10px; border-block-end: 1px solid var(--ink); max-inline-size: 900px; margin-inline: auto; }
.search__form input {
  flex: 1; min-inline-size: 0; min-block-size: 56px; border: 0; background: transparent;
  font-family: var(--f-serif); font-size: clamp(20px, 2.4vw, 28px); font-weight: 300;
}
.search__form input:focus-visible { outline: none; }
.search__form input::-webkit-search-cancel-button { display: none; }
.search__form:focus-within { border-color: var(--accent); }
.search__status, .search__hint { max-inline-size: 900px; margin: 12px auto 8px; font-size: 14px; color: var(--soft); }
.search__results { max-inline-size: 900px; margin-inline: auto; }
.search__results .chips { margin-block-start: 6px; }
.search__all { display: block; max-inline-size: 900px; margin: 14px auto 0; }
.search__empty { padding-block: 18px; display: grid; gap: 6px; }
.sresults { display: grid; }
.sresult {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center;
  padding-block: 8px; border-block-end: 1px solid var(--line);
}
.sresult:focus-visible .sresult__name { color: var(--accent); }
@media (hover: hover) { .sresult:hover .sresult__name { color: var(--accent); } }
.sresult__img { aspect-ratio: 1; }
.sresult__info { display: grid; line-height: 1.35; }
.sresult__name { font-family: var(--f-serif); font-size: 17px; transition: color var(--t-fast); }
.sresult__meta { font-size: 13px; color: var(--soft); }
.sresult__price { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.shop-sample { padding: 20px var(--g) 0; font-size: var(--fs-xs); color: var(--soft); }
.help-band--row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.help-band { margin: var(--section) var(--g) 0; padding: clamp(20px, 3vw, 36px); background: var(--cream); display: grid; gap: 14px; justify-items: start; }
.help-band p:first-child { font-family: var(--f-serif); font-weight: 300; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2; }

/* Small cards: lighter controls */
@media (max-width: 719px) {
  .pcard__fav, .pcard__ql { inline-size: 36px; block-size: 36px; min-inline-size: 36px; background: rgba(251, 248, 243, 0.85); }
  .pcard__fav .icon, .pcard__ql .icon { inline-size: 18px; block-size: 18px; }
  .pcard__media .badge { font-size: 11px; padding: 2px 7px; inset-block-start: 6px; inset-inline-start: 6px; }
}
.ql__panel:focus { outline: none; }
@media (max-width: 719px) {
  /* leave room for the browser's own bottom toolbar (e.g. iOS Safari) */
  .ql__body { padding-block-end: 48px; }
}

/* iOS zooms the page when a focused field's text is under 16px. */
@media (max-width: 959px) {
  .input, .select, .textarea, .letter-form input, .search__form input { font-size: max(16px, 1em); }
  .toolbar__sort .select, .slot__variant .select { font-size: 16px; }
}
