/* Coucoo virtual store
   ---------------------------------------------------------------------------
   A square showroom drawn with CSS 3D. store.js moves a "camera" by setting
   one transform on #room. Everything in the room is sized in --u, which is
   1% of the window height (set in px by store.js), so the scene scales as one.

   Layers on each wall, back to front:
     .wall     plaster, with each look's soft shadow painted on it
     .signage  the logo, standing slightly off the wall
     .figs     the looks, standing slightly in front of the wall
   The floor is glossy: it is see-through, and each look carries a flipped
   copy of itself below floor level that shows through as a reflection.
   --------------------------------------------------------------------------- */

:root {
  --red: #fd1a16;            /* Coucoo logo red */
  --ink: #101114;
  --muted: #7b808a;
  --line: #e4e6eb;
  --ok: #1e8a4c;

  /* Room measurements. The numbers must match K in store.js. */
  --u: 1vh;
  --D: 70vw;                                /* half the room's width (set by store.js) */
  --F: 70vw;                                /* how far the floor and ceiling run back from the room's middle (set by store.js) */
  --P: calc(110 * var(--u));                /* eye-to-wall distance at 1:1 */
  --floor: calc(31 * var(--u));             /* floor, below eye level */
  --ceil: calc(62 * var(--u));              /* ceiling, above eye level */
  --ext: calc(34 * var(--u));               /* wall "reflection" under the floor */
  --figh: calc(54 * var(--u));              /* height of every model */
  --zf: calc(3 * var(--u));                 /* looks stand this far off the wall */

  /* The room's one material (see "The room" below). */
  --wall-top: #e9ebf0;                      /* wall colour under the ceiling; also the ceiling */
  --wall-bot: #dcdfe5;                      /* wall colour at the floor */
  --ao: 46, 54, 78;                         /* shade: towards edges, and on walls you are not facing */
  --glow: 253, 26, 22;                      /* the red the sign throws on wall and floor */
  --under: #c9cdd6;                         /* what lies under the glossy floor */
  --bleed: 2px;                             /* surfaces overlap by this much at every join */

  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: #c9cdd6;
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
html { overscroll-behavior: none; }
#scene img, .ghost { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ============================ The room ============================ */
#scene {
  position: fixed; inset: 0;
  perspective: var(--P);
  overflow: hidden;
  background: var(--under);                 /* seen faintly through the glossy floor */
  /* The scene's own flat layer sits in front of the walls in 3D and would
     swallow every click, so only the walls and looks take pointer input. */
  pointer-events: none;
}
#room {
  position: absolute; left: 50%; top: 50%;
  width: 0; height: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.side {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  transform-style: preserve-3d;
  transform: rotateY(calc(var(--a) * 1deg)) translateZ(calc(var(--D) * -1));
}

/* The room is lit like a show.
   - The wall you face (.side.chosen) is the lit one: a wash of light, a pool of
     light behind every look and the red glow of the sign.
   - The other walls sit in gentle shade (.plaster::before), so each corner is a
     clean step from the lit wall to a shaded one, never a dark frame.
   - Shade gathers softly towards every edge (--ao) with a long falloff, the same
     on both sides of a join, and surfaces overlap by --bleed so no hairline of
     background shows through a corner. */
