/* Decoricamo — identità grafica legacy (stile.css ASP + home server.py):
   rosso #990000, crema #ffffcc, oro #cc9933, verde prezzo #163, Trebuchet MS. */

body {
  margin: 0;
  padding: 0;
  background-color: #ffffff;
  color: #333;
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

[hidden] { display: none !important; }

img { max-width: 100%; height: auto; }

/* ---------- strisce legacy ---------- */
.top-div {
  width: 100%;
  height: 40px;
  line-height: 40px;
  border-bottom: 1px dashed #cc9933;
}
.top-div .contenuto {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 10px;
  text-align: right;
  font-size: 13px;
  color: #996633;
}
.top-div strong { color: #990000; }

/* ---------- header ---------- */
.top { text-align: center; }
img.banner {
  display: block;
  margin: 0.6rem auto 0;
  max-width: min(100%, 520px);
  height: auto;
}
.deco-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.35rem 0.6rem;
  color: #996633;
}
.deco-tog {
  display: none;
  background: #cc9933;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 1.15rem;
}

nav.deco {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
  border-bottom: 1px dashed #cc9933;
  padding: 0.4rem;
}
nav.deco a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #990000;
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  font-weight: 700;
}
nav.deco a .ico { width: 28px; height: 28px; flex: none; }
nav.deco a.on, nav.deco a:hover { background: #cc9933; color: #fff; }

#search-form {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  padding: 0.6rem 0.4rem;
}
#search-input {
  padding: 0.45rem 0.65rem;
  border: 1px solid #cc9933;
  border-radius: 999px;
  min-width: min(20rem, 60vw);
  font: inherit;
  background: #ffffcc;
  color: #663;
}
#search-form button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem 0.35rem 0.35rem;
  border: 1px solid #990000;
  border-radius: 999px;
  background: #990000;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
#search-form button .ico { width: 26px; height: 26px; }
#search-form button:hover { background: #cc9933; border-color: #cc9933; }

/* ---------- layout ---------- */
.wrap { max-width: 940px; margin: 0 auto; padding: 1rem; }

