/* Side notch: one featured product at a time, rotating (js/side-notch.js, data in js/products.js). Every selector is scoped under .side-notch or an .sn- class.
   Shape = black container on the right viewport edge with concave "ears" drawn as radial-gradient pseudo-elements. */
.sn-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.side-notch {
  /* fallback easing first; the damped-spring linear() replaces it where supported */
  --sn-spring: cubic-bezier(0.34, 1.35, 0.5, 1);
  --sn-black: #0b0909;
  --sn-ink: #fff7ed;
  --sn-ear: 18px;
  --sn-w: 58px; --sn-h: 112px; --sn-r: 29px;
  --sn-open-w: min(300px, calc(100vw - 32px));
  --sn-open-h: clamp(300px, calc(100dvh - 140px), 356px);
  --sn-dur: 5000ms; --ring: #b51f42; --tint: #f4e5d2;
  position: fixed; z-index: 45;
  right: 0;
  /* vertically centred, but never higher than 120px from the top (fixed header) */
  top: max(50%, calc(120px + var(--sn-h) / 2));
  width: var(--sn-w); height: var(--sn-h);
  transform: translateY(-50%);
  box-sizing: border-box;
  background: var(--sn-black);
  border-radius: var(--sn-r) 0 0 var(--sn-r);
  filter: drop-shadow(-6px 10px 18px rgba(43, 26, 16, 0.14));
  transition: width .5s var(--sn-spring), height .5s var(--sn-spring), top .5s var(--sn-spring), border-radius .5s var(--sn-spring);
}
@supports (transition-timing-function: linear(0, 1)) {
  .side-notch {
    /* damped spring, ~8% overshoot */
    --sn-spring: linear(0, 0.027, 0.096, 0.193, 0.307, 0.425, 0.543, 0.653, 0.752, 0.837, 0.909, 0.967, 1.011, 1.043, 1.065, 1.078, 1.083, 1.083, 1.078, 1.071, 1.062, 1.052, 1.042, 1.033, 1.024, 1.017, 1.01, 1.005, 1);
  }
}
.side-notch.is-open { --sn-w: var(--sn-open-w); --sn-h: var(--sn-open-h); --sn-r: 32px; transition-duration: .62s; }
.side-notch *, .side-notch *::before, .side-notch *::after { box-sizing: border-box; }

/* Ears: quarter-circle cut-outs. 1px overlap into the body and 1px past the viewport edge so no seam can show. */
.side-notch::before, .side-notch::after {
  content: ""; position: absolute; right: -1px;
  width: calc(var(--sn-ear) + 1px); height: calc(var(--sn-ear) + 1px);
  pointer-events: none;
}
.side-notch::before { top: calc(var(--sn-ear) * -1); background: radial-gradient(circle at 0 0, transparent calc(var(--sn-ear) - 0.5px), var(--sn-black) var(--sn-ear)); }
.side-notch::after  { bottom: calc(var(--sn-ear) * -1); background: radial-gradient(circle at 0 100%, transparent calc(var(--sn-ear) - 0.5px), var(--sn-black) var(--sn-ear)); }

.side-notch .sn-clip { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }

/* collapsed tab */
.side-notch .sn-tab {
  position: absolute; inset: 0; width: 100%; margin: 0; padding: 0; border: 0; background: none; color: var(--sn-ink); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  transition: opacity .2s ease .28s;
  border-radius: inherit;
}
.side-notch.is-open .sn-tab { opacity: 0; pointer-events: none; transition: opacity .1s ease; }
.side-notch .sn-tab:focus-visible { outline: 2px solid var(--sn-ink); outline-offset: -4px; border-radius: 24px 0 0 24px; }
.side-notch .sn-tab-label { font: 600 10px/1 var(--font-display, system-ui, sans-serif); letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 247, 237, .62); }

/* collapsed: one product in a ring that fills up until the next product */
@property --snp { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
.side-notch .sn-thumb { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: none; }
.side-notch .sn-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--ring) var(--snp), rgba(255, 247, 237, .16) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
}
.side-notch .sn-ring.is-run, .side-notch .sn-bar.is-run > span { animation: sn-progress var(--sn-dur) linear forwards; }
.side-notch.is-paused .sn-ring, .side-notch.is-paused .sn-bar > span { animation-play-state: paused; }
@keyframes sn-progress { from { --snp: 0%; } to { --snp: 100%; } }
.side-notch .sn-media {
  position: relative; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--tint); transition: opacity .16s ease, transform .3s var(--ease-out, ease-out);
}
.side-notch .sn-media svg, .side-notch .sn-media img { width: 80%; height: 80%; object-fit: contain; }
.side-notch.is-swap .sn-media { opacity: 0; transform: scale(.8); }

/* open card */
.side-notch .sn-card {
  position: absolute; top: 0; right: 0; width: var(--sn-open-w); height: var(--sn-open-h);
  color: var(--sn-ink); opacity: 0; filter: blur(6px); transform: translateX(10px) scale(.98);
  transition: opacity .1s ease, filter .1s ease, transform .1s ease;
  pointer-events: none;
}
.side-notch.is-open .sn-card {
  opacity: 1; filter: none; transform: none; pointer-events: auto;
  transition: opacity .3s ease .2s, filter .3s ease .2s, transform .4s var(--ease-out, ease-out) .2s;
}
.side-notch .sn-inner { height: 100%; padding: 22px 20px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; overflow-y: auto; }

