/* Telefono e tablet: la categoria attuale resta in vista sotto la barra in alto. */
.catjump {
  position: sticky; top: calc(var(--topbar-h, 61px) + 6px); z-index: 15;
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin: 0 0 12px; padding: 4px 12px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.catjump[hidden] { display: none; }
.catjump:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.catjump svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.catjump-ico { color: var(--muted); }
.catjump-text { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.catjump-path { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catjump-name { font-size: max(16px, 1rem); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* I titoli raggiunti dall'albero si fermano sotto le barre fisse, non sotto di loro. */
#sections > [id^="sec-"] { scroll-margin-top: calc(var(--topbar-h, 61px) + 72px); }

.hint { font-size: 0.8125rem; color: var(--muted); margin: 4px 0 10px; }

/* ---------- impaginazione ---------- */
.layout { display: block; }
.sidebar { display: none; }
.sections { display: grid; gap: 14px; min-width: 0; }

.group-title {
  margin: 18px 0 -2px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  padding-left: calc(var(--depth) * 10px);
  scroll-margin-top: 120px;
}
.section {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; scroll-margin-top: 120px;
}
.section-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 14px 12px; border-bottom: 1px solid var(--line);
}
.section-head h3 { margin: 0; font-size: 1.0625rem; font-weight: 650; }
.section-head p { margin: 0; }
.crumbs { font-size: 0.75rem; color: var(--muted); }
.crumbs:empty { display: none; }

.dish-list { list-style: none; margin: 0; padding: 0; }
.dish {
  display: grid; grid-template-columns: var(--tap) auto minmax(0, 1fr) auto auto; align-items: center; gap: 2px;
  padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); background: var(--surface);
}
.dish:last-child { border-bottom: 0; }
.dish.is-off .thumb, .dish.is-off .dish-title { opacity: .45; }
.dish.flash { animation: flash 1s ease; }
@keyframes flash { from { background: var(--ok-soft); } to { background: var(--surface); } }
.dish.is-ghost { opacity: .35; }
.dish.is-chosen { box-shadow: var(--shadow); }
.empty { padding: 16px; color: var(--muted); font-size: 0.875rem; list-style: none; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 0; }

.handle {
  width: var(--tap); height: var(--tap); border: 0; background: transparent; cursor: grab; border-radius: 8px;
  display: grid; place-items: center; touch-action: none;
}
.handle svg { width: 16px; height: 16px; fill: var(--line-strong); }
.handle:hover svg { fill: var(--muted); }
.handle:disabled { cursor: default; opacity: .4; }

.dish-main {
  display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 56px;
  border: 0; background: transparent; text-align: left; padding: 4px; cursor: pointer; border-radius: 10px;
}
.dish:hover { background: var(--surface-2); }
.thumb {
  width: 48px; height: 48px; flex: none; border-radius: 10px; overflow: hidden; background: var(--surface-2);
  display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
/* miniatura che apre le foto: area di tocco 48 px */
.thumb-btn { position: relative; padding: 0; cursor: zoom-in; }
.thumb-btn:hover { border-color: var(--line-strong); }
.thumb-n {
  position: absolute; right: 2px; bottom: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: rgb(15 23 42 / 78%); color: #fff; font-size: 0.6875rem; font-weight: 700; line-height: 18px; text-align: center;
}
button.detail-img { position: relative; width: 100%; padding: 0; border: 0; cursor: zoom-in; }
.detail-img-hint {
  position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border-radius: 999px; background: rgb(15 23 42 / 72%); color: #fff; font-size: 0.8125rem; font-weight: 600;
}
.detail-img-hint svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