.wall {
  position: absolute;
  left: calc(var(--D) * -1 - var(--bleed)); width: calc(var(--D) * 2 + var(--bleed) * 2);
  top: calc(var(--ceil) * -1 - var(--bleed));
  height: calc(var(--ceil) + var(--floor) + var(--ext) + var(--bleed));
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
/* A wall that faces away from you is not drawn. That has to be said for everything on
   the wall too: a layer inside it (the shade, a pool of light, a shadow) is otherwise still
   drawn, back to front, and in a narrow window it would hang as a veil between you and the room. */
.side .wall *, .side .wall *::before, .side .wall *::after,
.side .figs *, .side .figs *::before, .side .figs *::after, .side .signage * {
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
/* Only the walls in view take pointer input (store.js sets .live). */
.side.live > .wall, .side.live > .figs { pointer-events: auto; }
.plaster, .mirror {
  --corners:
    linear-gradient(to right, rgba(var(--ao), .16), rgba(var(--ao), .09) 8%, rgba(var(--ao), .035) 22%, rgba(var(--ao), 0) 40%),
    linear-gradient(to left, rgba(var(--ao), .16), rgba(var(--ao), .09) 8%, rgba(var(--ao), .035) 22%, rgba(var(--ao), 0) 40%);
}
.plaster {
  position: absolute; inset: 0 0 var(--ext) 0;
  overflow: hidden;
  background:
    var(--corners),
    /* under the ceiling, and along the floor */
    linear-gradient(to bottom, rgba(var(--ao), .12), rgba(var(--ao), .05) 12%, rgba(var(--ao), 0) 30%),
    linear-gradient(to top, rgba(var(--ao), .12), rgba(var(--ao), .04) 8%, rgba(var(--ao), 0) 20%),
    /* fine plaster grain (a small pre-rendered tile: cheap to draw) */
    url("assets/plaster.png"),
    linear-gradient(180deg, var(--wall-top), var(--wall-bot));
  background-size: auto, auto, auto, auto, 96px 96px, auto;
}
.mirror {                                    /* the wall, mirrored in the glossy floor */
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--ext);
  overflow: hidden;
  /* a reflection dies away with depth: without this the walls would seem to carry on below the floor */
  -webkit-mask-image: linear-gradient(to bottom, #000, rgba(0,0,0,.35) 40%, transparent 92%);
          mask-image: linear-gradient(to bottom, #000, rgba(0,0,0,.35) 40%, transparent 92%);
  background:
    var(--corners),
    linear-gradient(to bottom, rgba(var(--ao), .12), rgba(var(--ao), .04) calc(6 * var(--u)), rgba(var(--ao), 0) calc(16 * var(--u))),
    linear-gradient(180deg, var(--wall-bot), var(--under) 85%);
}
/* Shade: on every wall you are not facing, and (deeper) on the one you are
   facing while a single look is in the spotlight. */
.plaster::before, .mirror::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: rgba(var(--ao), .17);
  opacity: .62;
  transition: opacity .7s;
}
.side.chosen .plaster::before, .side.chosen .mirror::before { opacity: 0; }
.side.chosen.spot .plaster::before, .side.focus .plaster::before { opacity: .8; transition-duration: .35s; }
/* Light: the wash on the wall you face, and the sign's red glow on wall and floor. */
.plaster::after, .mirror::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  opacity: 0; transition: opacity .7s;
}
.plaster::after {
  background:
    radial-gradient(ellipse 34% 30% at 50% 28%, rgba(var(--glow), .15), rgba(var(--glow), 0) 72%),
    radial-gradient(ellipse 52% 62% at 50% 46%, rgba(255,255,255,.5), rgba(255,255,255,0) 72%);
}
.mirror::after { background: radial-gradient(ellipse 30% 90% at 50% 0%, rgba(var(--glow), .30), rgba(var(--glow), 0) 72%); }
.side.chosen .plaster::after, .side.chosen .mirror::after { opacity: 1; }
.plaster > .shade { z-index: 1; }            /* shadows and light pools sit above shade and wash */

/* Floor and ceiling. In a narrow window the camera stands outside the room for
   the Store view (the wall behind it faces away, so it is not drawn); there they
   run on past the walls (--F > --D) so their edge is never in view. --g is how
   far inside their own edge the walls stand. They are shaded along the far wall
   and the two side walls only: the fourth wall is never seen. */
.floor, .ceiling {
  --g: var(--bleed);
  position: absolute;
  /* as wide as the room; from the far wall back to --F behind the room's middle. Kept no
     bigger than that: on a phone these are the largest things the browser has to draw. */
  left: calc(var(--D) * -1 - var(--bleed)); width: calc(var(--D) * 2 + var(--bleed) * 2);
  top: calc(var(--D) * -1 - var(--bleed)); height: calc(var(--D) + var(--F) + var(--bleed) * 2);
  transform-origin: 50% calc(var(--D) + var(--bleed));    /* the room's middle */
}
.floor {                                     /* see-through on purpose: reflections show in it */
  transform: translateY(var(--floor)) rotateX(90deg);
  background:
    linear-gradient(to bottom, rgba(var(--ao), .14) var(--g), rgba(var(--ao), .05) calc(var(--g) + 5 * var(--u)), rgba(var(--ao), 0) calc(var(--g) + 18 * var(--u))),
    linear-gradient(to right, rgba(var(--ao), .14) var(--g), rgba(var(--ao), .05) calc(var(--g) + 5 * var(--u)), rgba(var(--ao), 0) calc(var(--g) + 18 * var(--u))),
    linear-gradient(to left, rgba(var(--ao), .14) var(--g), rgba(var(--ao), .05) calc(var(--g) + 5 * var(--u)), rgba(var(--ao), 0) calc(var(--g) + 18 * var(--u))),
    rgba(236,239,243,.8);
}
.ceiling {
  transform: translateY(calc(var(--ceil) * -1)) rotateX(90deg);
  background:
    linear-gradient(to bottom, rgba(var(--ao), .15) var(--g), rgba(var(--ao), .07) calc(var(--g) + 8 * var(--u)), rgba(var(--ao), 0) calc(var(--g) + 30 * var(--u))),
    linear-gradient(to right, rgba(var(--ao), .15) var(--g), rgba(var(--ao), .07) calc(var(--g) + 8 * var(--u)), rgba(var(--ao), 0) calc(var(--g) + 30 * var(--u))),
    linear-gradient(to left, rgba(var(--ao), .15) var(--g), rgba(var(--ao), .07) calc(var(--g) + 8 * var(--u)), rgba(var(--ao), 0) calc(var(--g) + 30 * var(--u))),
    linear-gradient(rgba(var(--ao), .07), rgba(var(--ao), .07)),
    var(--wall-top);
}

/* ---------- Shadows on the floor ---------- */
/* .ground is a strip of floor at the foot of each wall, lying flat a hair above the
   floor itself. Each look has a .pad on it: her shadow where she stands, running back
   to meet her shadow on the wall. Being on the floor, it is drawn in true perspective. */
.ground {
  position: absolute;
  left: calc(var(--D) * -1); width: calc(var(--D) * 2);
  top: var(--floor); height: calc(18 * var(--u));
  transform-origin: 50% 0;
  transform: translateY(calc(-.08 * var(--u))) rotateX(90deg);
  overflow: hidden; pointer-events: none;
  display: none;   /* floor shadows switched off for now (16 Nov 2026): delete this line to bring them back */
}
.ground .strip { top: 0; bottom: auto; height: 100%; align-items: stretch; }
.pad { position: relative; flex: none; width: calc(var(--w, 19) * var(--u)); opacity: 0; transition: opacity .45s; }
.pad.ready { opacity: 1; }
.pad::before {                               /* centred under her feet, 3u out from the wall */
  content: ""; position: absolute; left: calc(50% + .9 * var(--u)); top: calc(2.6 * var(--u));
  width: calc(17 * var(--u)); height: calc(11 * var(--u)); translate: -50% -50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(20,24,38,.5), rgba(20,24,38,.2) 38%, rgba(20,24,38,0) 70%);
  transition: transform .22s var(--ease), opacity .22s;
}
.side:not(.chosen) .pad::before { opacity: .55; }   /* walls in shade throw softer shadows */
.pad.on::before { transform: scale(1.12); opacity: .85; }
.strip > .pad.gone { opacity: 0; transition: opacity .2s; }
.pad.ready.na:not(.sel) { opacity: .3; }
.strip > .pad.gone.na { opacity: 0; }
.side.focus .pad:not(.sel) { opacity: 0; }

