/* ==========================================================================
   MonkeysGod — Design System

   SORGENTE (non versionata, vedi .gitignore -> /design/):
     Claude Design, progetto abefda7c-ec73-4900-a938-187bb73b99e5
     file: assets/tokens.css + home.html
     archivio locale: "Refactor MonkeysGod Torino.zip"

   TRASFORMAZIONE APPLICATA rispetto alla sorgente:
     Prefisso .mg- sulle famiglie btn|tile|grid|footer, perche' collidono con
     alux.min.css (.grid, .tile) e style.css (.btn, .footer, .grid).
     Es. .btn-lg -> .mg-btn-lg, .tile-media -> .mg-tile-media.
     Nessun'altra modifica: token, valori e cascata sono invariati.

   Questo file e' la sola fonte di verita' in-repo del design system.
   Modificarlo qui; non rigenerarlo dalla sorgente senza riapplicare il prefisso.
   ========================================================================== */
/* ============================================================================
   MONKEYS GOD — REFACTOR · DESIGN SYSTEM (neutro B/N + 1 accento)
   Tono grafico "Mary Jane Berlin" trapiantato: loud di FORMA, non di colore.
   Outline cartoon · ombra dura · sticker pill · texture newsprint · ritmo
   paper/ink · 4 ruoli tipografici. Tutto deriva da :root → cambia 1 variabile
   e ri-tematizzi l'intero sito.
   ========================================================================== */

:root {
  /* ---- COLORE: base monocroma ---------------------------------------- */
  --ink:        #15110d;   /* near-black caldo: outline, testo, ombre        */
  --ink-2:      #4b443c;   /* testo secondario                              */
  --ink-3:      #837a6f;   /* testo di servizio / muted                     */
  --paper:      #f3efe6;   /* off-white: superfici fascia chiara            */
  --surface:    #ffffff;   /* superficie card                               */
  --surface-2:  #e9e4d8;   /* superficie alternativa / fill leggero         */
  --line:       #15110d;   /* OUTLINE = ink. Mai grigio.                     */

  /* ---- ACCENTO (unico) — ricavato dal MOODBOARD INSTAGRAM ------------- */
  /* Il colore più ricorrente ed energico del feed: GIALLO graffiti
     (Simpson, smiley filter-tips, oro RAW, monkey del festival).
     Usato come FILL dietro testo/outline ink → resta accessibile. */
  --accent:     #fdc80f;   /* GIALLO — highlight energetico (brand color)   */
  --accent-ink: #15110d;   /* testo che sta SOPRA il giallo (sempre ink)     */
  /* SECONDO accento — BLU "stile Torino": strutturale (ricerca, categorie,
     link, dettagli nav). Il giallo resta l'highlight caldo. */
  --accent-2:      #074ea5;   /* BLU Torino (brand color)                    */
  --accent-2-ink:  #ffffff;   /* testo sopra il blu                          */
  --accent-2-soft: color-mix(in srgb, var(--accent-2) 14%, transparent);
  /* Candidati alternativi estratti dal feed — cambia qui per ri-tematizzare:
     --accent: #f26a1b;    arancio (Kenny / fiamme glass-tip)
     --accent: #6e3fa3;    viola   (grinder Hashy)
     --accent: #a4132f;    bordeaux (RISERVA — palette attuale del negozio) */
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);

  /* ---- segnali funzionali (derivati, monocromi + 1) ------------------ */
  --ok:    #1f7a36;        /* conferma "aggiunto" (verde sobrio)            */
  --danger:#a4132f;        /* rimozione / errore                           */

  /* ---- FORMA: token firma -------------------------------------------- */
  --outline-w: 3px;                       /* spessore outline cartoon       */
  --radius:    20px;                      /* angoli card/bottoni (18–24)    */
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow:    4px 4px 0 var(--ink);      /* ombra dura base — ZERO blur    */
  --shadow-lg: 6px 6px 0 var(--ink);
  --shadow-press: 2px 2px 0 var(--ink);   /* stato active (bottone sceso)   */
  /* texture newsprint: linee 1px @45°, gap 5px, ink .10 */
  --newsprint: repeating-linear-gradient(45deg, rgba(21,17,13,.10) 0 1px, transparent 1px 5px);
  --dash: 2px dashed var(--accent);       /* separatori tratteggiati accento*/

  /* ---- TIPO: 4 ruoli -------------------------------------------------- */
  --font-display: 'Bowlby One', system-ui, sans-serif;       /* 1 display    */
  --font-graff:   'Bangers', system-ui, cursive;             /* 2 graffiti   */
  --font-marker:  'Permanent Marker', system-ui, cursive;    /* 3 pennarello */
  --font-ui:      'Inter', system-ui, sans-serif;            /* 4 sans UI    */

  --nav-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Altezza riservata all'avviso negozio di WooCommerce quando e' attivo.
     Valore misurato in produzione col testo attuale (56px a 1440px); js/mg-nav.js
     lo riallinea all'altezza reale dopo il caricamento e lo azzera se l'utente
     chiude l'avviso. Il valore statico serve a NON introdurre uno spostamento
     di layout: lo spazio e' riservato gia' dal primo CSS applicato. */
  --mg-store-notice-h: 56px;
}

