/* ─────────────────────────────────────────────────────────────
   Negozio — foglio del modulo.

   Si appoggia alle variabili del tema scelto in Aspetto (--ink,
   --page, --line, --brand, --muted): il negozio prende i colori
   del sito senza che si debba toccare niente qui.
   ───────────────────────────────────────────────────────────── */

.neg-stretto { max-width: 760px; }

/* ───── griglia e card ───── */

.neg-griglia {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin: 8px 0 26px;
}

.neg-griglia--testo { margin: 26px 0; }

.neg-card {
  background: var(--card, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.neg-card-img {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--page, #f2f5f9);
}

.neg-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.neg-card-vuota {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 42px; opacity: .35;
}

.neg-sconto {
  position: absolute; top: 10px; left: 10px;
  background: #b42318; color: #fff; font-weight: 700; font-size: 13px;
  padding: 3px 8px; border-radius: 999px;
}

.neg-card-testo { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.neg-card-testo h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.neg-card-testo h3 a { color: inherit; text-decoration: none; }
.neg-card-testo h3 a:hover { text-decoration: underline; }
.neg-card-sommario { margin: 0; font-size: .92rem; color: var(--muted, #64748b); line-height: 1.5; }

.neg-prezzo { margin: 2px 0; font-size: 1.15rem; }
.neg-prezzo b { font-weight: 800; }
.neg-prezzo s { color: var(--muted, #94a3b8); font-weight: 400; margin-left: 6px; font-size: .95rem; }
.neg-prezzo small { color: var(--muted, #94a3b8); font-size: .72rem; margin-left: 6px; }
.neg-prezzo--grande { font-size: 1.7rem; margin: 14px 0; }

.neg-tipo { margin: 0; font-size: .86rem; color: var(--muted, #64748b); }
.neg-pochi { color: #b45309; font-weight: 600; }
.neg-sku { font-size: .8rem; color: var(--muted, #94a3b8); }
.neg-esaurito { display: inline-block; padding: 8px 0; font-weight: 600; color: var(--muted, #64748b); }
.neg-aggiungi { margin-top: auto; padding-top: 8px; }
.neg-aggiungi .btn { width: 100%; }

.neg-card--grande { max-width: 520px; margin: 26px auto; }

/* ───── scheda ───── */

.neg-scheda { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 34px; margin: 18px 0 8px; }
.neg-scheda-img { background: var(--page, #f2f5f9); border-radius: 16px; overflow: hidden; aspect-ratio: 1 / 1; display: flex; }
.neg-scheda-img img { width: 100%; height: 100%; object-fit: cover; }
.neg-scheda-testo h1 { margin: 0 0 10px; }
.neg-descrizione { max-width: 760px; margin: 30px 0; }

@media (max-width: 760px) { .neg-scheda { grid-template-columns: 1fr; gap: 20px; } }

/* ───── tabelle di carrello e ordine ───── */

.neg-tabella { width: 100%; border-collapse: collapse; }
.neg-tabella th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #64748b); }
.neg-tabella td, .neg-tabella th { padding: 12px 10px; border-bottom: 1px solid var(--line, #e2e8f0); }
.neg-tabella .num { text-align: right; }
.neg-tabella input[type="number"] { width: 70px; }
.neg-riga-meta { display: block; font-size: .82rem; color: var(--muted, #94a3b8); }
.neg-x { border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--muted, #94a3b8); }
.neg-x:hover { color: #b42318; }

.neg-totali { margin: 20px 0; }
.neg-totali > div { display: flex; justify-content: space-between; gap: 20px; padding: 7px 0; border-bottom: 1px dashed var(--line, #e2e8f0); }
.neg-totali .neg-totale { border-bottom: 0; font-size: 1.2rem; padding-top: 12px; }
.neg-azioni { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0; }

.neg-codice { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 18px 0; }
.neg-codice label { font-weight: 600; }
.neg-codice input { flex: 0 1 220px; text-transform: uppercase; }

/* ───── cassa ───── */

.neg-form h2 { margin: 26px 0 10px; font-size: 1.15rem; }
.neg-form label { display: block; margin: 0 0 12px; }
.neg-form label > span { display: block; font-size: .86rem; color: var(--muted, #64748b); margin-bottom: 4px; }
.neg-form input[type="text"], .neg-form input[type="email"], .neg-form input[type="tel"], .neg-form textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line, #cbd5e1); border-radius: 10px; font: inherit; background: #fff;
}
.neg-due { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.neg-tre { display: grid; grid-template-columns: 120px 1fr 110px; gap: 0 16px; }
.neg-ko input, .neg-ko textarea { border-color: #b42318; }
.neg-err { display: block; color: #b42318; font-size: .82rem; font-style: normal; margin-top: 3px; }
.neg-trappola { position: absolute; left: -9999px; }
.neg-fattura { margin: 12px 0 18px; }
.neg-fattura summary { cursor: pointer; font-weight: 600; }
.neg-metodo { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line, #e2e8f0); border-radius: 12px; margin-bottom: 10px; }
.neg-metodo small { display: block; color: var(--muted, #64748b); font-size: .82rem; }
.neg-check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; }
.neg-check span { font-size: .92rem; }
.btn-grande { font-size: 1.05rem; padding: 14px 26px; }

@media (max-width: 640px) { .neg-due, .neg-tre { grid-template-columns: 1fr; } }

/* ───── ordine ───── */

.neg-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--muted, #64748b); margin: 0; }
.neg-bonifico { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92rem; margin: 0; }
.neg-download ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }

/* ───── avvisi, note, pallina ───── */

.neg-msg { padding: 12px 14px; border-radius: 10px; background: #eef6ee; border: 1px solid #cde3cd; margin: 12px 0; }
.neg-msg.err { background: #fdeaea; border-color: #f3c9c9; }
.neg-nota { color: var(--muted, #64748b); font-size: .9rem; }

.neg-filtri { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; }
.neg-filtri a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line, #e2e8f0); text-decoration: none; color: inherit; font-size: .9rem; }
.neg-filtri a.on { background: var(--brand, #0a63d6); color: #fff; border-color: transparent; }

.neg-pallina {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--brand, #0a63d6); color: #fff; text-decoration: none;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .25);
}
.neg-pallina b {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px;
  background: #b42318; border-radius: 999px; font-size: 12px; line-height: 22px; text-align: center; padding: 0 5px;
}

/* ───── il bottone, solo se il tema non ne ha uno ─────

   Sta tutto dentro :where(), che in fatto di specificita' vale zero: qualunque
   regola del tema — anche la piu' semplice, un «.btn { }» — lo scavalca senza
   doverlo sapere. Serve ai temi che una classe .btn non ce l'hanno: senza, i
   bottoni del modulo uscirebbero come link spogli, e un «Compra» che sembra un
   link e' un «Compra» che nessuno preme. */

:where(.negozio) .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; min-height: 44px;
  border: 1px solid transparent; border-radius: 10px;
  background: var(--brand, #0a63d6); color: #fff;
  font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
}
:where(.negozio) .btn:hover { filter: brightness(.94); color: #fff; }
:where(.negozio) .btn.sec {
  background: var(--card, #fff); color: inherit; border-color: var(--line, #cbd5e1);
}
:where(.negozio) .btn.sec:hover { filter: none; color: inherit; border-color: var(--brand, #0a63d6); }
:where(.negozio) .btn.danger { background: #b42318; }
:where(.negozio) .btn-grande { font-size: 1.05rem; padding: 14px 26px; min-height: 52px; }