/* ---------- Signage ---------- */
.signage {
  position: absolute; left: 0; top: calc(-41 * var(--u));
  transform: translateX(-50%) translateZ(calc(1.4 * var(--u)));
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  text-align: center; white-space: nowrap;
  pointer-events: none; user-select: none;
  transition: opacity .5s;
}
/* Overview: one logo, on the far wall. When a slide turns the room towards a side wall and that
   wall becomes the lit one, its sign comes on with it, so the red glow always has its source. */
body[data-view="store"] .side:not(.front):not(.chosen) > .signage { opacity: 0; }
.signage img {
  display: block; margin: 0 auto;
  height: min(calc(9.6 * var(--u)), 13vw); width: auto;
  filter:
    drop-shadow(0 0 calc(1.6 * var(--u)) rgba(var(--glow), .45))
    drop-shadow(calc(.35 * var(--u)) calc(.7 * var(--u)) calc(.7 * var(--u)) rgba(40,20,20,.26));
}
.side.front .signage img { animation: switch-on 1.5s .25s both; }   /* the sign flickers on, once */
@keyframes switch-on {
  0% { opacity: .12; } 9% { opacity: .9; } 13% { opacity: .2; } 22% { opacity: 1; }
  27% { opacity: .5; } 34%, 100% { opacity: 1; }
}
.signage span {
  display: block; margin-top: calc(1.5 * var(--u));
  font-size: max(calc(1.15 * var(--u)), 9px); font-weight: 500;
  letter-spacing: .52em; padding-left: .52em; text-transform: uppercase; color: #8b909b;
}