/* L'avviso negozio (.woocommerce-store-notice) e' position:absolute con
   z-index 99998, contro il 100 della nav sticky: senza questo padding si
   sovrappone all'intestazione e ne copre logo e voci di menu, lasciandone
   ~2px sensibili all'hover -- cioe' rende la navigazione inutilizzabile.
   La classe la mette mg_redesign_body_class() quando is_store_notice_showing(). */
body.mg-has-store-notice { padding-top: var(--mg-store-notice-h); }

/* Soglie misurate sul testo attuale dell'avviso: quante righe occupa cambia
   con la larghezza, e riservare troppo poco significa lasciarlo di nuovo
   sopra la nav finche' il JS non corregge.
     fino a 400px  -> 4 righe (128px)
     fino a 560px  -> 3 righe (104px)
     fino a 1200px -> 2 righe (80px)   <- i "desktop piccoli", la fascia che
                                          prima riservava 56px e copriva la barra
     oltre         -> 1 riga  (56px, il valore di :root)
   Si arrotonda per ECCESSO di proposito: qualche pixel di margine vuoto e'
   preferibile a un avviso che torna sopra il logo. Se il cliente cambia il
   testo dell'avviso questi numeri invecchiano, ma js/mg-nav.js misura
   l'altezza reale e riallinea: queste soglie servono solo a evitare il salto
   di layout nel primo istante. */
@media (max-width: 1200px) { :root { --mg-store-notice-h: 80px; } }
@media (max-width: 560px)  { :root { --mg-store-notice-h: 104px; } }
@media (max-width: 400px)  { :root { --mg-store-notice-h: 128px; } }

/* "Salta al contenuto" (header.php). Fuori schermo finche' non riceve il
   focus da tastiera. Lo z-index deve battere sia la nav sticky (100) sia
   l'avviso negozio di WooCommerce (99998), altrimenti comparirebbe sotto
   proprio nella fascia in cima dove viene mostrato. */
.mg-skip {
  position: fixed;
  top: 8px;
  left: -9999px;
  z-index: 100000;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border: var(--outline-w) solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-family: var(--font-ui);
  font-weight: 700;
  text-decoration: none;
}
.mg-skip:focus { left: 8px; }

/* ============================ RESET ======================================

   SCOPING (deviazione deliberata dalla sorgente Claude Design).

   Nel mockup queste regole erano globali: ogni elemento della pagina era
   disegnato. Qui convivono con alux.min.css e style.css su template legacy
   (blog, pagine, account) che NON sono nel perimetro del redesign.
   Applicate globalmente farebbero danno misurabile:

     a { color: inherit }        azzera i colori dei link su tutto il sito
     h1..h4 { margin: 0 }        collassa le spaziature dei contenuti Gutenberg
     img,svg { display: block }  rompe le immagini inline nei post
     * { box-sizing: border-box } alux imposta border-box solo su .glide,
                                  il suo grid a float gira in content-box

   Quindi: le regole di ELEMENTO valgono solo dove il redesign e' attivo
   (body.mg-redesign, aggiunta da mg_redesign_body_class() in functions.php)
   piu' il "chrome" — nav, mega-menu, footer, drawer, cartbar — che vive su
   OGNI pagina e deve reggersi ovunque.

   I selettori di CLASSE restano globali: sono prefissati .mg- o hanno nomi
   unici, quindi non collidono. Verificato: 0 collisioni residue.
   ======================================================================== */

