/* ═══════════════════════════════════════════════════════════════════
   Menu Braceria Nove Gradi
   Mobile: valori del design "Menu Braceria" (Claude Design).
   Tablet/desktop: stessa lingua (carta calda, filetti, numeri romani),
   copertina a due colonne, indice laterale, colonna di lettura.
   ═══════════════════════════════════════════════════════════════════ */
@import url('fonts.css');

:root {
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.2, .8, .2, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* THEMES.light */
  --m-bg: #FBF8F3; --m-bg2: #F5F0E8; --m-line: #EAE2D6; --m-line2: #D6CBBB;
  --m-text: #2B221C; --m-dim: #54463B; --m-mute: #8A7A69; --m-accent: #9C4A2F;
  --m-wash: radial-gradient(420px 240px at 50% -6%, rgba(156,74,47,.06), transparent 70%);
  --m-scrim: rgba(43, 34, 28, .42);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --m-bg: #151110; --m-bg2: #1C1715; --m-line: #2C2523; --m-line2: #443A35;
  --m-text: #F1E9DE; --m-dim: #D3C6B7; --m-mute: #948575; --m-accent: #D2794F;
  --m-wash: radial-gradient(460px 260px at 50% -8%, rgba(226,101,47,.20), transparent 72%);
  --m-scrim: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ── Animazioni ──────────────────────────────────────────────── */
@keyframes fadeIn   { from { opacity: 0 } to { opacity: 1 } }
@keyframes riseIn   { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
@keyframes catIn    { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes vtOut    { to { opacity: 0; transform: translateY(-4px) } }
@keyframes vtIn     { from { opacity: 0; transform: translateY(6px) } }
::view-transition-old(root) { animation: vtOut .18s var(--ease) both; }
::view-transition-new(root) { animation: vtIn .30s var(--ease-out) both; }

/* Cambio tema: dissolvenza dei colori solo durante il toggle */
html.theming, html.theming *, html.theming *::before, html.theming *::after {
  transition: background-color .38s var(--ease), color .38s var(--ease), border-color .38s var(--ease) !important;
}

/* ── Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--m-bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  background: var(--m-wash) no-repeat top center, var(--m-bg);
  color: var(--m-text); font-family: var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent;
}
body.is-locked { position: fixed; left: 0; right: 0; overflow: hidden; }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--m-accent); outline-offset: 4px; border-radius: 2px; }
[hidden] { display: none !important; }

/* Elementi ricorrenti */
.m-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--m-accent); flex: none; }
.m-rule { width: 18px; height: 1px; background: var(--m-line2); flex: none; }
.m-rule--long { width: 28px; }
.m-diamond { width: 5px; height: 5px; transform: rotate(45deg); border: 1px solid var(--m-accent); flex: none; }
.m-diamond--solid { width: 4px; height: 4px; border: 0; background: var(--m-accent); }
.m-arrow { font-size: 14px; color: var(--m-accent); }
.m-ornament { display: flex; align-items: center; gap: 10px; }
.m-back {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  color: var(--m-dim); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
}
.m-back .m-arrow { transition: transform .25s var(--ease-out); }
.m-back:hover .m-arrow { transform: translateX(-3px); }
.m-theme {
  height: 44px; display: inline-flex; align-items: center; padding: 0 14px;
  color: var(--m-mute); font-size: 10.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  transition: color .2s var(--ease);
}
/* Col tocco l'hover resta attivo dopo il tap: vale solo dove c'è un puntatore vero */
@media (hover: hover) { .m-theme:hover { color: var(--m-text); } }
.m-theme:active { color: var(--m-text); }
.no-js .m-theme, .no-js .m-back, .no-js .m-filters, .no-js .m-sheet, .no-js .m-tabs__ind, .no-js .m-cover__foot { display: none !important; }
.no-js [hidden]:not(.m-sheet) { display: block !important; }

.m-app { position: relative; min-height: 100vh; min-height: 100svh; }

/* ═══ COPERTINA ═══════════════════════════════════════════════ */
.m-cover { position: relative; min-height: 100vh; min-height: 100svh; display: flex; animation: fadeIn .3s var(--ease) both; }
.m-cover__frame {
  position: absolute; pointer-events: none; z-index: 0;
  top: calc(24px + var(--safe-top)); left: 18px; right: 18px; bottom: calc(24px + var(--safe-bottom));
  border: 1px solid var(--m-line); border-radius: 18px;
}
.m-cover__inner { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; padding: 0 34px; }
.m-cover__brand { padding: calc(96px + var(--safe-top)) 0 0; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; animation: riseIn .5s var(--ease-out) both; }
.m-cover__name { font-family: var(--display); font-weight: 500; font-size: 24px; letter-spacing: .32em; text-indent: .32em; color: var(--m-text); line-height: 1; }
.m-cover__tagline { font-size: 9px; letter-spacing: .34em; text-indent: .34em; text-transform: uppercase; color: var(--m-mute); }
.m-cover__lead { display: none; }
.m-cover__index { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; padding: 40px 0; }
.m-cover__cat {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  min-height: 56px; padding: 0 24px; text-align: center;
  animation: riseIn .55s var(--ease-out) both; animation-delay: calc(120ms + var(--i, 0) * 45ms);
}
/* Cascata senza attributi style (CSP): l'indice viene dalla posizione */
.m-cover__cat:nth-child(2) { --i: 1; }
.m-cover__cat:nth-child(3) { --i: 2; }
.m-cover__cat:nth-child(4) { --i: 3; }
.m-cover__cat:nth-child(5) { --i: 4; }
.m-cover__cat:nth-child(6) { --i: 5; }
.m-cover__cat:nth-child(7) { --i: 6; }
.m-cover__cat:nth-child(8) { --i: 7; }
.m-cover__cat:nth-child(9) { --i: 8; }
.m-cover__cat:nth-child(10) { --i: 9; }
.m-cover__cat:nth-child(11) { --i: 10; }
.m-cover__cat:nth-child(12) { --i: 11; }
.m-cover__cat:nth-child(13) { --i: 12; }
.m-cover__cat:nth-child(14) { --i: 13; }
.m-cover__cat:nth-child(15) { --i: 14; }
.m-cover__cat:nth-child(n+16) { --i: 15; }
.m-cover__num { font-family: var(--display); font-size: 8.5px; letter-spacing: .3em; text-indent: .3em; color: var(--m-accent); line-height: 1; }
.m-cover__title { font-size: 11.5px; font-weight: 500; letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; color: var(--m-text); line-height: 1.3; transition: color .2s var(--ease); }
.m-cover__cat--lead .m-cover__title { font-size: 13.5px; }
.m-cover__cat:active .m-cover__title { color: var(--m-accent); }
@media (hover: hover) { .m-cover__cat:hover .m-cover__title { color: var(--m-accent); } }
.m-cover__note, .m-cover__arrow { display: none; }
.m-cover__foot { padding: 0 0 calc(34px + var(--safe-bottom)); display: flex; flex-direction: column; align-items: center; gap: 10px; animation: fadeIn .6s var(--ease) .4s both; }
.m-theme--cover { font-size: 9px; letter-spacing: .3em; text-indent: .3em; padding: 0 16px; }
.m-theme__icon { display: none; }
.m-cover__alt { font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--m-mute); }
.m-cover__alt a { padding: 8px; transition: color .2s var(--ease); }
.m-cover__alt a:active { color: var(--m-accent); }
@media (hover: hover) { .m-cover__alt a:hover { color: var(--m-accent); } }