.plaster > .shade { position: absolute; inset: 0; }   /* holds the row of wall shadows */
/* A look that would run into a corner of the room leaves the row (store.js: slide). */
.strip > .fig.gone, .strip > .sh.gone { opacity: 0; pointer-events: none; transition: opacity .2s; }

/* ---------- Rows of looks ---------- */
/* .strip is used twice per wall (shadows on the wall, looks in front of it);
   both read the same --xu so they slide together. */
.strip {
  position: absolute; left: 50%; bottom: 0;
  display: flex; align-items: flex-end;
  transform: translateX(calc(-50% + var(--xu, 0) * var(--u)));
  transition: transform .6s var(--ease);
  will-change: transform;
}
.side.dragging .strip { transition: none; }

.figs {
  position: absolute;
  left: calc(var(--D) * -1); width: calc(var(--D) * 2);
  top: calc(var(--floor) - var(--figh) - 12 * var(--u));
  height: calc(var(--figh) + 34 * var(--u));         /* 12u headroom + 22u below the floor */
  transform: translateZ(var(--zf));
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  overflow: hidden;
  touch-action: pan-y;
}
.figs .strip { bottom: calc(22 * var(--u)); }
body[data-view="rail"] .figs { cursor: grab; }
body[data-view="rail"] .side.dragging .figs { cursor: grabbing; }
body[data-view="store"] .figs, body[data-view="store"] .wall { cursor: pointer; }
/* Whole-room view: a sideways drag anywhere turns the room (store.js: roam), so the browser is
   told to leave sideways touches to the page. Up-and-down swipes and pinch-zoom stay the browser's. */
body[data-view="store"], body[data-view="store"] .wall, body[data-view="store"] .figs { touch-action: pan-y pinch-zoom; }
body[data-view="store"] { -webkit-user-select: none; user-select: none; }
body.roaming, body.roaming .wall, body.roaming .figs { cursor: grabbing; }

/* --w (set per look by store.js) is her own width plus a fixed gap, in u: the clear
   space between neighbours is the same all along the wall. */
.fig, .sh {
  position: relative; flex: none;
  width: calc(var(--w, 19) * var(--u)); height: calc(var(--figh) + 3 * var(--u));
}
.fig {
  padding: 0; border: 0; background: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .45s;
}
.fig:focus-visible { outline-offset: calc(-1 * var(--u)); }
/* Every photo is scaled so the model is --figh tall, feet on the floor line.
   --ih: photo height in u · --b: feet position · --cx: body centre · --ar: w/h */
.photo, .sh img {
  position: absolute; left: 50%;
  top: calc(var(--figh) + 3 * var(--u) - var(--b) * var(--ih) * var(--u));
  height: calc(var(--ih) * var(--u));
  width: calc(var(--ih) * var(--ar) * var(--u));
  max-width: none;
  transform-origin: calc(var(--cx) * 100%) calc(var(--b) * 100%);
  pointer-events: none; user-select: none;
}
/* Two poses per look. On the wall you are facing (.side.chosen, set by store.js)
   every look shows its front photo (.facing); on the walls to either side it
   shows its sideways photo (.sideways), mirrored by --flip (1 or -1) so the
   model is turned towards the wall you face. A look keeps the sideways photo
   until its front photo has loaded (.turns). Pose changes are instant.
   The offset and the mirror use the separate translate / scale properties so
   that only the hover step forward (transform) is animated. */
.photo {
  translate: calc(var(--cx) * -100%) 0;
  transform: scale(var(--s, 1));
  transition: transform .22s var(--ease);
  opacity: 0;
}
.photo.sideways { scale: var(--flip, 1) 1; }
.photo.ready { animation: appear .35s; }     /* fades in once, when it first arrives */
@keyframes appear { from { opacity: 0; } }
.photo.sideways.ready { opacity: 1; }
.side.chosen .fig.turns .photo.sideways.ready, .fig.turns.sel .photo.sideways.ready { opacity: 0; }
.side.chosen .photo.facing.ready, .fig.sel .photo.facing.ready { opacity: 1; }
.fig.sel .photo.facing.ready.swap { opacity: 0; transition: opacity .16s; }   /* close-up: between two photos */
/* Hover: the look steps forward and the others fall back. No photo change. */
.fig.on { z-index: 3; }
.fig.on .photo { --s: 1.07; }
.side.chosen .strip.hot .fig:not(.on) .photo.facing.ready,
.side.chosen .strip.hot .fig:not(.on):not(.turns) .photo.sideways.ready { opacity: .58; transition: transform .22s var(--ease), opacity .2s; }