/* chrome globale + pagine ridisegnate */
body.mg-redesign, body.mg-redesign *,
.nav, .nav *, .mega, .mega *,
.mg-footer, .mg-footer *,
.drawer, .drawer *, .cartbar, .cartbar *, .scrim, .toast {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* innocue ovunque */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

/* alux.min.css (il framework vecchio, ancora caricato per il reset) dichiara
   `body,html{height:100%}`. Quella riga rendeva INUTILE la nav sticky: un
   elemento position:sticky resta incollato solo finche' il suo blocco
   contenitore e' in vista, e con height:100% il body e' alto quanto il
   viewport. Misurato in produzione su una pagina da 9594px: a scroll 1500 la
   nav era gia' a top -905, a fondo pagina a -8203. Spariva, e per rivederla
   bisognava risalire fino in cima.

   min-height conserva l'intento originale (almeno un viewport, cosi' il footer
   non risale sulle pagine corte) e lascia il body crescere col contenuto.
   Verificato: con questa riga la nav resta a top 0 a ogni quota di scroll. */
html,
body { height: auto; min-height: 100%; }
button, input { font-family: inherit; }

/* solo dove il redesign e' attivo */
body.mg-redesign {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* `a { color: inherit }` e' un RESET: azzera il blu-link del browser sul
   contenuto. Ma a specificita' (0,1,2) schiacciava le regole di colore dei
   componenti-link a classe singola — .nav-anchors a (0,1,1), .add-btn (0,1,1) —
   rendendoli color:inherit = testo scuro: nero-su-nero su nav e bottoni home.
   :where() porta il selettore a specificita' zero (0,0,1), com'e' corretto per
   un reset: qualunque regola di componente vince. Stesso trattamento a h1..h4
   perche' il problema e' identico (un titolo dentro un componente colorato). */
:where(body.mg-redesign) a { color: inherit; }
:where(body.mg-redesign) :is(h1, h2, h3, h4) { margin: 0; }

/* img/svg: nel redesign e nel chrome. Altrove le immagini restano inline. */
body.mg-redesign img, body.mg-redesign svg,
.nav img, .nav svg, .mega img, .mega svg,
.mg-footer img, .mg-footer svg,
.drawer img, .drawer svg, .cartbar svg {
  display: block;
  max-width: 100%;
}

/* ============================ TIPOGRAFIA RUOLI ========================== */
.t-display {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: .98;
  color: var(--surface);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: var(--shadow);
}
/* titolone hero — ombra MULTI-LAYER impilata (effetto 3D fumetto) */
.t-hero {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: .9;
  color: var(--paper);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow:
    3px 3px 0 var(--ink),
    6px 6px 0 var(--accent),
    9px 9px 0 var(--ink);
}
.t-graff  { font-family: var(--font-graff);  letter-spacing: 2px; font-weight: 400; }
.t-marker { font-family: var(--font-marker); letter-spacing: .5px; }

/* kicker pill (pennarello) — etichetta appiccicata a mano */
.kicker {
  display: inline-block;
  font-family: var(--font-marker);
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  border: var(--outline-w) solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 12px 4px;
  box-shadow: var(--shadow);
  transform: rotate(-3deg);
}

/* sub-head divisore (graffiti) su pill */
.subhead {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-graff);
  font-size: 17px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--surface);
  border: 2.5px solid var(--line);
  border-radius: 8px;
  padding: 5px 12px 2px;
  box-shadow: var(--shadow);
  transform: rotate(-1.5deg);
}

