/* =========================
   css/style.css — SaniBaby
   Filtri drawer da sinistra, menu mobile da destra,
   prodotti centrati (max 4/riga), sticky footer
   ========================= */

:root {
  --azzurro: #6ec1e4;
  --rosa: #f4a6b9;
  --grigio-chiaro: #f8f8f8;
  --testo: #333;
  --font-family: 'Nunito', sans-serif;

  --header-h: 72px; /* desktop */
}
@media (max-width: 768px) { :root { --header-h: 56px; } }

* { box-sizing: border-box; }

/* ===== Layout base con sticky footer ===== */
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-family);
  color: var(--testo);
  background: var(--grigio-chiaro);
  scroll-behavior: smooth;

  display: flex;
  min-height: 100dvh;
  flex-direction: column;
}
main { flex: 1 0 auto; }

/* ===== Header / Navbar ===== */
header {
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
}
.navbar {
  height: var(--header-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 .8rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo { display: flex; align-items: center; padding-right: 10px; }
.logo a { font-weight: 700; font-size: 1.6rem; color: var(--azzurro); text-decoration: none; }
.logo img { height: 48px; width: auto; display: block; }
@media (max-width: 1024px) { .logo img { height: 44px; } }
@media (max-width: 768px)  { .logo img { height: 36px; } }

.nav-links { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; }
.nav-links li a {
  text-decoration: none;
  font-weight: 600;
  color: var(--testo);
  transition: color .2s ease;
  font-size: 15px;
  padding: 8px 10px;
}
.nav-links li a:hover,
.nav-links li a.active { color: var(--rosa); }

/* ===== Social header buttons ===== */
.social-header-links {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
  margin-right: .6rem;
  position: relative;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  position: relative;
  z-index: 2;
}
.social-btn:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  filter: brightness(1.1);
}
.social-btn:active {
  transform: translateY(0) scale(.97);
}
.social-btn--ig {
  background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7);
}
.social-btn--tt {
  background: linear-gradient(135deg, #00f2ea, #010101 50%, #ff0050);
}
.social-btn--fb {
  background: linear-gradient(135deg, #1877f2, #0d65d9);
}

/* — Animazioni icone social — */
@keyframes socialPulseRing {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(244,166,185,.7); }
  40%  { box-shadow: 0 0 0 12px rgba(244,166,185,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(244,166,185,0); }
}
@keyframes socialBounceIn {
  0%   { transform: scale(1); }
  20%  { transform: scale(1.35); }
  40%  { transform: scale(.9); }
  60%  { transform: scale(1.15); }
  80%  { transform: scale(.95); }
  100% { transform: scale(1); }
}
@keyframes socialShake {
  0%, 100% { transform: rotate(0deg); }
  10%  { transform: rotate(-12deg) scale(1.1); }
  20%  { transform: rotate(12deg) scale(1.1); }
  30%  { transform: rotate(-8deg); }
  40%  { transform: rotate(8deg); }
  50%  { transform: rotate(-4deg); }
  60%  { transform: rotate(4deg); }
  70%  { transform: rotate(0deg); }
}
@keyframes socialGlow {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 0px transparent); }
  50%      { filter: brightness(1.3) drop-shadow(0 0 12px rgba(255,255,255,.6)); }
}

/* Stato attivo: le icone fanno scena */
.social-header-links--active .social-btn {
  animation: socialBounceIn .6s ease both, socialPulseRing 1.5s ease-out .6s infinite;
}
.social-header-links--active .social-btn--ig {
  animation-delay: 0s, .6s;
}
.social-header-links--active .social-btn--tt {
  animation-delay: .15s, .75s;
}
.social-header-links--active .social-btn--fb {
  animation-delay: .3s, .9s;
}

/* Shake periodica dopo il bounceIn */
.social-header-links--shake .social-btn {
  animation: socialShake .7s ease both, socialGlow 2s ease infinite;
}
.social-header-links--shake .social-btn--tt { animation-delay: .12s, .12s; }
.social-header-links--shake .social-btn--fb { animation-delay: .24s, .24s; }

/* — Bubble CTA sotto le icone — */
.social-bubble {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1100;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18), 0 0 0 2px var(--rosa, #f4a6b9);
  padding: 1rem 1.2rem;
  padding-right: 2.2rem;
  min-width: 260px;
  max-width: 320px;
  opacity: 0;
  transform: translateY(-10px) scale(.9);
  pointer-events: none;
  transition: opacity .35s ease, transform .4s cubic-bezier(.34,1.56,.64,1);
}
.social-bubble--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.social-bubble__arrow {
  position: absolute;
  top: -8px;
  right: 30px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-top: 2px solid var(--rosa, #f4a6b9);
  border-left: 2px solid var(--rosa, #f4a6b9);
  transform: rotate(45deg);
  z-index: 1;
}
.social-bubble__close {
  position: absolute;
  top: .4rem;
  right: .5rem;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #9ca3af;
  line-height: 1;
  transition: color .2s, transform .2s;
  z-index: 2;
}
.social-bubble__close:hover { color: #ef4444; transform: scale(1.2); }
.social-bubble__text {
  margin: 0;
  font-size: .88rem;
  font-weight: 700;
  color: #374151;
  line-height: 1.45;
}

@media (max-width: 768px) {
  .social-header-links { gap: .35rem; margin-right: .35rem; }
  .social-btn { width: 34px; height: 34px; }
  .social-btn svg { width: 17px; height: 17px; }
  .social-bubble { right: -10px; min-width: 220px; max-width: 280px; font-size: .82rem; }
  .social-bubble__arrow { right: 20px; }
}

.hamburger {
  display: none;
  font-size: 1.6rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--azzurro);
}

/* ===== Menu mobile (DA DESTRA) ===== */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    right: -100%;
    left: auto;
    top: var(--header-h, 60px);
    flex-direction: column;
    background: #fff;
    width: min(78vw, 320px);
    height: calc(100dvh - var(--header-h, 60px));
    padding: 1rem;
    box-shadow: -2px 0 12px rgba(0,0,0,0.12);
    transition: right .25s ease;
    z-index: 1300; /* sopra overlay */
  }
  .nav-links.active { right: 0; }
  .hamburger { display: block; }
}

