/* Sforna, app cliente. Palette e forme riprese dai mockup del locale. */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/fraunces-latin-standard-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/fraunces-latin-ext-standard-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap; src: url('/fonts/figtree-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap; src: url('/fonts/figtree-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f9f5ec;
  --panel: #fdfaf5;
  --tile: #f4ede2;
  --tile-hover: #efe6d8;
  --tile-sel: #e7e5cf;
  --line: #e6dfd2;
  --line-2: #d8cfbf;
  --ink: #20241a;
  --ink-2: #5d5f50;
  --ink-3: #8a8b7c;
  --sage: #767c58;
  --sage-hover: #676d49;
  --olive: #4b512d;
  --sage-soft: #e3e5cf;
  --accent: #df6c34;
  --red: #b3261e;
  --ok: #3f7a3a;
  --shadow-1: 0 1px 2px rgba(64, 52, 30, .06), 0 6px 20px rgba(64, 52, 30, .07);
  --shadow-2: 0 2px 4px rgba(64, 52, 30, .08), 0 18px 40px rgba(64, 52, 30, .14);
  --r-panel: 22px;
  --r-tile: 16px;
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --ui: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gutter: 16px;
  --header-h: 64px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; border-radius: 10px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--display); font-weight: 720; letter-spacing: -0.015em; line-height: 1.08; margin: 0; color: var(--ink); }
h1 { font-size: clamp(30px, 6.4vw, 54px); }
h2 { font-size: clamp(22px, 3.4vw, 30px); }
h3 { font-size: 19px; }
p { margin: 0; }

/* ------------------------------------------------------------ pulsanti */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 0;
  font-weight: 650; font-size: 17px; letter-spacing: .005em; text-decoration: none;
  transition: background-color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--sage); color: #fff; box-shadow: 0 6px 18px rgba(85, 92, 52, .28); }