/* titolo di sezione (display) */
.sec-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.6vw, 46px);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
  color: var(--surface);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: var(--shadow);
  transform: rotate(-1.5deg);
  display: inline-block;
}
/* su fascia ink, il titolo diventa accento */
.band-ink .sec-title { color: var(--accent); text-shadow: 4px 4px 0 #000; }

/* ============================ SUPERFICI / FASCE ======================== */
.band { position: relative; padding: clamp(48px, 7vw, 96px) 0; }
.band-paper { background: var(--paper); }
.band-surface { background: var(--surface); }
/* fascia INK full-black — ritmo cromatico in assenza di colore */
.band-ink { background: var(--ink); color: var(--paper); }
.band-ink .lead, .band-ink p { color: color-mix(in srgb, var(--paper) 86%, transparent); }
/* fascia BLU Torino — blocco di colore per spezzare il ritmo chiaro della home.
   Le card interne (bianche + gialla) restano coi propri fondi e spiccano sul blu. */
.band-blue { background: var(--accent-2); color: var(--accent-2-ink); }
.band-blue .lead, .band-blue p { color: color-mix(in srgb, var(--accent-2-ink) 90%, transparent); }

/* velatura marmorizzata — RIMOSSA su richiesta (niente texture maculata) */
.band-marble::before { content: none; }
.band > .wrap { position: relative; z-index: 1; }

.wrap { width: min(1240px, 92vw); margin: 0 auto; }
.wrap-narrow { width: min(820px, 92vw); margin: 0 auto; }

.sec-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
.sec-head .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lead { font-size: 16px; color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }

/* link "vedi tutti" graffiti */
.see-all {
  font-family: var(--font-graff);
  font-size: 16px; letter-spacing: 1.5px;
  text-decoration: none; color: var(--ink);
  border-bottom: 3px solid var(--accent);
  white-space: nowrap; padding-bottom: 1px;
}
.see-all:hover { color: var(--accent-ink); background: var(--accent); padding: 2px 8px; border-radius: 6px; border-bottom: 0; box-shadow: var(--shadow-press); }

/* ============================ BOTTONI ================================== */
.mg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 14px; letter-spacing: 1px; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  border: var(--outline-w) solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 22px 11px;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.mg-btn:hover { transform: translate(-1px,-1px); box-shadow: var(--shadow-lg); }
.mg-btn:active { transform: translate(2px,2px); box-shadow: var(--shadow-press); }
.mg-btn-primary { background: var(--accent); color: var(--accent-ink); text-shadow: 1px 1px 0 rgba(255,255,255,.35); }
.mg-btn-ink { background: var(--ink); color: var(--paper); }
.mg-btn-lg { font-size: 17px; padding: 16px 30px 14px; }
.mg-btn-block { width: 100%; }

/* accento secondario blu */
.pill-blue { background: var(--accent-2); color: var(--accent-2-ink); border-color: var(--ink); }
.mg-btn-blue { background: var(--accent-2); color: var(--accent-2-ink); text-shadow: 1px 1px 0 rgba(0,0,0,.25); }

/* ============================ BARRA DI RICERCA (grande) ============== */
.searchbar {
  display: flex; align-items: stretch; gap: 0;
  border: var(--outline-w) solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden;
}
.searchbar .ic { display: grid; place-items: center; padding: 0 6px 0 20px; color: var(--accent-2); }
.searchbar .ic svg { width: 26px; height: 26px; }
.searchbar input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  font-family: var(--font-ui); font-weight: 600; font-size: clamp(16px, 2.2vw, 21px);
  color: var(--ink); padding: 20px 14px;
}
.searchbar input::placeholder { color: var(--ink-3); }
.searchbar input:focus { outline: none; }
.searchbar .go-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 15px; letter-spacing: 1px; text-transform: uppercase;
  background: var(--accent-2); color: var(--accent-2-ink); border: 0; cursor: pointer;
  padding: 0 clamp(18px, 3vw, 34px); border-left: var(--outline-w) solid var(--line);
  transition: background .14s;
}
.searchbar .go-btn:hover { background: color-mix(in srgb, var(--accent-2) 84%, #000); }
.search-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; justify-content: center; }
.chip-link {
  font-family: var(--font-ui); font-weight: 700; font-size: 13px; text-decoration: none;
  color: var(--ink); background: var(--surface); border: 2.5px solid var(--line);
  border-radius: var(--radius-pill); padding: 8px 15px; box-shadow: var(--shadow-press);
  transition: transform .12s, background .12s, color .12s;
}
.chip-link:hover { background: var(--accent-2); color: var(--accent-2-ink); transform: translate(-1px,-1px); }

/* ============================ CARD CATEGORIA (brand) ================= */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-card {
  position: relative; display: flex; flex-direction: column; text-decoration: none; text-align: left;
  background: var(--surface); border: var(--outline-w) solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.cat-card:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-lg); }
.cat-card:active { transform: translate(2px,2px); box-shadow: var(--shadow-press); }
/* Quadrata come la .mega-feature del mega-menu: il cliente vuole le card
   brand della home con le stesse proporzioni delle card categoria in nav. */
.cat-card .cat-media { aspect-ratio: 1; border-bottom: var(--outline-w) solid var(--line); background: var(--surface-2); }
/* La sorgente aveva qui `.cat-card image-slot { width:100%; height:100% }`.
   <image-slot> e' il custom element drag&drop di Claude Design: non esiste a
   runtime. Il riempimento di .cat-media lo fa `.cat-card .cat-media img` in
   mg-home.css. Regola rimossa, non tradotta: sarebbe stata un duplicato. */
/* Spaziature e corpi allineati alla didascalia .mega-feature-cap del
   mega-menu (12/14/14, nome 15px, count a 2px dal nome). */
.cat-card .cat-body { padding: 12px 14px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cat-card .cat-name { font-family: var(--font-display); font-size: 15px; text-transform: uppercase; letter-spacing: .5px; line-height: 1; }
.cat-card .cat-count { font-family: var(--font-marker); font-size: 12px; color: var(--ink-3); margin-top: 2px; display: block; }
.cat-card .cat-arrow {
  flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--accent-2); color: var(--accent-2-ink); border: 2px solid var(--ink);
  border-radius: 9px; box-shadow: 2px 2px 0 var(--ink); transform: rotate(-3deg);
}
.cat-card:nth-child(3n) .cat-arrow { background: var(--accent); color: var(--accent-ink); }
.cat-card .cat-arrow svg { width: 17px; height: 17px; }
@media (max-width: 1080px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }

/* nav accent line ora BLU (vedi regola .nav sotto) */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--ink);
  border-bottom: var(--outline-w) solid var(--ink);
  box-shadow: 0 4px 0 var(--accent-2), 0 9px 18px rgba(0,0,0,.22);
}
.nav-inner {
  width: min(1320px, 95vw); margin: 0 auto;
  min-height: var(--nav-h);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 14px; padding: 10px 0;
}
/* wordmark brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; user-select: none; }
/* MONKEYS + GOD adiacenti, senza sovrapporsi (il vecchio -8px li faceva
   accavallare a certe risoluzioni). nowrap: non vanno mai a capo. */