/* Not in stock in the size you picked: the look falls back (store.js: paintSize). */
.fig.na:not(.sel) { opacity: .28; }
.sh.ready.na:not(.sel) { opacity: .3; }
.strip > .fig.gone.na, .strip > .sh.gone.na { opacity: 0; }       /* trimmed at a corner still wins */
/* The next look slides in from the side it came from (store.js: stepLook). */
.fig.enter-r { animation: enter-r .4s var(--ease) both; }
.fig.enter-l { animation: enter-l .4s var(--ease) both; }
@keyframes enter-r { from { opacity: 0; transform: translateX(calc(8 * var(--u))); } }
@keyframes enter-l { from { opacity: 0; transform: translateX(calc(-8 * var(--u))); } }

/* Wall shadows are pre-blurred silhouettes (assets/shadows), so the wall
   needs no live blur filter and stays cheap to redraw while the camera turns.
   One per pose; they follow the same rules as the photos. */
.sh { opacity: 0; transition: opacity .45s; }
.sh.ready { opacity: 1; }
/* A pool of light behind each look on the wall you face; the look you point at
   (or open) gets the spotlight and the rest of the wall falls back. */
.sh::before {
  content: ""; position: absolute; left: 50%; bottom: calc(2 * var(--u));
  width: calc(32 * var(--u)); height: calc(66 * var(--u)); translate: -50% 0;
  background: radial-gradient(ellipse at 50% 52%, rgba(255,255,255,.62), rgba(255,255,255,0) 68%);
  opacity: 0; transition: opacity .35s, transform .35s var(--ease);
}
.side.chosen .sh::before { opacity: .7; }
.side.chosen.spot .sh:not(.on)::before { opacity: .22; }
.side.chosen .sh.on::before, .side.focus .sh.sel::before { opacity: 1; transform: scale(1.2); }
.sh img {
  translate: calc(var(--cx) * -100% + 2.4 * var(--u)) calc(.6 * var(--u));
  transform: scale(1.02);
  opacity: .22;
  transition: transform .22s var(--ease), translate .22s var(--ease);
}
.sh img.sideways { scale: var(--flip, 1) 1; }
.sh img.facing { opacity: 0; }
.side.chosen .sh.turns img.sideways, .sh.turns.sel img.sideways { opacity: 0; }
.side.chosen .sh.turns img.facing, .sh.turns.sel img.facing { opacity: .22; }
.sh.on img { translate: calc(var(--cx) * -100% + 4.2 * var(--u)) calc(1.2 * var(--u)); transform: scale(1.1); }
.side.chosen .sh.turns.on img.facing { opacity: .15; }

.reflbox {                                   /* reflection, below floor level */
  position: absolute; left: 50%; top: 100%;
  width: calc(var(--ih) * var(--ar) * var(--u)); height: calc(20 * var(--u));
  transform: translateX(calc(var(--cx) * -100%));
  overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.8), rgba(0,0,0,0) 88%);
          mask-image: linear-gradient(180deg, rgba(0,0,0,.8), rgba(0,0,0,0) 88%);
}
.reflbox.facing, .side.chosen .fig.turns .reflbox.sideways, .fig.turns.sel .reflbox.sideways { opacity: 0; }
.side.chosen .fig.turns .reflbox.facing, .fig.turns.sel .reflbox.facing { opacity: 1; }
.reflbox.sideways .refl { transform: scale(var(--flip, 1), -1); transform-origin: calc(var(--cx) * 100%) 50%; }
.refl {
  position: absolute; left: 0; width: 100%;
  top: calc((var(--b) - 1) * var(--ih) * var(--u));
  height: calc(var(--ih) * var(--u));
  transform: scaleY(-1);
  user-select: none;
}

/* Close-up: everything but the chosen look leaves the wall */
.side.focus .fig:not(.sel), .side.focus .sh:not(.sel) { opacity: 0; }
.side.focus .signage { opacity: 0; }
.side.focus .figs { cursor: default; }

/* The edges of the picture fall away a little, like a stage seen from the stalls. */
.vignette {
  position: fixed; inset: 0; z-index: 12; pointer-events: none;
  background: radial-gradient(ellipse 85% 80% at 50% 46%, rgba(18,22,38,0) 58%, rgba(18,22,38,.2));
}

