:root {
  --fondo: #ffffff;
  --card: #ffffff;
  --inchiostro: #17181a;
  --grigio: #6f6f74;
  --grigio-chiaro: #a6a6ab;
  --bordo: rgba(23, 24, 26, 0.09);
  --tessera: #f4f3ef;
  --pillola: #17181a;
  --pillola-alta: #2a2b2f;
  --accento: #ff6b2c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 12px;
}

/* ---------- the card of the last order ---------- */
.order {
  position: relative;
  width: min(420px, 94vw, 88vh);
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 22px;
  padding: clamp(12px, 4vmin, 18px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 2px rgba(23, 24, 26, 0.04),
    0 4px 10px -4px rgba(23, 24, 26, 0.06),
    0 22px 44px -24px rgba(23, 24, 26, 0.24),
    0 44px 80px -48px rgba(23, 24, 26, 0.22);
}

.order__head { display: flex; align-items: center; gap: 10px; }
.order__mark {
  flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: #f1f4ec;
  box-shadow: 0 0 0 1px rgba(23, 24, 26, 0.05) inset;
}
.order__mark svg {
  width: 18px; height: 18px;
  fill: none; stroke: #3c5a2f; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.order__title { flex: 1; min-width: 0; }
.order__brand { font-size: 14px; font-weight: 650; letter-spacing: -0.012em; line-height: 1.2; }
.order__when { font-size: 12px; color: var(--grigio); margin-top: 1px; }
.order__state {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 560; color: var(--grigio);
  padding: 5px 9px 5px 7px; border-radius: 999px;
  background: var(--tessera);
  white-space: nowrap;
}
.order__state svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- the three products ---------- */
.items {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 2.6vmin, 12px);
  margin: clamp(12px, 3.6vmin, 18px) 0 clamp(12px, 3.6vmin, 16px);
}
.item { min-width: 0; }

.slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
}
/* the empty place a product leaves behind: a dashed outline drawn in SVG-like CSS */
.slot__ghost {
  position: absolute; inset: 0;
  border-radius: 16px;
  border: 1.2px dashed rgba(23, 24, 26, 0.2);
  background: repeating-linear-gradient(135deg, rgba(23, 24, 26, 0.025) 0 6px, transparent 6px 12px);
  opacity: 0;
}
.thumb {
  position: absolute; inset: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--tessera);
  box-shadow:
    0 0 0 1px rgba(23, 24, 26, 0.07),
    0 1px 2px rgba(23, 24, 26, 0.06),
    0 8px 16px -10px rgba(23, 24, 26, 0.3);
  will-change: transform;
}
.thumb img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
  user-select: none;
}
/* a thin light along the top edge, like a glossy print */
.thumb__shine {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 38%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
  pointer-events: none;
}

.item__name {
  margin-top: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: -0.008em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item__qty { font-size: 11.5px; color: var(--grigio); margin-top: 1px; white-space: nowrap; }

/* ---------- the pill ---------- */
.again {
  position: relative;
  display: block;
  width: 100%;
  height: 60px;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.again__body {
  position: relative;
  display: flex; align-items: center; gap: clamp(8px, 3vw, 12px);
  height: 100%;
  padding: 0 clamp(14px, 4.6vw, 20px) 0 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--pillola-alta), var(--pillola) 58%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 -1px 0 rgba(0, 0, 0, 0.4) inset,
    0 0 0 1px rgba(23, 24, 26, 0.9),
    0 2px 4px rgba(23, 24, 26, 0.12),
    0 12px 22px -12px rgba(23, 24, 26, 0.5);
  transition: box-shadow 0.35s ease;
}
.again:focus-visible .again__body {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 0 0 1px rgba(23, 24, 26, 0.9),
    0 0 0 4px #fff,
    0 0 0 6px var(--accento);
}
.again.is-hover .again__body {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 -1px 0 rgba(0, 0, 0, 0.4) inset,
    0 0 0 1px rgba(23, 24, 26, 0.9),
    0 4px 8px rgba(23, 24, 26, 0.14),
    0 18px 30px -14px rgba(23, 24, 26, 0.6);
}
@media (hover: hover) {
  .again:hover .again__body {
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.18) inset,
      0 -1px 0 rgba(0, 0, 0, 0.4) inset,
      0 0 0 1px rgba(23, 24, 26, 0.9),
      0 4px 8px rgba(23, 24, 26, 0.14),
      0 18px 30px -14px rgba(23, 24, 26, 0.6);
  }
}

.again__cart {
  position: relative;
  flex: none;
  width: 44px; height: 44px;
}
.again__disc {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset, 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}
.again__icon {
  position: absolute; left: 11px; top: 10px;
  width: 22px; height: 22px;
  fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  overflow: visible;
}
.again__icon circle { fill: #fff; stroke: none; }
.again__badge {
  position: absolute; right: -3px; top: -3px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: var(--accento);
  box-shadow: 0 0 0 2px var(--pillola), 0 2px 6px rgba(255, 107, 44, 0.45);
  display: grid; place-items: center;
  overflow: hidden;
  font-size: 10.5px; font-weight: 700; line-height: 1;
  color: #fff;
  opacity: 0;
  transform: scale(0.4);
}
.again__badge-n { display: block; }

.again__labels {
  position: relative;
  flex: 1; min-width: 0;
  height: 24px;
  overflow: hidden;
  text-align: left;
}
.again__label {
  position: absolute; left: 0; top: 0;
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px;
  font-size: clamp(14px, 4.3vw, 16px); font-weight: 600; letter-spacing: -0.01em;
  font-stretch: 100%;
  white-space: nowrap;
}
.again__label--done { opacity: 0; }
.again__check {
  width: 18px; height: 18px;
  fill: none; stroke: var(--accento); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}

/* the total: one window per character, every digit a column that rolls */
.again__total {
  flex: none;
  display: inline-flex; align-items: center;
  height: 22px;
  padding-left: clamp(10px, 3.4vw, 14px);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 15px; font-weight: 560;
  color: rgba(255, 255, 255, 0.78);
}
.odo { position: relative; display: inline-block; height: 22px; overflow: hidden; }
.odo--digit { width: 0.62em; text-align: center; }
.odo__col { display: block; will-change: transform; }
.odo__col span { display: block; height: 22px; line-height: 22px; }
.odo--fix { line-height: 22px; }

/* ---------- the photos in flight ---------- */
.flyers { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.flyer {
  position: absolute; left: 0; top: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--tessera);
  box-shadow:
    0 0 0 1.5px #fff,
    0 0 0 2.5px rgba(23, 24, 26, 0.08),
    0 10px 18px -8px rgba(23, 24, 26, 0.38),
    0 22px 36px -18px rgba(23, 24, 26, 0.3);
  will-change: transform;
}
.flyer img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* a band of light that crosses the pill once when the order is in the cart */
.again__glint {
  position: absolute; inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
.again__band {
  position: absolute; top: -20%; bottom: -20%; left: 0;
  width: 38%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.13) 45%, rgba(255, 160, 110, 0.16) 55%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg);
  opacity: 0;
}
.odo--digit {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
}
