/* =========================================================
   SHOP.CSS — unico file per shop + offerte (pulito)
   ========================================================= */

/* =========================
   VARIABILI
========================= */
:root{
  --primary: #f97316;
  --primary2:#f59e0b;
  --danger:  #ef4444;
  --success: #10b981;

  --bg:      #ffffff;
  --surface: #ffffff;
  --muted:   #64748b;
  --text:    #0f172a;
  --line:    #e2e8f0;

  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 10px;

  --sh-sm: 0 2px 10px rgba(15,23,42,.06);
  --sh-md: 0 10px 26px rgba(15,23,42,.10);

  --tr: 180ms ease;
}

/* =========================
   BASE
========================= */
*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a{ color:inherit; }
img{ max-width:100%; display:block; }

.section{
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* =========================
   HERO
========================= */
.shop-hero{
  text-align:center;
  padding: 22px 16px;
  background: linear-gradient(135deg, #ffedd5 0%, #fef3c7 100%);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  margin: 0 0 18px;
  position: relative;
  overflow: hidden;
}
.shop-hero::before{
  content:"";
  position:absolute;
  top:0; left:0; right:0;
  height:3px;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
}
.shop-hero h1{
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 900;
}
.shop-hero p{
  margin: 0 auto;
  max-width: 820px;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.45;
}

/* =========================
   BOTTONI
========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .92rem;
  border: 1px solid transparent;
  text-decoration:none;
  cursor:pointer;
  transition: transform var(--tr), box-shadow var(--tr), background var(--tr), border-color var(--tr);
}
.btn--primary{
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color:#fff;
  border: none;
  box-shadow: 0 10px 24px rgba(249,115,22,.22);
}
.btn--primary:hover{ transform: translateY(-1px); }
.btn--soft{
  background:#fff;
  border:1px solid var(--line);
  color: var(--text);
}
.btn--soft:hover{
  background:#fff7ed;
  border-color: rgba(249,115,22,.35);
}

/* =========================
   RICERCA
========================= */
.search-inline{
  display:flex;
  gap: 10px;
  margin: 14px 0 18px;
  flex-wrap: wrap;
}
.search-inline input[type="text"]{
  flex: 1;
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  font-size: .95rem;
  outline: none;
}
.search-inline input[type="text"]:focus{
  border-color: rgba(249,115,22,.65);
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}

/* =========================
   CATEGORIE (griglia home)
========================= */
.cats-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 12px;
  align-items: stretch;
}

/* ogni tile ha la stessa altezza “visiva” */
.cat-card{
  background: #fff;
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 18px;
  padding: 14px 12px 12px;
  text-align:center;
  text-decoration:none;
  box-shadow: none;
  transition: transform var(--tr), border-color var(--tr), box-shadow var(--tr), background var(--tr);
  min-height: 190px;
  display:flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
}

.cat-card:hover{
  transform: translateY(-2px);
  border-color: rgba(249,115,22,.35);
  box-shadow: 0 10px 22px rgba(15,23,42,.08);
  background: #fff;
}

/* attiva: evidenziata ma NON “gigante” */
.cat-card.active{
  border-color: rgba(249,115,22,.65);
  box-shadow: 0 0 0 3px rgba(249,115,22,.10), 0 10px 22px rgba(15,23,42,.08);
  background: #fff;
}

/* cerchio immagine categoria (il tuo cat_photo_html produce .cat-photo inline) */
.cat-card .cat-photo{
  margin: 0 auto;
  width: 96px !important;
  height: 96px !important;
  border-radius: 999px !important;
  border: 2px solid #eef2f7 !important;
  background: #f8fafc !important;
  overflow: hidden;
}

/* titolo leggibile e contenuto */
.cat-label{
  margin-top: 2px;
  font-weight: 900;
  font-size: 1.02rem;
  line-height: 1.15;
  color: var(--text);
  min-height: 40px;            /* stabilizza l'altezza */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;       /* max 2 righe */
  -webkit-box-orient: vertical;
}

/* pill prodotti */
.cat-count{
  margin-top: auto;            /* spinge in basso e allinea tutte */
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 800;
  color: var(--muted);
  background: #f1f5f9;
  border-radius: 999px;
  padding: 6px 10px;
}

/* chip categoria (vista filtrata) */
.cats-bar{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--line);
  text-decoration:none;
  font-weight: 800;
  font-size: .88rem;
  transition: background var(--tr), border-color var(--tr);
}
.chip:hover{ background:#eef2f7; }
.chip.active{
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color:#fff;
  border-color: transparent;
}
.chip-ico{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  overflow:hidden;
  background:#fff;
  border:1px solid #f1f5f9;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:.75rem;
  color: var(--muted);
}

/* =========================
   OFFERTE (card centrale + 3 card)
========================= */
.offers-section.is-hidden{ display:none; }

.offers-section{
  max-width: 980px;
  margin: 18px auto 24px;
  padding: 0 16px;
}

.offers-shell{
  background:
    radial-gradient(1200px 260px at 50% 0%, rgba(249,115,22,.16), rgba(255,255,255,0) 60%),
    linear-gradient(135deg,#fff7ed,#fffbeb);
  border: 1px solid #fed7aa;
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(15,23,42,.10);
  padding: 16px;
}

.offers-header{
  text-align:center;
  margin-bottom: 12px;
}
.offers-title{
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
}
.offers-subtitle{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .92rem;
}

/* PC: 3 card orizzontali */
.offers-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  justify-items: center;
  align-items: start;
}

/* =========================
   OFFERTA — CARD
========================= */
.offer-card{
  width: 100%;
  max-width: 320px;
  background:#fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--sh-sm);
  overflow:hidden;
  position:relative;
  transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr);

  /* spazio per badge “sopra la foto” ma non dentro */
  padding: 46px 12px 12px;

  display:grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items:start;
}
.offer-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
  border-color: rgba(249,115,22,.38);
}