/* ============================ Interface ============================ */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: 52px; pointer-events: none; }
.brand {
  position: absolute; left: 50%; top: 13px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-decoration: none; color: var(--muted); pointer-events: auto;
}
.brand img { height: 13px; width: auto; display: block; }
.brand span { font-size: 8px; font-weight: 500; letter-spacing: .42em; padding-left: .42em; text-transform: uppercase; }
.bag-btn {
  position: absolute; right: max(12px, env(safe-area-inset-right)); top: 6px;
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: none;
  display: grid; place-items: center; pointer-events: auto;
}
.badge {
  position: absolute; top: 5px; right: 3px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.badge.pop { animation: pop .45s var(--ease); }
@keyframes pop { 40% { transform: scale(1.5); } }

.round {
  width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center;
  background: #fff; box-shadow: 0 2px 10px rgba(20,24,36,.14), 0 0 0 1px rgba(20,24,36,.04);
  transition: transform .2s, opacity .3s;
}
.round:hover { transform: scale(1.08); }
.rail-arrow { position: fixed; top: 55%; z-index: 20; }
.rail-arrow.left { left: 14px; } .rail-arrow.right { right: 14px; }
.rail-arrow:disabled { opacity: 0; pointer-events: none; }
body[data-view="store"] .rail-arrow, body.shopping .rail-arrow { visibility: hidden; }

.caption {
  position: fixed; left: 0; top: 0; z-index: 15;
  transform: translate(-50%, 0); text-align: center; pointer-events: none;
  opacity: 0; transition: opacity .25s;
  font-size: 12px; line-height: 1.4; max-width: 220px;
}
.caption.on { opacity: 1; }
.caption strong { display: block; font-weight: 600; }
.caption span { color: var(--muted); font-size: 11px; }

.hint {
  position: fixed; left: 50%; bottom: 70px; z-index: 15; margin: 0;
  transform: translateX(-50%); white-space: nowrap;
  font-size: 11px; letter-spacing: .06em; color: var(--muted);
  transition: opacity .6s; pointer-events: none;
}
.hint.gone, body.shopping .hint { opacity: 0; }

.dock {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  max-width: calc(100vw - 16px);
}
.pillnav {
  position: relative; display: flex; align-items: center; gap: 2px; padding: 4px;
  background: #fff; border-radius: 999px;
  box-shadow: 0 6px 22px rgba(20,24,36,.13), 0 0 0 1px rgba(20,24,36,.04);
}
.pillnav button {
  position: relative; z-index: 1;
  border: 0; background: none; border-radius: 999px;
  padding: 0 14px; height: 32px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  color: #4d515a; transition: color .3s;
}
.pillnav button[aria-current="true"] { color: #fff; }
.pill-ink {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0;
  background: var(--ink); border-radius: 999px;
  transition: transform .5s var(--ease), width .5s var(--ease);
}
.pill-rule { width: 1px; height: 14px; background: var(--line); margin: 0 4px; }
.pillnav .pill-info { padding: 0; width: 32px; font-weight: 700; font-family: Georgia, serif; font-style: italic; font-size: 13px; }
.info {
  width: min(300px, calc(100vw - 32px)); padding: 12px 14px; border-radius: 14px;
  background: #fff; box-shadow: 0 6px 22px rgba(20,24,36,.13);
  font-size: 11.5px; line-height: 1.5; color: #4d515a; text-align: center;
  animation: rise .3s var(--ease) both;
}

/* Your size (store.js: paintSize): pick it once, top left. */
.sizer { position: fixed; left: max(12px, env(safe-area-inset-left)); top: 12px; z-index: 31; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.chip {
  height: 30px; padding: 0 12px; border: 0; border-radius: 999px;
  background: rgba(255,255,255,.82); box-shadow: 0 2px 10px rgba(20,24,36,.1), 0 0 0 1px rgba(20,24,36,.04);
  font-size: 11px; font-weight: 500; color: #4d515a; white-space: nowrap;
}
.chip b { font-weight: 700; color: var(--ink); margin-left: 3px; }
.size-menu {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; border-radius: 20px; background: #fff;
  max-width: calc(100vw - 24px);
  box-shadow: 0 6px 22px rgba(20,24,36,.13), 0 0 0 1px rgba(20,24,36,.04);
  animation: rise .25s var(--ease) both;
}
.size-menu button { min-width: 34px; height: 30px; padding: 0 9px; border: 0; border-radius: 999px; background: none; font-size: 11px; font-weight: 600; color: #4d515a; }
.size-menu button[aria-checked="true"] { background: var(--ink); color: #fff; }

/* ============================ Close-up ============================ */
.detail { position: fixed; inset: 0; z-index: 25; }
.stage {                                     /* where the camera parks the look */
  position: absolute;
  width: min(calc(34 * var(--u)), 44vw); left: calc(31vw - min(calc(17 * var(--u)), 22vw));
  top: calc(12 * var(--u)); bottom: calc(11.5 * var(--u));
}
.stage { touch-action: none; cursor: grab; user-select: none; }     /* drag to turn her round */
.stage.grabbing { cursor: grabbing; }
.stage-arrow { position: absolute; top: 50%; margin-top: -19px; animation: rise .5s .35s var(--ease) both; }
.stage-arrow.left { left: -19px; } .stage-arrow.right { right: -19px; }
.stage-arrow:disabled { opacity: .25; pointer-events: none; }
.turn {
  position: absolute; left: 50%; top: calc(100% + 1.4 * var(--u)); translate: -50% 0;   /* (not transform: the entrance animates that) */
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  animation: rise .5s .4s var(--ease) both;
}
.dots { display: flex; gap: 2px; }
.dots button { width: 24px; height: 24px; padding: 0; border: 0; background: none; display: grid; place-items: center; }
.dots button::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(16,17,20,.22);
  transition: background .2s, transform .2s;
}
.dots button.on::before { background: var(--ink); transform: scale(1.3); }
.turn-hint { margin: 0; font-size: 10.5px; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }

.card {
  position: absolute; left: 57vw; top: 50%; width: min(304px, 38vw);
  transform: translateY(-50%);
  background: #fff; border-radius: 16px; padding: 22px 20px 18px;
  box-shadow: 0 18px 50px rgba(20,24,36,.16), 0 0 0 1px rgba(20,24,36,.03);
  max-height: calc(100 * var(--u) - 24px); overflow: auto;
  animation: card-in .55s .25s var(--ease) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(calc(-50% + 16px)); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.card-close {
  position: absolute; right: 10px; top: 10px; width: 34px; height: 34px;
  border: 0; background: #f3f4f6; border-radius: 50%; display: grid; place-items: center; color: #4d515a;
}
.eyebrow { margin: 0 0 6px; font-size: 10px; font-weight: 500; letter-spacing: .04em; color: var(--muted); }
.card h2 { margin: 0 40px 6px 0; font-size: 18px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
.price { margin: 0; font-size: 14px; font-weight: 600; }
.price s { color: var(--muted); font-weight: 400; margin-left: 7px; }
.price.sale span { color: var(--red); }
.colour { margin: 3px 0 0; font-size: 11px; color: var(--muted); min-height: 1em; }
.label { margin: 16px 0 8px; font-size: 11px; font-weight: 600; }
.sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.sizes button {
  min-width: 40px; height: 34px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 11.5px; font-weight: 600; transition: background .2s, color .2s, border-color .2s;
}
.sizes button:hover:not(:disabled) { border-color: var(--ink); }
.sizes button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.sizes button:disabled { color: #b7bac2; text-decoration: line-through; cursor: not-allowed; background: #f6f7f9; }
.outfit { margin-top: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; }
.outfit-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.outfit-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); flex: none; }
.outfit-row img { width: 34px; height: 48px; object-fit: cover; object-position: top; border-radius: 7px; background: #eef0f3; flex: none; }
.outfit-text { min-width: 0; font-size: 11px; line-height: 1.4; color: var(--muted); }
.outfit-text strong { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink); }
.outfit .sizes { margin-top: 10px; }
.qty-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.qty-row .label { margin: 0; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty button { width: 34px; height: 32px; border: 0; background: none; font-size: 15px; border-radius: 999px; }
.qty button:disabled { color: #c5c8ce; cursor: default; }
.qty output { min-width: 18px; text-align: center; font-weight: 600; font-size: 12px; }
.cta {
  display: block; width: 100%; margin-top: 16px; padding: 0 16px; height: 44px; line-height: 44px;
  border: 0; border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 13px; font-weight: 600; text-align: center; text-decoration: none;
  transition: background .3s, transform .15s;
}
.cta:active { transform: scale(.98); }
.cta.done { background: var(--ok); }
.cta:disabled, .cta[aria-disabled="true"] { background: #c5c8ce; cursor: not-allowed; pointer-events: none; }
.more { display: block; margin-top: 12px; text-align: center; font-size: 11px; color: var(--muted); text-underline-offset: 3px; }
/* Stepping to another look: plain labelled links at the foot of the card, apart from the photo arrows. */
.look-step { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.look-step button { border: 0; background: none; padding: 6px 2px; font-size: 11px; font-weight: 500; color: #4d515a; }
.look-step button:hover:not(:disabled) { color: var(--ink); }
.look-step button:disabled { color: #c5c8ce; cursor: default; }

.ghost { position: fixed; z-index: 60; pointer-events: none; margin: 0; }

/* ============================ Bag ============================ */
.bag {
  position: fixed; top: 10px; right: 10px; bottom: 10px; z-index: 40;
  width: min(360px, calc(100vw - 20px)); background: #fff; border-radius: 20px;
  box-shadow: 0 24px 70px rgba(20,24,36,.24), 0 0 0 1px rgba(20,24,36,.04);
  display: flex; flex-direction: column;
  animation: bag-in .45s var(--ease) both;
}
@keyframes bag-in { from { opacity: 0; transform: translateX(30px); } }
.bag-head { position: relative; padding: 20px 20px 10px; }
.bag-head h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.bag-list { list-style: none; margin: 0; padding: 0 20px; overflow: auto; flex: 1; }
.bag-list li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #eef0f3; }
.bag-list img { width: 50px; height: 75px; object-fit: cover; object-position: top; background: #eef0f3; border-radius: 10px; }
.bag-list .meta { flex: 1; min-width: 0; font-size: 12px; line-height: 1.4; }
.bag-list .meta strong { display: block; font-weight: 600; }
.bag-list .meta span { color: var(--muted); font-size: 11px; }
.bag-list .rm { border: 0; background: none; color: var(--muted); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; padding: 12px 0 12px 8px; }
.bag-empty { padding: 0 20px; color: var(--muted); font-size: 13px; flex: 1; }
.bag-foot { padding: 14px 20px max(18px, env(safe-area-inset-bottom)); border-top: 1px solid #eef0f3; }
.bag-total { display: flex; justify-content: space-between; margin: 0; font-size: 14px; }
.bag-foot .cta { margin-top: 12px; }
.fine { margin: 10px 0 0; font-size: 10.5px; color: var(--muted); text-align: center; }

/* ============================ Phones ============================ */
@media (max-width: 760px) {
  .rail-arrow { display: none; }
  /* fingers, not a mouse: every control at least 40px tall */
  .pillnav button { padding: 0 12px; height: 40px; font-size: 12.5px; }
  .pillnav .pill-info { width: 40px; }
  .stage-arrow { width: 44px; height: 44px; margin-top: -22px; }
  .stage-arrow.left { left: -22px; } .stage-arrow.right { right: -22px; }
  .card-close { width: 40px; height: 40px; }
  .sizes button { min-width: 44px; height: 40px; font-size: 12.5px; }
  .size-menu button { min-width: 40px; height: 38px; font-size: 12px; }
  .qty button { width: 42px; height: 40px; }
  .look-step button { padding: 10px 2px; font-size: 12px; }
  .caption { font-size: 13px; }
  /* the Add button stays at the foot of the sheet however far its contents scroll */
  .card .cta { position: sticky; bottom: 4px; z-index: 2; box-shadow: 0 0 0 6px #fff, 0 -6px 8px 4px rgba(255,255,255,.9); }
  .stage {
    width: min(calc(30 * var(--u)), 70vw); left: calc(50vw - min(calc(15 * var(--u)), 35vw));
    top: calc(8.5 * var(--u)); bottom: auto; height: calc(38 * var(--u));
  }
  .turn { top: calc(100% + .6 * var(--u)); gap: 3px; }
  .chip { height: 34px; padding: 0 12px; font-size: 11px; }
  .card {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; transform: none;
    max-height: calc(50 * var(--u)); overflow: auto;
    border-radius: 22px 22px 0 0;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    animation-name: sheet-in;
  }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(40px); } }
  body.shopping .dock { visibility: hidden; }
}
@media (max-width: 380px) {
  .pillnav button { padding: 0 8px; font-size: 11px; }
  .pill-rule { display: none; }
  .pillnav .pill-info { width: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .strip, .photo, .reflbox, .pad, .pad::before, .sh img, .sh::before, .plaster::before, .plaster::after, .mirror::before, .mirror::after, .signage img, .pill-ink, .card, .bag, .info, .stage-arrow, .dots, .fig, .sh, .signage {
    transition-duration: .01s !important; animation-duration: .01s !important; animation-delay: 0s !important;
  }
}
