/* ---------- testata del menu ----------
   Telefono e tablet: due righe (ricerca, filtri, menu online; categoria e piatti spenti).
   Dai 1024 px la categoria è nella colonna a sinistra e resta una riga sola. */
.mh-row { display: flex; gap: 8px; align-items: stretch; margin: 0 0 8px; }
.mh-row .search { flex: 1; min-width: 0; }
.mh-btn {
  position: relative; flex: none; width: var(--tap); min-height: var(--tap); display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer;
}
.mh-btn[hidden] { display: none; }
.mh-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mh-sticky { position: sticky; top: calc(var(--topbar-h, 61px) + 6px); z-index: 15; }
.mh-sticky .catjump { position: static; flex: 1; min-width: 0; margin: 0; }
.mh-quick {
  flex: none; min-height: var(--tap); padding: 0 12px; margin-left: auto; font: inherit; font-size: 0.875rem; font-weight: 600;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.mh-quick[hidden] { display: none; }
.mh-quick[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.mf-label { margin: 12px 4px 6px; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.mf-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mf-list { display: grid; gap: 6px; }
.mf .chip { min-height: var(--tap); padding: 0 8px; }
.mf-list .chip { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 14px; }
.mf-list .chip[hidden] { display: none; }
.mh-wide { width: 100%; margin-top: 10px; min-height: var(--tap); }
.mh-back { margin-bottom: 10px; min-height: var(--tap); }
.online-panel { height: min(88dvh, 900px); display: flex; flex-direction: column; }
.sheet .online-panel { max-height: calc(100dvh - max(24px, var(--sa-t) + 12px)); }
.online-panel .sheet-head h2 { flex: 1; }
.online-note { margin: 0 20px 12px; }
#online-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; }
#online-frame[hidden] { display: none; }
@media (min-width: 1024px) {
  #view-dishes:not([hidden]) { display: flex; flex-wrap: wrap; align-items: stretch; align-content: flex-start; column-gap: 8px; }
  #view-dishes > .mh-top { flex: 1; }
  #view-dishes > .mh-sticky { position: static; flex: none; }
  #view-dishes > .layout, #view-dishes > .hint { flex: 0 0 100%; }
  .mh-quick { margin-left: 0; }
}

/* ---------- computer: sezioni nella barra in alto ----------
   Computer = almeno 1024 px, con mouse. Un tablet, anche in orizzontale, tiene la barra in basso. */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .topbar {
    grid-template-columns: minmax(0, auto) 1fr auto auto; grid-template-areas: "brand nav badge more";
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  }
  .mainnav {
    grid-area: nav; justify-self: center; position: static; display: flex; gap: 4px; padding: 0;
    background: transparent; border: 0; box-shadow: none;
  }
  .navbtn {
    display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 14px;
    font-size: 0.9375rem; border: 1px solid transparent;
  }
  .navbtn svg { width: 20px; height: 20px; padding: 0; border-radius: 0; }
  .navbtn:hover { background: var(--surface-2); color: var(--text); }
  .navbtn[aria-current="page"] { background: var(--surface-2); border-color: var(--line); }
  .navbtn[aria-current="page"] svg { background: none; color: var(--accent); }
  .navbtn .nav-lock { position: static; width: 14px; height: 14px; }
  .navbtn.is-locked:hover { background: transparent; color: var(--muted); }
  .nav-dot { position: static; width: 8px; height: 8px; box-shadow: none; }
  .app { padding-bottom: 0; }
  .toasts { bottom: max(20px, var(--sa-b)); }
}

/* ---------- menu e categorie ---------- */
.dish-meta { display: block; max-width: 100%; }
.price input { background: transparent; }
.price input:disabled { background: transparent; }
.price input:hover:not(:disabled) { background: var(--surface-2); }
.section { border-radius: 16px; }
.section-head [data-add-dish] { display: none; }
.page-foot { position: fixed; left: 0; right: 0; bottom: calc(63px + max(6px, var(--sa-b))); z-index: 30; display: flex; gap: 8px; padding: 10px max(16px, var(--sa-r)) 10px max(16px, var(--sa-l)); background: var(--surface); border-top: 1px solid var(--line); }
.page-foot[hidden] { display: none; }
.page-foot .btn { flex: 1; }
body.can-edit-menu #view-dishes, body.can-edit-menu #view-categories { padding-bottom: 150px; }
#view-dishes > .page-foot { flex: 0 0 auto; }
#btn-cat-order[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
/* si trascina solo dopo "Cambia ordine" */
.cat-tree .handle { display: none; }
.cat-tree.is-sorting .handle { display: grid; }
.cat-tree.is-sorting .cat-chev, .cat-tree.is-sorting .ico-edit { display: none; }
.cat-chev { width: 18px; height: 18px; flex: none; margin: 0 6px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modal-extra { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.modal-extra .btn { flex: 1 1 160px; }

/* ---------- Altro ---------- */
.more-block { display: grid; gap: 6px; padding: 8px 4px; }
.more-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.more-block select { width: 100%; min-height: var(--tap); padding: 0 12px; font-size: max(16px, 1rem); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }

/* ---------- avviso della modalità: una riga sottile ---------- */
.mode-note, .mode-live, .mode-dry, .mode-ro, .mode-demo {
  margin: 0; padding: 6px max(16px, var(--sa-r)) 6px max(16px, var(--sa-l)); border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; font-size: 0.75rem; font-weight: 600; line-height: 1.35;
}
.mode-live, .mode-dry { background: var(--warn-soft); color: var(--warn); }
.mode-ro { background: var(--info-soft); color: var(--info); }
.mode-demo { background: var(--surface-2); color: var(--muted); }
@media (min-width: 1024px) {
  .mode-note { max-width: none; margin: 0; padding-inline: 24px; }
  /* sul computer lo stato è nella riga sottile, e "+ Piatto" sta in ogni categoria */
  #mode-badge { display: none; }
  .section-head [data-add-dish] { display: inline-flex; }
  #dish-foot { display: none; }
  .page-foot { position: static; padding: 0; border: 0; background: transparent; justify-content: flex-end; margin-top: 16px; }
  .page-foot .btn { flex: 0 0 auto; }
  body.can-edit-menu #view-dishes, body.can-edit-menu #view-categories { padding-bottom: 80px; }
}