.brand-name { white-space: nowrap; }
.brand b + b { margin-left: 0; }
.brand img.logo {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  border: 2px solid #fff; box-shadow: 2px 2px 0 var(--accent);
  background: #000;
  flex: 0 0 auto;
}
/* nome (riga 1) + citta' (riga 2) impilati accanto al logo */
.brand-text { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.brand-name { display: inline-flex; }
.brand-city {
  font-family: var(--font-marker);
  font-size: 16px; letter-spacing: 1px;
  color: var(--accent-2);
  transform: rotate(-3deg);
  margin: 1px 0 0 4px;
}
.brand b {
  font-family: var(--font-display);
  font-size: 22px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--paper);
  -webkit-text-stroke: 1px #000;
  text-shadow: 2px 2px 0 var(--accent);
}
/* Ombra CHIARA: quella nera spariva sul fondo scuro della nav e "GOD"
   sembrava piu' piccolo/disallineato rispetto a MONKEYS (che ha l'ombra
   gialla visibile). Metricamente sono identici: era solo resa ottica. */
.brand b.go { color: var(--accent); -webkit-text-stroke: 1px #000; text-shadow: 2px 2px 0 var(--paper); }

.nav-anchors { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav-anchors::-webkit-scrollbar { display: none; }
.nav-anchors a {
  flex: 0 0 auto;
  font-family: var(--font-graff); font-size: 15px; letter-spacing: 1.5px;
  color: var(--accent); text-decoration: none; white-space: nowrap;
  padding: 8px 11px 4px; border-radius: 7px; border: 2px solid transparent; line-height: 1;
}
.nav-anchors a:hover { color: var(--surface); background: rgba(255,255,255,.08); }
.nav-anchors a.active,
.nav-anchors a[aria-current="page"] {
  color: var(--accent-ink); background: var(--accent);
  border-color: var(--ink); box-shadow: 2px 2px 0 #000; transform: rotate(-1.5deg);
}
.nav-tools { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: transparent; border: 2px solid var(--accent); border-radius: 9px;
  color: var(--accent); cursor: pointer; transition: transform .12s, background .12s;
}
/* Quando e' un link, style.css `a:focus, a:hover` ne scurisce il colore: va ribadito qui. */
.icon-btn:hover,
.icon-btn:focus { color: var(--accent); }
.icon-btn:hover { background: rgba(245,181,14,.14); }
.icon-btn:active { transform: translate(1px,1px); }
.icon-btn svg { width: 19px; height: 19px; }

/* switch lingua */
.lang { display: inline-flex; border: 2px solid var(--accent); border-radius: 9px; overflow: hidden; }
.lang button {
  background: transparent; color: var(--accent); border: 0; cursor: pointer;
  font-family: var(--font-graff); font-size: 14px; letter-spacing: 1px; padding: 8px 10px 5px;
}
.lang button.on { background: var(--accent); color: var(--accent-ink); }

/* pill carrello */
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink);
  border: 2px solid var(--ink); border-radius: 10px; cursor: pointer;
  padding: 9px 13px 7px; box-shadow: 3px 3px 0 #000;
  transition: transform .12s, box-shadow .12s;
}
.cart-btn:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 #000; }
.cart-btn:active { transform: translate(1px,1px); box-shadow: 2px 2px 0 #000; }
.cart-btn .count {
  font-family: var(--font-graff); font-size: 13px; letter-spacing: 1px;
  background: var(--ink); color: var(--accent);
  border-radius: 999px; min-width: 22px; min-height: 20px; padding: 2px 6px 0;
  display: inline-grid; place-items: center;
}

/* ---- MEGA-MENU per BRAND ---- */
.mega {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--paper);
  border-bottom: var(--outline-w) solid var(--ink);
  box-shadow: 0 14px 26px rgba(0,0,0,.22);
  transform: translateY(-12px); opacity: 0; pointer-events: none;
  transition: transform .16s, opacity .16s;
  z-index: 99;
}
.mega.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.mega-inner { width: min(1320px,95vw); margin: 0 auto; padding: 26px 0 32px; display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: center; }
.mega-feature {
  border: var(--outline-w) solid var(--line); border-radius: var(--radius);
  background: var(--surface) var(--newsprint); box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
}
.mega-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 28px; align-content: start; }
.mega-cols h4 {
  grid-column: 1 / -1;
  font-family: var(--font-graff); font-size: 16px; letter-spacing: 1.5px;
  color: var(--ink-3); text-transform: uppercase; margin: 4px 0 10px;
}
.mega-cols a {
  font-family: var(--font-ui); font-weight: 600; font-size: 14px; color: var(--ink);
  text-decoration: none; padding: 10px 8px; border-radius: 8px; display: flex; align-items: center; gap: 8px;
}
.mega-cols a::before { content: ""; width: 7px; height: 7px; background: var(--accent); border: 1.5px solid var(--ink); border-radius: 2px; transform: rotate(8deg); flex: 0 0 auto; }
.mega-cols a:hover { background: var(--accent-soft); }