/* ===== Overlay condiviso ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 1200; /* sotto menu (1300) e sopra contenuto */
}
.overlay.show { opacity: 1; pointer-events: all; }

/* ===== Footer ===== */
footer {
  position: static;
  background-color: #e0f7fa;
  text-align: center;
  padding: 12px 0;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.06);
  font-size: 0.9rem;
  z-index: 1;
}

/* ===== Catalogo wrapper ===== */
section.catalogo-wrap {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Toolbar: bottone filtri + conteggio */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin: .6rem 0 1rem 0;
}
.catalog-toolbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .7rem;
  margin-left: auto;
}
.btn-filtri {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .85rem;
  border: none;
  border-radius: 999px;
  background: var(--azzurro);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.results-count { font-weight: 700; color: #555; }

/* ===== Griglia prodotti (max 4 per riga) ===== */
#lista-prodotti {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
  gap: 1.5rem !important;
}

/* ===== Card prodotto ===== */
.card-prodotto {
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  transition: transform .25s ease, box-shadow .25s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}
.card-prodotto:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}
.card-prodotto img {
  height: 180px !important;
  width: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.card-prodotto h3 { margin: .7rem 0 .5rem; color: var(--azzurro); }
.card-prodotto p  { font-size: .9rem; color: var(--testo); }

/* ===== Stato disponibilità ===== */
.disponibilita { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; margin-top: 8px; }
.pallino { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.pallino.verde { background: #4CAF50; }
.pallino.rosso { background: #F44336; }
.pallino.limitata { animation: lampeggia 1s infinite; background: linear-gradient(45deg, #FFD700, #F44336); }
@keyframes lampeggia { 0%,100%{opacity:1} 50%{opacity:.3} }
.disponibilita.limitata { animation: lampeggiaText 1s infinite; color: #F44336; font-weight: 700; }
@keyframes lampeggiaText { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ===== Drawer FILTRI (DA SINISTRA) ===== */
.filters-drawer {
  position: fixed;
  left: -100%;
  top: var(--header-h);
  width: min(84vw, 380px);
  height: calc(100dvh - var(--header-h));
  background: #fff;
  box-shadow: 2px 0 16px rgba(0,0,0,0.15);
  transition: left .25s ease;
  z-index: 1250; /* sopra overlay, sotto menu */
  display: flex;
  flex-direction: column;
  border-right: 1px solid #eee;
}
.filters-drawer.show { left: 0; }

.filters-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem;
  border-bottom: 1px solid #eee;
}
.filters-drawer-body {
  padding: 1rem;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: .8rem;
}
.filters-drawer-body label {
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: .2rem;
  display: block;
}
.filters-drawer-body input,
.filters-drawer-body select {
  width: 100%;
  padding: .6rem .65rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
}
.filters-drawer-footer {
  display: flex;
  gap: .6rem;
  padding: .9rem 1rem;
  border-top: 1px solid #eee;
}
.btn-primary {
  padding: .6rem .9rem;
  border: none;
  border-radius: 10px;
  background: var(--azzurro);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.btn-secondary {
  padding: .6rem .9rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fafafa;
  color: #333;
  font-weight: 700;
  cursor: pointer;
}

/* ===== Navigazione fallback (desktop) ===== */
nav ul {
  align-items: center;
  margin: 0; padding: 0;
  list-style: none;
  display: flex;
  gap: 20px;
}
nav ul li a {
  font-size: 16px;
  padding: 8px 12px;
  text-decoration: none;
  color: #333;
  transition: color .2s ease;
}
nav ul li a:hover { color: #f06292; }

/* ====== FIX CLICK MENU MOBILE & OVERLAY ====== */

/* 1) Priorità stacking: overlay sotto, header sopra, filtri sopra overlay, menu sopra tutti */
.overlay { z-index: 2000 !important; }          /* scurisce lo sfondo, ma sotto i pannelli */
header   { z-index: 2100 !important; }          /* il menu è figlio del header: header > overlay */
.filters-drawer { z-index: 2300 !important; }   /* pannello filtri sopra overlay */
.nav-links { z-index: 2600 !important; }        /* menu mobile sopra a tutto */

/* 2) Menu mobile da DESTRA, fuori dal flow e cliccabile */
@media (max-width: 768px) {
  .nav-links {
    position: fixed !important;    /* esce dal contesto del flusso */
    top: var(--header-h, 60px);
    right: -100%;
    left: auto;
    width: min(78vw, 320px);
    height: calc(100dvh - var(--header-h, 60px));
    background: #fff;
    box-shadow: -2px 0 12px rgba(0,0,0,0.12);
    transition: right .25s ease;
    pointer-events: auto;          /* riceve i click */
  }
  .nav-links.active { right: 0; }
}

/* 3) Overlay: cliccabile solo quando visibile */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.overlay.show {
  opacity: 1;
  pointer-events: all;
}
/* --- FIX immagine card: più grande, piena e coerente --- */
.card-prodotto img {
  width: 100% !important;
  height: auto !important;          /* annulla l'altezza fissa inline */
  aspect-ratio: 1 / 1;              /* quadrata: più grande e uniforme */
  object-fit: cover;                 /* riempie tagliando i bordi se necessario */
  display: block;
  border-radius: 10px;
}

/* Se vuoi immagini ancora più alte (stile vetrina), usa 4/5: */
/*
.card-prodotto img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 5;  // più verticale delle quadrate
  object-fit: cover;
  display: block;
  border-radius: 10px;
}
*/

.btn-add-cart{
  margin-top:.6rem;
  width:100%;
  padding:.55rem .8rem;
  border:none;
  border-radius:10px;
  background: var(--azzurro);
  color:#fff;
  font-weight:800;
  cursor:pointer;
}
.btn-add-cart:hover{ filter: brightness(0.95); }
/* --- Cart icon in header --- */
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 1rem;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: .4rem .6rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.cart-link:hover { background: #f9fafb; }
.cart-icon { font-size: 1.25rem; line-height: 1; }
.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* --- Mobile FAB (replica carrello sempre visibile) --- */
@media (max-width: 768px) {
  .cart-link {
    position: fixed;
    right: 14px;
    bottom: 18px;
    z-index: 1001;
    border-radius: 999px;
    width: 56px;
    height: 56px;
    padding: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
  }
  .cart-icon { font-size: 1.35rem; }
  .cart-badge {
    top: -4px;
    right: -4px;
  }
}

/* Spazio per FAB sopra il footer sticky su mobile (se serve) */
@media (max-width: 768px) {
  main { padding-bottom: 80px; }
}
/* --- Cart button con emoji --- */
.cart-button{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.3rem;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:.45rem .6rem;
  box-shadow:0 2px 6px rgba(0,0,0,.06);
  color:inherit;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.cart-button:hover{ background:#f9fafb; box-shadow:0 4px 14px rgba(0,0,0,.08); transform:translateY(-1px); }
.cart-button:focus{ outline:none; box-shadow:0 0 0 3px rgba(110,193,228,.35); }

/* Emoji dimensionata bene */
.cart-icon{
  display:inline-block;
  font-size:1.25rem; /* regola qui la grandezza dell’emoji */
  line-height:1;
}

/* Badge rosso in alto a destra */
.cart-badge{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:12px;
  font-weight:800;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:2px solid #fff;
  line-height:1;
}

/* Mobile: FAB sempre visibile e sopra l'overlay */
@media (max-width:768px){
  .cart-button{
    position:fixed;
    right:14px;
    bottom:18px;
    z-index:2000;
    width:56px;
    height:56px;
    border-radius:999px;
    padding:0;
    box-shadow:0 10px 24px rgba(0,0,0,.18);
  }
  .cart-icon{ font-size:1.35rem; }
  .cart-badge{ top:-4px; right:-4px; }
  main{ padding-bottom:80px; }
}

/* Assicuriamoci che l’overlay stia sotto il FAB */
.overlay{ z-index:1500; }
/* --- Cart button con emoji --- */
.cart-button{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.3rem;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:.45rem .6rem;
  box-shadow:0 2px 6px rgba(0,0,0,.06);
  color:inherit;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.cart-button:hover{ background:#f9fafb; box-shadow:0 4px 14px rgba(0,0,0,.08); transform:translateY(-1px); }
.cart-button:focus{ outline:none; box-shadow:0 0 0 3px rgba(110,193,228,.35); }

/* Emoji dimensionata bene */
.cart-icon{
  display:inline-block;
  font-size:1.25rem; /* regola qui la grandezza dell’emoji */
  line-height:1;
}

/* Badge rosso in alto a destra */
.cart-badge{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:12px;
  font-weight:800;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:2px solid #fff;
  line-height:1;
}

/* Mobile: FAB sempre visibile e sopra l'overlay */
@media (max-width:768px){
  .cart-button{
    position:fixed;
    right:14px;
    bottom:18px;
    z-index:2000;
    width:56px;
    height:56px;
    border-radius:999px;
    padding:0;
    box-shadow:0 10px 24px rgba(0,0,0,.18);
  }
  .cart-icon{ font-size:1.35rem; }
  .cart-badge{ top:-4px; right:-4px; }
  main{ padding-bottom:80px; }
}

/* Assicuriamoci che l’overlay stia sotto il FAB */
.overlay{ z-index:1500; }
/* Home */
.hero {
  text-align: center;
  padding: 3rem 1rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  align-items: stretch;       /* stesse altezze */
}

@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .features-grid { grid-template-columns: 1fr; }
}

.feature-card {
  border-radius: 12px;
  padding: 1.5rem;
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 140px;          /* stabilizza le card */
}

.feature-card h2 {
  margin: 0 0 .4rem;
  line-height: 1.2;
}
.feature-card p {
  margin: 0;
}

/* varianti colore coerenti con i tuoi token */
.feature-card.azzurro { background: var(--azzurro); }
.feature-card.rosa    { background: var(--rosa); }
/* --- Contatti: layout responsive --- */
.contact-wrap{max-width:1100px;margin:1.5rem auto;padding:0 1rem;}
.contact-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem;}
.contact-card{background:#fff;border-radius:10px;box-shadow:0 3px 10px rgba(0,0,0,.06);padding:1rem;}

.contact-row-2{display:grid;grid-template-columns:1fr 1fr;gap:.8rem;}
.contact-actions{display:flex;gap:.6rem;flex-wrap:wrap;margin-top:1rem;}

@media (max-width: 900px){
  .contact-grid{grid-template-columns:1fr;}      /* le due card vanno una sotto l’altra */
  .contact-row-2{grid-template-columns:1fr;}     /* i campi affiancati passano a 1 colonna */
}
/* --- Catalogo: card sempre compatte e centrate --- */
#lista-prodotti {
  /* forziamo la griglia a tasselli fissi e centrati */
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  gap: 1.2rem !important;
  justify-content: center;      /* centra la griglia se poche colonne */
  align-content: start;
  max-width: 1100px;            /* non si allarga oltre */
  margin: 0 auto;               /* centra il blocco */
}

#lista-prodotti .card-prodotto {
  max-width: 280px;             /* card mai troppo larghe */
  width: 100%;
  margin: 0 auto;               /* centra la singola card quando è una sola */
}

#lista-prodotti .card-prodotto img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 10px;
}

/* Messaggio "nessun prodotto" compatto */
#lista-prodotti > p {
  max-width: 520px;
  margin: 0 auto;
}

/* 4 per riga su desktop largo */
@media (min-width: 1200px) {
  #lista-prodotti {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* 3 per riga su desktop medio */
@media (min-width: 900px) and (max-width: 1199px) {
  #lista-prodotti {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* 2 per riga su tablet */
@media (min-width: 600px) and (max-width: 899px) {
  #lista-prodotti {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* 1 per riga su mobile */
@media (max-width: 599px) {
  #lista-prodotti {
    grid-template-columns: 1fr !important;
  }
}
.products-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap:1.2rem;
  justify-content:center;
  align-content:start;
  max-width:1100px;
  margin:0 auto;
}
.products-grid .card-prodotto{ max-width:280px; width:100%; margin:0 auto; }
.products-grid .card-prodotto img{ width:100%; height:190px; object-fit:cover; border-radius:10px; }
/* media query come sopra, ma con .products-grid */
/* ——— Card stabili e promosse su layer GPU ——— */
/* === Card prodotto compatte === */
.card-prodotto{
  padding: .8rem;
  border-radius: 12px;
}
.card-prodotto h3{
  margin: .5rem 0 .35rem;
  font-size: 1rem;
  line-height: 1.2;
}
.card-prodotto .desc{
  font-size: .85rem;
  color: #555;
  max-height: 3.2em;           /* 2 righe circa */
  overflow: hidden;
}

/* Grid con card più piccole */
#lista-prodotti{
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 1rem !important;
}
#lista-prodotti .card-prodotto{
  max-width: 240px;
}

/* === Thumb: NON taglia, ridimensiona === */
.card-prodotto .thumb{
  position: relative;
  width: 100%;
  height: 150px;               /* più piccola delle attuali */
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-prodotto .thumb img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;         /* mai tagliare */
  display: block;
}

/* === Prezzo + bottone in riga === */
.price-row{
  margin-top: .4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.price-row .price{
  margin: 0;
  font-size: 1rem;
}

/* Bottone compatto accanto al prezzo */
.btn-add-cart.compact{
  margin: 0;
  padding: .45rem .6rem;
  font-weight: 800;
  border-radius: 10px;
  white-space: nowrap;
}

/* Stato disponibilità leggermente compattato */
.disponibilita{
  margin-top: .5rem;
  font-size: .9rem;
  gap: 6px;
}
.pallino{ width: 12px; height: 12px; }

/* Media: stringiamo ancora un filo sul mobile */
@media (max-width: 599px){
  #lista-prodotti{ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important; }
  #lista-prodotti .card-prodotto{ max-width: 220px; }
  .card-prodotto .thumb{ height: 140px; }
}
/* =============== SANIBABY — CATALOGO RESPONSIVE UNIVERSALE =============== */
/* Griglia fluida: da 1 a N colonne a seconda dello schermo */
section.catalogo-wrap #lista-prodotti{
  display: grid !important;
  /* tassello minimo che si adatta da mobile a desktop */
  grid-template-columns: repeat(auto-fit, minmax(clamp(170px, 28vw, 260px), 1fr)) !important;
  gap: clamp(.75rem, 1.5vw, 1.2rem) !important;
  justify-content: center; /* centra quando le colonne sono poche */
}

/* Card compatte e fluide */
section.catalogo-wrap #lista-prodotti .card-prodotto{
  width: 100%;
  max-width: clamp(190px, 32vw, 260px); /* mai enorme, mai microscopica */
  padding: clamp(.6rem, 1.2vw, .9rem);
  border-radius: 12px;
}

/* Titolo e descrizione scalano in modo fluido */
.card-prodotto h3{
  font-size: clamp(.95rem, 1.2vw, 1.05rem);
  margin: .45rem 0 .3rem;
  line-height: 1.2;
}
.card-prodotto .desc{
  font-size: clamp(.82rem, 1vw, .9rem);
  color:#555;
  max-height: 3.2em;  /* ~2 righe */
  overflow: hidden;
}

/* Thumb che NON taglia mai l’immagine (ridimensiona soltanto) */
.card-prodotto .thumb{
  width: 100%;
  height: clamp(130px, 22vw, 170px); /* più piccola su mobile, più ampia su desktop */
  border-radius: 10px;
  background:#fff;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.card-prodotto .thumb img{
  max-width:100%; max-height:100%;
  width:auto; height:auto;
  object-fit: contain;  /* non taglia mai */
  display:block;
}

/* Prezzo + bottone affiancati, con fallback a riga successiva su schermi stretti */
.price-row{
  margin-top: .35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  flex-wrap: wrap; /* permette al bottone di andare sotto se serve */
}
.price-row .price{
  margin: 0;
  font-size: clamp(.95rem, 1.2vw, 1.05rem);
}
.btn-add-cart.compact{
  margin: 0;
  padding: .42rem .6rem;
  font-weight: 800;
  border-radius: 10px;
  white-space: nowrap;
}

/* Stato disponibilità leggermente compattato e fluido */
.disponibilita{
  margin-top: .45rem;
  font-size: clamp(.85rem, 1vw, .95rem);
  gap: 6px;
}
.pallino{ width: 12px; height: 12px; }

/* ===== Micro-tuning per breakpoint molto piccoli ===== */
@media (max-width: 380px){
  /* forza 1 colonna piena e bottoni a larghezza piena se serve */
  section.catalogo-wrap #lista-prodotti{
    grid-template-columns: 1fr !important;
  }
  .price-row{
    gap: .5rem;
  }
  .btn-add-cart.compact{
    flex: 1 1 100%;
  }
}

/* ===== Micro-tuning per desktop larghi (estetica ancora più compatta) ===== */
@media (min-width: 1280px){
  section.catalogo-wrap #lista-prodotti{
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 1.1rem !important;
  }
}
/* ====== HERO con immagine di sfondo ====== */
/* Sostituisci il percorso se usi un file diverso da img/hero-bg.jpg */
/* ====== HERO con immagine di sfondo (path corretto) ====== */
.hero.hero-bg{
  /* usa il path relativo alla cartella css/ */
  background:
    linear-gradient(rgba(255,255,255,0.78), rgba(255,255,255,0.78)),
    url('../img/hero-bg.jpeg') !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* su desktop facciamo vedere un filo più immagine */
@media (min-width: 900px){
  .hero.hero-bg{
    background:
      linear-gradient(rgba(255,255,255,0.72), rgba(255,255,255,0.72)),
      url('../img/hero-bg.jpeg') !important;
  }
}

/* niente sottolineatura sui bottoni */
.btn-cta,
.btn-cta:visited,
.btn-cta:hover,
.btn-cta:focus,
.btn-cta-ghost,
.btn-cta-ghost:visited,
.btn-cta-ghost:hover,
.btn-cta-ghost:focus,
.btn-primary,
.btn-secondary {
  text-decoration: none !important;
}

/* ===== HERO con immagine di sfondo nitida ===== */
.hero.hero-bg{
  position: relative;
  min-height: clamp(360px, 52vh, 640px); /* assicura che si veda davvero */
  background-image: url('../img/hero-bg.jpg'); /* path corretto perché il CSS sta in /css */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Velo leggero per leggibilità del testo (riduci l'opacità se vuoi più foto) */
.hero.hero-bg::after{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.22),
    rgba(255,255,255,0.22)
  );
  pointer-events: none;
}

/* Contenuto sopra il velo */
.hero .hero-inner{
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 6rem) 1rem;
  text-align: center;
}

/* Titoli e paragrafi leggibili su foto */
.hero h1{
  margin: 0 0 .6rem;
  font-size: clamp(1.8rem, 3.8vw, 3rem);
  line-height: 1.1;
  color: #0f172a;
}
.hero p{
  margin: 0 auto;
  max-width: 780px;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: #1f2937;
}

/* CTA senza sottolineatura */
.hero-actions{
  margin-top: 1.2rem;
  display: inline-flex;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: center;
}
.btn-cta,
.btn-cta:visited,
.btn-cta:hover,
.btn-cta:focus,
.btn-cta-ghost,
.btn-cta-ghost:visited,
.btn-cta-ghost:hover,
.btn-cta-ghost:focus,
.btn-primary,
.btn-secondary{
  text-decoration: none !important;
}

/* ===== Background di pagina (dietro a tutto, senza spostare nulla) ===== */
.page-bg{
  position: fixed;
  inset: 0;                                  /* full screen */
  background-image: url('../img/hero-bg.jpeg'); /* cambia il nome se serve */
  background-size: cover;                    /* si adatta allo schermo */
  background-position: center;               /* centrata */
  background-repeat: no-repeat;
  z-index: 0;                                /* sotto ai contenuti */
  pointer-events: none;                      /* non blocca i click */
  will-change: transform;                    /* più fluido nello scroll */
}

/* Se usi .jpeg al posto di .jpg, basta cambiare la riga sopra.
   Per più nitidezza su schermi retina puoi usare image-set:
   background-image: image-set(url('../img/hero-bg.jpg') 1x,
                               url('../img/hero-bg@2x.jpg') 2x); */

/* Mettiamo header/main/footer sopra al background fisso */
header, main, footer{
  position: relative;
  z-index: 1;
}

/* Tuning responsive: sposta il focus della foto su mobile/desktop */
@media (max-width: 640px){
  .page-bg{ background-position: center top; }   /* mostra più parte alta su smartphone */
}
@media (min-width: 1280px){
  .page-bg{ background-position: center center; }/* ribilancia su schermi grandi */
}

/* (Opzionale) Velo leggerissimo per leggibilità: aumenta 0.06→0.12 se serve più contrasto */
.page-bg::after{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.06);
}


/* ===== Background globale sfumato dietro a tutto ===== */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  /* 1) Velo sfumato morbido (regolabile)
     2) Foto di sfondo che si adatta allo schermo */
  background:
    linear-gradient(
      to bottom,
      rgba(255,255,255,0.20),
      rgba(255,255,255,0.20)
    ),
    url('../img/hero-bg.jpeg') center / cover no-repeat; /* cambia .jpg in .jpeg se serve */
  z-index: -1;          /* dietro a tutto */
  pointer-events: none; /* non cattura i click */
  will-change: transform;
}

/* Su mobile facciamo vedere più la parte alta della foto */
@media (max-width: 640px){
  body::before{ background-position: center top; }
}

/* Su desktop larghi la centriamo perfettamente */
@media (min-width: 1280px){
  body::before{ background-position: center center; }
}

/* Se avevi messo sfondi sulla HERO, li annullo per non "impastare" */
.hero.hero-bg,
.hero.hero-gradient{
  background: none !important;
}

/* Bottoni mai sottolineati (ribadito qui) */
.btn-cta,
.btn-cta:visited,
.btn-cta:hover,
.btn-cta:focus,
.btn-cta-ghost,
.btn-cta-ghost:visited,
.btn-cta-ghost:hover,
.btn-cta-ghost:focus,
.btn-primary,
.btn-secondary{
  text-decoration: none !important;
}
/* === Background globale: immagine + velo chiaro, fisso e dietro a tutto === */
/* Metti qui il nome giusto del file (jpg/jpeg) */
html{
  /* 1° layer: velo chiaro molto sfumato */
  /* regola l'opacità: 0.85 = molto chiaro; scendi a 0.75 se vuoi più immagine */
  background:
    linear-gradient(rgba(255,255,255,0.85), rgba(255,255,255,0.85)),
    url('../img/hero-bg.jpg') center / cover no-repeat fixed;
}

/* IMPORTANTISSIMO: il body non deve coprire lo sfondo dell'html */
body{
  background: transparent !important;
}

/* Tuning di inquadratura su mobile/desktop */
@media (max-width: 640px){
  html{ background-position: center top; }
}
@media (min-width: 1280px){
  html{ background-position: center center; }
}

/* Se avevi messo sfondi sulla hero, li annullo per non impastare il risultato */
.hero.hero-bg,
.hero.hero-gradient{
  background: none !important;
}

/* I bottoni non devono mai essere sottolineati */
.btn-cta,
.btn-cta:visited,
.btn-cta:hover,
.btn-cta:focus,
.btn-cta-ghost,
.btn-cta-ghost:visited,
.btn-cta-ghost:hover,
.btn-cta-ghost:focus,
.btn-primary,
.btn-secondary{
  text-decoration: none !important;
}
/* =========================
   SANIBABY — FIX UNICO BACKGROUND (incollare in fondo)
   - Disattiva layer in conflitto (.page-bg, body::before, hero-bg/gradient)
   - Usa un solo background sull'HTML, chiaro e sfumato, fisso dietro a tutto
   ========================= */

/* 1) Disattiva eventuali layer/gradient precedenti che coprivano i contenuti */
.page-bg{ display: none !important; }                     /* evita il layer fisso extra */
body::before{ content: none !important; }                 /* spegne lo pseudo-elemento del body */
.hero.hero-bg,
.hero.hero-gradient{ background: none !important; }       /* niente sfondo sulla hero */

/* 2) Background UNICO sull'HTML: immagine + velo chiaro, fisso */
html{
  /* Velo molto chiaro: aumenta 0.85→0.90 per più “bianco”, abbassa a 0.75 per più foto */
  background:
    linear-gradient(rgba(255,255,255,0.60), rgba(255,255,255,0.60)),
    url('../img/hero-bg.jpeg') center / cover no-repeat fixed;
}

/* IMPORTANTISSIMO: il body non deve coprire lo sfondo dell'html */
/* Solo sul sito pubblico (non sulle pagine admin che hanno il loro body background) */
body:not(.admin-body){ background: transparent !important; }

/* 3) Tuning inquadratura della foto per device */
@media (max-width: 640px){
  html{ background-position: center top; }
}
@media (min-width: 1280px){
  html{ background-position: center center; }
}

/* 4) (Qualora qualche regola altrove ri-sottolinei link bottoni, ribadiamo no-underline) */
.btn-cta,
.btn-cta:visited,
.btn-cta:hover,
.btn-cta:focus,
.btn-cta-ghost,
.btn-cta-ghost:visited,
.btn-cta-ghost:hover,
.btn-cta-ghost:focus,
.btn-primary,
.btn-secondary{
  text-decoration: none !important;
}
/* --- Hero: bordo sottile intorno al testo (niente box) --- */
.hero--full h1{
  /* bordo chiaro attorno al testo scuro */
  -webkit-text-stroke: .8px rgba(255,255,255,.75);  /* Safari/Chrome */
  text-shadow:
    0 0 1px rgba(255,255,255,.75),
    0 0 6px rgba(255,255,255,.45);                  /* fallback per altri browser */
}

.hero--full p{
  -webkit-text-stroke: .4px rgba(0, 0, 0, 0.65);
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.65),
    0 0 4px rgba(0, 0, 0, 0.35);
}

/* su schermi piccoli, un filo più marcato per leggibilità */
@media (max-width: 640px){
  .hero--full h1{ -webkit-text-stroke: 1px rgba(0, 0, 0, 0.8); }
  .hero--full p{  -webkit-text-stroke: .6px rgba(0, 0, 0, 0.7); }
}
/* ===== BG SOLO INDEX (non tocca le altre pagine) ===== */
.page-bg{
  position: fixed;
  inset: 0;
  background:
    /* velo chiaro molto sfumato: alza 0.88 se vuoi ancora più chiaro */
    linear-gradient(rgba(255,255,255,0.85), rgba(255,255,255,0.85)),
    url('../img/hero-bg.jpg') center / cover no-repeat;
  z-index: 0;               /* sotto ai contenuti dell'index */
  pointer-events: none;     /* non blocca i click */
}

/* porta SOLO i contenuti dell'index sopra al bg */
.home-content{
  position: relative;
  z-index: 1;
}

/* hero a tutta pagina (senza stacchi) */
.hero--full{
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 6rem) 1rem;
  background: transparent !important; /* niente blocchi di colore */
}

/* contesto e tipografia come già avevi */
.hero .hero-inner{ max-width: 980px; text-align: center; margin: 0 auto; }

/* bordo/alone leggero SOLO al testo della hero (niente box) */
.hero--full h1{
  -webkit-text-stroke: .8px rgba(255,255,255,.75);
  text-shadow: 0 0 1px rgba(255,255,255,.75), 0 0 6px rgba(255,255,255,.45);
}
.hero--full p{
  -webkit-text-stroke: .4px rgba(5, 5, 5, 0.65);
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.65), 0 0 4px rgba(1, 1, 1, 0.35);
}
.contact-wrap p{
  -webkit-text-stroke: .4px rgba(5, 5, 5, 0.65);
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.65), 0 0 4px rgba(1, 1, 1, 0.35);
}

