
/* =====================================================================
   Le regole sono divise per vista: data-ptop-vista su <html> = classica | griglia | mosaico
   (senza attributo vale la Griglia). Comune = Griglia + Mosaico.
   ===================================================================== */

/* ===================== COMUNE (Griglia + Mosaico) ===================== */
/* ---- Riquadro "come il banner" nelle card speciali ---- */
html:not([data-ptop-vista="classica"]) .ptop-mz-chart{--mz-c:#16a34a;position:relative;background:#f8f9fa;border:0;border-radius:10px;padding:10px 12px;font-size:12px;line-height:1.35;box-sizing:border-box}
html:not([data-ptop-vista="classica"]) .ptop-mz-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px;flex-wrap:wrap;margin-bottom:4px}
html:not([data-ptop-vista="classica"]) .ptop-mz-head b{color:var(--mz-c);font-size:13px;font-weight:800}
html:not([data-ptop-vista="classica"]) .ptop-mz-head span{color:#6b7280;font-size:11px}
html:not([data-ptop-vista="classica"]) .ptop-mz-why{margin:0 0 6px !important;color:#374151;font-size:12px;line-height:1.4}
html:not([data-ptop-vista="classica"]) .ptop-mz-plot{position:relative}
html:not([data-ptop-vista="classica"]) .ptop-mz-chart svg{display:block;width:100%;height:64px;overflow:visible}
html:not([data-ptop-vista="classica"]) .ptop-mz-chart svg .l{fill:none;stroke:var(--mz-c);stroke-width:2;stroke-linejoin:round}
html:not([data-ptop-vista="classica"]) .ptop-mz-chart svg .a{fill:var(--mz-c);opacity:.09}
html:not([data-ptop-vista="classica"]) .ptop-mz-dots{position:absolute;inset:0;pointer-events:none}
html:not([data-ptop-vista="classica"]) .ptop-mz-dots i{position:absolute;width:9px;height:9px;border-radius:50%;transform:translate(-50%,-50%);border:2px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.08)}
html:not([data-ptop-vista="classica"]) .ptop-mz-dots .m{background:#374151}html:not([data-ptop-vista="classica"]) .ptop-mz-dots .o{background:var(--mz-c)}
html:not([data-ptop-vista="classica"]) .ptop-mz-foot{display:flex;align-items:center;flex-wrap:wrap;gap:5px;margin-top:8px;color:#374151;font-size:12px}
html:not([data-ptop-vista="classica"]) .ptop-mz-foot b{color:#111827}html:not([data-ptop-vista="classica"]) .ptop-mz-foot .sep{width:10px}
html:not([data-ptop-vista="classica"]) .ptop-mz-foot .dot-o,html:not([data-ptop-vista="classica"]) .ptop-mz-foot .dot-m{width:8px;height:8px;border-radius:50%;display:inline-block}
html:not([data-ptop-vista="classica"]) .ptop-mz-foot .dot-o{background:var(--mz-c)}html:not([data-ptop-vista="classica"]) .ptop-mz-foot .dot-m{background:#374151}

/* ---- Indice non ancora disponibile: niente barra vuota ---- */
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product.ptop-noscore .indice-convenienza .ic-barra,html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product.ptop-noscore .indice-convenienza .ic-score{display:none !important}
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product.ptop-noscore .indice-convenienza::before{content:"Indice in calcolo";display:inline-block;font-size:11px;font-weight:600;color:#6b7280;background:#f3f4f6;border-radius:999px;padding:3px 9px}

/* ---- Loghi dei negozi ---- */
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .ptop-shops{display:flex;align-items:center;flex-wrap:wrap;gap:4px;margin:8px 10px 0;min-height:24px}
html:not([data-ptop-vista="classica"]) .ptop-shops-lbl{font-size:10.5px;color:#6b7280;margin-right:2px;white-space:nowrap}
html:not([data-ptop-vista="classica"]) .ptop-shops .ptop-shop{width:22px;height:22px;border-radius:50%;background:#fff;border:1px solid #e5e7eb;object-fit:contain;padding:2px;box-sizing:border-box;box-shadow:0 1px 2px rgba(0,0,0,.06)}
html:not([data-ptop-vista="classica"]) .ptop-shops .ptop-shop + .ptop-shop{margin-left:-8px}
html:not([data-ptop-vista="classica"]) .ptop-shops .ptop-shop:hover{position:relative;z-index:2;transform:scale(1.25);transition:transform .15s}
html:not([data-ptop-vista="classica"]) .ptop-shops .ptop-shop-txt,html:not([data-ptop-vista="classica"]) .ptop-shops .ptop-shop-more{width:auto;min-width:22px;padding:0 7px;font-size:10px;font-weight:700;line-height:20px;color:#4b5563;background:#f3f4f6;border-color:#e5e7eb;border-radius:11px;white-space:nowrap;box-shadow:none}
html:not([data-ptop-vista="classica"]) .ptop-shops .ptop-shop-txt + .ptop-shop,html:not([data-ptop-vista="classica"]) .ptop-shops .ptop-shop + .ptop-shop-txt,html:not([data-ptop-vista="classica"]) .ptop-shops .ptop-shop-txt + .ptop-shop-txt,html:not([data-ptop-vista="classica"]) .ptop-shops .ptop-shop + .ptop-shop-more{margin-left:2px}

/* ---- "Prezzo ai minimi" sulle card normali (come il titolo del banner) ---- */
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .ptop-chip{--mz-c:#16a34a;display:inline-flex;align-items:center;gap:5px;align-self:flex-start;margin:8px 10px 0;padding:3px 9px 3px 7px;border-radius:999px;background:color-mix(in srgb,var(--mz-c) 14%,#fff);color:var(--mz-c);font-size:11px;font-weight:800;white-space:nowrap}
html:not([data-ptop-vista="classica"]) .ptop-chip svg{width:13px;height:13px}
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .ptop-shops{flex-wrap:nowrap !important;overflow:hidden}

/* =====================================================================
   RIFINITURA GRAFICA (1.8.0) – tutte le card della griglia
   ===================================================================== */
html:not([data-ptop-vista="classica"]) .woocommerce ul.products[data-products]{--mz-viola:#5b21b6;--mz-viola2:#7c3aed;--mz-bordo:#e5e7eb;--mz-testo:#1f1a2e;--mz-muto:#6b6780}

/* guscio della card */
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product{border-radius:16px !important;overflow:hidden;background:#fff !important;border:0 !important;
  box-shadow:0 1px 2px rgba(31,26,46,.04),0 6px 18px -10px rgba(31,26,46,.18) !important;
  transition:transform .28s cubic-bezier(.2,.8,.2,1),box-shadow .28s ease,border-color .28s ease !important}
@media (hover:hover){
  html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product:hover{transform:translateY(-4px);box-shadow:0 2px 4px rgba(31,26,46,.06),0 22px 40px -18px rgba(31,26,46,.30) !important}
  html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product:hover figure img{transform:scale(1.045)}
}
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product:hover{translate:none}

/* testata: stile originale del tema, titolo tagliato a 3 righe */
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .woocommerce-loop-product__title a{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;color:#fff !important;text-decoration:none !important}

/* foto */
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product > figure img{transition:transform .45s cubic-bezier(.2,.8,.2,1)}

/* Confronta: piu discreto */
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .prz-compare-check-loop{font-size:11.5px !important;color:var(--mz-muto) !important;border:1px solid var(--mz-bordo) !important;background:#fff !important;
  border-radius:999px !important;padding:3px 11px !important;transition:color .2s,border-color .2s,background .2s}
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .prz-compare-check-loop:hover{color:var(--mz-viola) !important;border-color:#d1d5db !important;background:#fff !important}
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .prz-compare-check-loop input{accent-color:var(--mz-viola2)}

/* barra dell'indice */
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .indice-convenienza .ic-barra{height:6px !important;border-radius:999px !important;background:#eef0f4 !important;overflow:hidden}
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .indice-convenienza .ic-fill{height:6px !important;border-radius:999px !important;
  background-image:linear-gradient(180deg,rgba(255,255,255,.35),rgba(255,255,255,0)) !important;transition:width .8s cubic-bezier(.2,.8,.2,1)}
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .indice-convenienza .ic-score{border-radius:999px !important;padding:3px 8px !important;font-variant-numeric:tabular-nums;
  box-shadow:0 2px 6px -2px rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.25)}

/* prezzo */
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .price{color:var(--mz-testo) !important;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .price del{opacity:.55;font-size:.6em;font-weight:600}

/* negozi */
html:not([data-ptop-vista="classica"]) .ptop-shops .ptop-shop{box-shadow:0 0 0 2px #fff,0 1px 3px rgba(0,0,0,.12) !important;border-color:transparent !important}
html:not([data-ptop-vista="classica"]) .ptop-shops-lbl{color:var(--mz-muto) !important;font-weight:600}

/* etichetta "Prezzo ai minimi" */
html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .ptop-chip{border:1px solid color-mix(in srgb,var(--mz-c) 28%,#fff);background:linear-gradient(180deg,color-mix(in srgb,var(--mz-c) 10%,#fff),color-mix(in srgb,var(--mz-c) 18%,#fff)) !important}

/* riquadro grafico */
html:not([data-ptop-vista="classica"]) .ptop-mz-chart{background:#f8f9fa !important;border:0 !important;border-radius:12px !important;
  box-shadow:none}
html:not([data-ptop-vista="classica"]) .ptop-mz-head b{display:inline-flex;align-items:center;gap:6px}
html:not([data-ptop-vista="classica"]) .ptop-mz-head b::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--mz-c);box-shadow:0 0 0 3px color-mix(in srgb,var(--mz-c) 22%,transparent)}
html:not([data-ptop-vista="classica"]) .ptop-mz-chart svg .l{stroke-width:2.4 !important;stroke-linecap:round}
html:not([data-ptop-vista="classica"]) .ptop-mz-dots .o{box-shadow:0 0 0 0 color-mix(in srgb,var(--mz-c) 55%,transparent)}
@media (prefers-reduced-motion:no-preference){
  html:not([data-ptop-vista="classica"]) .ptop-mz-dots .o{animation:ptopMzPulse 2.4s ease-out infinite}
}

/* ---- Timbro PREZZOTOP (componente) ---- */
html:not([data-ptop-vista="classica"]) .ptop-stamp{--stamp:76px;display:inline-block;width:var(--stamp);height:calc(var(--stamp) * 1.06);flex:none;transform:rotate(-8deg);line-height:0;
  filter:drop-shadow(0 6px 10px rgba(21,11,38,.18)) drop-shadow(0 1px 2px rgba(21,11,38,.14))}
html:not([data-ptop-vista="classica"]) .ptop-stamp__svg{display:block;width:100%;height:100%;overflow:visible}
html:not([data-ptop-vista="classica"]) .ptop-stamp--sm{--stamp:60px}
html:not([data-ptop-vista="classica"]) .ptop-stamp--lg{--stamp:92px}

@media (max-width:689px){
  html:not([data-ptop-vista="classica"]) .woocommerce ul.products[data-products]{grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:12px !important}
  html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .woocommerce-loop-product__title{font-size:.8em}
  html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .price{font-size:1.05em}
  html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .ptop-shops{margin:6px 8px 0;gap:3px}
  html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .ptop-shops-lbl{font-size:9.5px}
  html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product:not(.ptop-hero) .ptop-shops .ptop-shop{width:20px;height:20px}
  html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .ptop-chip{margin:6px 8px 0;font-size:10px}
  html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product{border-radius:14px !important}
  html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .woocommerce-loop-product__title{padding:8px 9px !important}
}

/* ---- Comparsa morbida allo scorrimento (solo browser che la supportano) ---- */
@media (prefers-reduced-motion:no-preference){
  @supports (animation-timeline:view()){
    html:not([data-ptop-vista="classica"]) ul.products[data-products] > li.product{
      animation:ptopMosaicoIn linear both;animation-timeline:view();animation-range:entry 0% entry 30%
    }
  }
}

/* ===================== SOLO MOSAICO ===================== */
/* ---- Griglia: riempie i buchi lasciati dalle card grandi ---- */
html[data-ptop-vista="mosaico"] .woocommerce ul.products[data-products]{grid-auto-flow:row dense}
/* ---- Card orizzontali: larga 2x1, tridente 3x1, quattro 4x1 ---- */
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad){
  grid-column:span 2 !important;display:grid !important;flex-direction:initial !important;
  grid-template-columns:minmax(0,40%) minmax(0,1fr) !important;
  grid-template-rows:auto minmax(6px,1fr) auto auto auto auto auto minmax(6px,1fr) !important;column-gap:18px;align-self:stretch;height:auto !important
}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad) > h2{grid-column:1 / -1 !important;grid-row:1 !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad) > figure{grid-column:1 !important;grid-row:2 / -1 !important;align-self:center;margin:0 !important;height:auto !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad) > :not(figure):not(h2){grid-column:2 !important;margin-left:0 !important;margin-right:0 !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad) > .indice-convenienza{grid-row:3 !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad) > .prz-compare-check-loop{grid-row:4 !important;justify-self:start}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad) > .price{grid-row:5 !important;margin-top:6px}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad) .price{font-size:1.35em}

/* ---- Tetto alle foto: nessuna card speciale diventa lunga ---- */
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad,.ptop-hero) figure .ct-media-container{aspect-ratio:auto !important;height:auto !important;display:flex;justify-content:center}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad) figure img{
  width:auto !important;height:auto !important;max-width:100% !important;max-height:190px !important;aspect-ratio:auto !important;object-fit:contain !important
}

@media (min-width:1100px){
  html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-tri{grid-column:span 3 !important;grid-template-columns:minmax(0,32%) minmax(0,1fr) !important}
  html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-quad{grid-column:span 4 !important;grid-template-columns:minmax(0,25%) minmax(0,1fr) !important;
}
  html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-tri,.ptop-quad) > h2{font-size:1.1em}
  html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-tri,.ptop-quad) .price{font-size:1.7em}
  html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-tri,.ptop-quad) .indice-convenienza{max-width:420px}
}

/* ---- Card grande 2x2 ---- */
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero{
  grid-column:span 2 !important;display:flex !important;flex-direction:column !important;
}
html[data-ptop-vista="mosaico"] ul.products[data-products]:not([data-ptop-masonry]) > li.product.ptop-hero{grid-row:span 2 !important;
  box-shadow:0 0 0 2px #22c55e, 0 18px 40px -18px rgba(34,197,94,.55)
}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero > figure{flex:0 0 auto !important;display:flex;align-items:center;justify-content:center;height:auto !important;min-height:0 !important;padding:12px 0 4px !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero figure .ct-media-container{background:transparent !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero > figure img{width:auto !important;height:auto !important;max-width:100% !important;max-height:360px !important;aspect-ratio:auto !important;object-fit:contain !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero > h2{font-size:1.12em}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero .price{font-size:1.6em}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero .ic-score{font-size:1.1em}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad,.ptop-hero) .ct-media-container{background:transparent !important}

/* larga (e tridente/quattro sotto i 1100 px): riquadro compatto sotto i negozi */
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad) > .ptop-mz-chart{grid-column:2 !important;grid-row:7 !important;align-self:start;margin:10px 12px 12px 0 !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-wide .ptop-mz-chart svg{height:44px}

@media (min-width:1100px){
  html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-tri{grid-template-columns:minmax(0,30%) minmax(0,1fr) minmax(0,1.15fr) !important}
  html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-quad{grid-template-columns:minmax(0,24%) minmax(0,.9fr) minmax(0,1.5fr) !important}
  html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-tri,.ptop-quad) > .ptop-mz-chart{grid-column:3 !important;grid-row:2 / -1 !important;align-self:center;margin:12px 14px 12px 0 !important}
}

/* grande: il riquadro riempie lo spazio sotto il prezzo */
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero > figure img{max-height:300px !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero > .ptop-mz-chart{margin:8px 12px 12px;flex:1 1 auto;display:flex;flex-direction:column;font-size:13px}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero .ptop-mz-head b{font-size:15px}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero .ptop-mz-why{font-size:13px}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero .ptop-mz-plot{flex:1 1 auto;min-height:90px;display:flex}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero .ptop-mz-plot svg{flex:1 1 auto;height:auto;min-height:90px}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad) > .ptop-shops{grid-column:2 !important;grid-row:6 !important;margin:10px 0 0}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-hero,.ptop-tri,.ptop-quad) .ptop-shops .ptop-shop:not(.ptop-shop-txt):not(.ptop-shop-more){width:28px;height:28px}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-hero,.ptop-tri,.ptop-quad) .ptop-shops-lbl{font-size:12px}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad) > figure{min-width:0 !important;overflow:hidden}

/* card grande: bordo sfumato + nastro "In evidenza" */
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero{box-shadow:0 2px 4px rgba(31,26,46,.06),0 26px 50px -26px rgba(31,26,46,.35) !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero > figure{position:relative}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero > figure::after{content:"★ Tra i migliori affari";position:absolute;z-index:3;right:10px;top:10px;font-size:11px;font-weight:800;letter-spacing:.02em;
  color:#fff;background:linear-gradient(135deg,#16a34a,#22c55e);padding:4px 10px;border-radius:999px;box-shadow:0 6px 14px -6px rgba(22,163,74,.7)}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero .woocommerce-loop-product__title{font-size:1.05em !important;padding:14px 18px !important}

/* indice 100: timbro sull'angolo in alto a destra della foto (lo sconto e a sinistra) */
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-fire > .ptop-stamp{grid-column:1 !important;grid-row:2 !important;justify-self:end;align-self:start;z-index:3;margin:4px 4px 0 0 !important;pointer-events:none}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-fire > figure{position:relative !important;overflow:visible !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-fire > figure > .ptop-stamp.is-on-photo{position:absolute;top:2px;right:2px;z-index:3;margin:0 !important;pointer-events:none}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-fire > .ptop-stamp.is-in-data{grid-column:2 !important;grid-row:2 !important;align-self:end;justify-self:start;margin:10px 0 4px !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad) > figure{margin:12px !important;align-self:center}

/* ---- Taglie per indice basso: 30-49 ridotta, sotto 30 piccola ---- */
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-size-m > figure img{max-width:72% !important;margin:0 auto !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-size-m .woocommerce-loop-product__title a{font-size:.92em !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-size-m .price .amount{font-size:.88em !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-size-m .ptop-shops .ptop-shop{width:19px !important;height:19px !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-size-s > figure img{max-height:110px !important;width:auto !important;max-width:60% !important;margin:0 auto !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-size-s .woocommerce-loop-product__title a{font-size:.85em !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-size-s .woocommerce-loop-product__title a{-webkit-line-clamp:2 !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-size-s :is(.prz-compare-check-loop,.ptop-shops){display:none !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-size-s .price .amount{font-size:.78em !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-size-s .indice-convenienza{margin:6px 0 !important}

/* ---- Griglia a incastro (attivata dallo script: senza script resta la griglia normale) ---- */
html[data-ptop-vista="mosaico"] ul.products[data-products][data-ptop-masonry],html[data-ptop-vista="mosaico"] .woocommerce ul.products[data-products][data-ptop-masonry],html[data-ptop-vista="mosaico"] body .woocommerce ul.products[data-products][data-ptop-masonry]{grid-auto-rows:4px !important;row-gap:0 !important;align-items:start !important}
html[data-ptop-vista="mosaico"] ul.products[data-products][data-ptop-masonry] > li.product{grid-row-end:span var(--mz-span,160) !important;align-self:start !important;height:auto !important;margin-bottom:var(--mz-gap,16px) !important}

.ct-pagination[data-pagination]{position:relative;z-index:5}
ul.products[data-products]{position:relative;z-index:1}
@media (max-width:689px){
  html[data-ptop-vista="mosaico"] ul.products[data-products]:not([data-ptop-masonry]) > li.product.ptop-hero{grid-row:span 1 !important}
  html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero > figure img{max-height:200px !important}
  html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad) figure img{max-height:150px !important}
  html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad){grid-column:span 2 !important}
  html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:is(.ptop-wide,.ptop-tri,.ptop-quad) .price{font-size:1.25em}
  html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-hero > figure::after{font-size:10px}
  html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-fire > .ptop-stamp{--stamp:62px}
}
/* nel mosaico le card speciali hanno gia il riquadro; il timbro piccolo serve solo alla Griglia */
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product.ptop-has-chart > .ptop-chip{display:none !important}
html[data-ptop-vista="mosaico"] ul.products[data-products] > li.product:not(.ptop-fire) .ptop-stamp{display:none !important}

/* ===================== SOLO GRIGLIA ===================== */
/* card tutte uguali: niente riquadro grafico, titolo su 2 righe, timbro piccolo sulla foto */
html:not([data-ptop-vista="mosaico"]):not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .ptop-mz-chart{display:none !important}
html:not([data-ptop-vista="mosaico"]):not([data-ptop-vista="classica"]) ul.products[data-products] > li.product .woocommerce-loop-product__title a{-webkit-line-clamp:2 !important;line-height:1.3 !important;min-height:2.6em}
html:not([data-ptop-vista="mosaico"]):not([data-ptop-vista="classica"]) ul.products[data-products] > li.product > figure{position:relative !important}
html:not([data-ptop-vista="mosaico"]):not([data-ptop-vista="classica"]) ul.products[data-products] > li.product > .ptop-stamp{display:none !important}
html:not([data-ptop-vista="mosaico"]):not([data-ptop-vista="classica"]) ul.products[data-products] > li.product > figure > .ptop-stamp{position:absolute;top:4px;right:4px;z-index:3;--stamp:58px;margin:0 !important;pointer-events:none}
@media (max-width:689px){
  html:not([data-ptop-vista="mosaico"]):not([data-ptop-vista="classica"]) ul.products[data-products] > li.product > figure > .ptop-stamp{--stamp:46px}
}

/* ===================== SOLO CLASSICA ===================== */
/* le card del tema come prima: niente aggiunte PrezzoTop */
html[data-ptop-vista="classica"] ul.products[data-products] > li.product :is(.ptop-shops,.ptop-chip,.ptop-mz-chart,.ptop-stamp){display:none !important}

/* =====================================================================
   FASCIA "I MIGLIORI AFFARI DI OGGI" (solo vista Griglia)
   ===================================================================== */
.ptop-fascia{width:100%;flex-basis:100%;box-sizing:border-box;margin:6px 0 20px;padding:18px 18px 16px;background:#fff;border-radius:18px;
  box-shadow:0 1px 2px rgba(31,26,46,.04),0 10px 30px -18px rgba(31,26,46,.25)}
html[data-ptop-vista="mosaico"] .ptop-fascia,html[data-ptop-vista="classica"] .ptop-fascia{display:none !important}
.ptop-fa-head h2{margin:0 !important;padding:0 !important;font-size:1.2rem !important;line-height:1.3 !important;font-weight:800 !important;color:#1f1a2e !important;background:none !important}
.ptop-fa-head p{margin:3px 0 0 !important;font-size:.86rem;line-height:1.4;color:#6b6780}
.ptop-fa-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-top:14px}
.ptop-fa-card{--mz-c:#16a34a;position:relative;display:flex;flex-direction:column;min-width:0;background:#fff;border:1px solid #eceef2;border-radius:14px;overflow:hidden;
  transition:transform .25s cubic-bezier(.2,.8,.2,1),box-shadow .25s ease}
@media (hover:hover){.ptop-fa-card:hover{transform:translateY(-3px);box-shadow:0 18px 34px -20px rgba(31,26,46,.35)}}
.ptop-fa-img{position:relative;display:flex;align-items:center;justify-content:center;height:150px;padding:12px;background:#fff;box-sizing:border-box}
.ptop-fa-img img{max-width:100% !important;max-height:100% !important;width:auto !important;height:auto !important;object-fit:contain;margin:0 !important}
.ptop-fa-img .ptop-stamp{position:absolute;top:4px;right:4px;--stamp:54px;z-index:2;pointer-events:none}
.ptop-fa-body{display:flex;flex-direction:column;gap:6px;padding:10px 14px 14px;flex:1 1 auto}
.ptop-fa-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.ptop-fa-hl{display:inline-flex;align-items:center;gap:6px;color:var(--mz-c);font-size:12.5px;font-weight:800;line-height:1.2}
.ptop-fa-hl::before{content:"";flex:none;width:8px;height:8px;border-radius:50%;background:var(--mz-c);box-shadow:0 0 0 3px color-mix(in srgb,var(--mz-c) 22%,transparent)}
.ptop-fa-score{flex:none;font-size:13px;font-weight:800;line-height:1.4;color:#fff;background:var(--mz-c);border-radius:999px;padding:1px 9px;font-variant-numeric:tabular-nums}
.ptop-fa-score small{font-size:.75em;opacity:.85;font-weight:700}
.ptop-fa-title{margin:0 !important;padding:0 !important;font-size:14px !important;line-height:1.35 !important;font-weight:700 !important;background:none !important}
.ptop-fa-title a{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:#1f1a2e !important;text-decoration:none !important}
.ptop-fa-title a::after{content:"";position:absolute;inset:0;z-index:1}
.ptop-fa-price{font-size:1.45rem;font-weight:800;color:#1f1a2e;letter-spacing:-.02em;font-variant-numeric:tabular-nums;line-height:1.2}
.ptop-fa-price del{font-size:.55em;opacity:.55;font-weight:600;margin-right:4px}
.ptop-fa-price ins{text-decoration:none;background:none}
.ptop-fa-why{margin:0 !important;font-size:12px;line-height:1.4;color:#4b5563;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ptop-fa-card .ptop-fa-chart{padding:8px 10px 6px !important}
.ptop-fa-card .ptop-fa-chart svg{height:44px}
.ptop-fa-per{display:block;text-align:right;font-size:10.5px;color:#6b7280;margin-top:2px}
.ptop-fa-card .ptop-shops{position:relative;z-index:2;display:flex;align-items:center;gap:4px;margin-top:auto;padding-top:4px;min-height:24px;flex-wrap:nowrap;overflow:hidden}
@media (max-width:689px){
  .ptop-fascia{padding:14px 0 12px;border-radius:14px}
  .ptop-fa-head{padding:0 14px}
  .ptop-fa-head h2{font-size:1.05rem !important}
  .ptop-fa-list{grid-auto-flow:column;grid-template-columns:none;grid-auto-columns:78%;overflow-x:auto;scroll-snap-type:x mandatory;padding:0 14px 6px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .ptop-fa-list::-webkit-scrollbar{display:none}
  .ptop-fa-card{scroll-snap-align:start}
  .ptop-fa-img{height:130px}
}

/* =====================================================================
   SELETTORE DELLA VISTA
   ===================================================================== */
.ptop-top{width:100%;flex-basis:100%}
.ptop-vista-bar{width:100%;flex-basis:100%;display:flex;justify-content:flex-end;margin:0 0 12px}
.ptop-vista{display:inline-flex;align-items:center;gap:2px;padding:3px;background:#fff;border:1px solid #e5e7eb;border-radius:999px;box-shadow:0 1px 2px rgba(31,26,46,.05)}
.ptop-vista-lbl{font-size:12px;font-weight:600;color:#6b6780;padding:0 6px 0 10px}
.ptop-vista .ptop-vista-btn{display:inline-flex;align-items:center;gap:6px;margin:0 !important;border:0 !important;background:transparent !important;color:#4b5563 !important;
  font-size:12.5px !important;font-weight:700 !important;line-height:1 !important;padding:7px 12px !important;border-radius:999px !important;cursor:pointer;
  box-shadow:none !important;min-height:0 !important;height:auto !important;width:auto !important;text-transform:none !important;letter-spacing:0 !important;transition:background .2s,color .2s}
.ptop-vista .ptop-vista-btn svg{width:14px;height:14px;fill:currentColor;flex:none}
.ptop-vista .ptop-vista-btn:hover{color:#1f1a2e !important;background:#f3f4f6 !important}
.ptop-vista .ptop-vista-btn:focus-visible{outline:2px solid #6c3d78;outline-offset:2px}
html[data-ptop-vista="classica"] .ptop-vista .ptop-vista-btn[data-v="classica"],
html[data-ptop-vista="griglia"] .ptop-vista .ptop-vista-btn[data-v="griglia"],
html[data-ptop-vista="mosaico"] .ptop-vista .ptop-vista-btn[data-v="mosaico"],
html:not([data-ptop-vista]) .ptop-vista .ptop-vista-btn[data-v="griglia"]{background:#6c3d78 !important;color:#fff !important}
@media (max-width:689px){
  .ptop-vista-bar{justify-content:center}
  .ptop-vista-lbl{display:none}
  .ptop-vista .ptop-vista-btn{padding:7px 11px !important}
}

@keyframes ptopMzPulse{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--mz-c) 55%,transparent)}70%,100%{box-shadow:0 0 0 9px transparent}}
@keyframes ptopMosaicoIn{from{opacity:0;transform:translateY(22px) scale(.97)}to{opacity:1;transform:none}}