/* Telefono: la copertina sta in una schermata, senza scroll. La card è un foglio chiaro con angoli larghi su un
   fondo appena più scuro, a 6px dal bordo dello schermo; l'alone sta dentro la card. Logo in alto (28px sotto la
   cornice). Lo spazio libero va prima alle righe dell'indice (da 44 a 58px), poi per un terzo sopra l'indice e
   per due terzi sotto. Se le categorie sono troppe per lo schermo, la pagina scorre come prima.
   Spessore 1.7px: i telefoni lo arrotondano ai pixel fisici (5 invece di 3 sugli schermi 3x, 3 invece di 2 sui 2x).
   In basso il cambio tema è un'icona (luna nel chiaro, sole nello scuro) al posto della parola, senza puntino sopra. */
@media (max-width: 719px) {
  .m-cover { background: var(--m-line); }
  .m-cover__frame { top: calc(6px + var(--safe-top)); left: 6px; right: 6px; bottom: calc(6px + var(--safe-bottom)); border: 1.7px solid var(--m-line2); border-radius: 36px; background: var(--m-wash) no-repeat top center, var(--m-bg); }
  .m-cover__inner { padding: 0 22px; }
  /* Proporzioni: 13px dentro il logo, 26 tra le voci, 53 tra logo e prima voce (ognuna il doppio della precedente) */
  .m-cover__brand { padding-top: calc(34px + var(--safe-top)); gap: 10px; }
  .m-cover__name { font-size: 22px; }
  .m-cover__tagline { margin-top: -2px; }
  .m-theme--cover { width: 44px; padding: 0; justify-content: center; text-indent: 0; }
  .m-theme--cover [data-theme-label] { display: none; }
  .m-theme__icon { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
  .m-theme__sun, :root[data-theme="dark"] .m-theme__moon { display: none; }
  :root[data-theme="dark"] .m-theme__sun { display: inline; }
  .m-cover__index { justify-content: flex-start; gap: 0; padding: 40px 0 22px; }
  .m-cover__index::before, .m-cover__index::after { content: ''; flex: 1 1 0; }
  .m-cover__index::after { flex-grow: 2; }
  .m-cover__cat { flex: 100 1 44px; min-height: 44px; max-height: 58px; }
  .m-cover__foot { gap: 2px; padding-bottom: calc(36px + var(--safe-bottom)); }
  .m-cover__foot .m-dot { display: none; }
  /* text-indent pari alla spaziatura: il link torna sull'asse. Il padding allarga il tocco senza coprire la luna */
  .m-cover__alt { text-indent: .22em; }
  .m-cover__alt a { padding: 10px 20px 16px; }
}
@media (max-width: 719px) and (min-height: 740px) {
  .m-cover__brand { padding-top: calc(46px + var(--safe-top)); }
}

/* ═══ PAUSA: "Stiamo aggiornando il menu" ═════════════════════
   Stessa copertina, con il messaggio al posto dell'indice (src/views/templates/pause_template.php). */
.m-pause__body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 40px 0 calc(96px + var(--safe-bottom)); text-align: center; animation: fadeIn .6s var(--ease) .15s both; }
.m-pause__body .m-ornament { margin-bottom: 12px; }
.m-pause__title { font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: -.01em; line-height: 1.2; color: var(--m-text); text-wrap: balance; }
.m-pause__text { font-size: 12.5px; line-height: 1.7; color: var(--m-mute); }
@media (min-width: 720px) {
  .m-pause__title { font-size: 28px; }
  .m-pause__text { font-size: 13.5px; }
}
/* Computer: la copertina del menu è a due colonne, qui resta una colonna centrata */
@media (min-width: 1024px) {
  .m-pause .m-cover__inner { display: flex; }
  .m-pause .m-cover__brand { padding: 104px 0 0; margin: 0; border-right: 0; align-items: center; text-align: center; }
  .m-pause .m-cover__name, .m-pause .m-cover__tagline { text-indent: .34em; }
  .m-pause__title { font-size: 34px; }
}

