:root {
  --fondo: #f6f3ee;
  --inchiostro: #1d1c1a;
  --tenue: #8a857c;
  --linea: rgba(29, 28, 26, 0.08);
  --carta: #ffffff;
  --accento: #2f5d50;
  --velo: #1f1b16;
  --cornice: #ffffff;
}

* { box-sizing: border-box; }

html, body { margin: 0; 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;
}

.palco {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 12px;
}

.vetrina {
  position: relative;
  width: min(92vw, calc((100vh - 96px) * 4 / 3), 820px);
}

.quadro { position: relative; }

.foto {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: clamp(12px, 2.4vw, 20px);
  overflow: hidden;
  background: #e6dfd3;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 30px 60px -32px rgba(60, 45, 25, 0.35), 0 0 0 1px var(--linea);
  isolation: isolate;
}

.foto__lente {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.scena, .luce, .velo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.scena { object-fit: cover; }
.luce { pointer-events: none; mix-blend-mode: soft-light; }
.velo { pointer-events: none; }
.velo__ombra { fill: var(--velo); opacity: 0; }

.grana {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.25  0 0 0 0 0.2  0 0 0 1 0'/></filter><rect width='160' height='160' filter='url(%23g)'/></svg>");
}

/* the four thin corner marks around the piece */
.cornice {
  --stacco: 0px;
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  opacity: 0;
  pointer-events: none;
}
.cornice i {
  position: absolute;
  width: clamp(10px, 2.2vw, 18px);
  height: clamp(10px, 2.2vw, 18px);
  border: 0 solid var(--cornice);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}
.cornice i:nth-child(1) { left: 0; top: 0; border-left-width: 1.5px; border-top-width: 1.5px; border-top-left-radius: 6px; transform: translate(calc(var(--stacco) * -1), calc(var(--stacco) * -1)); }
.cornice i:nth-child(2) { right: 0; top: 0; border-right-width: 1.5px; border-top-width: 1.5px; border-top-right-radius: 6px; transform: translate(var(--stacco), calc(var(--stacco) * -1)); }
.cornice i:nth-child(3) { left: 0; bottom: 0; border-left-width: 1.5px; border-bottom-width: 1.5px; border-bottom-left-radius: 6px; transform: translate(calc(var(--stacco) * -1), var(--stacco)); }
.cornice i:nth-child(4) { right: 0; bottom: 0; border-right-width: 1.5px; border-bottom-width: 1.5px; border-bottom-right-radius: 6px; transform: translate(var(--stacco), var(--stacco)); }

.zona {
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
}
.zona:focus-visible { outline: 1.5px solid var(--cornice); outline-offset: 2px; }

/* the product card */
.prodotto {
  position: absolute;
  top: 4%;
  left: 3%;
  width: clamp(150px, 36%, 270px);
  padding: clamp(8px, 1.4vw, 12px);
  border-radius: clamp(10px, 1.6vw, 14px);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 0 0 1px var(--linea), 0 18px 40px -18px rgba(40, 30, 15, 0.45);
  opacity: 0;
  visibility: hidden;
}
.prodotto.a-destra { left: auto; right: 3%; }

.prodotto__riga { display: flex; gap: clamp(8px, 1.2vw, 12px); align-items: center; }

.prodotto__foto {
  flex: none;
  width: clamp(40px, 7vw, 64px);
  aspect-ratio: 1;
  border-radius: 9px;
  overflow: hidden;
  background: #e6dfd3;
  box-shadow: 0 0 0 1px var(--linea);
}
.prodotto__foto svg { width: 100%; height: 100%; display: block; }
.prodotto__foto image { image-rendering: auto; }

.prodotto__testi { min-width: 0; }
.prodotto__testi p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prodotto__nome { font-size: clamp(11px, 1.6vw, 15px); font-weight: 620; letter-spacing: -0.01em; }
.prodotto__dett { margin-top: 2px !important; display: flex; align-items: center; gap: 5px; font-size: clamp(9.5px, 1.25vw, 12px); color: var(--tenue); }
.campione { flex: none; width: 9px; height: 9px; border-radius: 2.5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.prodotto__prezzo { margin-top: 3px !important; font-size: clamp(11px, 1.5vw, 14px); font-weight: 560; font-variant-numeric: tabular-nums; }

.aggiungi {
  position: relative;
  margin-top: clamp(7px, 1.2vw, 10px);
  width: 100%;
  height: clamp(28px, 4.4vw, 36px);
  border: 0;
  border-radius: 999px;
  background: var(--inchiostro);
  color: #fff;
  font: inherit;
  font-size: clamp(10.5px, 1.4vw, 13px);
  font-weight: 560;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 0.35s ease;
}
.aggiungi.fatto { background: var(--accento); }
.aggiungi__testo, .aggiungi__fatto {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.aggiungi__fatto { opacity: 0; }
.aggiungi__fatto svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (hover: hover) {
  .aggiungi:not(.fatto):hover { background: #34322e; }
}

.piede {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: clamp(11px, 1.5vw, 13px);
}
.piede p { margin: 0; }
.piede__titolo { color: var(--tenue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piede__titolo b { color: var(--inchiostro); font-weight: 620; margin-right: 6px; }

.borsa {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
  background: var(--carta);
  box-shadow: 0 0 0 1px var(--linea), 0 4px 12px -6px rgba(40, 30, 15, 0.25);
  font-weight: 560;
}
.borsa__cifra {
  display: inline-block;
  height: 1.5em;
  min-width: 1.5em;
  border-radius: 999px;
  background: var(--inchiostro);
  color: #fff;
  overflow: hidden;
  text-align: center;
  line-height: 1.5em;
  font-variant-numeric: tabular-nums;
  font-size: 0.92em;
}
.borsa__cifra > span { display: flex; flex-direction: column; }

.puntatore {
  position: absolute;
  left: 0; top: 0;
  width: 22px; height: 22px;
  fill: #111;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  z-index: 5;
}

/* on a narrow screen the card sits under the photo, on one line, so it never covers a piece */
@media (max-width: 560px) {
  .vetrina { width: min(92vw, calc((100vh - 168px) * 4 / 3)); }
  .prodotto, .prodotto.a-destra {
    position: relative;
    top: auto; left: auto; right: auto;
    width: 100%;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--carta);
  }
  .prodotto__riga { flex: 1; min-width: 0; }
  .aggiungi { flex: none; width: auto; min-width: 92px; margin-top: 0; padding: 0 12px; }
  .piede { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .puntatore { display: none; }
}
