/* ==========================================================================
   Product sheet (.sh-*) — bottom sheet on phones, centred two-column modal ≥768px.
   Functional motion only (slide/fade); the flying photo is site animation #2.
   ========================================================================== */
.sh-root {
  --sh-pad: 20px;
  --sh-grade: contrast(1.09) saturate(1.1) sepia(.07) brightness(1.015);
  --sh-radius: 24px;
  --sh-ink-body: var(--c-ink-700);   /* 10.6:1 on cream-50, used at regular weight */
  --sh-ink-meta: var(--c-ink-600);   /*  6.9:1 */
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sh-root[hidden] { display: none; }

/* Backdrop ------------------------------------------------------------- */
.sh-backdrop {
  position: absolute;
  inset: 0;
  /* phones: deeper at the top, so the sliver of page above the sheet reads as a
     deliberate dark band instead of half-legible grey header text */
  background: linear-gradient(to bottom, rgba(43, 18, 21, .86) 0, rgba(43, 18, 21, .72) 64px, var(--color-overlay) 220px);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.sh-root[data-state="open"] .sh-backdrop { opacity: calc(1 - var(--sh-drag, 0) * 1.4); }
.sh-root[data-state="closing"] .sh-backdrop { opacity: 0; transition-timing-function: var(--ease-in); }
.sh-root[data-dragging] .sh-backdrop { transition: none; }

/* Panel ---------------------------------------------------------------- */
.sh-panel {
  --sh-mini-h: 60px;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(100dvh - max(24px, var(--safe-top) + 10px));
  background: var(--color-surface);
  border-radius: var(--sh-radius) var(--sh-radius) 0 0;
  box-shadow: var(--shadow-sheet);
  overflow: hidden;
  transform: translate3d(0, 100%, 0);
  transition: transform var(--dur-sheet) var(--ease-out);
  outline: none;
  overscroll-behavior: contain;
}
.sh-root[data-state="open"] .sh-panel { transform: translate3d(0, 0, 0); }
.sh-root[data-state="closing"] .sh-panel {
  transform: translate3d(0, 100%, 0);
  transition-duration: 300ms;
  transition-timing-function: var(--ease-in);
}

/* Grabber: floats over the photo; turns cream-dark once the bar takes over. */
.sh-grabber {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  height: 20px;
  padding-top: 2px;
  pointer-events: none;
}
.sh-grabber span {
  width: 36px; height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 252, 249, .96);
  box-shadow: 0 0 0 .5px rgba(43, 18, 21, .18), 0 1px 4px rgba(43, 18, 21, .35);
  transition: background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.sh-panel[data-bar] .sh-grabber span { background: var(--c-cream-400); box-shadow: none; }

/* Sticky mini-header: appears when the photo has slid away ----------------- */
.sh-mini {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 2;
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  height: var(--sh-mini-h);
  padding: 6px 64px 0 var(--sh-pad);
  background: var(--color-surface);
  box-shadow: 0 1px 0 var(--color-line);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease-out), visibility 0s linear var(--dur-fast);
  pointer-events: none;
}
.sh-panel[data-bar] .sh-mini {
  opacity: 1; visibility: visible;
  transition: opacity var(--dur-fast) var(--ease-out), visibility 0s;
}
/* Whatever scrolls under the bar dissolves into it instead of being cut by a hard edge. */
.sh-mini::after {
  content: "";
  position: absolute;
  top: calc(100% + 1px); left: 0; right: 0;
  height: 16px;
  background: linear-gradient(to bottom, var(--color-surface) 0, var(--color-surface) 6px, rgba(255, 252, 249, .7) 9px, rgba(255, 252, 249, 0));
  pointer-events: none;
}
.sh-mini__title,
.sh-mini__meta {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transform: translateY(3px);
  transition: transform var(--dur-fast) var(--ease-out);
}
.sh-panel[data-bar] .sh-mini__title,
.sh-panel[data-bar] .sh-mini__meta { transform: none; }
.sh-mini__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--color-text-brand);
  font-variation-settings: "opsz" 48;
}
.sh-mini__meta {
  font-size: var(--text-xs);
  line-height: 1.2;
  letter-spacing: .02em;
  color: var(--sh-ink-meta);
  font-variant-numeric: lining-nums tabular-nums;
}
.sh-mini__meta:empty { display: none; }