/* ═══ MENU SPENTO: "Al momento non disponibile" ═══════════════
   Stessa copertina della pausa (src/views/templates/menu_off_template.php), con il nome del menu,
   il messaggio del ristoratore e i link agli altri menu accesi. */
.m-off__kicker { font-size: 9px; letter-spacing: .22em; text-indent: .22em; text-transform: uppercase; color: var(--m-accent); }
.m-off__note { max-width: 34ch; font-size: 13px; line-height: 1.7; color: var(--m-dim); overflow-wrap: anywhere; text-wrap: pretty; }
.m-off__next { margin-top: 10px; }
.m-off__next + .m-off__next { margin-top: -6px; }
.m-off__next a { min-height: 44px; }
@media (min-width: 720px) {
  .m-off__note { font-size: 14px; }
}
/* Anteprima nel pannello di un menu spento (admin/anteprima.php): striscia in cima che resta in vista scorrendo,
   senza coprire il piede della copertina (tema, altri menu). Mai nei menu pubblicati. */
.m-preview { position: sticky; top: 0; z-index: 90; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; margin: 0; padding: calc(4px + var(--safe-top)) 16px 4px; background: var(--m-text); color: var(--m-bg); font-size: 12.5px; line-height: 1.45; }
.m-preview a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ═══ CARTA ═══════════════════════════════════════════════════ */
.m-menu { display: flex; min-height: 100vh; min-height: 100svh; animation: fadeIn .3s var(--ease) both; }
.m-side { display: none; }
.m-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Barra superiore (mobile/tablet) */
.m-top {
  position: sticky; top: 0; z-index: 10;
  background: var(--m-wash) no-repeat top center, var(--m-bg);
  transition: box-shadow .3s var(--ease);
}
.m-top.is-compact { box-shadow: 0 1px 0 var(--m-line), 0 8px 24px -16px rgba(0,0,0,.25); }
.m-bar { padding: calc(18px + var(--safe-top)) 22px 12px; display: flex; flex-direction: column; align-items: center; position: relative; transition: padding .3s var(--ease); }
.m-top.is-compact .m-bar { padding-top: calc(10px + var(--safe-top)); padding-bottom: 6px; }
.m-bar .m-back { position: absolute; top: calc(6px + var(--safe-top)); left: 8px; transition: top .3s var(--ease); }
.m-bar .m-theme { position: absolute; top: calc(6px + var(--safe-top)); right: 8px; transition: top .3s var(--ease), color .2s; }
.m-top.is-compact .m-bar .m-back, .m-top.is-compact .m-bar .m-theme { top: calc(-2px + var(--safe-top)); }
.m-bar__name { font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: .13em; text-indent: .13em; color: var(--m-text); line-height: 1; padding: 6px 0; transition: font-size .3s var(--ease); }
.m-top.is-compact .m-bar__name { font-size: 15px; }