/* badge sopra foto (fuori dal box foto) */
.offer-badge{
  position:absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
}
.offer-badge .badge{
  display:inline-flex;
  align-items:center;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: .82rem;
  line-height: 1;
  color:#fff;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 10px 22px rgba(15,23,42,.16);
}

/* box immagine */
.offer-media{
  width: 84px;
  height: 84px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background:#f8fafc;
  overflow:hidden;
}
.offer-media img{
  width:100%;
  height:100%;
  object-fit: cover;
}

/* contenuto */
.offer-content{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.offer-name{
  margin: 0;
  font-size: .95rem;
  font-weight: 900;
  line-height: 1.2;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* prezzi */
.offer-prices{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  align-items: baseline;
}
.offer-old-price{
  font-size:.85rem;
  color: var(--muted);
  text-decoration: line-through;
}
.offer-new-price{
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--danger);
}
.offer-discount{
  font-size: .78rem;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffedd5;
  color: var(--primary);
}

/* stock */
.offer-stock{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  font-size:.82rem;
  color: var(--success);
  font-weight: 900;
}
.offer-stock i{ font-size: .9rem; }

/* countdown */
.offer-countdown{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color:#92400e;
  font-size: .82rem;
  font-weight: 900;
}
.offer-countdown i{ font-size:.9rem; }

/* CTA */
.offer-cta{
  margin-top: 6px;
  width: 100%;
  border:none;
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 900;
  cursor:pointer;
  color:#fff;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  box-shadow: 0 10px 22px rgba(249,115,22,.20);
  transition: transform var(--tr), box-shadow var(--tr);
}
.offer-cta:hover{ transform: translateY(-1px); }
.offer-cta:disabled{
  background:#cbd5e1;
  box-shadow:none;
  cursor:not-allowed;
}

/* =========================
   PRODOTTI
========================= */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.product{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px;
  box-shadow: var(--sh-sm);
  display:flex;
  flex-direction: column;
  transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr);
}
.product:hover{
  transform: translateY(-3px);
  box-shadow: var(--sh-md);
  border-color: rgba(249,115,22,.38);
}
.product .product-media{
  background:#f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  padding: 10px;
  min-height: 140px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.product .product-media img{
  height: 130px;
  width: 100%;
  object-fit: contain;
  border-radius: 10px;
}
.product h2{
  margin: 10px 0 6px;
  font-size: .95rem;
  font-weight: 900;
  line-height: 1.25;
  min-height: 38px;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.price{
  margin-top: 2px;
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--primary);
}
.product-actions{
  margin-top: auto;
  padding-top: 10px;
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.add-row{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items:center;
}
.add-row input[type="number"]{
  width: 100%;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  text-align:center;
  font-weight: 800;
}

/* =========================
   PAGINAZIONE
========================= */
.pager{
  display:flex;
  justify-content:center;
  align-items:center;
  gap: 8px;
  margin: 18px 0 24px;
  flex-wrap: wrap;
}
.pager a, .pager span{
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  font-weight: 900;
  border: 1px solid var(--line);
  background:#fff;
  color: var(--text);
}
.pager a:hover{
  border-color: rgba(249,115,22,.45);
  background:#fff7ed;
  color: var(--primary);
}
.pager .current{
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color:#fff;
}

/* =========================
   CARRELLO FLOTTANTE
========================= */
.floating-cart{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 999;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--danger));
  color:#fff;
  text-decoration:none;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(15,23,42,.25);
}
.floating-cart .badge{
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size: .78rem;
  padding: 0 7px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 980px){
  .offers-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px){
  .search-inline{ flex-direction: column; }
  .search-inline input[type="text"]{ min-width: 100%; }

  .offers-grid{ grid-template-columns: 1fr; }
  .offer-card{
    max-width: 420px;
    grid-template-columns: 80px 1fr;
    padding-top: 44px;
  }
}
@media (max-width: 520px){
  .offer-badge{
    top: 10px;
    left: 10px;
  }
  .offer-badge .badge{
    padding: 6px 10px;
    font-size: .72rem;
  }

  .grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
 /* responsive: 2 colonne su mobile */
@media (max-width: 520px){
  .cats-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .cat-card{
    min-height: 178px;
    padding: 12px 10px;
  }
  .cat-card .cat-photo{
    width: 86px !important;
    height: 86px !important;
  }
  .cat-label{
    font-size: .95rem;
    min-height: 38px;
  }
}
  .product .product-media img{ height: 115px; }
}
.hidden { display: none !important; }
/* =========================================================
   CATEGORIE — CARD WOW (solo questa sezione)
   Incolla in fondo a shop.css
   ========================================================= */

