/* ==========================================================================
   /menu — menù interattivo "da ordinare" (si appoggia a style.css per i colori,
   i caratteri, .paper, .polaroid, .pin, .btn, .chip, .status, .hours)
   ========================================================================== */
.menu-app { --col: 780px; --z-tabs: 100; --z-fab: 150; --z-sheet: 200; --z-toast: 210; }
.menu-app .skip-link { z-index: 300; }
.m-hero, .m-tools, .m-alg-panel, .m-tabs__scroll, .m-main, .m-foot { max-width: var(--col); margin-left: auto; margin-right: auto; }

/* ---------- testa: il cartello appeso ---------- */
.m-hero { position: relative; text-align: center; padding: 22px 16px 26px; }
.m-top {
  position: absolute; top: 16px; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px; background: var(--paper); color: var(--ink); border: 0;
  font-size: 13px; font-weight: 700; box-shadow: var(--sh-sm);
  transition: transform .16s var(--ease-out), background-color .2s ease;
}
.m-top--l { left: 16px; }
.m-top--r { right: 16px; width: 40px; padding: 0; justify-content: center; }
.m-top .icon { width: 18px; height: 18px; }
.m-top .flip { transform: scaleX(-1); }
.m-top:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .m-top:hover { background: #fff; color: var(--ink); } }
.m-sign { position: relative; display: inline-block; margin-top: 10px; transform: rotate(-2deg); transform-origin: 50% 10%; }
.m-sign img { height: 112px; width: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .5)); }
.m-nail { position: absolute; top: 9%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #6b6b6b, #141414 70%); box-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.m-nail--l { left: 11%; }
.m-nail--r { left: 89%; }
.m-title { margin-top: 16px; font-family: var(--f-display); font-size: clamp(42px, 10vw, 60px); line-height: 1; color: var(--cream); letter-spacing: -.01em; }
.m-tag { font-size: 26px; color: var(--gold); margin-top: 4px; }
.m-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; letter-spacing: .06em; color: var(--cream); }
.m-status[data-open="1"] { --dot: var(--open-on-dark); }
.m-status[data-open="0"] { --dot: var(--closed-on-dark); }
.m-table { display: table; margin: 14px auto 0; background: var(--paper); color: var(--ink); padding: 6px 16px; font-family: var(--f-hand); font-size: 24px; font-weight: 700; line-height: 1.1; transform: rotate(-1.5deg); box-shadow: var(--sh-sm); }

/* ---------- cerca e allergeni ---------- */
.m-tools { display: flex; gap: 10px; padding: 0 16px; }
.m-search { flex: 1; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 12px 0 14px; background: var(--paper); color: var(--ink); box-shadow: var(--sh-sm); }
.m-search .icon { color: var(--bordeaux); width: 20px; height: 20px; }
.m-search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; color: var(--ink); outline: 0; }
.m-search input::placeholder { color: #8a7358; opacity: 1; }
.m-search input::-webkit-search-cancel-button { display: none; }
.m-search:focus-within { box-shadow: var(--sh-sm), 0 0 0 2px var(--bordeaux); }
.m-search__x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--paper-3); color: var(--ink); display: grid; place-items: center; }
.m-search__x .icon { width: 16px; height: 16px; }
.m-alg-btn { position: relative; width: 48px; height: 48px; border: 0; background: var(--paper); color: var(--ink); box-shadow: var(--sh-sm); display: grid; place-items: center; transition: transform .16s var(--ease-out), background-color .2s ease; }
.m-alg-btn .icon { width: 22px; height: 22px; }
.m-alg-btn:active { transform: scale(.95); }
.m-alg-btn[aria-expanded="true"] { background: var(--ink); color: var(--paper-2); }
.m-alg-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--bordeaux); color: var(--cream); font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.m-alg-panel { margin: 12px 16px 0; padding: 18px 16px 16px; }
.m-alg-panel__t { font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.m-alg-chips { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.m-alg-chips .chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.m-alg-chips .chip i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: rgba(36, 22, 13, .08); font-variant-numeric: tabular-nums; }
.m-alg-chips .chip[aria-pressed="true"] i { background: rgba(255, 244, 228, .18); }

/* ---------- linguette fisse ---------- */
.m-tabs { position: sticky; top: 0; z-index: var(--z-tabs); margin-top: 16px; padding: 10px 0; background: var(--walnut) url(../img/wood-dark.webp) center / 1400px auto; box-shadow: 0 8px 20px rgba(20, 10, 5, .45); }
.m-tabs__scroll { display: flex; gap: 8px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.m-tabs__scroll::-webkit-scrollbar { display: none; }
.m-tab {
  flex: 0 0 auto; min-height: 40px; padding: 0 15px; border: 1px solid rgba(245, 238, 226, .3); background: rgba(245, 238, 226, .08); color: var(--cream-2);
  font-size: 13px; font-weight: 700; letter-spacing: .03em; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, transform .16s var(--ease-out);
}
.m-tab:active { transform: scale(.96); }
.m-tab[aria-pressed="true"] { background: var(--paper-2); color: var(--ink); border-color: var(--paper-2); }
@media (hover: hover) and (pointer: fine) { .m-tab[aria-pressed="false"]:hover { background: rgba(245, 238, 226, .18); } }
.m-tabs :focus-visible { outline-color: var(--gold); }

/* ---------- fogli di categoria ---------- */
.m-main { padding: 26px 12px 30px; }
.m-cat { margin: 0 4px 30px; padding: 26px 14px 14px; transform: rotate(var(--r, 0deg)); }
.m-cat[hidden] { display: none; }
.m-cat__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 0 8px 12px; }
.m-cat__head h2 { font-size: 30px; line-height: 1; }
.m-cat__head .hand { font-size: 22px; margin-top: 4px; }
.m-count { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--bordeaux); background: var(--paper-3); padding: 5px 9px; margin-bottom: 4px; white-space: nowrap; }
.m-scroll { display: flex; gap: 12px; margin: 0 -14px; padding: 8px 22px 14px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-left: 22px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.m-scroll::-webkit-scrollbar { display: none; }
.m-main.grid .m-scroll { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(156px, 100%), 1fr)); overflow: visible; margin: 0; padding: 6px 2px 6px; gap: 14px; }