.side-notch .sn-stage { position: relative; width: 116px; height: 116px; flex: none; }
.side-notch .sn-disc {
  position: absolute; inset: 0; border-radius: 50%; background: var(--tint); display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 0 0 3px rgba(255, 247, 237, .08), 0 14px 30px -12px var(--ring);
  transition: opacity .18s ease, transform .34s var(--sn-spring), background .3s ease;
}
.side-notch .sn-disc svg, .side-notch .sn-disc img { width: 80%; height: 80%; object-fit: contain; }
.side-notch.is-swap .sn-disc { opacity: 0; transform: scale(.86) rotate(-6deg); }
.side-notch .sn-badge {
  position: absolute; top: -2px; left: calc(100% + 6px); padding: 4px 9px; border-radius: 999px; white-space: nowrap;
  font: 600 10px/1 var(--font-display, system-ui, sans-serif); letter-spacing: .06em; text-transform: uppercase;
  background: rgba(255, 247, 237, .14); color: var(--sn-ink); box-shadow: inset 0 0 0 1px rgba(255, 247, 237, .22);
}

.side-notch .sn-text { margin-top: 14px; transition: opacity .14s ease, transform .2s var(--ease-out, ease-out); }
.side-notch.is-swap .sn-text { opacity: 0; transform: translateY(4px); }
.side-notch .sn-meta { margin: 0 0 4px; font: 600 11px/1.2 var(--font-display, system-ui, sans-serif); letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 247, 237, .62); }
.side-notch .sn-meta:empty { display: none; }
.side-notch .sn-name { margin: 0; font: 600 19px/1.25 var(--font-display, system-ui, sans-serif); text-wrap: balance; }
.side-notch .sn-desc { margin: 4px 0 0; font-size: 13.5px; line-height: 1.4; color: rgba(255, 247, 237, .7); text-wrap: balance; }

.side-notch .sn-row { margin-top: auto; padding-top: 12px; width: 100%; display: flex; align-items: center; gap: 12px; flex: none; }
.side-notch .sn-view {
  flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; padding: 0 14px;
  border-radius: 999px; text-decoration: none; white-space: nowrap;
  background: var(--paper, #fff7ed); color: #0b0909; font: 600 15px/1 var(--font-display, system-ui, sans-serif);
  transition: transform .18s var(--ease-out, ease-out), background .18s ease;
}
.side-notch .sn-view svg { width: 14px; height: 14px; flex: none; }
.side-notch .sn-view:hover { background: #fff; transform: scale(1.02); }
.side-notch .sn-view:active { transform: scale(.98); }
.side-notch .sn-ctrl { display: flex; gap: 2px; flex: none; }
.side-notch .sn-btn {
  display: grid; place-items: center; width: 34px; height: 44px; padding: 0; border: 0; border-radius: 12px;
  background: transparent; color: rgba(255, 247, 237, .78); cursor: pointer; transition: background .15s ease, color .15s ease;
}
.side-notch .sn-btn:hover { background: rgba(255, 247, 237, .1); color: var(--sn-ink); }
.side-notch .sn-btn svg { width: 18px; height: 18px; }
.side-notch .sn-pause .i-play, .side-notch .sn-pause[aria-pressed="true"] .i-pause { display: none; }
.side-notch .sn-pause[aria-pressed="true"] .i-play { display: block; }
.side-notch .sn-bar { display: block; width: 100%; height: 3px; margin-top: 14px; border-radius: 3px; background: rgba(255, 247, 237, .14); overflow: hidden; flex: none; }
.side-notch .sn-bar > span { display: block; height: 100%; width: var(--snp); background: var(--ring); border-radius: inherit; }
.side-notch .sn-note { margin: 10px 0 0; font-size: 11.5px; line-height: 1.35; color: rgba(255, 247, 237, .55); flex: none; }
.side-notch .sn-note:empty { display: none; }
.side-notch .sn-view:focus-visible, .side-notch .sn-btn:focus-visible { outline: 2px solid var(--sn-ink); outline-offset: 2px; }

@media (max-width: 599px) {
  .side-notch { --sn-w: 48px; --sn-ear: 16px; }
  .side-notch.is-open { --sn-w: var(--sn-open-w); }
}

@media (prefers-reduced-motion: reduce) {
  .side-notch, .side-notch.is-open { transition: width .16s ease, height .16s ease, top .16s ease, border-radius .16s ease; }
  .side-notch .sn-card, .side-notch.is-open .sn-card { filter: none; transform: none; transition: opacity .15s ease; }
  .side-notch .sn-tab, .side-notch.is-open .sn-tab, .side-notch .sn-disc, .side-notch .sn-media, .side-notch .sn-text, .side-notch .sn-view { transition: opacity .15s ease; }
  .side-notch.is-swap .sn-disc, .side-notch.is-swap .sn-media { transform: none; }
  .side-notch .sn-view:hover, .side-notch .sn-view:active { transform: none; }
  .side-notch .sn-ring, .side-notch .sn-bar { display: none; } /* no auto-rotation: use the arrows */
}