/* ============================ STICKER PILL (generica) ================= */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui); font-weight: 800; font-size: 12px; letter-spacing: .4px;
  background: var(--surface); color: var(--ink);
  border: 2.5px solid var(--line); border-radius: var(--radius-pill);
  padding: 6px 12px; box-shadow: var(--shadow-press); transform: rotate(-2deg);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 1.5px solid var(--ink); }
.pill-accent { background: var(--accent); color: var(--accent-ink); }
.pill:hover { animation: wiggle .4s ease; }
@keyframes wiggle { 0%,100%{transform:rotate(-2deg)} 30%{transform:rotate(2deg) scale(1.04)} 60%{transform:rotate(-3deg)} }

/* ============================ TILE PRODOTTO ============================ */
.mg-grid { display: grid; gap: 16px; }
.mg-grid-4 { grid-template-columns: repeat(4, 1fr); }
.mg-grid-3 { grid-template-columns: repeat(3, 1fr); }
.mg-grid-2 { grid-template-columns: repeat(2, 1fr); }

.mg-tile {
  position: relative; display: flex; flex-direction: column; text-align: left;
  background: var(--surface) var(--newsprint);
  border: var(--outline-w) solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.mg-tile:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-lg); }
.mg-tile:active { transform: translate(2px,2px); box-shadow: var(--shadow-press); }
.mg-tile-media {
  aspect-ratio: 1; position: relative; display: grid; place-items: center;
  border-bottom: var(--outline-w) solid var(--line); overflow: hidden;
}
/* placeholder immagine: blob sticker (outline + ombra) — mostra il TRATTAMENTO */
.ph {
  width: 64%; aspect-ratio: 1; filter: drop-shadow(3px 3px 0 var(--ink));
}
.ph svg { width: 100%; height: 100%; }
.ph .blob { fill: var(--surface-2); stroke: var(--ink); stroke-width: 6; }
.ph .blob-accent { fill: var(--accent-soft); }
.mg-tile-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2; white-space: nowrap;
  font-family: var(--font-ui); font-weight: 800; font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase;
  background: var(--ink); color: var(--paper); border: 2px solid var(--ink);
  padding: 4px 7px; border-radius: 6px; transform: rotate(-3deg);
}
.mg-tile-badge.new { background: var(--accent); color: var(--accent-ink); }
.mg-tile-badge.sale { background: var(--danger); color: #fff; }
.mg-tile-fav {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--surface); color: var(--ink); border: 2px solid var(--ink);
  border-radius: 50%; box-shadow: 2px 2px 0 var(--accent); cursor: pointer; transform: rotate(4deg);
}
.mg-tile-fav svg { width: 15px; height: 15px; }
.mg-tile-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mg-tile-brand { font-family: var(--font-marker); font-size: 12px; letter-spacing: 1px; color: var(--ink-3); text-transform: uppercase; }
.mg-tile-name { font-family: var(--font-ui); font-weight: 700; font-size: 14px; line-height: 1.3; color: var(--ink); min-height: 2.6em; }
.mg-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.mg-tile-price { flex: 1 1 auto; }
.mg-tile-price { font-family: var(--font-graff); font-size: 24px; letter-spacing: 2px; color: var(--ink); line-height: 1; }
.mg-tile-price small { font-family: var(--font-ui); font-weight: 700; font-size: 12px; color: var(--ink-3); text-decoration: line-through; letter-spacing: 0; margin-right: 6px; }
.add-btn {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex: 0 0 auto;
  font-family: var(--font-display); font-size: 11px; letter-spacing: .5px; text-transform: uppercase;
  background: var(--ink); color: var(--paper); border: 2px solid var(--ink);
  border-radius: 9px; padding: 9px 12px 7px; cursor: pointer;
  box-shadow: 2px 2px 0 var(--accent); transition: transform .1s, box-shadow .1s, background .14s;
}
.add-btn:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--accent); }
.add-btn:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--accent); }
.add-btn.added { background: var(--ok); border-color: var(--ok); box-shadow: 2px 2px 0 var(--ink); animation: pop .7s cubic-bezier(.34,1.56,.64,1); }
@keyframes pop { 0%{transform: scale(.85)} 100%{transform: scale(1)} }
.mg-tile.sold .mg-tile-media { opacity: .4; }
.mg-tile.sold::after {
  content: "ESAURITO"; position: absolute; top: 38%; left: 50%; transform: translate(-50%,-50%) rotate(-9deg);
  background: var(--ink); color: var(--paper); font-family: var(--font-display); font-size: 13px; letter-spacing: 1px;
  padding: 6px 12px; border-radius: 6px; z-index: 3;
}