/* ---------- la scheda: una polaroid ---------- */
.m-card {
  flex: 0 0 200px; scroll-snap-align: start; position: relative; display: flex; flex-direction: column;
  background: #fff; padding: 8px 8px 10px; box-shadow: 0 10px 24px rgba(70, 40, 15, .32);
  transform: rotate(var(--r, -.4deg)); transition: transform .3s var(--ease-out), opacity .2s ease, filter .2s ease;
}
.m-card:nth-child(even) { --r: .5deg; }
.m-card[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .m-card:hover { transform: rotate(0deg) translateY(-3px); } .m-card:hover .m-card__open img { transform: scale(1.04); } }
.m-card__open { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: var(--sand); overflow: hidden; cursor: pointer; }
.m-card__open img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out); }
.m-card__nophoto { position: absolute; inset: 0; display: grid; place-content: center; gap: 2px; padding: 12px; text-align: center; background: var(--paper-3) url(../img/wood-light.webp) center / 700px auto; background-blend-mode: soft-light; }
.m-card__nophoto b { font-family: var(--f-hand); font-weight: 700; font-size: 24px; line-height: 1.05; color: var(--ink); }
.m-card__nophoto i { font-family: var(--f-hand); font-style: normal; font-size: 16px; color: var(--text-3); }
.m-card__tags { position: absolute; left: 6px; top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.m-card__tags i { font-style: normal; background: var(--paper); color: var(--bordeaux); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 6px; box-shadow: 0 2px 6px rgba(40, 20, 5, .25); }
.m-card__body { flex: 1; padding: 10px 4px 0; }
.m-card__body h3 { font-size: 17px; line-height: 1.15; }
.m-card__body p { margin-top: 4px; font-size: 12.5px; line-height: 1.45; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.m-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 2px 0; min-height: 46px; }
.m-card__alg { display: flex; flex-wrap: wrap; gap: 3px; }
.m-card__alg i { width: 19px; height: 19px; border-radius: 50%; border: 1px solid var(--rule); font-style: normal; font-size: 11px; font-weight: 700; color: var(--text-3); display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.m-price { font-family: var(--f-hand); font-weight: 700; font-size: 22px; line-height: 1; color: var(--bordeaux); }
.m-add { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--bordeaux); color: var(--cream); display: grid; place-items: center; box-shadow: 0 6px 14px rgba(125, 31, 31, .4); transition: transform .16s var(--ease-out), background-color .2s ease; }
.m-add .icon { width: 20px; height: 20px; stroke-width: 2.4; }
.m-add:active { transform: scale(.88); }
@media (hover: hover) and (pointer: fine) { .m-add:hover { background: var(--bordeaux-deep); } }
.m-add.pop { animation: m-pop .4s var(--ease-out); }
@keyframes m-pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.m-step { display: flex; align-items: center; height: 36px; border: 1px solid var(--ink); background: #fff; }
.m-step button { width: 34px; height: 34px; border: 0; background: transparent; color: var(--ink); display: grid; place-items: center; transition: background-color .15s ease; }
.m-step button:active { background: rgba(36, 22, 13, .1); }
.m-step .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.m-step output { min-width: 22px; text-align: center; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.m-go { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--bordeaux); min-height: 38px; }
.m-go .icon { transition: transform .2s var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .m-go:hover .icon { transform: translateX(3px); } }
/* piatto con un allergene segnato: resta leggibile ma in secondo piano */
.m-card.is-alg { opacity: .6; filter: grayscale(.7); }
.m-card.is-alg .m-card__body::before { content: attr(data-why); display: block; font-size: 11px; font-weight: 700; color: var(--bordeaux); margin-bottom: 4px; }

.m-empty { margin: 4px 8px 26px; padding: 30px 20px 22px; text-align: center; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.m-note { max-width: 560px; margin: 6px auto 0; padding: 0 12px; text-align: center; font-size: 13px; line-height: 1.6; color: var(--on-dark); }
.m-note b { color: var(--cream); }

/* ---------- piede ---------- */
.m-foot { text-align: center; padding: 40px 16px 120px; color: var(--on-dark); font-size: 14px; }
.m-foot img { height: 56px; width: auto; margin: 0 auto; opacity: .9; }
.m-foot address { font-style: normal; margin-top: 16px; }
.m-foot p a { display: inline-block; margin: 8px 8px 0; color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.m-foot nav { margin-top: 18px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; }
.m-foot nav a { color: var(--cream-2); text-decoration: underline; text-decoration-color: rgba(242, 234, 220, .35); }
.m-foot nav .credit { opacity: .7; }
@media (hover: hover) and (pointer: fine) { .m-foot a:hover { color: var(--cream); } }

/* ---------- bottone dell'ordine ---------- */
.m-fab {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: var(--z-fab);
  display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px 0 18px; border: 0;
  background: var(--bordeaux); color: var(--cream); font-size: 15px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 244, 228, .12) inset;
  transform: translate(-50%, 0); transition: transform .35s var(--ease-out), opacity .2s ease, background-color .2s ease;
}
.m-fab .icon { width: 22px; height: 22px; }
.m-fab:active { transform: translate(-50%, 0) scale(.96); }
@media (hover: hover) and (pointer: fine) { .m-fab:hover { background: var(--bordeaux-deep); } }
.m-fab[hidden] { display: flex !important; transform: translate(-50%, 140%); opacity: 0; pointer-events: none; visibility: hidden; transition: transform .25s ease-in, opacity .2s ease, visibility 0s linear .25s; }
.m-fab__n { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--cream); color: var(--bordeaux); font-size: 13px; font-weight: 800; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.m-fab__n.bump { animation: m-bump .45s var(--ease-out); }
@keyframes m-bump { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------- fogli che salgono dal basso ---------- */
.m-sheet { position: fixed; inset: 0; z-index: var(--z-sheet); visibility: hidden; pointer-events: none; }
.m-sheet.is-open { visibility: visible; pointer-events: auto; }
.m-sheet__back { position: absolute; inset: 0; background: rgba(20, 10, 5, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s ease; }
.m-sheet.is-open .m-sheet__back { opacity: 1; }
.m-sheet__card {
  position: absolute; left: 50%; bottom: 0; width: min(580px, 100%); max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 28px 20px calc(22px + env(safe-area-inset-bottom)); background: var(--paper); box-shadow: 0 -20px 60px rgba(0, 0, 0, .5);
  transform: translate(-50%, 104%); transition: transform .4s cubic-bezier(.32, .72, 0, 1); will-change: transform;
}
.m-sheet.is-open .m-sheet__card { transform: translate(-50%, 0); }
.m-sheet.is-dragging .m-sheet__card { transition: none; }
.m-sheet__card .pin { top: 6px; }
.m-sheet__grip { width: 44px; height: 4px; margin: 0 auto 16px; border-radius: 2px; background: var(--rule); }
.m-sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.m-sheet__head h2 { font-size: 30px; line-height: 1; }
.m-sheet__head .hand { font-size: 21px; margin-top: 4px; }
.m-sheet__x { flex-shrink: 0; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--paper-3); color: var(--ink); display: grid; place-items: center; transition: background-color .2s ease, transform .16s var(--ease-out); }
.m-sheet__x:active { transform: scale(.92); }
@media (hover: hover) and (pointer: fine) { .m-sheet__x:hover { background: var(--sand); } }
.m-sheet__actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.m-sheet__actions .btn { flex: 1; justify-content: center; font-size: 15px; padding: 15px 16px; }
.m-sheet__actions .btn.is-off { opacity: .45; }

/* il foglietto dell'ordine */
.m-cart { margin-top: 18px; }
.m-cart__row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--rule); }
.m-cart__name { flex: 1; font-family: var(--f-display); font-size: 18px; line-height: 1.2; }
.m-cart__empty { padding: 18px 0 6px; text-align: center; font-size: 14.5px; color: var(--text-2); }
.m-cart__empty b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bordeaux); color: var(--cream); font-size: 15px; vertical-align: middle; }
.m-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.m-mode label { position: relative; }
.m-mode input[type="radio"] { position: absolute; inset: 0; opacity: 0; margin: 0; }
.m-mode span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--ink); font-size: 13.5px; font-weight: 700; color: var(--ink); transition: background-color .2s ease, color .2s ease; }
.m-mode input:checked + span { background: var(--ink); color: var(--paper-2); }
.m-mode input:focus-visible + span { outline: 2px solid var(--bordeaux); outline-offset: 3px; }
.m-mode__n { width: 112px; height: 40px; padding: 0 12px; border: 1px solid var(--border); background: #fff; font-size: 15px; color: var(--ink); }
.m-mode__n:focus { outline: 2px solid var(--bordeaux); outline-offset: 1px; }
.m-notes { display: block; margin-top: 14px; }
.m-notes span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--text); }
.m-notes textarea { display: block; width: 100%; min-height: 62px; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--border); background: #fff; font-size: 15px; line-height: 1.45; color: var(--ink); resize: vertical; }
.m-notes textarea::placeholder { color: #8a7358; opacity: 1; }
.m-notes textarea:focus { outline: 2px solid var(--bordeaux); outline-offset: 1px; }
.m-cart__hint { margin-top: 12px; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.m-clear { border: 0; background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 600; padding: 10px 8px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }

/* il piatto in grande */
.m-dish .m-sheet__x { position: absolute; top: 14px; right: 14px; z-index: 2; }
.m-dish__ph { margin: 6px 0 18px; padding: 10px 10px 40px; --r: -1deg; transform: rotate(var(--r)); }
.m-dish__ph img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sand); }
.m-dish__ph figcaption { position: absolute; left: 16px; bottom: 6px; font-size: 24px; color: var(--text-2); }
.m-dish__ph[hidden] { display: none; }
.m-dish h2 { font-size: 32px; line-height: 1.05; padding-right: 44px; }
.m-dish__desc { margin-top: 10px; font-size: 16px; line-height: 1.6; color: var(--text-2); }
.m-dish__tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.m-dish__tags i { font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--bordeaux); border: 1px solid var(--bordeaux); padding: 4px 8px; }
.m-dish__alg { margin-top: 12px; font-size: 13.5px; line-height: 1.5; color: var(--text-3); }
.m-dish__alg[hidden], .m-dish__tags[hidden] { display: none; }