/* inquadratura foto: più alto su mobile */
@media (max-width: 640px){
  .page-bg{ background-position: center top; }
}

/* =========================
   MODALE DETTAGLIO PRODOTTO
   ========================= */

.product-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
}

.product-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.product-modal-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 900px;
  animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-modal-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-size: 2rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: all 0.2s ease;
}

.product-modal-close:hover {
  background: var(--rosa);
  color: #fff;
  transform: rotate(90deg);
}

.product-modal-body {
  display: flex;
  gap: 2rem;
  padding: 2rem;
}

.product-modal-image {
  flex: 0 0 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f8f8;
  border-radius: 12px;
  padding: 1.5rem;
  min-height: 350px;
}

.product-modal-image img {
  max-width: 100%;
  max-height: 400px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.product-modal-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-modal-details h2 {
  color: var(--azzurro);
  margin: 0;
  font-size: 1.8rem;
}

.modal-brand {
  color: #666;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.modal-description {
  color: var(--testo);
  font-size: 1rem;
  line-height: 1.6;
  flex: 1;
  margin: 0.5rem 0;
}

.modal-price-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.modal-price {
  font-size: 1.8rem;
  color: var(--azzurro);
  margin: 0;
}

.product-modal-details .btn-add-cart {
  margin-top: 1rem;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  width: 100%;
}

/* Responsive modale */
@media (max-width: 768px) {
  .product-modal-body {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .product-modal-image {
    flex: none;
    min-height: 250px;
  }

  .product-modal-image img {
    max-height: 300px;
  }

  .product-modal-details h2 {
    font-size: 1.5rem;
  }

  .modal-price {
    font-size: 1.5rem;
  }

  .modal-price-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* Link "Visualizza altro..." nelle card */
.desc-preview {
  position: relative;
}

.view-more-link {
  color: var(--azzurro);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  font-size: 0.85rem;
  display: inline-block;
  margin-top: 0.25rem;
}

.view-more-link:hover {
  color: var(--rosa);
}

/* =========================
   ANIMAZIONE "AGGIUNGI AL CARRELLO" SPETTACOLARE
   ========================= */

/* Miniatura volante */
.fly-to-cart {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  transition: none;
  will-change: transform, top, left, width, height, opacity;
}
.fly-to-cart.flying {
  transition: top .7s cubic-bezier(.2,.8,.3,1.2),
              left .7s cubic-bezier(.2,.8,.3,1.2),
              width .7s ease-in,
              height .7s ease-in,
              opacity .7s ease-in,
              border-radius .7s ease;
}

/* Particelle / coriandoli */
.cart-particle {
  position: fixed;
  z-index: 9998;
  pointer-events: none;
  border-radius: 50%;
  will-change: transform, opacity;
  animation: particleBurst .75s ease-out forwards;
}
@keyframes particleBurst {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { opacity: 0; }
}

/* Bounce del badge */
@keyframes badgeBounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.7); }
  50%  { transform: scale(.85); }
  70%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.cart-badge.bounce {
  animation: badgeBounce .5s cubic-bezier(.3,.7,.4,1.5);
}

/* Ring pulse sul badge */
@keyframes badgeRing {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,.6); }
  100% { box-shadow: 0 0 0 14px rgba(239,68,68,0); }
}
.cart-badge.ring {
  animation: badgeRing .6s ease-out;
}

