/* Mordi e Fuggi — sito ordini asporto
   Palette dal logo ufficiale (pagina Facebook): rosso pennarello su bianco,
   panino col sesamo come "o". */

:root {
  color-scheme: light;

  --brand: #e81204;        /* rosso del logo */
  --brand-deep: #b70d02;   /* hover / testo rosso piccolo */
  --brand-soft: #ffe7e3;
  --bun: #f0c068;          /* crosta del panino nel logo */
  --bun-soft: #fff3d9;
  --crust: #9a5f12;        /* testo su fondo crosta */
  --ink: #1c1412;
  --ink-2: #3a2e2a;
  --muted: #6b5d56;
  --paper: #fffcf6;
  --surface: #ffffff;
  --line: #eadfce;
  --line-strong: #d6c6b0;
  --ok: #1d6b3a;
  --ok-soft: #e3f4e7;

  --font-display: "Permanent Marker", "Marker Felt", cursive;
  --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", "Segoe UI", sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --tap: 44px;
  --wrap: 760px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 160px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.skip:focus {
  top: 12px;
}

/* ---------- Bottoni ---------- */

.btn-primary,
.btn-ghost,
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 140ms ease;
}

.btn-primary {
  border: 0;
  background: var(--brand);
  color: #fff;
}

@media (hover: hover) {
  .btn-primary:hover {
    background: var(--brand-deep);
  }
}

.btn-primary:active,
.btn-ghost:active,
.cta:active {
  transform: scale(0.97);
}

.btn-primary:disabled {
  background: #c9bdb6;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
}

.btn-block {
  width: 100%;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  min-height: min(88svh, 740px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 16px 44px;
  background: var(--surface);
  border-bottom: 3px solid var(--ink);
}

.hero > *:not(.sesame) {
  position: relative;
  z-index: 1;
}

.hero-top {
  position: absolute !important;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-place {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ok);
  white-space: nowrap;
}

.tag::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent);
}

.tag.warn {
  color: var(--crust);
}

.tag.off {
  color: var(--brand-deep);
}

.hero-logo {
  margin: 34px 0 0;
  width: min(92vw, 560px);
}

.hero-logo img {
  width: 100%;
  height: auto;
}

.hero-swash {
  margin-top: 6px;
  padding: 18px 28px 20px;
  background: var(--brand);
  color: #fff;
  transform: rotate(-2.5deg);
  /* bordo irregolare come una pennellata */
  clip-path: polygon(2% 8%, 22% 2%, 48% 6%, 76% 0, 99% 7%, 97% 52%, 100% 92%, 74% 100%, 46% 94%, 20% 100%, 0 93%, 3% 48%);
}

.hero-headline {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 8.5vw, 50px);
  line-height: 1.05;
}

.hero-lead {
  max-width: 30em;
  margin: 26px auto 22px;
  font-size: 18px;
  color: var(--ink-2);
}

.cta {
  background: var(--ink);
  color: #fff;
  min-height: 56px;
  padding: 0 28px;
  font-size: 21px;
}

.cta span {
  color: var(--bun);
  font-size: 22px;
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) {
  .cta:hover span {
    transform: translateY(3px);
  }
}

/* semi di sesamo sparsi, presi dal panino del logo */
.sesame {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(ellipse 3px 6px at 12% 18%, var(--bun) 98%, transparent),
    radial-gradient(ellipse 6px 3px at 86% 14%, var(--bun) 98%, transparent),
    radial-gradient(ellipse 3px 6px at 92% 62%, var(--bun) 98%, transparent),
    radial-gradient(ellipse 6px 3px at 6% 74%, var(--bun) 98%, transparent),
    radial-gradient(ellipse 3px 6px at 78% 88%, var(--bun) 98%, transparent),
    radial-gradient(ellipse 6px 3px at 22% 92%, var(--bun) 98%, transparent),
    radial-gradient(ellipse 3px 6px at 70% 30%, var(--bun) 98%, transparent),
    radial-gradient(ellipse 6px 3px at 30% 40%, var(--bun) 98%, transparent);
  background-repeat: no-repeat;
}

/* ---------- Layout ---------- */

main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}

