/* Wildfire Store — vetrina. Layout: fascia scura con logo e categorie, griglia prodotti su fondo chiaro, scheda prodotto a due colonne */
:root {
  --bg: #f7f6f4; --surface: #ffffff; --tile: #efedea; --line: #e3dfda; --line-strong: #cfc8c0;
  --ink: #17140f; --muted: #6b645c; --faint: #9a928a;
  --band: #191b24; --band-2: #232633; --band-fg: #f3efe9; --band-muted: #a7a9b6;
  --fire: #d71f27; --fire-deep: #b3161d; --fire-soft: #fde8e8;
  --ok: #2c7a4b; --ok-soft: #e4f3e9; --warn: #9a6100; --warn-soft: #fbf0d9; --bad: #b42318; --info: #3355a0; --info-soft: #e7edfa;
  --display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111217; --surface: #1a1c23; --tile: #20232b; --line: #2b2e38; --line-strong: #3b3f4b;
    --ink: #f1eee9; --muted: #a8a6a2; --faint: #7b7a78;
    --band: #0b0c10; --band-2: #16181f;
    --fire: #e2343a; --fire-deep: #f0575c; --fire-soft: #2e1415;
    --ok: #63c48a; --ok-soft: #13271b; --warn: #e6b450; --warn-soft: #2a2212; --bad: #f2786d; --info: #8cabf0; --info-soft: #161f33;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.08; margin: 0; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(30px, 5vw, 48px); }
h2 { font-size: clamp(22px, 3vw, 28px); }
h3 { font-size: 18px; font-weight: 600; letter-spacing: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.price { font-variant-numeric: tabular-nums; font-weight: 600; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--fire); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- testata ---------- */
.top { background: var(--band); color: var(--band-fg); position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top, 0px); }
.top-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo img { height: 44px; width: auto; display: block; }
.foot-logo { height: 84px; width: auto; margin-bottom: 14px; }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--fire); position: relative; flex: none; }
.logo-mark::after { content: ""; position: absolute; inset: 7px 9px 6px; background: #fff3ea; clip-path: polygon(50% 0, 78% 38%, 100% 70%, 82% 100%, 18% 100%, 0 70%, 26% 44%, 38% 60%); }
.logo-name { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.search { flex: 1; min-width: 0; max-width: 560px; margin-left: auto; }
.search input { width: 100%; background: var(--band-2); border: 1px solid #343847; color: var(--band-fg); border-radius: 999px; padding: 10px 16px; min-height: 42px; }
.search input::placeholder { color: var(--band-muted); }
.cart-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; background: var(--band-2); color: var(--band-fg); flex: none; }
.cart-n { position: absolute; top: -3px; right: -3px; background: var(--fire); color: #fff; font-size: 12px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 99px; display: grid; place-items: center; padding: 0 5px; }
.cats { max-width: 1240px; margin: 0 auto; display: flex; gap: 6px; overflow-x: auto; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { white-space: nowrap; text-decoration: none; color: var(--band-muted); font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 99px; }
.cats a:hover { color: var(--band-fg); }
.cats a.on { background: var(--band-fg); color: var(--band); }
@media (max-width: 640px) {
  .top-in { flex-wrap: wrap; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .cart-btn { margin-left: auto; }
  .logo-name { font-size: 18px; }
}

/* ---------- avvisi ---------- */
.notice { background: var(--warn-soft); color: var(--ink); font-size: 14px; text-align: center; padding: 9px 16px; }

/* ---------- home ---------- */
.hero { background: var(--band); color: var(--band-fg); overflow: hidden; }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center; padding-block: 34px 44px; }
.hero h1 { font-size: clamp(34px, 6vw, 64px); }
.hero h1 em { font-style: normal; color: var(--fire); }
.hero p { color: var(--band-muted); font-size: 17px; max-width: 46ch; margin: 14px 0 22px; }
.hero-img { border-radius: 16px; overflow: hidden; aspect-ratio: 3 / 2; background: var(--band-2); max-width: 100%; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-fan { position: relative; height: 290px; }
.hero-fan .c { position: absolute; width: 150px; aspect-ratio: 63 / 88; border-radius: 10px; left: 50%; top: 50%; border: 2px solid rgba(255,255,255,.08); background-size: cover; background-position: center; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 820px) { .hero-in { grid-template-columns: minmax(0, 1fr); padding-block: 26px 30px; } .hero-fan { height: 200px; } .hero-fan .c { width: 110px; } }

.perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.perks > div { background: var(--surface); padding: 16px 18px; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.perks b { display: block; font-size: 15px; }
.perks svg { flex: none; color: var(--fire); margin-top: 2px; }
@media (max-width: 760px) { .perks { grid-template-columns: minmax(0, 1fr); } }

.section { padding-block: 34px 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head a { font-weight: 600; color: var(--fire); text-decoration: none; font-size: 15px; }
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.cat-tiles a { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; min-height: 86px; justify-content: flex-end; }
.cat-tiles a:hover { border-color: var(--fire); }
.cat-tiles b { font-family: var(--display); font-size: 18px; }
.cat-tiles span { color: var(--muted); font-size: 13px; }

/* ---------- griglia prodotti ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.card a.img { display: block; aspect-ratio: 1; background: var(--tile); position: relative; }
.card a.img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.card .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint); font-family: var(--display); font-size: 15px; text-align: center; padding: 12px; }
.card .body { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.card .name { font-weight: 600; font-size: 15px; line-height: 1.3; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .cfoot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.card .price { font-size: 18px; }
.card .add { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 99px; }
.tag { position: absolute; top: 10px; left: 10px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tag.pre { background: var(--fire); color: #fff; }
.tag.out { background: var(--ink); color: var(--bg); }
.stock { font-size: 13px; font-weight: 500; }
.stock.ok { color: var(--ok); } .stock.low { color: var(--warn); } .stock.no { color: var(--muted); } .stock.pre { color: var(--fire); }

/* ---------- bottoni e moduli ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn.fire { background: var(--fire); border-color: var(--fire); color: #fff; }
.btn.fire:hover { background: var(--fire-deep); border-color: var(--fire-deep); }
.btn.light { background: var(--band-fg); color: var(--band); border-color: var(--band-fg); }
.btn.ghost-dark { background: transparent; color: var(--band-fg); border-color: #3a3e4c; }
.btn.big { min-height: 54px; font-size: 17px; padding: 12px 28px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--muted); min-width: 0; }
input, select, textarea { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; min-height: 46px; width: 100%; min-width: 0; color: var(--ink); font-size: 16px; }
textarea { min-height: 80px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .fields { grid-template-columns: minmax(0, 1fr); } }
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice label { border: 1.5px solid var(--line-strong); border-radius: var(--r); padding: 14px; display: flex; gap: 10px; cursor: pointer; background: var(--surface); }
.choice label:has(input:checked) { border-color: var(--fire); background: var(--fire-soft); }
.choice input { width: 18px; height: 18px; min-height: 0; accent-color: var(--fire); margin-top: 3px; }
.choice b { display: block; }
@media (max-width: 560px) { .choice { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--fire); margin-top: 2px; flex: none; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: var(--surface); }
.qty button { width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer; font-size: 18px; }
.qty span { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- prodotto ---------- */
.crumbs { font-size: 14px; color: var(--muted); padding-top: 18px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding-block: 18px 40px; align-items: start; }
.pdp .img { background: var(--tile); border-radius: 16px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; }
.pdp .img img { width: 100%; height: 100%; object-fit: contain; padding: 24px; }
.pdp h1 { font-size: clamp(26px, 3.6vw, 40px); margin: 6px 0 12px; }
.pdp .big-price { font-family: var(--display); font-size: 34px; font-weight: 800; }
.pdp .buy { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 18px 0; }
.pdp .desc { border-top: 1px solid var(--line); padding-top: 18px; white-space: pre-line; max-width: 65ch; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.box.pre { background: var(--fire-soft); border-color: transparent; }
.info-list { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); margin-top: 16px; }
.info-list div { display: flex; gap: 8px; }
@media (max-width: 820px) { .pdp { grid-template-columns: minmax(0, 1fr); gap: 18px; } }

/* ---------- carrello e cassa ---------- */
.two { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; padding-block: 22px 50px; }
@media (max-width: 900px) { .two { grid-template-columns: minmax(0, 1fr); } }
.lines { display: flex; flex-direction: column; }
.line { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line .thumb { width: 76px; height: 76px; border-radius: 10px; background: var(--tile); overflow: hidden; }
.line .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.line .t { font-weight: 600; line-height: 1.3; }
.line .r { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.line .rm { background: none; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; }
.summary { position: sticky; top: 130px; display: flex; flex-direction: column; gap: 12px; }
.summary .row { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.summary .tot { font-size: 22px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 12px; }
.err { background: #fdecea; color: #8a1c13; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
@media (prefers-color-scheme: dark) { .err { background: #2d1513; color: #f6b3ac; } }

/* ---------- ordine ---------- */
.steps { display: flex; gap: 0; margin: 20px 0; }
.steps div { flex: 1; text-align: center; font-size: 13px; color: var(--muted); position: relative; padding-top: 22px; }
.steps div::before { content: ""; position: absolute; top: 6px; left: 50%; width: 12px; height: 12px; border-radius: 99px; background: var(--line-strong); transform: translateX(-50%); z-index: 1; }
.steps div::after { content: ""; position: absolute; top: 11px; left: 0; right: 0; height: 2px; background: var(--line); }
.steps div:first-child::after { left: 50%; } .steps div:last-child::after { right: 50%; }
.steps div.on { color: var(--ink); font-weight: 600; }
.steps div.on::before { background: var(--fire); }

/* ---------- testi ---------- */
.prose { max-width: 72ch; padding-block: 24px 50px; }
.prose h1 { margin-bottom: 16px; }
.prose h2 { font-size: 20px; margin: 26px 0 8px; }
.prose p, .prose li { color: var(--ink); }
.empty { text-align: center; padding: 60px 16px; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 8px; }

/* ---------- piè di pagina ---------- */
.foot { background: var(--band); color: var(--band-muted); margin-top: 50px; font-size: 14px; padding-bottom: env(safe-area-inset-bottom, 0px); }
.foot-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 26px; padding-block: 34px; }
.foot b { color: var(--band-fg); display: block; margin-bottom: 6px; font-family: var(--display); font-size: 16px; }
.foot a { color: var(--band-fg); text-decoration: none; display: block; padding: 2px 0; }
.foot a:hover { text-decoration: underline; }
.foot .legal { border-top: 1px solid #2a2d38; padding-block: 14px; font-size: 13px; }
@media (max-width: 760px) { .foot-in { grid-template-columns: minmax(0, 1fr); } }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 460px); pointer-events: none; }
#toast .t { background: var(--band); color: var(--band-fg); padding: 11px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; gap: 12px; align-items: center; pointer-events: auto; }
#toast .t a { color: #ff9a9d; font-weight: 600; white-space: nowrap; }
#toast .t.err { background: var(--bad); }
.skeleton { background: var(--tile); border-radius: var(--r); aspect-ratio: 3 / 4; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

main { min-height: 60vh; }
