:root {
  --paper: #ffffff;
  --ink: #1d1b19;
  --muted: #8b847c;
  --line: #ece7e1;
  --tile: #f6f3ef;
  --accent: #c4553a;        /* terracotta, the only accent: filled hearts, the counter, the price drop */
  --accent-soft: #fbece7;
  --shadow: 46 32 22;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 999px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.defs { position: absolute; }

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 3vh 4vw;
}

.shop {
  position: relative;
  width: 34em;
  font-size: clamp(8px, min(2.75vw, 3.2vh), 16px);
}

/* ---- the bar ---- */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.1em;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.4em;
}
.brand { font-size: 1.15em; font-weight: 640; font-stretch: 112%; letter-spacing: -.01em; }
.brand__amp { color: var(--muted); font-weight: 400; }
.brand__sub { margin-left: .5em; font-size: .72em; font-weight: 520; color: var(--muted); letter-spacing: .02em; }
.bar__tools { display: flex; gap: .5em; }

.tool {
  position: relative;
  width: 2.6em;
  height: 2.6em;
  border-radius: 999px;
  display: grid;
  place-items: center;
  transition: background .25s;
}
@media (hover: hover) { .tool:hover { background: var(--tile); } }
.tool__icon { width: 1.35em; height: 1.35em; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; overflow: visible; }
.tool__heart-fill { fill: var(--accent); stroke: var(--accent); }
.tool__heart { transform-origin: 50% 55%; }

.badge {
  position: absolute;
  top: .05em;
  right: -.05em;
  min-width: 1.3em;
  height: 1.3em;
  padding: 0 .3em;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .78em;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 .18em var(--paper);
}
.badge--bag { background: var(--ink); }

.roll { display: inline-grid; overflow: hidden; vertical-align: top; line-height: 1.3em; height: 1.3em; }
.roll__line { grid-area: 1 / 1; display: block; white-space: nowrap; }

/* ---- the products ---- */
.grid { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1em; }
.card__tile {
  position: relative;
  aspect-ratio: 5 / 5.6;
  border-radius: .9em;
  background: var(--tile);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.card__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(var(--shadow) / .04);
  pointer-events: none;
}
.card__art { width: 74%; height: auto; overflow: visible; }
.card__name { margin-top: .75em; font-size: .95em; font-weight: 560; }
.card__price { margin-top: .15em; font-size: .9em; color: var(--muted); font-variant-numeric: tabular-nums; }

.heart {
  position: absolute;
  top: .55em;
  right: .55em;
  width: 2.2em;
  height: 2.2em;
  border-radius: 999px;
  background: rgb(255 255 255 / .9);
  box-shadow: 0 1px 2px rgb(var(--shadow) / .08), 0 4px 10px -4px rgb(var(--shadow) / .18);
  display: grid;
  place-items: center;
}
.heart svg { width: 1.15em; height: 1.15em; overflow: visible; }
.heart__line { fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linejoin: round; }
.heart__fill { fill: var(--accent); stroke: var(--accent); stroke-width: 1.7; stroke-linejoin: round; transform-origin: 12px 13px; transform-box: view-box; }
.heart__ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  opacity: 0;
  pointer-events: none;
}

/* ---- the panel ---- */
.panel {
  position: absolute;
  top: 3.6em;
  right: -.4em;
  width: min(24em, 100%);
  background: var(--paper);
  border-radius: 1em;
  box-shadow: 0 0 0 1px rgb(var(--shadow) / .06), 0 2px 4px rgb(var(--shadow) / .05), 0 22px 44px -18px rgb(var(--shadow) / .34);
  padding: 1em 1em .7em;
  transform-origin: 92% 0;
  z-index: 3;
}
.panel[hidden] { display: block; visibility: hidden; }
.panel__head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 .1em .7em; }
.panel__title { font-weight: 640; font-stretch: 108%; }
.panel__sum { font-size: .85em; color: var(--muted); font-variant-numeric: tabular-nums; }
.roll--sum { color: var(--ink); font-weight: 600; }

.rows { list-style: none; }
.row { overflow: hidden; }
.row[hidden] { display: none; }
.row__in {
  display: grid;
  grid-template-columns: 3.4em minmax(0, 1fr) auto;
  align-items: center;
  gap: .8em;
  padding: .55em .1em;
  border-top: 1px solid var(--line);
}
.row__art { width: 3.4em; height: 3.4em; border-radius: .65em; background: var(--tile); padding: .3em; overflow: visible; }
.row__name { font-size: .9em; font-weight: 560; }
.row__price { margin-top: .1em; font-size: .85em; font-variant-numeric: tabular-nums; display: flex; gap: .45em; align-items: baseline; }
.row__now { font-weight: 600; }
.roll--now { color: var(--ink); }
.row__was { position: relative; color: var(--muted); display: none; }
.row.has-drop .row__was { display: inline-block; }
.row.has-drop .roll--now { color: var(--accent); }
.row__strike { position: absolute; left: -.08em; right: -.08em; top: 55%; height: 1px; background: currentColor; transform-origin: 0 50%; transform: scaleX(0); }

.drop {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: .25em;
  margin-top: .35em;
  padding: .18em .55em .2em .4em;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .7em;
  font-weight: 620;
  letter-spacing: .01em;
  white-space: nowrap;
  opacity: 0;
  transform-origin: 0 50%;
}
.drop svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.drop__shine {
  position: absolute;
  inset: 0 auto 0 -40%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / .75), transparent);
  pointer-events: none;
}

.row__acts { display: flex; align-items: center; gap: .3em; }
.act--bag {
  font-size: .78em;
  font-weight: 600;
  padding: .55em .85em;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  white-space: nowrap;
  transition: background .25s;
}
@media (hover: hover) { .act--bag:hover { background: #3a3530; } }
.act--x { width: 1.9em; height: 1.9em; border-radius: 999px; display: grid; place-items: center; color: var(--muted); transition: background .25s, color .25s; }
@media (hover: hover) { .act--x:hover { background: var(--tile); color: var(--ink); } }
.act--x svg { width: .8em; height: .8em; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

.empty { display: none; padding: 1.1em .1em .6em; border-top: 1px solid var(--line); font-size: .85em; color: var(--muted); }
.panel.is-empty .empty { display: block; }

.undo {
  position: absolute;
  left: .4em;
  right: .4em;
  top: calc(100% + .55em);
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 14px 28px -14px rgb(var(--shadow) / .5);
  padding: .6em .9em;
  border-radius: .7em;
  background: var(--ink);
  color: #fff;
  font-size: .8em;
  visibility: hidden;
}
.undo__btn { font-weight: 650; color: #f3b6a6; padding: .1em .2em; }
.undo__time { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: #f3b6a6; transform-origin: 0 50%; opacity: .7; }

/* ---- the copy that flies into the list ---- */
.flyers { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.flyer {
  position: fixed;
  left: 0;
  top: 0;
  border-radius: .8em;
  background: var(--tile);
  box-shadow: 0 10px 22px -10px rgb(var(--shadow) / .45);
  display: grid;
  place-items: center;
}
.flyer svg { width: 78%; height: 78%; overflow: visible; }

@media (max-width: 380px) {
  .brand__sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tool, .act--bag, .act--x { transition: none; }
}