.sh-close {
  /* 44px hit area, 32px quiet disc: one small piece of chrome over the photo */
  position: absolute;
  top: 6px; right: 6px;
  z-index: 3;
  display: grid; place-items: center;
  width: var(--tap); height: var(--tap);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-brand);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.sh-close::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: rgba(255, 252, 249, .74);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-instant) var(--ease-out);
}
.sh-close svg { position: relative; width: 16px; height: 16px; }
.sh-panel[data-bar] .sh-close::before { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
@media (hover: hover) {
  .sh-close:hover::before { background: rgba(255, 252, 249, .95); }
  .sh-panel[data-bar] .sh-close:hover::before { background: var(--c-blush-50); }
}
.sh-close:active::before { transform: scale(.92); }
.sh-close:focus-visible { outline: none; }
.sh-close:focus-visible::before { box-shadow: var(--focus-ring); }

/* Scrollable content ------------------------------------------------------ */
.sh-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--c-cream-400) transparent;
}

/* Photo: full-bleed under the sheet's own rounded top — no frame inside a frame. */
.sh-media {
  position: relative;
  margin: 0;
  /* with no size picker the sheet is short: the photo gets the room, and the sheet still
     tops out well below the header on a 390x844 phone */
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-surface-sunken);
  isolation: isolate;
}
.sh-media::after {
  /* a whisper of shade at the top so the grabber and close button always read, and a warm
     vignette that pulls the eye to the slice and quiets whatever kitchen is behind it */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(90px 34px at 50% 0, rgba(43, 18, 21, .34), rgba(43, 18, 21, 0)),
    linear-gradient(to bottom, rgba(43, 18, 21, .26) 0, rgba(43, 18, 21, .1) 36px, rgba(43, 18, 21, .03) 70px, rgba(43, 18, 21, 0) 96px),
    radial-gradient(ellipse 78% 82% at 54% 56%, rgba(110, 33, 41, 0) 58%, rgba(86, 26, 33, .16) 100%);
  pointer-events: none;
}
.sh-media picture { display: contents; }
.sh-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  /* one shared grade, so phone snapshots and stock shots sit in the same warm light and
     hold their own next to the crisp type: a touch more contrast, a touch warmer */
  filter: var(--sh-grade);
  transition: opacity var(--dur-base) var(--ease-out);
}
/* Art-directed 4:3 file: already framed around the focal point. */
.sh-media[data-art] img { object-position: 50% 50%; }
.sh-media[data-loading] img { opacity: 0; }
.sh-media[data-loading],
.sh-media.is-broken {
  background: var(--c-blush-100) url("../assets/wordmark.svg") center / 34% auto no-repeat;
}
.sh-media.is-broken img { opacity: 0; }
.sh-media.is-broken::after { display: none; }

/* Body ------------------------------------------------------------------ */
.sh-body {
  display: grid;
  gap: 16px;
  padding: 20px var(--sh-pad) 24px;
}
/* Eyebrow, name and price read as one block: what it is and what it costs. */
.sh-head { display: grid; gap: 4px; }

.sh-eyebrow {
  margin-bottom: 4px;
  font-size: var(--text-2xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--color-text-brand);
}

.sh-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.7rem + 1.4vw, 2.625rem);
  font-weight: var(--fw-regular);
  line-height: 1.02;
  letter-spacing: -.026em;
  font-kerning: normal;
  color: var(--color-text-brand);
  text-wrap: balance;
  font-variation-settings: "opsz" 72;
}

.sh-price {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 6px;
  font-variant-numeric: lining-nums tabular-nums;
}
.sh-price__amount {
  font-size: 1.375rem;
  font-weight: var(--fw-medium);
  letter-spacing: -.005em;
  color: var(--color-text);
}
.sh-price__unit {
  display: inline-flex; align-items: center;
  height: 26px; padding: 0 10px;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px var(--color-line-strong);
  font-size: var(--text-xs); font-weight: var(--fw-medium); letter-spacing: .02em;
  color: var(--sh-ink-meta);
}

.sh-desc {
  font-size: .9375rem;
  font-weight: var(--fw-regular);
  line-height: 1.6;
  color: var(--sh-ink-body);
  max-width: 46ch;
  text-wrap: pretty;
}

/* Facts: lead time + pickup as two equal columns under a hairline; the divider sits exactly
   on the centre line and each icon is centred on its two-line block. -------------------- */
.sh-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 4px 0 0; padding: 16px 0 0; list-style: none;
  border-top: 1px solid var(--color-line);
}
.sh-facts:empty { display: none; }
.sh-facts li {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 10px; align-items: center;
  min-height: 40px;
  padding-right: 14px;
  font-size: var(--text-xs); line-height: 1.35; letter-spacing: .01em;
  color: var(--sh-ink-meta);
}
.sh-facts li + li { padding: 0 0 0 16px; border-left: 1px solid var(--color-line); }
.sh-facts li:only-child { padding-right: 0; }
.sh-facts svg { width: 20px; height: 20px; color: var(--color-text-brand); }
.sh-facts strong { display: block; font-size: var(--text-sm); font-weight: var(--fw-medium); line-height: 1.3; color: var(--color-text); }

