:root { --ink: #111; --muted: #8a8a8a; --line: #e6e6e6; --panel: clamp(280px, 22vw, 380px); --font: "Helvetica Neue", Arial, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #fff; color: var(--ink); font-family: var(--font); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.stage { position: fixed; left: 0; top: 0; bottom: 0; right: var(--panel); overflow: hidden; touch-action: pan-y; user-select: none; }
.head { position: absolute; left: 32px; top: 26px; z-index: 3; }
.head h1 { margin: 0 0 8px; font-size: clamp(34px, 3.4vw, 56px); font-weight: 300; letter-spacing: -0.03em; }
.head p { margin: 0; max-width: 300px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.back { border: 0; background: none; padding: 6px 0; font-size: 13px; font-weight: 600; letter-spacing: .12em; }
.back:hover { text-decoration: underline; }

.track { position: absolute; inset: 0; outline: none; cursor: grab; }
.track.drag { cursor: grabbing; }
.look { position: absolute; left: 50%; bottom: 15vh; height: 60vh; aspect-ratio: 200 / 520; margin-left: calc(-60vh * 200 / 520 / 2); border: 0; padding: 0; background: none;
  transform-origin: 50% 100%; will-change: transform, filter, opacity; transition: opacity .5s ease; }
.look svg { width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; }
.look::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: -1.5%; height: 3%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.22), transparent); z-index: -1; }
.look[aria-selected="true"]:focus-visible { outline-offset: 8px; }
.stage.solo .look:not([aria-selected="true"]) { opacity: 0 !important; pointer-events: none; }

.caption { position: absolute; left: 0; right: 0; bottom: calc(15vh - 46px); margin: 0; text-align: center; font-size: 13px; transition: opacity .3s; }
.caption b { font-weight: 600; } .caption span { color: var(--muted); margin-left: 8px; }

.foot { position: absolute; left: 32px; right: 32px; bottom: 22px; display: flex; align-items: center; gap: 16px; z-index: 3; }
.progress { flex: 1; height: 2px; background: var(--line); position: relative; }
.progress i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); width: 0; }
.count { font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.nav { display: flex; gap: 8px; }
.nav button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--ink); background: #fff; font-size: 16px; }
.nav button:disabled { opacity: .3; cursor: default; }

/* panel */
.panel { position: fixed; right: 0; top: 0; bottom: 0; width: var(--panel); border-left: 1px solid var(--line); background: #fff; padding: 26px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.phead { display: flex; justify-content: space-between; align-items: center; font-size: 12px; letter-spacing: .16em; }
.bag { border: 1px solid var(--ink); background: none; border-radius: 999px; padding: 5px 12px; font-size: 12px; letter-spacing: 0; }
.bag span { font-weight: 700; }
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; overflow: auto; min-height: 0; transition: opacity .25s ease, transform .25s ease; }
.items.fade { opacity: 0; transform: translateY(6px); }
.item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.thumb { width: 64px; height: 80px; background: #f4f4f2; border-radius: 6px; display: grid; place-items: center; overflow: hidden; }
.thumb svg { width: 88%; height: 88%; }
.brand { font-size: 10px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.name { font-size: 14px; margin: 2px 0 4px; }
.price { font-size: 13px; font-weight: 600; }
.plus { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--ink); background: #fff; font-size: 16px; line-height: 1; }
.plus[aria-pressed="true"] { background: var(--ink); color: #fff; }
.total { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; font-size: 13px; }
.total small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.sum { text-align: right; } .sum s { display: block; color: var(--muted); font-size: 12px; } .sum b { font-size: 20px; }
.add { width: 100%; border: 0; background: var(--ink); color: #fff; padding: 15px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.add:hover { background: #333; }

.toast { position: fixed; left: calc((100% - var(--panel)) / 2); top: 26px; transform: translateX(-50%); z-index: 9; background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.on { opacity: 1; }

/* tablet / phone: the panel becomes a sheet at the bottom */
@media (max-width: 820px) {
  :root { --sheet: 38vh; }
  .stage { right: 0; bottom: var(--sheet); }
  .look { bottom: 11vh; height: 42vh; margin-left: calc(-42vh * 200 / 520 / 2); }
  .caption { bottom: calc(11vh - 34px); }
  .head { left: 18px; top: 16px; } .head p { display: none; }
  .foot { left: 18px; right: 18px; bottom: 10px; }
  .nav button { width: 36px; height: 36px; }
  .panel { top: auto; left: 0; width: auto; height: var(--sheet); border-left: 0; border-top: 1px solid var(--line); padding: 14px 16px 14px; gap: 10px;
    box-shadow: 0 -10px 30px rgba(0,0,0,.06); }
  .item { grid-template-columns: 48px 1fr auto; } .thumb { width: 48px; height: 60px; }
  .add { padding: 12px; }
  .toast { left: 50%; }
}
@media (prefers-reduced-motion: reduce) { .look, .items, .caption { transition: none; } }
