/* Wren & Loom, the shop page and the bag that slides out from the right like a drawer */
:root {
  --carta: #f6f3ee;            /* warm white page */
  --foglio: #fdfbf8;           /* the drawer, a shade lighter than the page */
  --inchiostro: #1a1916;       /* type and the Checkout pill */
  --grigio: #8a857d;           /* small type */
  --filo: rgba(26, 25, 22, 0.1); /* hairlines */
  --binario: #ebe6df;          /* the empty free shipping bar */
  --accento: #2f6a4c;          /* the one accent: a deep green for free shipping */
  --velo: rgb(30, 27, 22);     /* the shade over the page (how dark: DIM in script.js) */
  --cassetto: min(400px, 92vw);
  --bordo: clamp(14px, 3.2vw, 44px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  height: 100vh;
  background: var(--carta);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
p, h1, h2, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }

/* ---- the page ---- */
.pagina {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 var(--bordo);
  transform-origin: 30% 50%;
}
.testa {
  display: flex;
  align-items: center;
  gap: 28px;
  height: clamp(48px, 9vh, 72px);
  border-bottom: 1px solid var(--filo);
}
.marchio { font-weight: 640; font-stretch: 112%; letter-spacing: -0.01em; font-size: 15px; white-space: nowrap; }
.voci { display: flex; gap: 22px; margin-right: auto; font-size: 13px; color: var(--grigio); }
.borsa {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
}
.borsa svg { width: 21px; height: 21px; stroke-width: 1.5; }
.borsa__conto {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--inchiostro);
  color: var(--carta);
  font-size: 10px;
  font-weight: 600;
  line-height: 17px;
  display: flex;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--carta);
  transform: scale(0);
}

.vetrina {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: clamp(10px, 3vh, 40px) 0;
}
.sopra { font-size: 12px; color: var(--grigio); letter-spacing: 0.02em; }
.titolo {
  margin: 6px 0 clamp(14px, 4vh, 40px);
  font-size: clamp(22px, min(4.2vw, 6.4vh), 52px);
  font-weight: 520;
  font-stretch: 94%;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
.prodotti {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 28px);
  max-width: 980px;
}
.prodotto { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tassello {
  position: relative;
  display: block;
  height: clamp(84px, 34vh, 360px);
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 28% 18%, rgba(255, 255, 255, 0.34), transparent 55%),
    linear-gradient(160deg, var(--tinta), var(--tinta-2));
  box-shadow: inset 0 0 0 1px rgba(26, 25, 22, 0.06), 0 1px 1px rgba(26, 25, 22, 0.04), 0 20px 36px -28px rgba(26, 25, 22, 0.5);
}
.tassello__trama {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0 1px, transparent 1px 5px), repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 5px);
  mix-blend-mode: soft-light;
}
.prodotto__riga { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.prodotto__nome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prodotto__prezzo { color: var(--grigio); }
.aggiungi {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px 0 6px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 540;
  background: var(--foglio);
  box-shadow: inset 0 0 0 1px var(--filo), 0 1px 2px rgba(26, 25, 22, 0.05);
  white-space: nowrap;
}
.aggiungi__piu {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--inchiostro);
  color: var(--carta);
}
.aggiungi__piu svg { width: 10px; height: 10px; stroke-width: 1.6; }
@media (hover: hover) {
  .aggiungi:hover { box-shadow: inset 0 0 0 1px rgba(26, 25, 22, 0.22), 0 4px 10px -6px rgba(26, 25, 22, 0.3); }
  .voci a:hover { color: var(--inchiostro); }
  .togli:hover { color: var(--inchiostro); }
  .quantita__tasto:hover { background: rgba(26, 25, 22, 0.06); }
  .chiudi:hover { background: rgba(26, 25, 22, 0.06); }
}

/* ---- the shade and the drawer ---- */
.velo {
  position: fixed;
  inset: 0;
  background: var(--velo);
  opacity: 0;
  visibility: hidden;
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
}
.cassetto {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--cassetto);
  display: flex;
  flex-direction: column;
  background: var(--foglio);
  border-left: 1px solid rgba(26, 25, 22, 0.08);
  box-shadow: -1px 0 0 rgba(255, 255, 255, 0.7) inset, -24px 0 60px -30px rgba(26, 25, 22, 0.45), -4px 0 14px -8px rgba(26, 25, 22, 0.18);
  transform: translateX(104%);
  visibility: hidden;
  overflow: hidden;
}
.cassetto__luce {
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.95) 30%, rgba(255, 255, 255, 0.95) 70%, transparent);
  pointer-events: none;
}
.cassetto__testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3vh, 24px);
  height: clamp(46px, 11vh, 64px);
  flex: none;
}
.cassetto__testa h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.cassetto__quanti {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  background: var(--binario);
  color: var(--grigio);
}
.chiudi { width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; margin-right: -6px; }
.chiudi svg { width: 15px; height: 15px; stroke-width: 1.5; }