/* ============================ CAROSELLO =============================== */
/* Le regole .rail / .rail-head / .rail-nav sono state rimosse il 03/08/2026:
   il rail "In evidenza" e' diventato una griglia e nessun template emette piu'
   quelle classi (verificato: zero occorrenze nel PHP e nell'HTML servito). */

/* ============================ STEP CARDS (Scegli/Ordina/Gusta) ======== */
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 34px; }
.step {
  position: relative; text-align: center;
  background: var(--surface); border: var(--outline-w) solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 26px 18px 22px; transform: rotate(-1.4deg);
}
.step:nth-child(2) { transform: rotate(1.2deg); background: var(--accent); }
.step:nth-child(3) { transform: rotate(-1.6deg); }
.step .num {
  font-family: var(--font-display); font-size: 30px; color: var(--surface);
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink);
  display: inline-block; margin-bottom: 8px;
}
.step:nth-child(2) .num { color: var(--accent); text-shadow: 3px 3px 0 #000; -webkit-text-stroke: 2px #000; }
.step h3 { font-family: var(--font-display); font-size: 20px; text-transform: uppercase; letter-spacing: 1px; }
.step p { font-size: 13.5px; color: var(--ink-2); margin: 8px 0 0; }
.step:nth-child(2) p { color: var(--accent-ink); }
.step + .step::before {
  content: ""; position: absolute; left: -26px; top: 50%; width: 20px; height: 20px;
  transform: translateY(-50%) rotate(-45deg);
  border-right: 5px solid var(--ink); border-bottom: 5px solid var(--ink);
  filter: drop-shadow(2px 2px 0 var(--accent));
}

/* ============================ STRIP LOGHI BRAND ====================== */
.logos { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.logo-chip {
  display: grid; place-items: center; min-width: 150px; height: 76px; padding: 0 22px;
  background: var(--surface); border: var(--outline-w) solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); font-family: var(--font-display); font-size: 17px; letter-spacing: .5px;
  text-transform: uppercase; color: var(--ink); transform: rotate(-1deg);
}
.logo-chip:nth-child(even) { transform: rotate(1.2deg); }
.logo-chip:hover { box-shadow: var(--shadow-lg); transform: translate(-1px,-1px) rotate(0); }

/* ============================ NEWSLETTER ============================= */
.news { display: flex; gap: 12px; flex-wrap: wrap; max-width: 540px; }
.news input {
  flex: 1 1 240px; min-width: 0;
  border: var(--outline-w) solid var(--accent); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-size: 16px; padding: 14px 16px;
  box-shadow: 3px 3px 0 var(--accent);
}
.news input::placeholder { color: var(--ink-3); }

/* ============================ FOOTER ================================= */
.mg-footer { background: var(--ink); color: var(--paper); border-top: var(--outline-w) solid var(--ink); }
.mg-footer-grid { width: min(1240px,92vw); margin: 0 auto; padding: 54px 0 26px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px; }
.mg-footer h4 { font-family: var(--font-graff); font-size: 18px; letter-spacing: 1.5px; color: var(--accent); text-transform: uppercase; margin-bottom: 14px; }
.mg-footer a { color: color-mix(in srgb, var(--paper) 84%, transparent); text-decoration: none; font-size: 14px; display: inline-block; padding: 4px 0; }
.mg-footer a:hover { color: var(--accent); }
.mg-footer .col p { font-size: 14px; color: color-mix(in srgb, var(--paper) 78%, transparent); margin: 4px 0; }
.mg-footer .socials { display: flex; gap: 10px; margin-top: 4px; }
.mg-footer .socials a { width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--accent); border-radius: 9px; color: var(--accent); padding: 0; }
.mg-footer .socials a:hover { background: var(--accent); color: var(--accent-ink); }
.mg-footer .socials svg { width: 17px; height: 17px; }
.mg-footer-meta { border-top: var(--dash); width: min(1240px,92vw); margin: 0 auto; padding: 16px 0 30px; font-family: var(--font-marker); font-size: 12px; letter-spacing: .5px; color: color-mix(in srgb, var(--paper) 66%, transparent); text-align: center; }

/* ============================ CART DRAWER =========================== */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 110; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 92vw);
  background: var(--paper); border-left: var(--outline-w) solid var(--ink);
  box-shadow: -8px 0 0 var(--accent), -18px 0 30px rgba(0,0,0,.25);
  transform: translateX(100%); transition: transform .26s cubic-bezier(.34,1.1,.64,1);
  z-index: 120; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 16px; border-bottom: var(--dash); }