.btn-primary:hover { background: var(--sage-hover); }
.btn-primary:disabled { background: #b9bba6; box-shadow: none; cursor: not-allowed; }
.btn-big { min-height: 64px; font-size: 20px; padding: 0 30px; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line-2); }
.btn-ghost:hover { background: var(--tile); }
.btn-soft { background: var(--tile); color: var(--ink); }
.btn-soft:hover { background: var(--tile-hover); }
.btn-block { width: 100%; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #962019; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn .ico { width: 22px; height: 22px; flex: none; }
.btn-price { margin-left: auto; font-variant-numeric: tabular-nums; opacity: .92; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 999px; border: 0; background: transparent; color: var(--ink);
  display: inline-grid; place-items: center; position: relative;
}
.icon-btn:hover { background: var(--tile); }
.icon-btn svg { width: 26px; height: 26px; }
.badge {
  position: absolute; top: 2px; right: 0; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font: 700 13px/22px var(--ui); text-align: center; border: 2px solid var(--bg);
}
.badge.pop { animation: pop .35s ease-out; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }

.x-btn {
  width: 36px; height: 36px; border-radius: 999px; border: 1.5px solid var(--line-2); background: #fff;
  display: inline-grid; place-items: center; flex: none; color: var(--ink);
}
.x-btn:hover { border-color: var(--ink-3); }
.x-btn svg { width: 16px; height: 16px; }

.pill {
  height: 42px; padding: 0 20px; border-radius: 999px; border: 0; background: #f0eadf; color: var(--ink);
  font-weight: 550; font-size: 16px; white-space: nowrap; flex: none;
}
.pill[aria-pressed="true"], .pill[aria-selected="true"] { background: var(--olive); color: #fff; }

/* ------------------------------------------------------------ intestazione */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; height: var(--header-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 0 calc(var(--gutter) - 4px); background: rgba(249, 245, 236, .94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.topbar-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.logo { width: 48px; height: 48px; border-radius: 12px; display: block; }
.logo-link { display: block; border-radius: 12px; }
.lang-btn { height: 36px; min-width: 44px; padding: 0 10px; border-radius: 999px; border: 1.5px solid var(--line-2); background: transparent; font-weight: 650; font-size: 14px; }
.table-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--sage-soft); color: var(--olive); font-weight: 650; font-size: 14px; white-space: nowrap; }

.banner { margin: 8px var(--gutter) 0; padding: 12px 16px; border-radius: 14px; background: #fbe8d8; color: #6b3414; font-weight: 550; }
.banner.info { background: var(--sage-soft); color: var(--olive); }

/* ------------------------------------------------------------ menu (home) */
.home { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) 120px; }
.hero { display: grid; gap: 8px; align-items: center; padding: 8px 0 12px; }
.hero-copy { display: grid; gap: 14px; justify-items: start; }
.hero-copy h1 { font-size: clamp(38px, 9vw, 72px); }
.hero-copy .lead { font-size: 18px; color: var(--ink-2); max-width: 32ch; }
.hero-copy .tag { font-size: 20px; color: var(--ink-2); }
.hero-stage { position: relative; aspect-ratio: 1000 / 820; width: 100%; max-width: 640px; justify-self: center; }
.hero-stage canvas { width: 100%; height: 100%; display: block; }

.sec { margin-top: 40px; }
.sec-head { display: grid; gap: 6px; margin-bottom: 16px; }
.sec-head p { color: var(--ink-2); }
.cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
.card {
  display: grid; grid-template-columns: 1fr 132px; gap: 14px; align-items: center;
  background: var(--panel); border-radius: 20px; padding: 14px 14px 14px 18px; box-shadow: var(--shadow-1); position: relative;
}
.card h3 { font-size: 20px; }
.card .desc { color: var(--ink-2); font-size: 15px; margin-top: 4px; }
.card .price { font-weight: 700; margin-top: 8px; font-variant-numeric: tabular-nums; }
.card .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.card .thumb { width: 132px; aspect-ratio: 1 / 0.82; border-radius: 16px; background: var(--tile); display: grid; place-items: center; overflow: hidden; }
.card .thumb img { width: 112%; max-width: none; height: auto; }
.card .thumb.empty { background: var(--tile); }
.card .thumb.empty svg { width: 46px; height: 46px; color: #c8bba5; }
.mini-btn { height: 40px; padding: 0 16px; border-radius: 999px; border: 0; font-weight: 650; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.mini-btn.primary { background: var(--sage); color: #fff; }
.mini-btn.primary:hover { background: var(--sage-hover); }
.mini-btn.ghost { background: transparent; border: 1.5px solid var(--line-2); }
.mini-btn svg { width: 18px; height: 18px; }
.card.soldout { opacity: .55; }
.soldout-tag { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--red); }

.rows { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px; background: var(--panel); border-radius: 16px; box-shadow: var(--shadow-1); }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 600; }
.row .sub { color: var(--ink-2); font-size: 14px; }
.row .price { font-weight: 700; font-variant-numeric: tabular-nums; }
.add-round { width: 44px; height: 44px; border-radius: 999px; border: 1.5px solid #ead9c9; background: #fff; color: var(--accent); display: grid; place-items: center; flex: none; }
.add-round:hover { background: #fff5ee; }
.add-round svg { width: 22px; height: 22px; }

.foot { margin-top: 48px; display: grid; gap: 10px; color: var(--ink-2); font-size: 15px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--olive); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

/* ------------------------------------------------------------ compositore */
.composer {
  max-width: 1500px; margin: 0 auto; padding: 0 var(--gutter) 150px;
  display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'head' 'stage' 'ingr' 'sel';
}
.composer > * { min-width: 0; }
.c-head { grid-area: head; display: grid; justify-items: center; text-align: center; gap: 6px; padding-top: 4px; }
.c-head h1 { font-size: clamp(28px, 7.6vw, 46px); }
.c-head .tag { font-size: 19px; color: var(--ink-2); }

.stepper { display: flex; align-items: center; gap: 8px; margin-top: 10px; list-style: none; padding: 0; max-width: 100%; }
.stepper li { display: flex; align-items: center; gap: 7px; font-size: 15px; color: var(--ink-3); white-space: nowrap; }
.stepper li + li::before { content: ''; width: clamp(14px, 5vw, 70px); height: 1.5px; background: var(--line-2); margin-right: 1px; }
.stepper .dot { width: 24px; height: 24px; border-radius: 999px; border: 2px solid var(--ink-3); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.stepper li.done { color: var(--ink-2); }
.stepper li.done .dot { background: var(--sage); border-color: var(--sage); color: #fff; }
.stepper li.done .dot svg { width: 14px; height: 14px; }
.stepper li.now { color: var(--ink); font-weight: 650; }
.stepper li.now .dot { border-color: var(--accent); }
.stepper li.now .dot::after { content: ''; width: 10px; height: 10px; border-radius: 999px; background: var(--accent); }
.stepper li.next .dot { border-color: var(--accent); opacity: .7; }

.c-stage { grid-area: stage; position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); z-index: 5; background: var(--bg); margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 6px; }
.stage-box { position: relative; width: 100%; aspect-ratio: 1000 / 690; max-height: 44vh; margin: 0 auto; }
.stage-box canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; }
.price-pill { position: absolute; left: 8px; bottom: 10px; background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 750; font-variant-numeric: tabular-nums; box-shadow: var(--shadow-1); font-size: 17px; }
.price-pill.bump { animation: pop .3s ease-out; }
.stage-hint { display: flex; justify-content: center; align-items: center; gap: 8px; color: var(--ink-2); font-size: 15px; }
.stage-hint svg { width: 22px; height: 22px; }
.stage-actions { position: absolute; right: 6px; bottom: 8px; display: flex; gap: 6px; }
.chip-btn { height: 38px; padding: 0 14px; border-radius: 999px; border: 0; background: #fff; box-shadow: var(--shadow-1); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chip-btn svg { width: 18px; height: 18px; }

.c-ingr { grid-area: ingr; }
.c-ingr .ttl { font-size: 26px; margin-bottom: 12px; }
.cat-pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
.cat-pills::-webkit-scrollbar { display: none; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile {
  scroll-margin-top: calc(var(--header-h) + 48vh); scroll-margin-bottom: 110px;
  position: relative; display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; gap: 2px;
  aspect-ratio: 1 / 0.86; padding: 8px 6px 10px; border-radius: var(--r-tile); background: var(--tile); border: 1.5px solid transparent;
  text-align: center; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: background-color .15s, border-color .15s, transform .12s;
}
.tile:hover { background: var(--tile-hover); }
.tile img { width: 88%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(80, 52, 18, .22)); pointer-events: none; -webkit-user-drag: none; }
.tile .nm { font-size: 14px; line-height: 1.15; font-weight: 500; }
.tile .pr { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tile[aria-pressed="true"] { background: var(--tile-sel); border-color: #6f764e; }
.tile[aria-pressed="true"]::after {
  content: ''; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 999px; background: var(--sage)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.tile.lifting { transform: scale(.96); }
.tile:disabled, .tile.is-off { opacity: .45; }
.tile .off { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 750; color: var(--red); background: #fff; border-radius: 999px; padding: 2px 8px; }
.tiles-empty { color: var(--ink-2); padding: 16px 4px; }

.c-sel { grid-area: sel; }
.sel-title { font-size: 15px; color: var(--ink-2); font-weight: 500; font-family: var(--ui); letter-spacing: 0; margin: 4px 0 10px; }
.sel-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.sel-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 999px; background: #efe9dc; border: 0; }
.sel-chip img { width: 46px; height: 34px; object-fit: contain; }
.sel-chip .nm { font-weight: 550; font-size: 15px; }
.sel-chip .x2 { font-size: 12px; font-weight: 750; color: var(--olive); background: var(--sage-soft); border-radius: 999px; padding: 2px 7px; }
.sel-chip .x-btn { width: 30px; height: 30px; border: 0; background: transparent; }
.sel-empty { color: var(--ink-2); font-size: 15px; }
.sel-list { display: grid; gap: 10px; list-style: none; padding: 0; margin: 0; }
.sel-row { display: grid; grid-template-columns: 76px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 10px 8px 6px; border-radius: 16px; background: var(--tile); }
.sel-row img { width: 76px; height: 56px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(80, 52, 18, .2)); }
.sel-row .nm { font-size: 16px; font-weight: 500; line-height: 1.2; }
.sel-row .pr { font-size: 13px; color: var(--ink-2); }
.dbl-btn { height: 32px; padding: 0 10px; border-radius: 999px; border: 1.5px solid var(--line-2); background: #fff; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.dbl-btn[aria-pressed="true"] { background: var(--sage-soft); border-color: var(--sage); color: var(--olive); }
.sel-row.enter { animation: rowIn .35s ease-out; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.sel-actions { display: grid; gap: 10px; margin-top: 16px; }

.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, rgba(249, 245, 236, 0));
}
.cta-bar .btn { width: 100%; }

/* passi 1 e 3: niente colonna ingredienti */
.composer[data-step="1"] .c-ingr, .composer[data-step="3"] .c-ingr { display: none; }
.composer[data-step="1"] .stage-hint, .composer[data-step="3"] .stage-hint { display: none; }

/* passo 1: base */
.base-step { display: grid; gap: 18px; justify-items: center; text-align: center; }
.base-step .stage-box { aspect-ratio: 1000 / 820; max-height: none; max-width: 640px; }
.base-step .desc { color: var(--ink-2); max-width: 46ch; font-size: 17px; }
.base-step .price { font-weight: 750; font-size: 20px; }
.base-choices { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.sig-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; width: 100%; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.sig-mini { flex: none; width: 170px; scroll-snap-align: start; display: grid; gap: 6px; padding: 8px; border-radius: 18px; background: var(--panel); border: 0; box-shadow: var(--shadow-1); text-align: left; }
.sig-mini img { width: 100%; aspect-ratio: 1 / .8; object-fit: cover; border-radius: 12px; background: var(--tile); }
.sig-mini .nm { font-weight: 650; font-size: 15px; line-height: 1.2; }
.sig-mini .pr { font-size: 14px; color: var(--ink-2); }

/* passo 3: riepilogo */
.sum { display: grid; gap: 16px; }
.sum-name { display: grid; gap: 6px; }
.sum-name label { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.sum-name input { font-family: var(--display); font-weight: 700; font-size: 26px; border: 0; border-bottom: 2px dashed var(--line-2); background: transparent; padding: 4px 0; width: 100%; border-radius: 0; }
.sum-name input:focus { outline: none; border-bottom-color: var(--sage); }
.layers-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; counter-reset: lay; }
.layers-list li { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 14px; background: var(--tile); }
.layers-list img { width: 54px; height: 40px; object-fit: contain; }
.layers-list .grow { flex: 1; }
.layers-list .pr { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 15px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-chip { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--sage-soft); color: var(--olive); }
.tag-chip.hot { background: #fde3d6; color: #8a2f0e; }
.allergens { display: flex; gap: 6px; flex-wrap: wrap; }
.al { font-size: 13px; font-weight: 650; padding: 4px 10px; border-radius: 999px; border: 1.5px solid #e2b9a3; color: #7c3615; background: #fff7f2; }
.note { font-size: 14px; color: var(--ink-2); }
.breakdown { display: grid; gap: 4px; font-size: 15px; }
.breakdown div { display: flex; justify-content: space-between; gap: 10px; }
.breakdown .tot { font-weight: 800; font-size: 19px; border-top: 1.5px solid var(--line); padding-top: 8px; margin-top: 4px; }
.qty { display: inline-flex; align-items: center; gap: 4px; background: var(--tile); border-radius: 999px; padding: 4px; }
.qty button { width: 40px; height: 40px; border-radius: 999px; border: 0; background: #fff; display: grid; place-items: center; font-size: 22px; line-height: 1; }
.qty button svg { width: 18px; height: 18px; }
.qty output { min-width: 32px; text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ------------------------------------------------------------ trascinamento */
.drag-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.drag-ghost { position: absolute; left: 0; top: 0; width: 150px; will-change: transform; }
.drag-ghost img { width: 100%; filter: drop-shadow(0 14px 14px rgba(70, 44, 12, .35)); }
.drag-ghost::after {
  content: ''; position: absolute; left: 50%; top: 58%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 999px;
  background: rgba(255, 255, 255, .42); border: 1.5px solid rgba(255, 255, 255, .8); box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.drag-ghost.mouse::after { display: none; }
.drag-trail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.drag-trail path { fill: none; stroke: #59603a; stroke-width: 3; stroke-dasharray: 9 9; stroke-linecap: round; opacity: .8; }

/* ------------------------------------------------------------ fogli (carrello, conferma, info) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(32, 30, 22, .38); opacity: 0; transition: opacity .2s; }
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 71; left: 0; right: 0; bottom: 0; max-height: 92vh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-2); transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.sheet.open { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px var(--gutter) 8px; }
.sheet-head h2 { font-size: 26px; }
.sheet-body { overflow-y: auto; padding: 4px var(--gutter) 20px; overscroll-behavior: contain; }
.sheet-foot { padding: 12px var(--gutter) calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.grab { width: 44px; height: 5px; border-radius: 999px; background: var(--line-2); margin: 8px auto 0; }

.cart-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cart-item { display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 10px; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-1); }
.cart-item .thumb { width: 88px; height: 72px; border-radius: 12px; background: var(--tile); display: grid; place-items: center; overflow: hidden; }
.cart-item .thumb img { width: 116%; max-width: none; }
.cart-item .nm { font-weight: 650; line-height: 1.2; }
.cart-item .det { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.cart-item .ctrl { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.cart-item .price { font-weight: 750; font-variant-numeric: tabular-nums; }
.cart-item .links { display: flex; gap: 14px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 19px; font-weight: 800; margin-bottom: 10px; }
.upsell { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; }
.upsell .mini-btn { background: var(--panel); border: 1.5px solid var(--line); flex: none; }

.form { display: grid; gap: 16px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: grid; gap: 4px; text-align: left; padding: 14px; border-radius: 18px; border: 2px solid var(--line); background: var(--panel); min-height: 92px; }
.choice .t { font-weight: 750; font-size: 17px; }
.choice .s { font-size: 13px; color: var(--ink-2); }
.choice[aria-checked="true"] { border-color: var(--sage); background: #f1f1e2; }
.choice:disabled { opacity: .5; cursor: not-allowed; }
.slots { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; }
.slot { flex: none; height: 46px; min-width: 78px; padding: 0 12px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--panel); font-weight: 700; font-variant-numeric: tabular-nums; }
.slot[aria-checked="true"] { background: var(--olive); color: #fff; border-color: var(--olive); }
.slot:disabled { opacity: .4; text-decoration: line-through; }
.field { display: grid; gap: 6px; }
.field label, .field .lbl { font-weight: 650; font-size: 15px; }
.field input, .field textarea { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line-2); background: #fff; font-size: 17px; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(118, 124, 88, .2); }
.field .hint { font-size: 13px; color: var(--ink-2); }
.field .err { font-size: 14px; color: var(--red); font-weight: 600; }
.field.invalid input { border-color: var(--red); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--sage); flex: none; }
.pay-note { font-size: 14px; color: var(--ink-2); text-align: center; margin-top: 8px; }
.form-error { padding: 12px 14px; border-radius: 14px; background: #fbe1dd; color: #7a1d14; font-weight: 600; }

/* ------------------------------------------------------------ stato ordine */
.status { max-width: 640px; margin: 0 auto; padding: 8px var(--gutter) 80px; display: grid; gap: 18px; }
.ticket { background: var(--panel); border-radius: 26px; padding: 22px; box-shadow: var(--shadow-1); display: grid; gap: 14px; text-align: center; }
.ticket .num-label { color: var(--ink-2); font-weight: 600; }
.ticket .num { font-family: var(--display); font-weight: 800; font-size: 88px; line-height: 1; letter-spacing: -0.02em; }
.ticket .where { font-weight: 650; }
.progress { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.progress li { display: grid; gap: 6px; justify-items: center; align-content: start; text-align: center; line-height: 1.2; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.progress .bar { width: 100%; height: 8px; border-radius: 999px; background: var(--line); }
.progress li.done { color: var(--ink-2); }
.progress li.done .bar { background: var(--sage); }
.progress li.now { color: var(--ink); }
.progress li.now .bar { background: linear-gradient(90deg, var(--sage) 0 50%, var(--line) 50%); background-size: 200% 100%; animation: flow 1.6s linear infinite; }
@keyframes flow { from { background-position: 100% 0; } to { background-position: 0 0; } }
.status-msg { font-size: 20px; font-weight: 650; }
.status-msg.ready { color: var(--ok); }
.live { font-size: 13px; color: var(--ink-3); display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 999px; background: var(--ok); }
.live.off::before { background: var(--red); }
.status-items { display: grid; gap: 10px; }
.status-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.status-actions .btn { font-size: 15px; padding: 0 14px; line-height: 1.15; }

/* ------------------------------------------------------------ avvisi */
.toasts { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 16px; background: #2b2e22; color: #fff; font-weight: 550; box-shadow: var(--shadow-2); animation: toastIn .22s ease-out; }
.toast button { background: none; border: 0; color: #e8eccd; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; padding: 6px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

.loading { min-height: 60vh; display: grid; place-items: center; color: var(--ink-2); }
.prose { white-space: pre-line; color: var(--ink-2); font-size: 15px; }
.hours { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ tablet */
@media (min-width: 700px) {
  :root { --gutter: 24px; --header-h: 76px; }
  .logo { width: 56px; height: 56px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr 1.1fr; padding-top: 20px; }
  .composer {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
    grid-template-areas: 'head head' 'stage ingr' 'sel sel';
    align-items: start;
  }
  .c-head { justify-items: start; text-align: left; }
  .c-stage { margin: 0; padding: 0; border-radius: var(--r-panel); top: calc(var(--header-h) + 8px + env(safe-area-inset-top, 0px)); }
  .stage-box { max-height: none; aspect-ratio: 1000 / 860; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .c-ingr { background: var(--panel); border-radius: var(--r-panel); padding: 20px; box-shadow: var(--shadow-1); }
  .cat-pills { margin: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; overflow: visible; }
  .c-sel { position: sticky; bottom: 12px; z-index: 6; display: flex; align-items: center; gap: 16px; background: var(--panel); border-radius: var(--r-panel); padding: 14px 16px 14px 24px; box-shadow: var(--shadow-2); }
  .c-sel .sel-title { font-family: var(--display); font-weight: 720; font-size: 21px; color: var(--ink); margin: 0; white-space: nowrap; }
  .c-sel .sel-chips { flex: 1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .c-sel .sel-actions { margin: 0; display: flex; }
  .cta-bar { display: none; }
  .composer[data-step="1"], .composer[data-step="3"] {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
    grid-template-areas: 'head head' 'stage sel';
  }
  .composer[data-step="1"] .c-sel, .composer[data-step="3"] .c-sel {
    position: sticky; top: calc(var(--header-h) + 8px + env(safe-area-inset-top, 0px)); bottom: auto; display: block; padding: 24px;
  }
  .sheet { left: auto; right: 16px; bottom: 16px; top: 16px; width: 460px; max-height: none; border-radius: 26px; transform: translateX(110%); }
  .sheet.open { transform: none; }
  .grab { display: none; }
  .toasts { top: auto; bottom: 28px; }
}

/* ------------------------------------------------------------ desktop: tre colonne come nel mockup */
@media (min-width: 1100px) {
  .composer {
    grid-template-columns: minmax(360px, 430px) minmax(0, 1fr) minmax(320px, 370px);
    grid-template-areas: 'ingr stage sel';
    gap: 24px; padding-top: 10px;
  }
  .composer .c-head { display: none; }
  .c-stage { position: sticky; top: calc(var(--header-h) + 10px + env(safe-area-inset-top, 0px)); background: transparent; }
  .stage-box { aspect-ratio: 1000 / 930; }
  .c-ingr { position: sticky; top: calc(var(--header-h) + 10px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - var(--header-h) - 24px); overflow-y: auto; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .tile .nm { font-size: 17px; }
  .tile .pr { font-size: 13px; }
  .c-sel { position: sticky; top: calc(var(--header-h) + 10px + env(safe-area-inset-top, 0px)); display: block; padding: 24px; }
  .composer[data-step="1"], .composer[data-step="3"] {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
    grid-template-areas: 'stage sel';
  }
  .c-sel .sel-title { font-size: 30px; margin-bottom: 18px; }
  .c-sel .sel-actions { display: grid; margin-top: 18px; }
  .topbar.wide { grid-template-columns: auto 1fr auto; padding: 0 28px; height: 96px; }
  .topbar.wide .topbar-center { display: flex; justify-content: center; }
  :root { --header-h: 96px; }
  .logo { width: 72px; height: 72px; border-radius: 16px; }
  .topbar-title { display: flex; align-items: center; gap: 26px; }
  .topbar-title h1 { font-size: 46px; }
  .topbar-title .divider { width: 1.5px; height: 56px; background: var(--line-2); }
  .topbar .stepper { margin: 0; }
  .stepper .dot { width: 46px; height: 46px; font-size: 19px; font-weight: 500; border: 0; background: #f0eadf; color: var(--ink-2); }
  .stepper li.now .dot { background: var(--olive); color: #fff; border: 0; }
  .stepper li.now .dot::after { display: none; }
  .stepper li.next .dot { opacity: 1; }
  .stepper li.done .dot { background: var(--sage); }
  .stepper li { font-size: 19px; }
  .stepper li.now { font-family: var(--display); font-weight: 720; }
  .stepper li + li::before { width: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