/* Tab delle categorie: scorrimento orizzontale con indicatore che scorre */
.m-tabs { position: relative; border-bottom: 1px solid var(--m-line); }
.m-tabs::before, .m-tabs::after { content: ''; position: absolute; top: 0; bottom: 1px; width: 22px; z-index: 1; pointer-events: none; }
.m-tabs::before { left: 0; background: linear-gradient(to right, var(--m-bg), transparent); }
.m-tabs::after { right: 0; background: linear-gradient(to left, var(--m-bg), transparent); }
.m-tabs__track { position: relative; display: flex; gap: 0 22px; padding: 2px 22px 0; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.m-tabs__track::-webkit-scrollbar { display: none; }
.m-tab {
  flex: none; height: 44px; display: flex; align-items: flex-end; padding: 0 2px 9px; scroll-snap-align: center;
  font-size: 10.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  color: var(--m-mute); transition: color .2s var(--ease);
}
.m-tab:hover { color: var(--m-dim); }
.m-tab[aria-current="true"] { color: var(--m-text); }
.m-tabs__ind {
  position: absolute; left: 0; bottom: 0; height: 1.5px; width: 0; background: var(--m-accent);
  transition: transform .32s var(--spring), width .32s var(--spring); will-change: transform, width;
}

/* Categoria */
.m-cat { display: flex; flex-direction: column; animation: catIn .32s var(--ease-out) both; }
.m-cat__head { padding: 32px 26px 6px; text-align: center; }
.m-cat__num { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 13px; font-family: var(--display); font-size: 10px; letter-spacing: .26em; color: var(--m-accent); }
.m-cat__title { font-family: var(--display); font-weight: 500; font-size: 28px; letter-spacing: -.01em; color: var(--m-text); line-height: 1.06; }
.m-cat__note { font-size: 12.5px; line-height: 1.7; color: var(--m-mute); margin: 11px auto 0; max-width: 33ch; }

.m-filters { display: flex; justify-content: center; gap: 18px; padding: 12px 22px 0; flex-wrap: wrap; }
.m-filter {
  height: 36px; padding: 0 2px; border-bottom: 1px solid transparent;
  font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--m-mute); transition: color .2s var(--ease), border-color .2s var(--ease);
}
.m-filter:hover { color: var(--m-dim); }
.m-filter[aria-pressed="true"] { color: var(--m-accent); border-bottom-color: var(--m-accent); }

.m-list { padding: 6px 26px 0; }
.m-group { display: flex; flex-direction: column; }
.m-group__head { display: flex; align-items: center; gap: 10px; padding: 26px 0 2px; animation: riseIn .45s var(--ease-out) both; animation-delay: calc(min(var(--i, 0) + var(--g, 0), 14) * 28ms); }
/* Cascata della lista: posizione nel gruppo (nth-child) più uno scarto per i gruppi successivi, al massimo 14 passi */
.m-group > :nth-child(2) { --i: 1; }
.m-group > :nth-child(3) { --i: 2; }
.m-group > :nth-child(4) { --i: 3; }
.m-group > :nth-child(5) { --i: 4; }
.m-group > :nth-child(6) { --i: 5; }
.m-group > :nth-child(7) { --i: 6; }
.m-group > :nth-child(8) { --i: 7; }
.m-group > :nth-child(9) { --i: 8; }
.m-group > :nth-child(10) { --i: 9; }
.m-group > :nth-child(11) { --i: 10; }
.m-group > :nth-child(12) { --i: 11; }
.m-group > :nth-child(13) { --i: 12; }
.m-group > :nth-child(14) { --i: 13; }
.m-group > :nth-child(15) { --i: 14; }
.m-group > :nth-child(n+16) { --i: 14; }
.m-group ~ .m-group { --g: 6; }
.m-group ~ .m-group ~ .m-group { --g: 10; }
.m-group__label { font-size: 9.5px; font-weight: 400; letter-spacing: .24em; text-transform: uppercase; color: var(--m-accent); white-space: nowrap; }
.m-group__line { flex: 1; height: 1px; background: var(--m-line); }
.m-group__hint { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--m-mute); white-space: nowrap; }

/* Riga piatto: comparsa a scalare, accento al passaggio */
.m-item {
  position: relative; display: flex; flex-direction: column; gap: 5px; padding: 19px 0; border-bottom: 1px solid var(--m-line);
  animation: riseIn .45s var(--ease-out) both; animation-delay: calc(min(var(--i, 0) + var(--g, 0), 14) * 28ms);
}
.m-item__row { display: flex; align-items: baseline; }
.m-item__name {
  font-family: var(--display); font-weight: 500; font-size: 16.5px; letter-spacing: -.01em; color: var(--m-text); line-height: 1.3; max-width: 72%;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
  transition: color .2s var(--ease);
}
.m-dots { flex: 1; min-width: 14px; border-bottom: 1px dotted var(--m-line2); margin: 0 9px 5px; opacity: .7; transition: border-color .2s var(--ease); }
.m-item__price { font-family: var(--display); font-weight: 500; font-size: 14.5px; letter-spacing: .03em; font-variant-numeric: tabular-nums; color: var(--m-text); white-space: nowrap; }
.m-item__desc { font-size: 12.5px; line-height: 1.65; color: var(--m-mute); max-width: 42ch; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.m-item__mark { font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--m-accent); }
.m-item--off .m-item__name, .m-item--off .m-item__price, .m-item--off .m-item__desc { opacity: .45; }
.m-item:active .m-item__name { color: var(--m-accent); }
@media (hover: hover) {
  .m-item:hover .m-item__name { color: var(--m-accent); }
  .m-item:hover .m-dots { border-color: var(--m-accent); }
}
.m-empty { padding: 56px 0; text-align: center; font-size: 12.5px; color: var(--m-mute); }