.notice {
  margin: 18px 0 4px;
  padding: 12px 14px;
  border-left: 5px solid var(--bun);
  background: var(--bun-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15px;
  color: var(--ink-2);
}

.notice.bad {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: #7d0f06;
}

/* ---------- Barra menu (cerca + categorie) ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 -16px;
  padding: 12px 16px 8px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.toolbar:focus {
  outline: none;
}

.search {
  position: relative;
}

.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.2;
  stroke-linecap: round;
  pointer-events: none;
}

.search input {
  padding-left: 44px;
  background: var(--surface);
}

.chips {
  display: flex;
  gap: 8px;
  margin: 10px -16px 0;
  padding: 0 16px 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 16px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-height: var(--tap);
  padding: 0 16px;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

@media (hover: hover) {
  .chip:hover {
    border-color: var(--ink);
  }
}

.chip.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  animation: pop 240ms var(--ease-out);
}

@media (min-width: 760px) {
  .chips {
    flex-wrap: wrap;
    overflow: visible;
    margin: 10px 0 0;
    padding: 0 0 4px;
  }
}

/* ---------- Menu ---------- */

.menu {
  padding-top: 6px;
}

.cat {
  margin-top: 26px;
}

.cat-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.1;
  color: var(--brand);
}

.cat-title small {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.item {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1.5px dashed var(--line-strong);
}

.item:last-child {
  border-bottom: 0;
}

.item-head {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.item-name {
  margin: 0;
  min-width: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* puntini da lavagna tra nome e prezzo */
.item-head::after {
  content: "";
  order: 1;
  flex: 1;
  min-width: 16px;
  border-bottom: 2px dotted var(--line-strong);
  transform: translateY(-5px);
}

.item-head .price {
  order: 2;
}

.price {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.item-desc {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

/* bottone tondo "+": con ricetta apre Personalizza, senza aggiunge subito */
.add {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 2px solid var(--brand);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms var(--ease-out);
}

.add .ico {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  transform: translateY(-1px);
}

.add.plain {
  background: var(--brand);
  color: #fff;
}

@media (hover: hover) {
  .add:hover {
    background: var(--brand);
    color: #fff;
  }

  .add.plain:hover {
    background: var(--brand-deep);
    border-color: var(--brand-deep);
  }
}

.add:active {
  transform: scale(0.92);
}

.add:disabled {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  cursor: not-allowed;
}

.add.added {
  animation: added 520ms var(--ease-out);
}

.empty {
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
}

/* ---------- Ordine (scontrino) ---------- */

.order {
  margin: 44px 0 20px;
}

.receipt {
  position: relative;
  padding: 26px 20px 22px;
  background: var(--surface);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px #3a1a0a55;
}

/* bordo seghettato da scontrino */
.receipt::before,
.receipt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 10px;
  background: radial-gradient(circle at 6px 0, transparent 6px, var(--surface) 6.5px) 0 0 / 12px 10px repeat-x;
}

.receipt::before {
  top: -9px;
  transform: scaleY(-1);
}

.receipt::after {
  bottom: -9px;
}

.receipt h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  color: var(--brand);
}

.receipt h2:focus {
  outline: none;
}

.receipt-sub {
  margin: 2px 0 14px;
  font-size: 14px;
  color: var(--muted);
}

.cart {
  border-top: 2px solid var(--ink);
}

.cart-empty {
  margin: 0;
  padding: 18px 0;
  color: var(--muted);
}

.line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1.5px dashed var(--line-strong);
}

.line-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 19px;
  text-transform: uppercase;
  line-height: 1.2;
}

.line-detail {
  font-size: 14px;
  color: var(--muted);
}

.qty {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
}

.qty button {
  width: var(--tap);
  height: var(--tap);
  border: 0;
  background: none;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
}

@media (hover: hover) {
  .qty button:hover {
    background: var(--bun-soft);
  }
}

.qty .q {
  min-width: 22px;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 19px;
}

.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0 4px;
  border-top: 2px solid var(--ink);
  margin-top: -1.5px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  text-transform: uppercase;
}

.total-row .price {
  font-size: 30px;
}

.fields {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

@media (min-width: 600px) {
  .fields {
    grid-template-columns: 1fr 1fr 150px;
  }

  .field.wide {
    grid-column: 1 / -1;
  }
}

label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

label .opt {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font-size: 16px; /* niente zoom su iOS */
  background: var(--paper);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--bun) 45%, transparent);
}