/* Shake+pulse del bottone carrello nell'header */
@keyframes cartButtonShake {
  0%   { transform: rotate(0); }
  15%  { transform: rotate(-12deg) scale(1.15); }
  30%  { transform: rotate(10deg) scale(1.15); }
  45%  { transform: rotate(-8deg); }
  60%  { transform: rotate(5deg); }
  75%  { transform: rotate(-3deg); }
  100% { transform: rotate(0) scale(1); }
}
.cart-button.shake {
  animation: cartButtonShake .55s ease-in-out;
}

/* Pulsazione verde successo sul bottone "Aggiungi" */
@keyframes addedPulse {
  0%   { box-shadow: 0 0 0 0 rgba(76,175,80,.5); }
  50%  { box-shadow: 0 0 0 12px rgba(76,175,80,0); }
  100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
}
.btn-add-cart.added {
  background: #4CAF50 !important;
  animation: addedPulse .6s ease-out;
  transition: background .25s ease;
}

/* Lottie-style checkmark dentro il bottone */
.btn-add-cart .check-icon {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  vertical-align: middle;
  margin-right: .3em;
  animation: checkPop .4s cubic-bezier(.3,.7,.4,1.5);
}
@keyframes checkPop {
  0%   { transform: scale(0) rotate(-45deg); opacity: 0; }
  60%  { transform: scale(1.3) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* Toast di conferma */
.cart-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: linear-gradient(135deg, #4CAF50, #2e7d32);
  color: #fff;
  padding: .65rem 1.4rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: .95rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity .3s ease, transform .3s ease;
  white-space: nowrap;
}
.cart-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================
   FIX GRIGLIA CATALOGO — override finale (sovrascrive tutto sopra)
   Le card riempiono le celle senza max-width; auto-fill mantiene
   colonne uniformi anche con pochi risultati.
   ========================= */
section.catalogo-wrap #lista-prodotti,
#lista-prodotti {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
  gap: 1.1rem !important;
  justify-content: stretch !important;
  align-content: start !important;
  max-width: 1100px !important;
  margin: 0 auto !important;
}

section.catalogo-wrap #lista-prodotti .card-prodotto,
#lista-prodotti .card-prodotto {
  max-width: none !important;   /* NO tetto: la card riempie la cella */
  width: 100% !important;
  margin: 0 !important;         /* niente auto-centering nella cella */
}