/* Sticky footer: stepper + CTA in thumb reach ------------------------------ */
.sh-foot {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: var(--color-surface);
  border-top: 1px solid var(--color-line-strong);
  transition: box-shadow var(--dur-fast) var(--ease-out);
}
.sh-panel[data-more] .sh-foot { box-shadow: 0 -10px 24px -14px rgba(43, 18, 21, .28); }
/* Soft fade so content slides under the footer instead of being cut — only while there is
   more below; at the end of the content nothing is veiled. */
.sh-foot::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: calc(100% + 1px);
  height: 22px;
  background: linear-gradient(to bottom, rgba(255, 252, 249, 0), rgba(255, 252, 249, .85) 65%, var(--color-surface));
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.sh-panel[data-more] .sh-foot::before { opacity: 1; }
.sh-stepper {
  /* secondary control: a hairline pill, so the burgundy CTA is the only weight in the bar */
  flex: none;
  display: inline-flex; align-items: center;
  height: var(--tap-lg);
  padding: 0 3px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-line-strong);
}
.sh-stepper button {
  display: grid; place-items: center;
  width: var(--tap); height: var(--tap);
  padding: 0;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--color-text-brand);
  touch-action: manipulation;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-instant) var(--ease-out);
}
.sh-stepper button svg { width: 16px; height: 16px; }
@media (hover: hover) { .sh-stepper button:hover:not(:disabled) { background: var(--c-cream-300); } }
.sh-stepper button:active:not(:disabled) { background: var(--c-cream-400); transform: scale(.94); }
.sh-stepper button:disabled { color: var(--c-ink-500); opacity: .4; cursor: default; }
.sh-stepper button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--color-focus); }
.sh-stepper__value {
  width: 2ch;
  text-align: center;
  font-size: var(--text-base);
  font-weight: var(--fw-medium);
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--color-text);
}

.sh-cta {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: var(--tap-lg);
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-text-on-brand);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-medium);
  letter-spacing: .02em;
  white-space: nowrap;
  touch-action: manipulation;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 6px 16px -8px rgba(110, 33, 41, .55);
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-instant) var(--ease-out);
}
.sh-cta__dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .55; }
.sh-cta__total { font-variant-numeric: lining-nums tabular-nums; }
@media (hover: hover) { .sh-cta:hover { background: var(--color-accent-hover); } }
.sh-cta:active { background: var(--color-accent-pressed); transform: translateY(1px); }
.sh-cta:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Missing product ------------------------------------------------------- */
.sh-missing { display: grid; gap: 12px; justify-items: start; padding: 64px var(--sh-pad) 32px; }
.sh-missing__mark {
  width: 56px; height: 56px; margin-bottom: 8px;
  border-radius: 50%;
  background: var(--c-blush-100) url("../assets/wordmark.svg") center / 76% auto no-repeat;
}