textarea {
  resize: vertical;
}

.fineprint {
  margin: 16px 0 12px;
  font-size: 14px;
  color: var(--muted);
}

.send-msg {
  margin: 10px 0 0;
  min-height: 1.5em;
  font-weight: 600;
  color: var(--brand-deep);
}

/* ---------- Conferma ---------- */

.done {
  padding: 48px 0 24px;
  text-align: center;
}

.done-kicker {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--brand);
  transform: rotate(-2deg);
}

.done h2 {
  margin: 4px 0 22px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(40px, 11vw, 60px);
  line-height: 1;
  text-transform: uppercase;
}

.done h2:focus {
  outline: none;
}

.ticket {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 240px;
  padding: 18px 28px;
  border: 2.5px dashed var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  animation: pop 420ms var(--ease-out);
}

.ticket-label {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.ticket-num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 72px;
  line-height: 1;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.ticket-total {
  margin-top: 6px;
  font-size: 17px;
}

.done-text {
  max-width: 28em;
  margin: 22px auto;
  color: var(--ink-2);
}

/* ---------- Footer ---------- */

.site-foot {
  max-width: var(--wrap);
  margin: 30px auto 0;
  padding: 22px 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.site-foot p {
  margin: 2px 0;
}

.site-foot a {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Carrello fisso ---------- */

.sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px max(16px, calc((100vw - var(--wrap)) / 2 + 16px));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--ink);
  color: #fff;
  transform: translateY(110%);
  transition: transform 280ms var(--ease-out);
}

body.has-cart .sticky {
  transform: none;
}

.sticky :focus-visible {
  outline-color: #fff;
}

.sticky-info {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  line-height: 1.15;
  white-space: nowrap;
}

.count {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 21px;
  text-transform: uppercase;
}

.count.bump {
  animation: bump 380ms var(--ease-out);
}

.sticky-hint {
  font-size: 13px;
  color: #cbbdb6;
}

.sticky .btn-primary {
  flex: 1 1 auto;
  max-width: 320px;
  min-width: 0;
  white-space: nowrap;
  font-size: 18px;
  padding: 0 18px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 30;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--bun);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 10px 30px -10px #0006;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 260ms var(--ease-out);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Dialog personalizza ---------- */

dialog.editor {
  width: min(100vw, 580px);
  max-width: 100vw;
  max-height: min(92dvh, 860px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px #1c141299;
  overflow: hidden;
}

dialog.editor[open] {
  animation: rise 300ms var(--ease-out);
}

dialog.editor::backdrop {
  background: #1c1412b3;
  animation: fade 220ms ease;
}

.editor-shell {
  display: flex;
  flex-direction: column;
  max-height: min(92dvh, 860px);
  margin: 0;
}

.editor-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.grab {
  display: none;
}

.editor-title {
  flex: 1;
  min-width: 0;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--brand);
}

.editor-head h2 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 30px;
  line-height: 1.05;
  text-transform: uppercase;
}

.editor-desc {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.icon-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  cursor: pointer;
}

@media (hover: hover) {
  .icon-btn:hover {
    background: var(--bun-soft);
  }
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.editor-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 18px 16px;
}

.editor-block {
  margin-top: 18px;
}

.editor-block h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.editor-block h3 span {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

/* filtro categorie extra: schede sottolineate, non pill */
.filter-bar {
  display: flex;
  gap: 2px;
  margin: 0 -18px 10px;
  padding: 0 18px;
  overflow-x: auto;
  border-bottom: 2px solid var(--line);
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}

.tab::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -2px;
  height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--brand);
  transform: scaleX(0);
  transition: transform 220ms var(--ease-out);
}

@media (hover: hover) {
  .tab:hover {
    color: var(--ink);
  }
}

.tab[aria-selected="true"] {
  color: var(--ink);
}

.tab[aria-selected="true"]::after {
  transform: scaleX(1);
}

.tab .n {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0;
}

.ing-list {
  display: grid;
  gap: 6px;
}

@media (min-width: 520px) {
  #dlgAggiungiList {
    grid-template-columns: 1fr 1fr;
  }
}