/* 4 per riga su desktop largo */
@media (min-width: 1200px) {
  section.catalogo-wrap #lista-prodotti,
  #lista-prodotti {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}
/* 3 per riga su desktop medio */
@media (min-width: 900px) and (max-width: 1199px) {
  section.catalogo-wrap #lista-prodotti,
  #lista-prodotti {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}
/* 2 per riga su tablet */
@media (min-width: 560px) and (max-width: 899px) {
  section.catalogo-wrap #lista-prodotti,
  #lista-prodotti {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
/* 1 per riga su mobile */
@media (max-width: 559px) {
  section.catalogo-wrap #lista-prodotti,
  #lista-prodotti {
    grid-template-columns: 1fr !important;
  }
}

/* Catalogo: ricerca centrale grande + paginazione */
.catalog-search-hero {
  max-width: 760px;
  margin: 1rem auto 1.2rem;
  text-align: center;
}

.catalog-search-label {
  display: block;
  margin-bottom: .55rem;
  font-weight: 900;
  color: #12425a;
}

.catalog-search-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}

.catalog-search-input {
  width: 100%;
  border: 2px solid #bfe3f3;
  border-radius: 14px;
  padding: .9rem 1rem;
  font-size: 1.02rem;
  background: #fff;
}

.catalog-search-input:focus {
  outline: none;
  border-color: #6ec1e4;
  box-shadow: 0 0 0 3px rgba(110, 193, 228, 0.2);
}

.catalog-search-btn {
  justify-self: center;
  min-width: 260px;
  border: none;
  border-radius: 999px;
  padding: .95rem 2.2rem;
  background: linear-gradient(135deg, #2f9fcf, #6ec1e4);
  color: #fff;
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(47, 159, 207, 0.28);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.catalog-search-btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 28px rgba(47, 159, 207, 0.34);
  filter: brightness(1.02);
}

.catalog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: 1.2rem;
}

.catalog-pagination--top {
  margin-top: 0;
  justify-content: flex-end;
}

.catalog-pagination--top .catalog-page-btn {
  padding: .38rem .58rem;
  min-width: 36px;
  font-size: .86rem;
}

.catalog-page-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 10px;
  padding: .48rem .75rem;
  min-width: 42px;
  cursor: pointer;
  font-weight: 700;
}

