:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --card: #f6f6f8;           /* the cards and the empty slots */
  --testo: #15151a;
  --testo-2: #5f5e68;
  --testo-3: #a3a2ac;
  --linea: #e9e8ee;
  --tratteggio: #cfcdd6;     /* the dashed empty slots */
  --inchiostro: #15151a;     /* the Compare pill and the drawings */
  --accento: #2d55e6;        /* the single accent: a cobalt blue, on the ticks, the counter and the best values */
  --accento-velo: rgba(45, 85, 230, .08);
  --ombra: 20, 20, 32;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: min(3.1vw, 2.45vh, 16px); }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stage { height: 100vh; display: grid; place-items: center; padding: 1em; }

.shop {
  position: relative;
  width: 30em;
  height: 25em;
  padding: 1.1em 1.1em 0;
}

.shop__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .9em; }
.brand { font-weight: 640; font-size: .95em; letter-spacing: -.01em; }
.crumb { font-size: .74em; color: var(--testo-3); }
.crumb strong { font-weight: 520; color: var(--testo-2); }
.crumb .sep { margin: 0 .25em; }

/* ---- the three cards ---- */
.cards { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7em; }
.card { display: flex; flex-direction: column; gap: .15em; }
.thumb {
  height: 6em;
  border-radius: .9em;
  background: var(--card);
  display: grid; place-items: center;
  margin-bottom: .45em;
}
.thumb svg { width: 72%; height: auto; overflow: visible; }
.ph .band, .ph .pad { fill: none; stroke: var(--inchiostro); stroke-width: 2.4; stroke-linecap: round; }
.ph .cup, .ph .bud { fill: #fff; stroke: var(--inchiostro); stroke-width: 2.4; }
.ph .pad { stroke-width: 1.6; opacity: .45; }
.card__name { font-size: .86em; font-weight: 600; letter-spacing: -.01em; }
.card__price { font-size: .78em; color: var(--testo-2); font-variant-numeric: tabular-nums; }

.check {
  margin-top: .45em;
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: .45em;
  font-size: .74em; font-weight: 520; color: var(--testo-2);
  padding: .25em .1em;
  border-radius: .4em;
}
.check:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.box {
  position: relative;
  width: 1.35em; height: 1.35em;
  border-radius: .38em;
  border: 1.5px solid var(--tratteggio);
  background: #fff;
  display: grid; place-items: center;
}
.box::before { /* the blue fill that grows from the centre when ticked */
  content: ""; position: absolute; inset: -1.5px; border-radius: inherit;
  background: var(--accento); transform: scale(var(--pieno, 0)); opacity: var(--pieno, 0);
}
.box svg { position: relative; width: 100%; height: 100%; }
.tick { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
@media (hover: hover) {
  .check:hover { color: var(--testo); }
  .check:hover .box { border-color: var(--testo-3); }
}

/* ---- the tray ---- */
.tray {
  position: absolute;
  left: .8em; right: .8em; bottom: .8em;
  height: 4.6em;
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 1.2em;
  box-shadow: 0 1px 2px rgba(var(--ombra), .05), 0 22px 44px -26px rgba(var(--ombra), var(--alza, .0));
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  will-change: transform;
}
.tray__bar {
  order: 2;
  flex: 0 0 4.6em;
  display: flex; align-items: center; gap: .7em;
  padding: 0 .8em;
}
.slots { display: flex; gap: .4em; margin-right: auto; }
.slot {
  position: relative;
  width: 2.9em; height: 2.9em;
  border-radius: .7em;
  border: 1.5px dashed var(--tratteggio);
  display: grid; place-items: center;
}
.slot svg { width: 2.3em; height: auto; overflow: visible; }
.slot.pieno { border-style: solid; border-color: transparent; background: var(--card); }

.clear { font-size: .76em; font-weight: 520; color: var(--testo-3); padding: .3em .2em; border-radius: .4em; }
.clear:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
@media (hover: hover) { .clear:hover { color: var(--testo); } }

.go {
  position: relative;
  height: 2.6em;
  padding: 0 1.1em;
  border-radius: 99em;
  background: var(--inchiostro);
  color: #fff;
  font-size: .86em; font-weight: 600;
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.go:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }
.go[aria-disabled="true"] { background: #e3e2e8; color: var(--testo-3); box-shadow: none; cursor: default; }
/* the two labels stay out of the flow, in a box as wide as the visible one: a hidden label never widens the pill */
.go__words { position: relative; display: block; height: 1.3em; }
.go__word { position: absolute; left: 0; top: 0; line-height: 1.3em; white-space: nowrap; }
.count { color: #9fb2ff; }
.go[aria-disabled="true"] .count { color: var(--testo-3); }
.num { position: relative; display: inline-block; overflow: hidden; height: 1.3em; vertical-align: top; text-align: center; }
.num b { display: block; font-weight: inherit; font-variant-numeric: tabular-nums; }

/* ---- the table that opens from the tray ---- */
.table {
  flex: 1 1 auto;
  min-height: 0;
  padding: .9em .9em .4em;
  display: flex; flex-direction: column;
  visibility: hidden;
}
.row {
  display: grid;
  grid-template-columns: 8.4em repeat(3, minmax(0, 1fr));
  align-items: center;
  min-height: 2.35em;
  flex: 1 1 auto;
  max-height: 3.4em;
  border-bottom: 1px solid var(--linea);
  font-size: .76em;
}
.row--head { flex: 0 0 auto; max-height: none; border-bottom-color: transparent; min-height: 4.6em; align-items: end; padding-bottom: .4em; }
.row__label { color: var(--testo-3); font-weight: 500; }
.cell { position: relative; text-align: center; font-variant-numeric: tabular-nums; color: var(--testo-2); padding: .3em 0; }
.cell b { display: block; font-weight: 600; color: var(--testo); }
.cell svg { display: block; width: 3.4em; height: auto; margin: 0 auto .35em; overflow: visible; }
.cell.meglio { color: var(--accento); font-weight: 600; }
.cell .velo { /* the soft blue band behind the best value */
  position: absolute; inset: .15em 12%; border-radius: .5em;
  background: var(--accento-velo); transform-origin: 50% 50%; z-index: -1;
}
.cell.spento { opacity: .28; }

/* the picture that flies from the card to the tray */
.volo { position: fixed; z-index: 20; pointer-events: none; display: grid; place-items: center; }
.volo svg { width: 100%; height: auto; overflow: visible; }
