/* =====================================================================
   styles.css — Maison Nord (negozio demo per il corso GA4)
   Tutto lo stile del sito è qui. Non serve modificarlo per il corso.
   ===================================================================== */

:root {
  --ink:      #1C1C1A;
  --bg:       #FBFAF8;
  --card:     #FFFFFF;
  --line:     #E8E6E0;
  --brand:    #0F4C4A;   /* verde pino: logo, header, bottoni */
  --brand-700:#0A3A38;
  --accent:   #E0A82E;   /* ambra: prezzi, evidenze */
  --muted:    #6B6B66;
  --radius:   14px;
  --maxw:     1120px;
  --shadow:   0 1px 2px rgba(28,28,26,.05), 0 10px 30px rgba(28,28,26,.06);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo {
  font-family: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 .4em;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ----------------------------- Header ----------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--brand);
  color: #fff;
  border-bottom: 1px solid var(--brand-700);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 24px;
  height: 64px;
}
.logo {
  font-size: 1.35rem; color: #fff; text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
.logo .dot { color: var(--accent); }
.site-nav { display: flex; gap: 22px; margin-left: 8px; }
.site-nav a {
  color: rgba(255,255,255,.85); text-decoration: none; font-size: .95rem;
  padding: 6px 2px; border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a:focus-visible { color: #fff; border-color: var(--accent); }
.header-spacer { flex: 1; }
.cart-link {
  color: #fff; text-decoration: none; font-size: .95rem;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--brand-700); padding: 8px 14px; border-radius: 999px;
}
.cart-link:hover, .cart-link:focus-visible { background: #073230; }
.cart-count {
  background: var(--accent); color: #2a2200; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem; padding: 0 5px;
}

/* ----------------------------- Hero ------------------------------- */
.hero {
  background:
    radial-gradient(60% 120% at 80% 0%, rgba(224,168,46,.18), transparent 60%),
    var(--brand);
  color: #fff;
}
.hero .wrap { padding: 64px 20px 72px; }
.hero .eyebrow {
  text-transform: uppercase; letter-spacing: .16em; font-size: .75rem;
  color: var(--accent); font-weight: 600; margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); max-width: 16ch; color:#fff; }
.hero p { font-size: 1.1rem; color: rgba(255,255,255,.82); max-width: 46ch; margin: 8px 0 28px; }

/* --------------------------- Bottoni ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  text-decoration: none; transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #2a2200; }
.btn-primary:hover, .btn-primary:focus-visible { background: #d09a1f; }
.btn-light { background: #fff; color: var(--brand); }
.btn-light:hover, .btn-light:focus-visible { background: #f2f0ea; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* --------------------------- Sezioni ------------------------------ */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.7rem; }
.section-head a { color: var(--brand); text-decoration: none; font-weight: 600; font-size: .95rem; }
.section-head a:hover { text-decoration: underline; }

/* ------------------------ Griglia prodotti ------------------------ */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(28,28,26,.06), 0 18px 40px rgba(28,28,26,.10);
}
.thumb {
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
}
.thumb.c-cucina  { background: linear-gradient(135deg,#e8f0ee,#d3e4df); }
.thumb.c-tavola  { background: linear-gradient(135deg,#f3ece0,#ecdfc8); }
.thumb.c-tessili { background: linear-gradient(135deg,#eae6f0,#ddd6ec); }
.card-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.card .name { font-weight: 600; }
.card .price { margin-top: auto; padding-top: 8px; font-weight: 700; color: var(--brand); }

/* ----------------------- Dettaglio prodotto ---------------------- */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.product .thumb { aspect-ratio: 1 / 1; border-radius: var(--radius); font-size: 8rem; }
.product .cat { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.product h1 { font-size: 2.2rem; margin: 6px 0 10px; }
.product .price { font-size: 1.8rem; font-weight: 700; color: var(--brand); margin: 4px 0 18px; }
.product .desc { color: #44443f; margin-bottom: 26px; }
.product .actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ----------------------------- Carrello --------------------------- */
.cart-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cart-table th, .cart-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.cart-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.cart-table tr:last-child td { border-bottom: none; }
.cart-row-emoji { font-size: 1.8rem; }
.cart-table .num { text-align: right; white-space: nowrap; }
.cart-summary { margin-top: 22px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.cart-total { font-size: 1.4rem; font-weight: 700; }
.cart-total .accent { color: var(--brand); }

.checkout-form { margin-top: 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.checkout-form h3 { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: .85rem; font-weight: 600; }
.field input {
  font: inherit; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff;
}
.field input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.hidden { display: none !important; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .big { font-size: 3rem; margin-bottom: 12px; }

/* --------------------------- Conferma ----------------------------- */
.thanks { text-align: center; padding: 56px 0; }
.thanks .check {
  width: 76px; height: 76px; border-radius: 999px; background: var(--brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; margin: 0 auto 22px;
}
.thanks h1 { font-size: 2.2rem; }
.thanks .order-id { display: inline-block; margin-top: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; font-weight: 600; }
.receipt { max-width: 520px; margin: 30px auto 0; text-align: left; }

/* ----------------------------- Footer ----------------------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 30px 0; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* =====================================================================
   TOAST EVENTI GA4 — l'elemento "didattico"
   Appare a ogni evento inviato, così in aula si vede il dato partire.
   ===================================================================== */
#ga4-toast-container {
  position: fixed; right: 18px; bottom: 18px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(360px, calc(100vw - 36px));
}
.ga4-toast {
  background: #14201f; color: #eafff9; border: 1px solid #1f3a36;
  border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
  animation: ga4in .25s ease;
  font-size: .88rem;
}
.ga4-toast .t-head {
  display: flex; align-items: center; gap: 8px;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
  color: #8fd6c8; margin-bottom: 6px;
}
.ga4-toast .t-name {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 4px;
}
.ga4-toast .t-params { color: #b9d8d1; line-height: 1.4; }
.ga4-toast .t-params b { color: var(--accent); }
@keyframes ga4in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --------------------------- Responsive --------------------------- */
@media (max-width: 720px) {
  .product { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .hero .wrap { padding: 44px 20px 52px; }
}

/* ----------------------- Quality floor ---------------------------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