/* contenitore categorie */
.cats-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 14px;
  align-items: stretch;
}

/* card */
.cat-card{
  position: relative;
  display:flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;

  padding: 18px 16px 14px;
  min-height: 230px;
  text-align:center;
  text-decoration:none;

  border-radius: 26px;
  background:
    radial-gradient(120% 120% at 15% 10%, rgba(249,115,22,.12), transparent 55%),
    radial-gradient(120% 120% at 85% 90%, rgba(245,158,11,.10), transparent 60%),
    rgba(255,255,255,.96);

  border: 1px solid rgba(226,232,240,.95);
  box-shadow:
    0 12px 30px rgba(15,23,42,.08),
    inset 0 1px 0 rgba(255,255,255,.75);

  overflow:hidden;
  transform: translateZ(0);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

/* bordo gradiente (premium) */
.cat-card::before{
  content:"";
  position:absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(249,115,22,.80),
    rgba(245,158,11,.40),
    rgba(148,163,184,.35)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events:none;
  opacity: .35;
  transition: opacity 220ms ease;
}

/* glow morbido */
.cat-card::after{
  content:"";
  position:absolute;
  inset: -40%;
  background: radial-gradient(circle at 30% 25%, rgba(249,115,22,.22), transparent 42%),
              radial-gradient(circle at 80% 80%, rgba(245,158,11,.18), transparent 46%);
  opacity: .55;
  filter: blur(12px);
  pointer-events:none;
  transition: opacity 220ms ease;
}

/* effetto “shine” */
.cat-card .cat-shine{
  position:absolute;
  top:-40%;
  left:-60%;
  width: 140%;
  height: 140%;
  background: linear-gradient(120deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%);
  transform: rotate(12deg);
  opacity: 0;
  transition: opacity 220ms ease, transform 420ms ease;
  pointer-events:none;
}

/* hover */
.cat-card:hover{
  transform: translateY(-6px) perspective(900px) rotateX(2.2deg) rotateY(-2.2deg);
  border-color: rgba(249,115,22,.38);
  box-shadow:
    0 22px 55px rgba(15,23,42,.16),
    0 0 0 6px rgba(249,115,22,.08),
    inset 0 1px 0 rgba(255,255,255,.75);
}

.cat-card:hover::before{ opacity: .70; }
.cat-card:hover::after{ opacity: .80; }
.cat-card:hover .cat-shine{
  opacity: 1;
  transform: translateX(45%) rotate(12deg);
}

/* stato attivo (categoria selezionata) */
.cat-card.active{
  border-color: rgba(249,115,22,.55);
  box-shadow:
    0 22px 55px rgba(15,23,42,.16),
    0 0 0 8px rgba(249,115,22,.12),
    inset 0 1px 0 rgba(255,255,255,.75);
}
.cat-card.active::before{ opacity: .85; }

/* bolla immagine */
.cat-card .cat-photo{
  width: 108px !important;
  height: 108px !important;
  border-radius: 999px !important;

  background:
    radial-gradient(circle at 30% 25%, #ffffff 0%, #f8fafc 55%, #eef2f7 100%) !important;
  border: 2px solid rgba(226,232,240,.95) !important;

  box-shadow:
    0 16px 32px rgba(15,23,42,.10),
    inset 0 1px 0 rgba(255,255,255,.85);

  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.cat-card:hover .cat-photo{
  transform: translateY(-2px) scale(1.04);
  border-color: rgba(249,115,22,.35) !important;
  box-shadow:
    0 22px 42px rgba(15,23,42,.14),
    inset 0 1px 0 rgba(255,255,255,.85);
}

.cat-card .cat-photo img{
  width:100%;
  height:100%;
  object-fit: cover;
}

/* se la tua UI mette un'icona dentro cat-photo quando manca immagine */
.cat-card .cat-photo i,
.cat-card .cat-photo .fa,
.cat-card .cat-photo .fas,
.cat-card .cat-photo .far{
  font-size: 44px;
  color: rgba(15,23,42,.45);
}

/* titolo categoria */
.cat-label{
  margin-top: 2px;
  font-weight: 950;
  letter-spacing: -0.02em;
  font-size: 1.10rem;
  line-height: 1.15;
  color: #0f172a;

  min-height: 44px;
  max-width: 18ch;

  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* pill prodotti (sotto) */
.cat-count{
  margin-top: auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;

  padding: 10px 16px;
  min-width: 160px;

  border-radius: 999px;
  font-weight: 900;
  font-size: .92rem;

  color: rgba(30,41,59,1);
  background: rgba(241,245,249,.85);
  border: 1px solid rgba(226,232,240,.95);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
  transition: transform 220ms ease, background 220ms ease, border-color 220ms ease;
}

.cat-card:hover .cat-count{
  background: rgba(255,247,237,.92);
  border-color: rgba(249,115,22,.25);
  transform: translateY(-1px);
}

/* micro-dettaglio: testo più “pulito” */
.cat-count span,
.cat-count b,
.cat-count strong{
  font-weight: inherit;
}

/* MOBILE: carousel orizzontale (niente “riga spezzata”) */
@media (max-width: 900px){
  .cats-grid{
    display:flex;
    gap: 14px;
    overflow-x:auto;
    padding: 6px 6px 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .cats-grid::-webkit-scrollbar{ height: 10px; }
  .cats-grid::-webkit-scrollbar-thumb{
    background: rgba(148,163,184,.35);
    border-radius: 999px;
  }
  .cat-card{
    flex: 0 0 260px;
    scroll-snap-align: start;
  }
}

/* piccoli schermi */
@media (max-width: 420px){
  .cat-card{ flex-basis: 240px; min-height: 220px; }
  .cat-card .cat-photo{ width: 100px !important; height: 100px !important; }
}

/* Accessibilità: riduci movimento */
@media (prefers-reduced-motion: reduce){
  .cat-card,
  .cat-card::before,
  .cat-card::after,
  .cat-card .cat-photo,
  .cat-card .cat-shine,
  .cat-count{
    transition: none !important;
  }
  .cat-card:hover{ transform:none !important; }
}

/* OPTIONAL: se vuoi lo shine senza toccare HTML, lo iniettiamo con pseudo-elemento */
.cat-card{
  /* crea “shine layer” senza markup */
}
.cat-card > .cat-shine{ display:block; }
