/* Italia Lume table ordering, in the website's own palette and type (italia.johncrm.com). */
:root {
  --bg: #16060a;          /* notte */
  --panel: #210b10;
  --raise: #2a0e14;       /* vino */
  --fg: #efe4d2;          /* osso */
  --muted: #b39a93;       /* fumo */
  --accent: #f2c27e;      /* cera */
  --accent-ink: #16060a;
  --line: rgba(242, 194, 126, .16);
  --shade: rgba(8, 2, 4, .62);
  --display: "Bodoni Moda", "Bodoni 72", Didot, "Times New Roman", serif;
  --text: "Hanken Grotesk", "Helvetica Neue", Arial, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --gutter: 20px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}
/* Simplified Chinese in its own typeface, so its characters keep their mainland forms. */
:root:lang(zh-Hans) { --text: "Hanken Grotesk", "Helvetica Neue", Arial, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--text); font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .35; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---- header and the order status strip ---------------------------------------------------------------------- */
/* The header and the order-status strip stick together as one solid block, so the menu never shows through. */
.top { position: sticky; top: 0; z-index: 5; padding-top: env(safe-area-inset-top); background: var(--bg); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 720px; margin: 0 auto; padding: 14px var(--gutter); }
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand-name { font-family: var(--display); font-size: 21px; color: var(--accent); letter-spacing: .01em; white-space: nowrap; }
.table { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Language: a globe icon that opens a small menu. */
.lang { position: relative; flex: none; margin-right: -8px; }
.icon-button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--muted); display: grid; place-items: center; transition: background .2s ease, color .2s ease; }
.icon-button[aria-expanded="true"] { background: var(--raise); color: var(--fg); }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 1; min-width: 196px; padding: 6px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--raise); box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
  transform-origin: top right; animation: pop .18s var(--ease);
}
.lang-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%;
  padding: 12px 12px; border: 0; border-radius: 11px; background: none; color: var(--fg); font-size: 15px; text-align: left;
}
.lang-menu button:hover, .lang-menu button:focus-visible { background: rgba(242, 194, 126, .09); outline: none; }
.lang-menu button[aria-checked="true"] { font-weight: 600; }
.lang-menu .tick { width: 18px; height: 18px; color: var(--accent); stroke-width: 2; visibility: hidden; }
.lang-menu button[aria-checked="true"] .tick { visibility: visible; }

.strip {
  display: flex; align-items: center; gap: 10px; width: calc(100% - 2 * var(--gutter)); max-width: 680px; margin: 0 auto 10px;
  padding: 11px 14px; border: 0; border-radius: 12px; background: var(--raise); text-align: left; font-size: 14px;
}
.strip-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-go { width: 18px; height: 18px; color: var(--muted); }

/* The category bar: one tab per section, scrolling sideways; the section being read is highlighted. */
.sections { border-bottom: 1px solid var(--line); }
.sections-track {
  display: flex; gap: 6px; max-width: 720px; margin: 0 auto; padding: 4px var(--gutter) 10px;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.sections-track::-webkit-scrollbar { display: none; }
/* An edge with more tabs past it fades out, so a phone shows there are more to swipe to; an edge with none stays sharp. */
.sections-track {
  --fade-start: 0px; --fade-end: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent);
}
.sections-track.more-before { --fade-start: 28px; }
.sections-track.more-after { --fade-end: 28px; }
.section-tab {
  flex: none; padding: 8px 14px; border: 0; border-radius: 999px; background: none; color: var(--muted);
  font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .2s ease, color .2s ease;
}
.section-tab[aria-current="true"] { background: var(--raise); color: var(--accent); }
.strip-dot, .status-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
[data-status="new"] .strip-dot, [data-status="new"] .status-dot { animation: pulse 1.6s ease-in-out infinite; }
[data-status="served"] .strip-dot, [data-status="served"] .status-dot,
[data-status="cancelled"] .strip-dot, [data-status="cancelled"] .status-dot { background: var(--muted); }

main { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter) 40px; }
body.has-bar main { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }

.state { min-height: 72vh; display: grid; place-content: center; text-align: center; gap: 10px; }
.state h1 { font-family: var(--display); font-weight: 500; color: var(--accent); font-size: 28px; line-height: 1.2; margin: 0; }
.state p { color: var(--muted); margin: 0 auto; max-width: 28ch; }
.state .ghost { justify-self: center; margin-top: 12px; }