.ing-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

@media (hover: hover) {
  .ing-row:hover {
    border-color: var(--line-strong);
  }
}

.ing-row .name {
  flex: 1;
  min-width: 0;
}

.ing-row .extra {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  color: var(--crust);
  white-space: nowrap;
}

.ing-row .mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  color: var(--muted);
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 200ms var(--ease-out);
}

/* aggiunte */
.ing-row.add-mode.on {
  border-color: var(--bun);
  background: var(--bun-soft);
}

.ing-row.add-mode.on .mark {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  transform: rotate(-8deg) scale(1.06);
}

/* togli dalla ricetta */
.ing-row.remove-mode .state {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.ing-row.remove-mode.on {
  border-style: dashed;
  border-color: var(--brand);
  background: var(--brand-soft);
}

.ing-row.remove-mode.on .name {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 2.5px;
}

.ing-row.remove-mode.on .state {
  color: var(--brand-deep);
}

.editor-block label {
  font-size: 17px;
}

.editor-foot {
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.preview {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.foot-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qty-row {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
}

.qty-row .step {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
}

@media (hover: hover) {
  .qty-row .step:hover {
    background: var(--bun-soft);
  }
}

.qty-row input {
  width: 40px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.qty-row input::-webkit-inner-spin-button,
.qty-row input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-row input:focus {
  box-shadow: none;
}

.add-btn {
  flex: 1;
  min-width: 0;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 18px;
}

.add-btn .price {
  font-size: 21px;
}

@media (max-width: 420px) {
  .sticky-hint {
    display: none;
  }

  .sticky .btn-primary {
    font-size: 17px;
    padding: 0 14px;
  }
}

@media (max-width: 560px) {
  dialog.editor {
    width: 100vw;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  dialog.editor[open] {
    animation: sheet 320ms var(--ease-out);
  }

  .editor-shell {
    max-height: 94dvh;
  }

  .editor-head {
    padding-top: 24px;
  }

  .grab {
    display: block;
    position: absolute;
    top: 8px;
    left: 50%;
    width: 44px;
    height: 5px;
    margin-left: -22px;
    border-radius: 5px;
    background: var(--line-strong);
  }
}

@media (min-width: 760px) {
  .hero-place {
    font-size: 16px;
  }

  .hero-lead {
    font-size: 20px;
  }

  .receipt {
    padding: 32px 34px 28px;
  }
}

/* ---------- Account cliente ---------- */

[hidden] {
  display: none !important;
}

.btn-sm {
  min-height: var(--tap);
  padding: 0 16px;
  font-size: 16px;
}

.link-btn {
  min-height: var(--tap);
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--brand-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:disabled {
  color: var(--muted);
  text-decoration: none;
  cursor: default;
}

.account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-top: 18px;
  padding: 14px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
}

.account[data-stato="ok"] {
  border-style: solid;
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
  background: var(--ok-soft);
}

.account[data-stato="ospite"],
.account[data-stato="email"],
.account[data-stato="telefono"] {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.account-text {
  flex: 1 1 240px;
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

.account-ok {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.account-det {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

input[readonly] {
  background: var(--line);
  color: var(--ink-2);
}

/* dialog accesso / registrazione (stessa base di Personalizza) */
.auth-body {
  padding-bottom: 22px;
}

.auth-steps {
  display: flex;
  gap: 6px;
  margin: 16px 0 18px;
  padding: 0;
  list-style: none;
  counter-reset: passo;
}

.auth-steps li {
  flex: 1;
  padding-top: 8px;
  border-top: 4px solid var(--line);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  counter-increment: passo;
  transition: border-color 200ms ease, color 200ms ease;
}

.auth-steps li::before {
  content: counter(passo) ". ";
}

.auth-steps li.done {
  border-color: var(--ok);
  color: var(--ok);
}

.auth-steps li[aria-current] {
  border-color: var(--brand);
  color: var(--ink);
}

.auth-step {
  display: grid;
  gap: 14px;
}

.auth-step .link-btn {
  justify-self: start;
}

.auth-switch {
  margin: 0;
  color: var(--muted);
}

.auth-info {
  margin: 0;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.auth-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.auth-done {
  text-align: center;
}

.auth-done .done-kicker {
  font-size: 28px;
}

.prefixed {
  display: flex;
  align-items: stretch;
}

.prefixed span {
  display: grid;
  place-items: center;
  padding: 0 12px;
  border: 2px solid var(--line-strong);
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--line);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
}

.prefixed input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.code-input {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 0.4em;
  text-align: center;
}

.sms-wait {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bun-soft);
  font-size: 15px;
  color: var(--ink-2);
}

.sms-wait .dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bun);
  animation: attesa 1.2s ease-in-out infinite;
}

.sms-wait.late {
  background: var(--brand-soft);
}

.sms-wait.late .dot {
  background: var(--brand);
  animation: none;
}

@keyframes attesa {
  0%, 100% { transform: scale(0.7); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
}

.send-msg.ok {
  color: var(--ok);
}

#authRecaptcha:empty {
  display: none;
}

/* ---------- Motion ---------- */

@keyframes pop {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.25) rotate(-4deg); color: var(--bun); }
  100% { transform: scale(1); }
}

@keyframes added {
  0% { transform: scale(1); }
  30% { transform: scale(0.92); background: var(--bun); border-color: var(--bun); color: var(--ink); }
  100% { transform: scale(1); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes sheet {
  from { transform: translateY(100%); }
  to { transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* ---------- Telefoni stretti (iPhone SE, Android compatti) ---------- */

@media (max-width: 479px) {
  .item-name,
  .item-head .price {
    font-size: 19px;
  }

  .item-desc {
    font-size: 14px;
  }

  .chip {
    padding: 0 14px;
    font-size: 16px;
  }
}

@media (max-width: 360px) {
  .hero-place {
    font-size: 13px;
    letter-spacing: 0.08em;
  }

  .tag {
    font-size: 14px;
  }

  .editor-head h2 {
    font-size: 26px;
  }

  .editor-body,
  .editor-foot {
    padding-left: 14px;
    padding-right: 14px;
  }

  .filter-bar {
    margin: 0 -14px 10px;
    padding: 0 14px;
  }

  .foot-row {
    gap: 8px;
  }

  .qty-row .step {
    width: 44px;
  }

  .qty-row input {
    width: 30px;
  }

  .add-btn {
    padding: 0 14px;
    font-size: 17px;
    gap: 6px;
  }

  .add-btn .price {
    font-size: 19px;
  }

  .sticky .btn-primary {
    font-size: 16px;
    padding: 0 12px;
  }

  .count {
    font-size: 18px;
  }
}

/* ---------- Telefono in orizzontale (schermi bassi) ---------- */

@media (max-height: 520px) and (orientation: landscape) {
  html {
    scroll-padding-top: 80px;
  }

  .hero {
    min-height: 0;
    padding-top: 56px;
  }

  .hero-logo {
    margin-top: 0;
    width: min(60vw, 420px);
  }

  /* cerca e categorie su una riga sola: la barra fissa resta bassa */
  .toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .search {
    flex: 0 0 240px;
  }

  .search input {
    min-height: 44px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .chips {
    flex: 1;
    flex-wrap: nowrap;
    overflow-x: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    scroll-padding-inline: 0;
  }

  .sticky {
    padding-top: 6px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }

  .sticky .btn-primary {
    min-height: 46px;
  }

  /* personalizza a tutta altezza, testata compatta */
  dialog.editor {
    width: min(100vw, 720px);
    max-height: 100dvh;
    height: 100dvh;
    margin: 0 auto;
    border-radius: 0;
  }

  dialog.editor[open] {
    animation: sheet 320ms var(--ease-out);
  }

  .editor-shell {
    height: 100dvh;
    max-height: 100dvh;
  }

  .editor-head {
    padding-top: 10px;
    padding-bottom: 8px;
  }

  .grab,
  .eyebrow {
    display: none;
  }

  .editor-head h2 {
    font-size: 24px;
  }

  .editor-desc {
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .editor-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .preview {
    flex: 1;
    min-width: 0;
    margin: 0;
  }

  .foot-row {
    flex: 0 0 auto;
  }

  .add-btn {
    min-width: 220px;
    min-height: 48px;
  }

  #dlgSenzaList {
    grid-template-columns: 1fr 1fr;
  }
}