.spedizione {
  flex: none;
  margin: 0 clamp(16px, 3vh, 24px);
  padding: clamp(9px, 2.4vh, 14px) 14px clamp(10px, 2.6vh, 16px);
  border-radius: 12px;
  background: var(--carta);
  box-shadow: inset 0 0 0 1px rgba(26, 25, 22, 0.05);
}
.spedizione__frase { font-size: 12.5px; height: 18px; margin-bottom: 9px; }
.spedizione__finestra { display: block; height: 18px; overflow: hidden; }
.spedizione__riga { display: flex; flex-direction: column; }
.spedizione__riga > span { height: 18px; line-height: 18px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.spedizione__manca { color: var(--grigio); gap: 0 !important; }
.spedizione__manca .rullo { color: var(--inchiostro); font-weight: 600; margin-right: 0.3em; }
.spedizione__fatta { color: var(--accento); font-weight: 600; }
.spedizione__fatta svg { width: 14px; height: 14px; stroke-width: 1.8; }
.spedizione__fatta path { stroke-dasharray: 1; stroke-dashoffset: 1; }

.barra { position: relative; display: block; height: 4px; border-radius: 999px; background: var(--binario); }
.barra__pieno {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #4e8a6b, var(--accento));
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.barra__filo {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 0;
  width: 26%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  opacity: 0;
  pointer-events: none;
}
.barra__meta {
  position: absolute;
  right: -2px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border-radius: 999px;
  background: var(--carta);
  color: #bdb6ac;
}
.barra__meta svg { width: 18px; height: 18px; stroke-width: 1.4; }
.barra__cerchio { stroke-dasharray: 1; stroke-dashoffset: 0; }
.barra__spunta { stroke-dasharray: 1; stroke-dashoffset: 1; stroke-width: 1.8; }

.righe {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  padding: clamp(4px, 1.4vh, 10px) clamp(16px, 3vh, 24px) 0;
}
.righe::-webkit-scrollbar { display: none; }
.riga { overflow: hidden; }
.riga__dentro {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(8px, 2.2vh, 14px) 0;
  border-bottom: 1px solid var(--filo);
}
.riga__tassello {
  flex: none;
  width: clamp(40px, 12vh, 58px);
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  background:
    radial-gradient(120% 90% at 28% 18%, rgba(255, 255, 255, 0.34), transparent 55%),
    linear-gradient(160deg, var(--tinta), var(--tinta-2));
  box-shadow: inset 0 0 0 1px rgba(26, 25, 22, 0.06);
}
.riga__testo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.riga__nome { font-size: 13.5px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.riga__variante { font-size: 11.5px; color: var(--grigio); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quantita {
  margin-top: 5px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  height: 26px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--filo);
}
.quantita__tasto { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; }
.quantita__tasto svg { width: 10px; height: 10px; stroke-width: 1.6; }
.quantita__numero { font-size: 12px; font-weight: 600; min-width: 14px; justify-content: center; }
.riga__destra { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; align-self: stretch; justify-content: space-between; padding: 2px 0; }
.riga__prezzo { font-size: 13.5px; font-weight: 560; }
.togli { font-size: 11.5px; color: var(--grigio); }

.vuoto {
  position: absolute;
  left: 0;
  right: 0;
  top: 46%;
  text-align: center;
  font-size: 14px;
  font-weight: 560;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}
.vuoto span { font-size: 12px; font-weight: 400; color: var(--grigio); }

.cassetto__piede {
  flex: none;
  padding: clamp(10px, 2.6vh, 18px) clamp(16px, 3vh, 24px) clamp(14px, 3.4vh, 24px);
  border-top: 1px solid var(--filo);
  background: var(--foglio);
  position: relative;
}
.totale { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; }
.nota { font-size: 11.5px; color: var(--grigio); margin: 3px 0 clamp(9px, 2.4vh, 16px); }
.cassa {
  position: relative;
  width: 100%;
  height: clamp(40px, 11vh, 50px);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  background: var(--inchiostro);
  color: var(--foglio);
  font-size: 14px;
  font-weight: 560;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 10px 22px -12px rgba(26, 25, 22, 0.7);
}
.cassa svg { width: 15px; height: 15px; stroke-width: 1.6; }
.cassa__luce {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  opacity: 0;
}

/* ---- rolling digits ---- */
.rullo { display: inline-flex; align-items: flex-start; overflow: hidden; height: 1.25em; line-height: 1.25em; vertical-align: bottom; }
.rullo__fermo { display: inline-block; flex: none; }
.rullo__colonna { display: inline-flex; flex-direction: column; overflow: hidden; flex: none; }
.rullo__colonna > span { height: 1.25em; display: block; text-align: center; }
.borsa__conto .rullo { height: 17px; line-height: 17px; }
.borsa__conto .rullo__colonna > span { height: 17px; }

/* ---- the phone: the drawer takes almost the whole width ---- */
@media (max-width: 560px) {
  :root { --cassetto: calc(100vw - 22px); }
  .voci { display: none; }
  .marchio { margin-right: auto; }
  .aggiungi { padding: 0 10px 0 5px; gap: 5px; font-size: 11.5px; height: 28px; }
  .aggiungi__piu { width: 18px; height: 18px; }
  .prodotto__riga { flex-direction: column; gap: 1px; font-size: 12px; }
}
@media (max-width: 380px) {
  .aggiungi__resto { display: none; }
}
@media (max-height: 460px) {
  .nota { display: none; }
  .totale { margin-bottom: 8px; }
  .riga__variante { display: none; }
}
.cassetto__quanti { display: inline-flex; align-items: center; justify-content: center; }
.cassetto__quanti .rullo { height: 20px; line-height: 20px; }
.cassetto__quanti .rullo__colonna > span { height: 20px; }