.drawer-head .ttl { font-family: var(--font-display); font-size: 20px; text-transform: uppercase; letter-spacing: 1px; }
.drawer-items { flex: 1; overflow-y: auto; padding: 8px 20px; }
.ci { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1.5px dashed rgba(21,17,13,.25); }
.ci .thumb { width: 52px; height: 52px; background: var(--surface) var(--newsprint); border: 2px solid var(--ink); border-radius: 9px; box-shadow: 2px 2px 0 var(--ink); display: grid; place-items: center; }
.ci .thumb .ph { width: 74%; }
.ci .nm { font-weight: 800; font-size: 13.5px; line-height: 1.25; }
.ci .br { font-family: var(--font-marker); font-size: 11px; color: var(--ink-3); text-transform: uppercase; }
.ci .qty { display: inline-flex; align-items: center; gap: 8px; margin-top: 5px; }
.ci .qty button { width: 22px; height: 22px; border: 2px solid var(--ink); background: var(--surface); border-radius: 6px; font-weight: 800; cursor: pointer; line-height: 1; }
.ci .qty span { font-family: var(--font-graff); font-size: 15px; min-width: 16px; text-align: center; }
.ci .pr { font-family: var(--font-graff); font-size: 18px; letter-spacing: 1px; color: var(--ink); }
.ci .rm { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 11px; text-decoration: underline; padding: 2px 0; }
.drawer-empty { text-align: center; padding: 50px 24px; font-family: var(--font-marker); color: var(--ink-3); }
.drawer-foot { padding: 16px 20px calc(18px + var(--safe-bottom)); border-top: var(--outline-w) solid var(--ink); background: var(--surface); }
.drawer-tot { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.drawer-tot .lbl { font-family: var(--font-graff); font-size: 18px; letter-spacing: 1.5px; }
.drawer-tot .val { font-family: var(--font-display); font-size: 26px; }

/* ============================ MOBILE CART BAR ======================== */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--accent); color: var(--accent-ink);
  border-top: var(--outline-w) solid var(--ink);
  box-shadow: 0 -4px 0 var(--ink);
  padding: 12px 16px calc(12px + var(--safe-bottom));
}
.cartbar .info { font-family: var(--font-graff); font-size: 17px; letter-spacing: 1px; }
.cartbar .info b { font-family: var(--font-display); font-size: 18px; }

/* ============================ TOAST ================================== */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper); border: 2px solid var(--ink);
  border-radius: 12px; box-shadow: var(--shadow); padding: 12px 18px;
  font-family: var(--font-graff); letter-spacing: 1px; font-size: 16px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 130;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================ RESPONSIVE ============================= */
@media (max-width: 1080px) {
  .mg-grid-4 { grid-template-columns: repeat(3, 1fr); }
  .mega-inner { grid-template-columns: 1fr; }
  .mega-feature { display: none; }
}
@media (max-width: 860px) {
  .mg-footer-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; gap: 40px; }
  .step, .step:nth-child(2), .step:nth-child(3) { transform: rotate(-1deg); }
  .step:nth-child(2) { transform: rotate(1deg); }
  .step + .step::before { left: 50%; top: -28px; transform: translateX(-50%) rotate(45deg); }
}
@media (max-width: 680px) {
  /* --mg-store-notice-h NON si dichiara qui: le sue soglie stanno tutte
     insieme in cima al file (blocco "Soglie misurate"). Tenerne una copia
     anche in questo blocco, che viene dopo, avrebbe schiacciato le altre. */
  :root { --nav-h: 56px; }
  .nav-inner { grid-template-columns: auto auto; grid-template-areas: "brand tools" "anchors anchors"; row-gap: 8px; }
  .brand { grid-area: brand; }
  .nav-tools { grid-area: tools; justify-self: end; }
  .nav-anchors { grid-area: anchors; border-top: 1.5px dashed rgba(245,181,14,.3); padding-top: 8px; }
  .mg-grid-4, .mg-grid-3 { grid-template-columns: repeat(2, 1fr); }
  /* A 2 colonne i titoli lunghi allungavano le card a dismisura: 2 righe
     con ellissi, il titolo completo resta sulla scheda prodotto. */
  .mg-tile-name {
    font-size: 13px; min-height: 2.4em;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .mg-tile-price { font-size: 21px; }
  /* "Aggiungi al carrello" overflowa il bottone a 2 colonne: resta "Aggiungi"
     (la coda e' lo span .mg-atc-tail generato in PHP, vedi functions.php). */
  .mg-atc-tail { display: none; }
  .mg-footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .cartbar { display: flex; }
  .cartbar--empty { display: none; }
  /* Senza :has() la seconda regola e' ignorata e lo spazio resta: meglio vuoto che contenuto coperto. */
  body.has-cartbar { padding-bottom: 78px; }
  body.has-cartbar:has(.cartbar--empty) { padding-bottom: 0; }
  .icon-btn.search-btn { display: none; }
  .sec-title { font-size: clamp(24px, 8vw, 34px); }
}

/* L'avviso di categoria (.term-description) e' stilato in mg-shop.css,
   sezione "ARCHIVIO CATEGORIA": la' vive la card-nota compatta. */