/* informazioni */
.m-info .status { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; font-weight: 700; }
.m-info .hours { margin-top: 10px; }
.m-info address { font-style: normal; margin-top: 18px; font-size: 15px; line-height: 1.6; }
.m-info__note { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.m-info__btns { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.m-info__btns .btn { justify-content: center; gap: 8px; font-size: 15px; padding: 14px 16px; }

/* avviso breve */
.m-toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: var(--z-toast);
  max-width: calc(100% - 32px); padding: 10px 16px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45); opacity: 0; transform: translate(-50%, 14px); pointer-events: none;
  transition: opacity .2s ease, transform .25s var(--ease-out);
}
.m-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- schermi grandi ---------- */
@media (min-width: 900px) {
  .menu-app { --col: 880px; }
  .m-hero { padding-top: 34px; }
  .m-sign img { height: 136px; }
  .m-title { font-size: 68px; }
  .m-card { flex-basis: 212px; }
  .m-main.grid .m-scroll { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .m-cat { padding: 30px 22px 18px; }
  .m-scroll { margin: 0 -22px; padding-left: 30px; padding-right: 30px; scroll-padding-left: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .m-sheet__card, .m-fab, .m-toast, .m-card, .m-card__open img { transition: none; }
  .m-add.pop, .m-fab__n.bump { animation: none; }
}