/* Flying photo + arrival ring + confirmation (animation #2) — live on <body>. */
.sh-flyer {
  position: fixed;
  z-index: var(--z-toast);
  pointer-events: none;
  will-change: transform, clip-path, opacity;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 10px 18px rgba(63, 18, 23, .28));
}
.sh-flyer img { width: 100%; height: 100%; object-fit: cover; display: block; filter: contrast(1.09) saturate(1.1) sepia(.07) brightness(1.015); }
.sh-ring {
  position: fixed;
  z-index: var(--z-toast);
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--c-blush-400);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.sh-toast {
  --caret: 24px;
  position: fixed;
  z-index: var(--z-toast);
  display: flex; align-items: center; gap: 10px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 16px 10px 10px;
  border-radius: 16px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 0 0 1px var(--color-line), 0 14px 32px -12px rgba(43, 18, 21, .45), 0 2px 6px rgba(43, 18, 21, .12);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  /* phones: a snackbar in thumb reach, clear of the wordmark */
  left: 16px; right: 16px;
  bottom: calc(16px + var(--safe-bottom));
  margin-inline: auto;
  width: max-content;
  transform: translateY(10px);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s linear 200ms;
}
.sh-toast--hang { bottom: auto; left: auto; margin: 0; transform: translateY(-6px); }
.sh-toast--hang::before {
  /* caret pointing up at the bag */
  content: "";
  position: absolute;
  bottom: 100%; right: calc(var(--caret) - 7px);
  border: 7px solid transparent;
  border-top: 0;
  border-bottom-color: var(--color-surface);
  filter: drop-shadow(0 -1px 0 var(--color-line));
}
.sh-toast.is-in { opacity: 1; visibility: visible; transform: none; transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s; }
.sh-toast.is-out { transition-timing-function: var(--ease-in); }
.sh-toast__check {
  flex: none;
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-text-on-brand);
}
.sh-toast__check svg { width: 14px; height: 14px; }
.sh-toast__text { display: grid; gap: 1px; min-width: 0; }
.sh-toast__name {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.15;
  color: var(--color-text-brand);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sh-toast__meta { font-size: var(--text-xs); line-height: 1.3; color: var(--sh-ink-meta, var(--c-ink-600)); }

/* Short phones: a wider photo keeps the price and facts above the fold. ---- */
@media (max-width: 767px) and (max-height: 780px) {
  .sh-media { aspect-ratio: 16 / 9; }
  .sh-body { padding-top: 16px; }
  .sh-title { font-size: 2rem; }
}

/* Desktop / tablet: centred two-column modal ------------------------------ */
@media (min-width: 768px) {
  .sh-root { align-items: center; padding: 32px; }
  /* A dense, even scrim: the page underneath (hero scallop, giant headings) must not read
     through as a lighter band, so it is blurred hard and covered almost uniformly. */
  .sh-backdrop {
    background: linear-gradient(to bottom, rgba(43, 18, 21, .86), rgba(43, 18, 21, .93) 60%, rgba(43, 18, 21, .97));
    -webkit-backdrop-filter: blur(22px) saturate(.8);
    backdrop-filter: blur(22px) saturate(.8);
  }
  .sh-panel {
    --sh-media-w: 46%;
    --sh-mini-h: 72px;
    width: min(1000px, 100%);
    /* fits its content (a single-size box is shorter than a cake with three sizes), and
       leaves the header's bag clear above the modal at 800px tall */
    height: auto;
    max-height: min(640px, calc(100dvh - 160px));
    min-height: min(500px, calc(100dvh - 48px));
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transform: translate3d(0, 14px, 0) scale(.985);
    opacity: 0;
    transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
  }
  .sh-root[data-state="open"] .sh-panel { transform: none; opacity: 1; }
  .sh-root[data-state="closing"] .sh-panel {
    transform: translate3d(0, 8px, 0) scale(.99);
    opacity: 0;
    transition-duration: 180ms;
  }
  .sh-grabber { display: none; }
  .sh-close { top: 16px; right: 16px; }
  .sh-close::before,
  .sh-panel[data-bar] .sh-close::before {
    inset: 2px;
    background: var(--color-surface);
    box-shadow: inset 0 0 0 1px var(--color-line-strong);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .sh-close svg { width: 18px; height: 18px; }
  @media (hover: hover) { .sh-close:hover::before, .sh-panel[data-bar] .sh-close:hover::before { background: var(--c-blush-50); } }
  .sh-close:focus-visible::before { box-shadow: var(--focus-ring); }

  .sh-mini { left: var(--sh-media-w); padding: 0 72px 0 44px; }
  .sh-mini__title { font-size: 1.5rem; }
  .sh-mini::after { height: 36px; }

  .sh-scroll, .sh-foot { margin-left: var(--sh-media-w); }
  .sh-media {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: var(--sh-media-w);
    aspect-ratio: auto;
  }
  .sh-media::after {
    background: radial-gradient(ellipse 85% 75% at 55% 55%, rgba(110, 33, 41, 0) 60%, rgba(86, 26, 33, .16) 100%);
  }
  .sh-media img { object-position: 50% 55%; }
  /* The order column centres its (short) content against the photo instead of leaving a
     void above the footer; it still scrolls normally if a long description overflows. */
  .sh-scroll { display: flex; flex-direction: column; }
  .sh-body { --sh-pad: 44px; gap: 22px; margin-block: auto; padding: 48px var(--sh-pad) 40px; }
  .sh-title { font-size: 2.875rem; }
  .sh-price__amount { font-size: 1.5rem; }
  .sh-desc { font-size: 1rem; line-height: 1.62; }
  .sh-foot::before { height: 40px; }
  .sh-foot { padding: 16px 44px 20px; }
  .sh-missing { padding: 72px 44px; }
}

@media (min-width: 768px) and (max-width: 900px) {
  .sh-panel { --sh-media-w: 40%; }
  .sh-body { --sh-pad: 32px; }
  .sh-mini { padding-left: 32px; }
  .sh-foot { padding-inline: 32px; }
}

/* Reduced motion: no slide, just appear. */
@media (prefers-reduced-motion: reduce) {
  .sh-panel, .sh-backdrop, .sh-toast { transition-duration: 1ms !important; }
}
html[data-reduced-motion] .sh-panel,
html[data-reduced-motion] .sh-backdrop,
html[data-reduced-motion] .sh-toast { transition-duration: 1ms !important; }