.catalog-page-btn:hover:not(:disabled) {
  border-color: #6ec1e4;
  color: #0f5270;
}

.catalog-page-btn.is-active {
  background: #6ec1e4;
  border-color: #6ec1e4;
  color: #fff;
}

.catalog-page-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Catalogo: prodotto esaurito con foto sfocata + overlay */
.card-prodotto .thumb {
  position: relative;
}

.card-prodotto .thumb.is-sold-out img {
  filter: blur(2px) grayscale(45%);
}

.card-prodotto .thumb .sold-out-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.08em;
  font-size: 1rem;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

@media (max-width: 640px) {
  .catalog-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-toolbar-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .45rem;
  }

  .catalog-pagination--top {
    width: 100%;
    justify-content: flex-start;
  }

  .catalog-search-btn {
    width: 100%;
    min-width: 0;
  }
}

/* =========================
   CARRELLO (cart.php)
   ========================= */

.table-wrap {
  background: #fff;
  border-radius: 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.table-cart {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.table-cart th,
.table-cart td {
  padding: .7rem;
  border-bottom: 1px solid #eee;
}

.table-cart thead th { text-align: left; font-weight: 800; }
.table-cart .unit-price,
.table-cart .row-sub { text-align: right; }

.table-cart .qty {
  width: 70px;
  padding: .35rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-align: center;
}

.btn-remove {
  border: none;
  background: #F44336;
  color: #fff;
  padding: .4rem .6rem;
  border-radius: 8px;
  cursor: pointer;
}

/* Mobile: righe impilate */
@media (max-width: 640px) {
  .table-wrap { overflow: visible; }
  .table-cart { min-width: 0; }
  .table-cart thead { display: none; }

  .table-cart tbody tr {
    display: block;
    position: relative;
    padding: .6rem;
    border-bottom: 1px solid #eee;
  }

  .table-cart td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .45rem 0;
    border-bottom: none;
  }

  .table-cart td[data-label]::before {
    content: attr(data-label);
    font-weight: 700;
    color: #374151;
    margin-right: .75rem;
  }

  .table-cart td.prod-cell { display: flex; gap: .7rem; align-items: center; }
  .table-cart td.prod-cell::before { content: ""; }
  .table-cart td.prod-cell img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }

  .table-cart td.actions-cell {
    position: absolute;
    top: .5rem;
    right: .5rem;
    padding: 0;
    justify-content: flex-end;
  }

  .table-cart .unit-price,
  .table-cart .qty-cell,
  .table-cart .row-sub { text-align: right; }

  .table-cart .qty { width: 64px; }
}