/* While the table's menu loads: the shape of the list, gently breathing. */
.loading { padding-top: 30px; }
.sk { display: block; height: 12px; border-radius: 6px; background: var(--raise); animation: breathe 1.4s ease-in-out infinite; }
.sk-title { width: 42%; height: 38px; border-radius: 10px; margin-bottom: 18px; }
.sk-row { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.sk-row:last-child { border-bottom: 0; }
.sk-photo { flex: none; width: 92px; height: 92px; border-radius: 14px; }
.sk-lines { flex: 1; display: grid; gap: 10px; align-content: start; padding-top: 6px; }
.sk-lines .sk:first-child { width: 64%; height: 17px; }
.sk-lines .sk.short { width: 28%; margin-top: 6px; }

.menu-title { font-family: var(--display); font-weight: 500; font-size: 44px; line-height: 1; color: var(--accent); margin: 28px 0 8px; letter-spacing: -.01em; }
.notice { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--raise); font-size: 15px; }
.notice.warn { margin: 0 0 12px; }

/* ---- the dishes: a quiet list, in sections ------------------------------------------------------------------------- */
.group { scroll-margin-top: calc(var(--top-h, 70px) + 6px); }
.group + .group { margin-top: 14px; }
.group-title { font-family: var(--display); font-weight: 500; font-size: 26px; line-height: 1.2; color: var(--accent); margin: 22px 0 0; letter-spacing: .005em; }
.items { list-style: none; margin: 8px 0 0; padding: 0; }
.item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item-main { display: flex; gap: 16px; align-items: flex-start; min-width: 0; text-align: left; background: none; border: 0; padding: 0; }
.item-main .photo { transition: transform .25s var(--ease); }
.item-main:active .photo { transform: scale(.97); }
.photo { position: relative; flex: none; width: 92px; height: 92px; border-radius: 14px; overflow: hidden; background: var(--raise); display: grid; place-items: center; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease; }
.photo img.loaded { opacity: 1; }
.item-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.item-name { font-family: var(--display); font-size: 19px; line-height: 1.2; }
.item-desc { color: var(--muted); font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-price { color: var(--accent); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 2px; }
/* The smallest phones: a smaller photo and a narrower "− n +", so a dish's text keeps its room. */
@media (max-width: 360px) {
  .item-main { gap: 12px; }
  .photo { width: 76px; height: 76px; border-radius: 12px; }
  .stepper.has-qty .step { width: 28px; }
}
/* A dish without a photo: its text only, centred against the "+" button. */
.item.no-photo { align-items: center; padding: 16px 0; }
.item.no-photo .item-text { padding-top: 0; }

/* "+" until added, then a filled "− n +" pill. */
.stepper { display: flex; align-items: center; flex: none; }
.stepper .add { width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); background: none; color: var(--accent); display: grid; place-items: center; transition: background .2s ease, color .2s ease; }
.stepper .icon { width: 18px; height: 18px; stroke-width: 1.8; }
.stepper .add:active { background: var(--accent); color: var(--accent-ink); }
.stepper.has-qty { height: 36px; border-radius: 18px; background: var(--accent); color: var(--accent-ink); }
.stepper.has-qty .step { width: 34px; height: 36px; padding: 0; border: 0; background: none; color: inherit; display: grid; place-items: center; }
.stepper.has-qty { animation: grow .22s var(--ease); }
.stepper.has-qty .count { min-width: 14px; text-align: center; font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.stepper.large .add { width: 48px; height: 48px; }
.stepper.large .icon { width: 22px; height: 22px; }
.stepper.large.has-qty { height: 48px; border-radius: 24px; }
.stepper.large.has-qty .step { width: 46px; height: 48px; }

/* ---- the order bar -------------------------------------------------------------------------------------------- */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 60%, transparent); }
.bar-button { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 12px; animation: rise .35s var(--ease); }
.bar-count { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--accent-ink); color: var(--accent); display: grid; place-items: center; font-size: 14px; font-weight: 600; }
.bar-total { margin-left: auto; font-variant-numeric: tabular-nums; }

.primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 14px; padding: 15px 18px; font-weight: 600; font-size: 16px; }
.wide { width: 100%; }
.ghost { background: none; border: 1px solid var(--line); color: var(--fg); border-radius: 12px; padding: 10px 16px; }

/* ---- sheets --------------------------------------------------------------------------------------------------- */
.sheet { position: fixed; inset: 0; z-index: 10; background: var(--shade); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet-body {
  position: relative; width: 100%; max-width: 720px; max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); border-radius: 22px 22px 0 0; padding: 22px var(--gutter) calc(22px + env(safe-area-inset-bottom));
  animation: rise .32s var(--ease);
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.sheet-head h2, .detail-copy h2, .done-body h2 { font-family: var(--display); font-weight: 500; font-size: 26px; line-height: 1.15; margin: 0; }
.close { flex: none; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 0; background: var(--raise); color: var(--muted); display: grid; place-items: center; }
.close .icon { width: 18px; height: 18px; stroke-width: 1.8; }
.close.floating { position: absolute; top: 14px; right: 14px; z-index: 1; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--fg); }

.lines { list-style: none; margin: 0; padding: 0; }
.line { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.line-main { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.line-name { font-family: var(--display); font-size: 18px; line-height: 1.25; }
.line-total { font-variant-numeric: tabular-nums; white-space: nowrap; }
.line-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 60%; min-width: 0; padding: 6px 12px; border-radius: 16px; border: 1px dashed var(--line); background: none; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.filled { border-style: solid; background: var(--raise); color: var(--fg); }
.chip .icon { width: 14px; height: 14px; opacity: .85; }
.line-note, .field textarea {
  width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font: inherit; font-size: 16px;
}
.line-note { flex: 1; min-width: 0; }
.field { display: grid; gap: 8px; margin: 18px 0 6px; color: var(--muted); font-size: 14px; }
.field textarea { resize: none; }
.sheet-foot { position: sticky; bottom: calc(-22px - env(safe-area-inset-bottom)); margin: 12px calc(-1 * var(--gutter)) 0; padding: 12px var(--gutter) 0; background: var(--panel); }
.pay-note { color: var(--muted); font-size: 13px; text-align: center; margin: 0 0 12px; }
#submit { display: flex; justify-content: space-between; }
.submit-total { font-variant-numeric: tabular-nums; }

.detail-body { padding: 0 0 calc(22px + env(safe-area-inset-bottom)); }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: center; }
.detail-copy { padding: 20px var(--gutter) 0; display: grid; gap: 10px; }
#detail.no-photo .detail-copy { padding-top: 64px; }
.detail-text { color: var(--muted); margin: 0; white-space: pre-line; }
.detail-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.detail-foot strong { color: var(--accent); font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }

.receipts { list-style: none; margin: 8px 0 16px; padding: 0; display: grid; gap: 12px; }
.receipt { border-radius: 16px; padding: 16px; background: var(--raise); }
.receipt-head { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.receipt-total { font-variant-numeric: tabular-nums; }
.receipt-status { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; font-size: 15px; color: var(--accent); }
.receipt[data-status="served"] .receipt-status, .receipt[data-status="cancelled"] .receipt-status { color: var(--muted); }
.receipt-lines { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.receipt-lines li { display: flex; flex-wrap: wrap; gap: 0 8px; }
.receipt-qty { color: var(--fg); font-variant-numeric: tabular-nums; }
.receipt-note { flex-basis: 100%; padding-left: 26px; font-size: 13px; opacity: .8; }

.done-body { text-align: center; display: grid; gap: 8px; padding-top: 34px; }
.done-mark svg { width: 64px; height: 64px; }
.done-mark circle { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s var(--ease) .05s forwards; }
.done-mark path { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 36; stroke-dashoffset: 36; animation: draw .4s var(--ease) .5s forwards; }
.done-number { font-size: 15px; font-weight: 600; letter-spacing: .04em; color: var(--accent); margin: 0; }
.done-text { color: var(--muted); margin: 4px auto 18px; max-width: 30ch; }

@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes breathe { 50% { opacity: .45; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scale(.9); } to { transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: no-preference) {
  #groups:not(.settled) .item { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .done-mark circle, .done-mark path { stroke-dashoffset: 0; }
}
