
    :root { --brand:#059669; --ink:#111827; --muted:#6b7280; --card:#ffffff; --line:#e5e7eb; --bg:#f7f7f7; }
    *{box-sizing:border-box} body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;background:var(--bg);color:var(--ink)}
    .wrap{max-width:1100px;margin:0 auto;padding:16px}
    header{position:sticky;top:0;background:#fffcc0a0;background:#fff;backdrop-filter:saturate(1.2) blur(2px);border-bottom:1px solid var(--line);z-index:10}
    .tabs{display:flex;gap:8px;justify-content:flex-end}
    .tab{padding:8px 12px;border-radius:999px;border:1px solid var(--line);background:#fff;color:var(--ink);font-weight:600;cursor:pointer}
    .tab.active{background:var(--brand);color:#fff;border-color:var(--brand)}
    h1{margin:0;font-size:20px}
    main{padding:24px 0}
    .grid{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:12px}
    @media(min-width:640px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
    @media(min-width:1024px){.grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
    .card{background:var(--card);border:1px solid var(--line);border-radius:16px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.04)}
    .card-img{aspect-ratio:4/3;display:grid;place-items:center;background:#f3f4f6}
    .card-img img{max-width:100%;max-height:100%;object-fit:contain;display:block}
    .card-body{padding:12px}
    .price{font-weight:800}
    .subprice{color:var(--muted);font-size:12px}
    .rep-title{font-size:18px;font-weight:700;margin:22px 0 10px}
    .vol-thumb{position:relative;border-radius:16px;overflow:hidden;border:1px solid var(--line);cursor:pointer;background:#fff}
    .vol-thumb img{display:block;width:100%;height:auto}
    .vol-badge{position:absolute;bottom:8px;right:8px;background:rgba(0,0,0,.6);color:#fff;padding:3px 8px;border-radius:999px;font-size:11px}
    .empty{border:1px dashed var(--line);border-radius:16px;padding:24px;text-align:center;background:#fff;color:var(--muted)}
    .toolbar{display:flex;gap:8px;align-items:center;margin-bottom:12px}
    .search{width:100%;max-width:420px;padding:10px 12px;border-radius:12px;border:1px solid var(--line)}
    .btn{display:inline-block;padding:10px 14px;border-radius:12px;background:var(--brand);color:#fff;text-decoration:none;font-weight:700}
    /* Lightbox */
    .overlay{position:fixed;inset:0;background:rgba(0,0,0,.85);display:none;align-items:center;justify-content:center;padding:16px;z-index:50}
    .overlay.open{display:flex}
    .overlay img{max-height:90vh;width:auto;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.3)}
    .overlay .close{position:fixed;top:16px;right:16px;background:#fff;color:#000;border:0;border-radius:10px;padding:8px 10px;font-weight:700;cursor:pointer}

    /* --- Accordion --- */
.acc-section { border:1px solid var(--line); border-radius:14px; background:#fff; overflow:hidden; }
.acc-head { width:100%; text-align:left; background:#fff; border:0; padding:12px 14px; font-weight:700; cursor:pointer; display:flex; align-items:center; justify-content:space-between; }
.acc-head:hover { background:#f8faf8; }
.acc-icon { transition: transform .2s ease; }
.acc-section.open .acc-icon { transform: rotate(90deg); }
.acc-body { display:none; border-top:1px solid var(--line); padding:14px; }

/* --- Griglia 2 colonne fissa anche su mobile, card stessa altezza --- */
.grid-2 {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  align-items:stretch;          /* card della stessa riga = stessa altezza */
}

/* --- Card prodotto --- */
.product-card {
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  box-shadow:0 1px 3px rgba(0,0,0,.04);
  display:flex;
  flex-direction:column;
  height:100%;                  /* riempie l'intera cella di griglia */
  min-width:0;                  /* impedisce overflow orizzontale su flex/grid */
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease;
}
.product-card:hover {
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(0,0,0,.08);
}

/* Box immagine: aspect-ratio + flexbox per centrare senza che l'img sbordi
   (iOS Safari ha un bug con display:grid + place-items:center + max-height:100%
    su immagini verticali, quindi uso flex). */
.product-img {
  position:relative;            /* per badge sconto e counter foto */
  aspect-ratio:1 / 1;           /* tutte le "teste" delle card sono uguali */
  width:100%;
  background:#f3f4f6;
  padding:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;              /* sicurezza anti-sbordamento */
  flex-shrink:0;                /* non si comprime se il body cresce */
}
.product-img img {
  display:block;
  max-width:100%;
  max-height:100%;
  width:auto;
  height:auto;
  object-fit:contain;
}

/* Corpo card: occupa lo spazio rimanente, prezzo "incollato" in basso */
.product-body {
  padding:10px;
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  gap:4px;
}
.product-title {
  font-weight:700;
  line-height:1.2;
  text-transform:uppercase;
  font-size:13px;
}
.product-sub {
  font-size:12px;
  color:var(--muted);
  line-height:1.3;
}
.product-prices {
  margin-top:auto;               /* spinge in fondo */
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  padding-top:8px;
  gap:1px;
}
.product-oldprice {
  font-size:12px;
  color:var(--muted);
  text-decoration:line-through;
  text-decoration-thickness:1.5px;
}
.product-price {
  font-weight:800;
  font-size:1.2rem;
  line-height:1.1;
  color:var(--ink);
}
.product-subprice {
  color:var(--muted);
  font-size:12px;
}

/* Badge sconto: cartellino rosso in alto a destra dell'immagine.
   Forma a "bollino" pieno (cerchio leggermente ovalizzato), più "volantino" che pillola. */
.badge-discount {
  position:absolute;
  top:10px;
  right:10px;
  background:#dc2626;
  color:#fff;
  font-weight:900;
  font-size:18px;
  line-height:1;
  letter-spacing:.01em;
  padding:10px 14px;
  border-radius:999px;
  box-shadow:0 4px 12px rgba(220,38,38,.4);
  pointer-events:none;
  z-index:2;
  /* leggera rotazione "cartellino" - dà l'effetto sticker da volantino */
  transform:rotate(-6deg);
}

/* Su mobile riduco un filo per non occupare troppa immagine */
@media (max-width: 640px) {
  .badge-discount {
    font-size:14px;
    padding:7px 10px;
    top:8px;
    right:8px;
  }
}

/* Counter foto multiple: pillola scura in basso a destra dell'immagine */
.photo-counter {
  position:absolute;
  bottom:8px;
  right:8px;
  background:rgba(17,24,39,.78);
  color:#fff;
  font-size:11px;
  font-weight:700;
  padding:3px 8px;
  border-radius:999px;
  backdrop-filter:blur(4px);
  pointer-events:none;
}

.header-brand { display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px 0; }
.header-brand img { height:36px; width:auto; display:block; }
.header-validita { font-size:12px; letter-spacing:.02em; color:var(--muted); text-transform:uppercase; }
.tabs { display:flex; gap:8px; justify-content:center; padding:8px 0 12px; }
.tab { padding:8px 12px; border-radius:999px; border:1px solid var(--line); background:#fff; color:var(--ink); font-weight:600; text-decoration:none; }
.tab.active { background:var(--brand); color:#fff; border-color:var(--brand); }


/* --- Modale prodotto --- */
.product-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.75);
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:60;
}
.product-overlay.open{
  display:flex;
}
.product-modal{
  position:relative;
  max-width:420px;
  width:100%;
  background:#fff;
  border-radius:20px;
  box-shadow:0 20px 40px rgba(0,0,0,.35);
  overflow:hidden;
  transform-origin:center center;
}
.product-modal-img-wrap{
  position:relative;
  background:#f3f4f6;
  display:grid;
  place-items:center;
  padding:12px;
}
.product-modal-img{
  max-width:100%;
  max-height:260px;
  object-fit:contain;
  display:block;
}
.product-modal-body{
  padding:14px 16px 16px;
}
.product-modal-title{
  font-size:18px;
  font-weight:800;
  text-transform:uppercase;
  line-height:1.2;
}
.product-modal-subtitle{
  font-size:14px;
  color:var(--muted);
  margin-top:4px;
}
.product-modal-prices{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.product-modal-oldprice{
  font-size:0.95rem;
  color:var(--muted);
  text-decoration:line-through;
  text-decoration-thickness:1.5px;
}
.product-modal-price{
  font-size:1.6rem;
  font-weight:900;
}
.product-modal-subprice{
  font-size:0.95rem;
  color:var(--muted);
}

/* Badge sconto nella modale - stesso stile "cartellino" della card */
.product-modal-badge{
  position:absolute;
  top:14px;
  left:14px;
  background:#dc2626;
  color:#fff;
  font-weight:900;
  font-size:20px;
  line-height:1;
  padding:10px 16px;
  border-radius:999px;
  box-shadow:0 4px 12px rgba(220,38,38,.4);
  z-index:2;
  transform:rotate(-6deg);
}

/* Strip di miniature sotto l'immagine grande (solo se >1 foto) */
.product-modal-thumbs{
  display:flex;
  gap:6px;
  padding:8px 12px;
  background:#fafafa;
  border-bottom:1px solid var(--line);
  overflow-x:auto;
  scrollbar-width:thin;
}
.product-modal-thumb{
  flex:0 0 auto;
  width:56px;
  height:56px;
  padding:4px;
  border:2px solid transparent;
  border-radius:10px;
  background:#fff;
  cursor:pointer;
  display:grid;
  place-items:center;
  transition:border-color .15s ease;
}
.product-modal-thumb:hover{ border-color:#cbd5e1; }
.product-modal-thumb.active{ border-color:var(--brand); }
.product-modal-thumb img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  display:block;
}
.product-modal-close{
  position:absolute;
  top:8px;
  right:8px;
  border:0;
  background:rgba(0,0,0,.06);
  border-radius:999px;
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  cursor:pointer;
  font-size:14px;
}

/* Animazioni */
@keyframes modalEnterElastic{
  0%   { transform:scale(0.8); opacity:0; }
  60%  { transform:scale(1.05); opacity:1; }
  100% { transform:scale(1); opacity:1; }
}
@keyframes modalExitFade{
  0%   { opacity:1; transform:scale(1); }
  100% { opacity:0; transform:scale(0.95); }
}
.product-modal.animate-in{
  animation:modalEnterElastic .35s cubic-bezier(0.25, 1.25, 0.5, 1) forwards;
}
.product-modal.animate-out{
  animation:modalExitFade .22s ease-out forwards;
}

/* Barra di condivisione */
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:var(--bg);
  color:var(--ink);
  padding-bottom:70px; /* spazio per la barra fissa */
}

.share-bar{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  background:var(--brand);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 16px;
  z-index:55;
  box-shadow:0 -2px 8px rgba(0,0,0,.15);
}
.share-bar-text{
  font-size:14px;
  font-weight:600;
}
.share-bar-url{
  font-size:11px;
  opacity:.9;
  max-width:220px;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
}
.share-bar-actions{
  display:flex;
  gap:8px;
}
.share-bar-btn{
  border:0;
  padding:8px 12px;
  border-radius:999px;
  background:#ffffff;
  color:var(--brand);
  font-weight:700;
  font-size:13px;
  cursor:pointer;
}
.share-bar-btn.secondary{
  background:rgba(255,255,255,.15);
  color:#fff;
}