/* Desktop: righe compatte */
@media (min-width: 641px) {
  .table-cart th,
  .table-cart td {
    padding: .5rem .6rem;
    line-height: 1.25;
    vertical-align: middle;
  }

  .table-cart td.prod-cell { gap: .5rem; }

  .table-cart td.prod-cell img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
  }

  .table-cart .qty {
    width: 60px;
    height: 32px;
    padding: .3rem;
  }

  .btn-remove {
    padding: .3rem .5rem;
    font-size: .9rem;
  }

  .table-cart thead th {
    padding: .55rem .6rem;
    background: #fafafa;
  }
}

/* Totale */
.cart-total-bar {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* —— Modale conferma rimozione —— */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.modal-backdrop.show { display: flex; }

.modal {
  background: #fff;
  border-radius: 14px;
  width: min(92vw, 420px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  padding: 1.5rem;
}
.modal h3 { margin: 0 0 .5rem; font-size: 1.18rem; font-weight: 800; }
.modal p  { margin: 0 0 1.2rem; color: #444; line-height: 1.5; }
.modal .actions {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .65rem 1rem;
  font-weight: 800;
  cursor: pointer;
  font-size: 1rem;
}
.btn-light {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: .65rem 1rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
}

/* —— Animazione cestinamento —— */
.table-cart tbody tr { transform-origin: center; }

.table-cart tbody tr.row-removing {
  animation: rowSoftRemove .75s cubic-bezier(.2, .8, .25, 1) forwards;
}
.table-cart tbody tr.row-removing td { pointer-events: none; }
.table-cart tbody tr.row-removing .qty,
.table-cart tbody tr.row-removing .btn-remove { visibility: hidden; }

.trash-target {
  position: fixed;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%) scale(.88);
  z-index: 10000;
  pointer-events: none;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, #4b5563, #111827);
  border: 3px solid rgba(255, 255, 255, .78);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
}
.trash-target.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.trash-target.active { animation: trashPulse .38s ease; }
.trash-target span { font-size: 2rem; line-height: 1; }

.fly-to-trash {
  position: fixed;
  z-index: 10001;
  pointer-events: none;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
  object-fit: cover;
  transition:
    top .95s cubic-bezier(.2, .85, .25, 1.05),
    left .95s cubic-bezier(.2, .85, .25, 1.05),
    width .95s ease,
    height .95s ease,
    opacity .95s ease,
    border-radius .95s ease,
    transform .95s ease;
}

@keyframes trashPulse {
  0%   { transform: translate(-50%, -50%) scale(1); }
  50%  { transform: translate(-50%, -50%) scale(1.14); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes rowSoftRemove {
  0%   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translateY(8px) scale(.98); filter: blur(1px); }
}

/* —— Toast annulla rimozione —— */
.undo-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  z-index: 9500;
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  background: #111827;
  color: #fff;
  border-radius: 12px;
  padding: .75rem .9rem;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .28);
  transition: opacity .22s ease, transform .22s ease;
}
.undo-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.undo-toast__btn {
  border: none;
  border-radius: 8px;
  background: var(--azzurro);
  color: #fff;
  font-weight: 900;
  padding: .4rem .65rem;
  cursor: pointer;
}
.undo-toast__btn:disabled { opacity: .6; cursor: not-allowed; }