h1 { font-size: 1.45rem; color: #990000; margin: 0.6rem 0 0.9rem; }
h2 { font-size: 1.1rem; }
h1 .ico, h2 .ico { width: 36px; height: 36px; vertical-align: middle; margin-right: 0.35rem; }
h2 .ico { width: 28px; height: 28px; }
a { color: #990000; }

.loading, .meta { color: #996633; font-style: italic; }
.error { color: #990000; font-weight: 700; }
.lead { color: #663; line-height: 1.45; }
.titolo { font-weight: 700; color: #990000; }

/* ---------- home: card sezioni ---------- */
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}
.card {
  background: #fff;
  border: 1px solid #e6d9a8;
  padding: 0.9rem;
}
.card a { text-decoration: none; color: inherit; }
.card img.tab { width: 100%; height: 180px; object-fit: cover; display: block; }
.card h2 a { color: #990000; }

/* chips categorie (stile legacy) */
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.8rem 0; }
.chips a {
  border: 1px solid #cc9933;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: #990000;
  text-decoration: none;
  font-size: 0.85rem;
  background: #fff;
}
.chips a.on, .chips a:hover { background: #cc9933; color: #fff; }
.chips .count { color: #996633; font-size: 0.8em; }
.chips a:hover .count { color: #fff; }
/* R19 §2: foto categoria nelle chip (thumb quadrata) */
.chips a { display: inline-flex; align-items: center; gap: 0.35rem; }
.chips a img { width: 26px; height: 26px; object-fit: cover; border-radius: 50%; border: 1px solid #e6d9a8; }
.chips a img.ico { object-fit: contain; border-radius: 8px; background: #fff; }

/* griglia categorie */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 1rem; }
.cat-grid { list-style: none; padding: 0; margin: 0.8rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 0.5rem; }
.cat-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border: 1px dashed #cc9933;
  background: #fff;
  text-decoration: none;
  color: #990000;
  font-size: 1rem;
}
.cat-grid a:hover { background: #cc9933; color: #fff; }
.cat-grid .count { color: #996633; white-space: nowrap; margin-left: auto; }
.cat-grid a:hover .count { color: #fff; }
/* R19 §2: foto categoria nella card del catalogo. Segno e nome stanno affiancati. */
.cat-grid a .cat-main { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.cat-grid a .name { font-size: 1.08rem; font-weight: 700; color: #990000; line-height: 1.25; }
.cat-grid a:hover .name { color: #fff; }
.cat-grid a img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid #e6d9a8; flex: none; }
.cat-grid a img.ico { object-fit: contain; background: #fff; }

/* ---------- card prodotto ---------- */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 1rem;
}
.pcard {
  background: #fff;
  border: 1px solid #e6d9a8;
  overflow: hidden;
  display: flex;
}
.pcard a { text-decoration: none; color: inherit; display: flex; flex-direction: column; width: 100%; }
.pcard img.prod { width: 100%; height: 160px; object-fit: cover; background: #eee; }
.pcard .body { padding: 0.6rem 0.7rem; display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.pcard .name { font-weight: 700; color: #990000; }
.pcard .price { font-weight: 700; color: #116633; margin-top: auto; }
.pcard .cat { font-size: 0.8rem; color: #996633; }
.badge {
  display: inline-block;
  font-size: 0.72rem;
  border: 1px solid #cc9933;
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  color: #990000;
  background: #fff;
  width: fit-content;
}

/* ---------- scheda prodotto ---------- */
.crumbs { font-size: 0.85rem; color: #996633; }
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 0.6rem; }
@media (max-width: 720px) { .product, .cols { grid-template-columns: 1fr; } }

.gallery { display: flex; gap: 0.7rem; margin: 0.8rem 0; align-items: flex-start; }
.gallery .g-main { flex: 1; min-width: 0; }
.gallery img.hero { width: 100%; height: auto; max-height: 420px; object-fit: contain; background: #fff; cursor: default; }
.gallery .g-thumbs { display: flex; flex-direction: column; gap: 0.4rem; max-height: 420px; overflow-y: auto; flex-shrink: 0; }
.gallery .g-thumbs img { width: 76px; height: 76px; object-fit: cover; border: 1px solid #e6d9a8; cursor: pointer; }
.gallery .g-thumbs img:hover { border-color: #990000; }
.more-wrap { text-align: center; margin: 1rem 0; }

.price-big { font-weight: 700; color: #116633; font-size: 1.5rem; }
.description { color: #333; white-space: pre-line; }
select, input[type="number"] {
  padding: 0.4rem;
  border: 1px solid #cc9933;
  font: inherit;
  background: #ffffcc;
  color: #663;
}

/* ---------- dove siamo / footer ---------- */
.dove p { color: #663; }
.foot {
  border-top: 1px dashed #cc9933;
  color: #996633;
  padding: 1.1rem;
  font-size: 0.9rem;
  text-align: center;
}
.foot a { color: #990000; }

/* ---------- banner cookie (come legacy) ---------- */
#cookie-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffcc;
  border-top: 2px solid #cc9933;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  color: #663;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: center;
}
#cookie-bar button {
  background: #990000;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font: inherit;
  cursor: pointer;
}
#cookie-bar button.ghost { background: #cc9933; }

@media (max-width: 800px) {
  .deco-bar { display: flex; }
  .deco-tog { display: inline-block; }
  nav.deco { display: none; flex-direction: column; }
  nav.deco.open { display: flex; }
}

/* banner spedizione (leva vendita: GRATIS sopra X) */
.ship-banner {
  background: #990000;
  color: #ffffcc;
  text-align: center;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 700;
}

/* carrello */
.cart-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  background: #ffffcc;
  border: 1px solid #e6d9a8;
  padding: 0.6rem;
  margin-bottom: 0.5rem;
}
.cart-row img { width: 64px; height: 64px; object-fit: cover; background: #fff; }
.cart-row .qty input { width: 3.4rem; text-align: center; }
.cart-row .line { font-weight: 700; color: #116633; white-space: nowrap; }
.cart-totals { max-width: 340px; margin-left: auto; }
.cart-totals div { display: flex; justify-content: space-between; padding: 0.2rem 0; }
.cart-totals .grand { font-size: 1.2rem; font-weight: 700; color: #990000; border-top: 1px dashed #cc9933; margin-top: 0.3rem; padding-top: 0.4rem; }

/* checkout */
.checkout label { display: block; font-weight: 700; color: #663; font-size: 0.85rem; margin-top: 0.5rem; }
.checkout input, .checkout select, .checkout textarea {
  width: 100%; padding: 0.45rem; border: 1px solid #cc9933; font: inherit; background: #fffdf5;
}
.pay-methods label { font-weight: 400; color: #333; border: 1px solid #e6d9a8; background: #ffffcc; padding: 0.5rem 0.7rem; margin: 0.3rem 0; border-radius: 4px; }
.order-box { background: #ffffcc; border: 1px solid #e6d9a8; padding: 1rem; }
.order-status { font-weight: 700; color: #116633; }

@media (max-width: 600px) {
  .cart-row { grid-template-columns: 52px 1fr; }
  .cart-row .line { grid-column: 2; }
  .cart-row .actions { grid-column: 1 / -1; display: flex; gap: 0.5rem; justify-content: flex-end; }
}

/* ---------- responsive raffinato (telefoni) ---------- */
@media (max-width: 600px) {
  .top-div { height: auto; line-height: 1.3; padding: 0.3rem 0; }
  .top-div .contenuto { text-align: center; font-size: 11px; }
  img.banner { max-width: 100%; }
  nav.deco a { padding: 0.6rem 0.5rem; font-size: 0.92rem; }
  .wrap { padding: 0.7rem; }
  h1 { font-size: 1.2rem; }
  h2 { font-size: 1rem; }
  .card { padding: 0.7rem; }
  .card img.tab { height: 130px; }
  .pcard img.prod { height: 140px; }
  .gallery { flex-direction: column; }
  .gallery .g-thumbs { flex-direction: row; flex-wrap: wrap; max-height: none; order: 2; }
  .gallery .g-thumbs img { width: 64px; height: 64px; }
  .gallery img.hero { max-height: 300px; }
  .price-big { font-size: 1.3rem; }
  #search-input { min-width: 0; flex: 1; }
  #search-form button { padding: 0.45rem 0.7rem; }
  .product { gap: 0.8rem; }
  .chips a { padding: 0.45rem 0.6rem; font-size: 0.85rem; }
}

/* ---------- Round 6: dove siamo, area cliente, pulsanti flottanti, fidelity ---------- */

/* Pulsanti contatto "lite" (Dove siamo) */
.btn-lite {
  display: inline-block;
  margin: 0.15rem 0.25rem 0.15rem 0;
  padding: 0.45rem 0.9rem;
  background: #ffffcc;
  border: 1px solid #cc9933;
  color: #990000;
  font-weight: 700;
  text-decoration: none;
  border-radius: 6px;
}
.btn-lite:hover { background: #cc9933; color: #fff; }
.btn-lite.wa { background: #25d366; border-color: #1da851; color: #fff; }
.btn-lite.wa:hover { background: #1da851; }

/* Pagina Dove siamo: testo + mappa affiancati */
.dove-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 1rem;
  align-items: start;
}
iframe.mappa {
  width: 100%;
  height: 340px;
  border: 1px solid #cc9933;
  border-radius: 8px;
  background: #ffffcc;
}
.mappa-consent {
  width: 100%;
  height: 340px;
  border: 1px solid #cc9933;
  border-radius: 8px;
  background: #ffffcc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 1rem;
}
.dove { background: #ffffcc; border: 1px solid #e6d9a8; padding: 1rem; }

/* Area cliente */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.account-grid form.card label { display: block; font-weight: 700; color: #663; font-size: 0.85rem; margin-top: 0.5rem; }
.account-grid form.card input {
  width: 100%; padding: 0.45rem; border: 1px solid #cc9933; font: inherit; background: #fffdf5;
  box-sizing: border-box;
}
.area-badge { color: #116633; font-size: 0.8em; }

.fidelity-card { background: linear-gradient(135deg, #990000 0%, #7a0000 100%); color: #ffffcc; border: 2px solid #cc9933; }
.fidelity-card h2 { color: #cc9933; margin-top: 0; }
.fid-code {
  font-family: "Courier New", monospace;
  font-size: 1.5rem; font-weight: 700; letter-spacing: 2px;
  background: #ffffcc; color: #990000; display: inline-block;
  padding: 0.3rem 0.9rem; border-radius: 6px; border: 1px dashed #cc9933;
}

.order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem; align-items: center;
  padding: 0.55rem 0.3rem;
  border-bottom: 1px dashed #e6d9a8;
}
.order-row .thumb { width: 52px; height: 52px; object-fit: cover; border: 1px solid #e6d9a8; border-radius: 4px; vertical-align: middle; margin-right: 0.5rem; }
.legacy-orders { margin: 0.8rem 0; }
.legacy-orders summary { cursor: pointer; font-weight: 700; color: #663; padding: 0.4rem 0; }

/* Pulsanti flottanti (come VHH): WA in basso a sinistra, torna-su a destra */
.wa-float {
  position: fixed; left: 18px; bottom: 18px; z-index: 60;
  width: 54px; height: 54px; border-radius: 50%;
  background: #25d366; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 30px; height: 30px; }

.back-to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: #cc9933; color: #fff; font-size: 1.4rem; font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  opacity: 0; pointer-events: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: opacity 0.25s, transform 0.2s;
}
.back-to-top .ico { width: 26px; height: 26px; }
.back-to-top.show { opacity: 0.95; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-2px); }

/* Cookie bar: stile coerente (già presente? qui garantiamo il minimo) */
#cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: #ffffcc; border-top: 2px solid #cc9933;
  padding: 0.6rem 1rem; text-align: center; font-size: 0.92rem;
}
#cookie-bar p { margin: 0.3rem 0; }
#cookie-bar button { margin: 0 0.25rem; }

@media (max-width: 760px) {
  .dove-grid { grid-template-columns: 1fr; }
  iframe.mappa { height: 260px; }
  .mappa-consent { height: 260px; }
  .order-row { grid-template-columns: 1fr; text-align: left; }
  .order-row > div:last-child { text-align: left !important; }
  .order-row .thumb { width: 44px; height: 44px; }
  .wa-float { width: 48px; height: 48px; left: 12px; bottom: 12px; }
  .back-to-top { width: 42px; height: 42px; right: 12px; bottom: 12px; }
}

/* ---------- M1: feedback (form pubblico) + roadmap ---------- */

/* Honeypot anti-spam: invisibile a chi naviga, compilato dai bot */
.hp { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

.roadmap { display: grid; gap: 0.5rem; max-width: 640px; }
.rm-item {
  display: flex; align-items: center; gap: 0.8rem;
  background: #ffffcc; border: 1px solid #e6d9a8; padding: 0.6rem 0.9rem; border-radius: 6px;
}
.rm-status {
  flex: 0 0 auto; font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  padding: 0.15rem 0.55rem; border-radius: 999px; background: #cc9933; color: #fff;
}
.rm-fatto .rm-status { background: #116633; }
.rm-pianificato .rm-status { background: #990000; }

/* Fondo crema: spento di default, si riaccende da Impostazioni (shop_theme.creamBoxes). */
body.theme-cream .card,
body.theme-cream .cat-grid a,
body.theme-cream .pcard { background: #ffffcc; }

/* ---------- Pagine guida / pagine statiche (stessa veste del negozio) ---------- */
.etichetta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid #cc9933;
  background: #ffffcc;
  color: #990000;
  border-radius: 999px;
  padding: 0.12rem 0.7rem 0.12rem 0.2rem;
  font-size: 0.8rem;
  font-weight: 700;
  font-style: normal;
}
.etichetta .ico { width: 22px; height: 22px; }
.page-body { line-height: 1.65; }
.page-body h2 { color: #990000; }
.page-body figure { margin: 1rem 0; }
.page-body figure img { border: 1px solid #e6d9a8; border-radius: 6px; background: #fff; }
.page-body figcaption { color: #996633; font-size: 0.85rem; font-style: italic; margin-top: 0.3rem; }
.video-consent {
  border: 1px solid #cc9933;
  border-radius: 8px;
  background: #ffffcc;
  padding: 1rem;
  text-align: center;
  margin: 0.8rem 0;
}
.video-consent button {
  background: #990000;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.sources { border-top: 1px dashed #cc9933; margin-top: 1.5rem; padding-top: 0.8rem; color: #663; }
.move {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  margin-top: 1.4rem;
}
.btn-move {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  background: #ffffcc;
  border: 1px solid #cc9933;
  color: #990000;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
}
.btn-move.next { justify-content: flex-end; text-align: right; }
.btn-move small { display: block; font-weight: 400; color: #996633; font-size: 0.75rem; }
.btn-move .ico { width: 36px; height: 36px; flex: none; }
.btn-move:hover { background: #cc9933; color: #fff; }
.btn-move:hover small { color: #fff; }
.link-list { line-height: 1.6; }
.link-list li { margin: 0.55rem 0; }

form.card select, form.card input[type="email"], form.card input:not([type]), form.card textarea {
  width: 100%; box-sizing: border-box; padding: 0.45rem; border: 1px solid #cc9933; font: inherit; background: #fffdf5;
}
form.card label { display: block; font-weight: 700; color: #663; font-size: 0.85rem; margin-top: 0.6rem; }