.m-cat__foot { padding: 36px 34px 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.m-cat__footer { font-size: 11.5px; line-height: 1.8; color: var(--m-mute); max-width: 40ch; }
.m-cat__next { margin-top: 24px; }
.m-cat__next a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 24px; }
.m-cat__next-label { font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--m-mute); }
.m-cat__next-title { font-family: var(--display); font-weight: 500; font-size: 18px; color: var(--m-text); letter-spacing: -.01em; transition: color .2s var(--ease); }
.m-cat__next .m-arrow { transition: transform .25s var(--ease-out); }
.m-cat__next a:hover .m-cat__next-title { color: var(--m-accent); }
.m-cat__next a:hover .m-arrow { transform: translateX(4px); }
.m-cat__next-num { font-size: 10px; letter-spacing: .22em; color: var(--m-accent); margin-right: 10px; vertical-align: 3px; }

/* Sottocategorie: elenco in cima alla pagina della categoria; ogni voce apre la sua pagina.
   Telefono e tablet: come l'indice della copertina (numero, nome in maiuscolo spaziato, introduzione sotto, centrati).
   Da 1024 px: a righe come l'indice desktop (numero · titolo · quante voci · freccia), nel blocco del computer. */
.m-subs { display: flex; flex-direction: column; align-items: center; padding: 26px 26px 0; }
.m-sub {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  width: 100%; min-height: 56px; padding: 14px 24px; text-align: center;
  animation: riseIn .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms);
}
.m-sub:nth-child(2) { --i: 1; }
.m-sub:nth-child(3) { --i: 2; }
.m-sub:nth-child(4) { --i: 3; }
.m-sub:nth-child(5) { --i: 4; }
.m-sub:nth-child(6) { --i: 5; }
.m-sub:nth-child(7) { --i: 6; }
.m-sub:nth-child(n+8) { --i: 7; }
.m-sub__num { font-family: var(--display); font-size: 8.5px; letter-spacing: .3em; text-indent: .3em; color: var(--m-accent); line-height: 1; white-space: nowrap; }
/* il titolo arriva a 40 caratteri: va a capo bilanciato; text-indent pari alla spaziatura, così resta sull'asse */
.m-sub__title {
  font-size: 13.5px; font-weight: 500; letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; line-height: 1.5;
  color: var(--m-text); text-wrap: balance; overflow-wrap: anywhere; transition: color .2s var(--ease);
}
.m-sub__note {
  max-width: 34ch; font-size: 12px; line-height: 1.55; color: var(--m-mute);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.m-sub__count, .m-sub__arrow { display: none; }
.m-sub:active .m-sub__title { color: var(--m-accent); }
@media (hover: hover) { .m-sub:hover .m-sub__title { color: var(--m-accent); } }
.m-ornament--subs { justify-content: center; margin: 34px 0 0; }
/* "← Antipasti" nella testata della sottocategoria: sul telefono c'è già nella barra in alto */
.m-cat__up { display: none; }
.m-bar .m-back [data-back-label] { max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.m-site-foot {
  margin-top: auto; padding: 8px 24px calc(28px + var(--safe-bottom)); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px;
  font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--m-mute);
}
.m-site-foot a { padding: 8px 0; transition: color .2s var(--ease); }
.m-site-foot a:hover { color: var(--m-accent); }

/* ═══ SCHEDA: bottom sheet (mobile) ═══════════════════════════ */
.m-sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.m-sheet__backdrop { position: absolute; inset: 0; background: var(--m-scrim); opacity: 0; transition: opacity .32s var(--ease); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.m-sheet__panel {
  position: relative; width: 100%; max-height: calc(100svh - 44px - var(--safe-top)); display: flex; flex-direction: column;
  background: var(--m-bg); color: var(--m-text); border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 40px -20px rgba(0,0,0,.45), 0 0 0 1px var(--m-line);
  transform: translateY(100%); transition: transform .38s var(--spring);
  will-change: transform; outline: none; touch-action: none;
}
.m-sheet.is-open .m-sheet__backdrop { opacity: 1; }
.m-sheet.is-open .m-sheet__panel { transform: translateY(0); }
.m-sheet.is-dragging .m-sheet__panel { transition: none; }
.m-sheet__grip { display: flex; justify-content: center; padding: 10px 0 2px; cursor: grab; }
.m-sheet__handle { width: 36px; height: 4px; border-radius: 999px; background: var(--m-line2); }
.m-sheet__bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 4px 24px; }
.m-sheet__num { font-family: var(--display); font-size: 10px; letter-spacing: .26em; color: var(--m-accent); }
.m-sheet__close { height: 40px; padding: 0 14px; color: var(--m-dim); font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; transition: color .2s; }
.m-sheet__close:hover { color: var(--m-accent); }
.m-sheet__close--foot { align-self: center; margin-top: 30px; color: var(--m-accent); border-bottom: 1px solid var(--m-accent); height: 32px; padding: 0 2px; }
.m-sheet__scroll { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; scrollbar-width: none; }
.m-sheet__scroll::-webkit-scrollbar { display: none; }
.m-sheet__body { --sheet-pad: 30px; padding: 10px var(--sheet-pad) calc(34px + var(--safe-bottom)); display: flex; flex-direction: column; align-items: center; text-align: center; transition: opacity .16s var(--ease), transform .16s var(--ease); }
.m-sheet.is-swapping .m-sheet__body { opacity: 0; transform: translateY(6px); }
.m-sheet__img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: contain; border-radius: 14px; margin: 6px 0 26px; }
.m-sheet__group { font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--m-mute); }
.m-sheet__name { font-family: var(--display); font-weight: 500; font-size: 26px; letter-spacing: -.02em; line-height: 1.18; color: var(--m-text); max-width: 22ch; margin-top: 10px; overflow-wrap: anywhere; }
.m-sheet__price { font-family: var(--display); font-weight: 500; font-size: 16px; letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--m-text); margin-top: 11px; }
.m-sheet__mark { margin-top: 10px; }
.m-sheet__mark:empty { display: none; }
.m-ornament--sheet { gap: 9px; margin: 22px 0; }
.m-ornament--sheet .m-rule { width: 26px; }
.m-sheet__long { font-size: 14px; line-height: 1.8; color: var(--m-dim); max-width: 36ch; white-space: pre-line; }
.m-sheet__long:empty { display: none; }

.m-specs { width: 100%; margin-top: 30px; display: flex; flex-direction: column; }
.m-specs:empty { display: none; }
.m-spec { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid var(--m-line); text-align: left; }
.m-spec dt { font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--m-mute); white-space: nowrap; }
.m-spec dd { font-size: 13px; line-height: 1.5; color: var(--m-text); text-align: right; }


.m-next { width: 100%; margin-top: 34px; text-align: left; }
.m-next__head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--m-mute); white-space: nowrap; }
.m-next__item { display: flex; align-items: baseline; width: 100%; min-height: 44px; padding: 11px 0; border-bottom: 1px solid var(--m-line); text-align: left; }
.m-next__name { font-family: var(--display); font-weight: 500; font-size: 14px; color: var(--m-text); line-height: 1.3; max-width: 74%; transition: color .2s; }
.m-next__item:hover .m-next__name { color: var(--m-accent); }
.m-next__item .m-dots { min-width: 12px; margin: 0 9px 4px; }
.m-next__price { font-family: var(--display); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--m-mute); white-space: nowrap; }

/* Avviso offline */
.m-offline {
  position: fixed; left: 50%; bottom: calc(16px + var(--safe-bottom)); transform: translateX(-50%); z-index: 50;
  max-width: calc(100% - 32px); padding: 10px 16px; border: 1px solid var(--m-line); border-radius: 999px;
  background: var(--m-bg2); color: var(--m-dim); font-size: 11px; letter-spacing: .04em; text-align: center; white-space: nowrap;
  animation: riseIn .4s var(--ease-out) both;
}

/* ═══ TABLET (≥ 720px): colonna centrata più ariosa ═══════════ */
@media (min-width: 720px) {
  .m-cover__frame { left: 32px; right: 32px; top: calc(32px + var(--safe-top)); bottom: calc(32px + var(--safe-bottom)); border-radius: 24px; }
  .m-cover__name { font-size: 32px; }
  .m-cover__tagline { font-size: 10px; }
  .m-cover__title { font-size: 13px; }
  .m-cover__cat--lead .m-cover__title { font-size: 15px; }
  .m-cover__cat { min-height: 64px; }
  .m-main, .m-top { max-width: 680px; margin: 0 auto; width: 100%; }
  .m-cat__title { font-size: 34px; }
  .m-cat__note { font-size: 13.5px; max-width: 42ch; }
  .m-list { padding: 6px 40px 0; }
  .m-subs { padding: 30px 40px 0; }
  .m-sub { min-height: 64px; }
  .m-sub__title { font-size: 15px; }
  .m-sub__note { font-size: 12.5px; }
  .m-item__name { font-size: 17.5px; }
  .m-item__price { font-size: 15.5px; }
  .m-item__desc { font-size: 13px; }
  .m-sheet__panel { width: min(600px, 100%); }
}

/* ═══ DESKTOP (≥ 1024px) ══════════════════════════════════════ */
@media (min-width: 1024px) {
  html { scrollbar-gutter: stable; }

  /* Copertina: brand a sinistra, indice a destra, dentro la cornice */
  .m-cover__frame { left: 40px; right: 40px; top: 40px; bottom: 40px; border-radius: 28px; }
  .m-cover__inner { padding: 0; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: 1fr auto; }
  .m-cover__brand {
    grid-column: 1; grid-row: 1; padding: 0 8vw; align-items: flex-start; justify-content: center; text-align: left; gap: 22px;
    border-right: 1px solid var(--m-line); margin: 80px 0 24px;
  }
  .m-cover__name { font-size: clamp(36px, 3.6vw, 52px); letter-spacing: .34em; text-indent: 0; }
  .m-cover__tagline { font-size: 11px; text-indent: 0; }
  .m-cover__lead { display: block; margin-top: 28px; font-family: var(--display); font-weight: 500; font-size: 15px; color: var(--m-dim); letter-spacing: -.01em; }
  .m-cover__lead::before { content: ''; display: block; width: 28px; height: 1px; background: var(--m-line2); margin-bottom: 26px; }
  .m-cover__index { grid-column: 2; grid-row: 1; align-items: stretch; justify-content: center; gap: 0; padding: 80px 8vw 24px 6vw; }
  .m-cover__cat {
    display: grid; grid-template-columns: 34px 1fr auto; grid-template-rows: auto auto; column-gap: 18px; row-gap: 3px; align-items: baseline;
    padding: clamp(12px, 1.6vh, 20px) 8px; min-height: 0; text-align: left; border-top: 1px solid var(--m-line);
    transition: padding .3s var(--ease-out);
  }
  .m-cover__cat:last-child { border-bottom: 1px solid var(--m-line); }
  .m-cover__cat:hover { padding-left: 16px; }
  .m-cover__num { grid-row: 1 / span 2; font-size: 10px; align-self: start; padding-top: 9px; text-indent: 0; }
  .m-cover__title { font-family: var(--display); font-size: clamp(19px, 2.4vh, 23px); letter-spacing: -.01em; text-indent: 0; text-transform: none; line-height: 1.15; }
  .m-cover__cat--lead .m-cover__title { font-size: clamp(19px, 2.4vh, 23px); }
  .m-cover__note { display: block; grid-column: 2; grid-row: 2; font-size: 12px; line-height: 1.55; color: var(--m-mute); max-width: 48ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-cover__arrow { display: block; grid-column: 3; grid-row: 1; font-size: 16px; color: var(--m-accent); opacity: 0; transform: translateX(-8px); transition: opacity .25s var(--ease), transform .3s var(--ease-out); }
  .m-cover__cat:hover .m-cover__arrow { opacity: 1; transform: none; }
  .m-cover__foot { grid-column: 1 / -1; grid-row: 2; flex-direction: row; justify-content: center; gap: 28px; padding-bottom: 64px; }

  /* Carta: indice laterale fisso + colonna di lettura */
  .m-menu { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
  .m-side {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100svh;
    padding: 44px 36px 36px 44px; border-right: 1px solid var(--m-line);
  }
  .m-side__brand { display: flex; flex-direction: column; gap: 12px; }
  .m-side__name { font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: .3em; color: var(--m-text); line-height: 1; }
  .m-side__tagline { font-size: 8.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--m-mute); }
  .m-side__nav { display: flex; flex-direction: column; margin-top: 56px; flex: 1; overflow-y: auto; scrollbar-width: none; }
  .m-side__cat {
    position: relative; display: flex; align-items: baseline; gap: 16px; padding: 11px 0 11px 14px;
    color: var(--m-mute); transition: color .2s var(--ease), padding-left .3s var(--ease-out);
  }
  .m-side__cat::before { content: ''; position: absolute; left: 0; top: 50%; width: 0; height: 1px; background: var(--m-accent); transform: translateY(-50%); transition: width .3s var(--spring); }
  .m-side__num { font-family: var(--display); font-size: 9px; letter-spacing: .22em; color: var(--m-accent); width: 24px; flex: none; }
  .m-side__label { font-family: var(--display); font-weight: 500; font-size: 15px; letter-spacing: -.01em; }
  .m-side__cat:hover { color: var(--m-dim); }
  .m-side__cat[aria-current="true"] { color: var(--m-text); padding-left: 22px; }
  .m-side__cat[aria-current="true"]::before { width: 12px; }
  .m-side__subs { display: flex; flex-direction: column; padding: 0 0 8px 54px; animation: riseIn .3s var(--ease-out) both; }
  .m-side__sub { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; color: var(--m-mute); transition: color .2s var(--ease); }
  .m-side__sub .m-side__num { width: 30px; font-size: 8.5px; letter-spacing: .14em; }
  .m-side__sublabel { font-family: var(--display); font-weight: 500; font-size: 13px; letter-spacing: -.005em; line-height: 1.3; }
  .m-side__sub:hover { color: var(--m-dim); }
  .m-side__sub[aria-current="true"] { color: var(--m-text); }
  .m-side__foot { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding-top: 24px; border-top: 1px solid var(--m-line); }
  .m-side__foot .m-theme { padding: 0 0 8px; height: 36px; }
  .m-side__link { font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--m-mute); padding: 6px 0; transition: color .2s; }
  .m-side__link:hover { color: var(--m-accent); }

  .m-main { max-width: none; margin: 0; }
  .m-top { position: static; max-width: none; background: none; box-shadow: none !important; }
  .m-bar, .m-tabs { display: none; }

  .m-cat { width: min(760px, 100%); margin: 0 auto; padding: 0 48px; }
  .m-cat__head { padding: 92px 0 10px; }
  .m-cat__title { font-size: 44px; }
  .m-cat__note { font-size: 14px; max-width: 48ch; margin-top: 16px; }
  .m-cat--sub .m-cat__head { padding-top: 64px; }
  .m-cat__up {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; margin-bottom: 18px;
    font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--m-mute); transition: color .2s var(--ease);
  }
  .m-cat__up .m-arrow { font-size: 12px; transition: transform .25s var(--ease-out); }
  .m-cat__up:hover { color: var(--m-accent); }
  .m-cat__up:hover .m-arrow { transform: translateX(-3px); }
  /* Sottocategorie a righe, come l'indice desktop della copertina */
  .m-subs { align-items: stretch; padding: 34px 0 0; }
  .m-sub {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; grid-template-rows: auto auto; column-gap: 18px; row-gap: 4px;
    justify-content: normal; align-items: baseline; min-height: 0; padding: 20px 8px; text-align: left;
    border-bottom: 1px solid var(--m-line); transition: padding .3s var(--ease-out);
  }
  .m-sub:first-child { border-top: 1px solid var(--m-line); }
  .m-sub:hover { padding-left: 16px; }
  .m-sub__num { grid-column: 1; grid-row: 1; font-size: 10px; letter-spacing: .16em; text-indent: 0; line-height: inherit; }
  .m-sub__title {
    grid-column: 2; grid-row: 1; font-family: var(--display); font-size: 22px; letter-spacing: -.01em; text-indent: 0;
    text-transform: none; line-height: 1.25; text-wrap: wrap;
  }
  .m-sub__count { display: block; grid-column: 3; grid-row: 1; font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--m-mute); white-space: nowrap; }
  .m-sub__arrow { display: block; grid-column: 4; grid-row: 1; transition: transform .25s var(--ease-out); }
  .m-sub:hover .m-sub__arrow { transform: translateX(4px); }
  .m-sub__note {
    grid-column: 2 / -1; grid-row: 2; display: block; max-width: none; font-size: 13px;
    -webkit-line-clamp: none; line-clamp: none; white-space: nowrap; text-overflow: ellipsis;
  }
  .m-filters { padding-top: 22px; }
  .m-list { padding: 12px 0 0; }
  .m-group__head { padding-top: 34px; }
  .m-item { padding: 22px 0; }
  .m-item__name { font-size: 19px; max-width: 68%; }
  .m-item__price { font-size: 16.5px; }
  .m-item__desc { font-size: 13.5px; max-width: 52ch; }
  .m-cat__foot { padding: 56px 0 48px; }
  .m-site-foot { padding-bottom: 36px; }

  /* Scheda come finestra centrata */
  .m-sheet { align-items: center; padding: 40px; }
  .m-sheet__panel {
    width: min(600px, 100%); max-height: min(86vh, 900px); border-radius: 24px;
    box-shadow: 0 40px 90px -30px rgba(0,0,0,.5), 0 0 0 1px var(--m-line);
    transform: translateY(18px) scale(.985); opacity: 0;
    transition: transform .34s var(--spring), opacity .26s var(--ease);
    touch-action: auto;
  }
  .m-sheet.is-open .m-sheet__panel { transform: none; opacity: 1; }
  .m-sheet__backdrop { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .m-sheet__grip { display: none; }
  .m-sheet__bar { padding: 18px 16px 0 30px; }
  .m-sheet__body { --sheet-pad: 44px; padding: 14px var(--sheet-pad) 40px; }
  .m-sheet__name { font-size: 30px; }
  .m-sheet__long { font-size: 15px; max-width: 42ch; }
}

@media (min-width: 1400px) {
  .m-menu { grid-template-columns: 340px minmax(0, 1fr); }
  .m-side { padding-left: 56px; }
  .m-cat { width: min(820px, 100%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
