/* Tap Dine customer pages. Brand: green #1F4D3A, orange #E8692A, cream #FBF8F2. The restaurant's theme overrides
   --primary, --accent and --bg. Logical properties keep right-to-left languages working. */
:root {
  --primary: #1F4D3A;
  --accent: #E8692A;
  --bg: #FBF8F2;
  --card: #FFFFFF;
  --ink: #1F2A24;
  --muted: #66756D;
  --line: #E6E0D3;
  --ok: #067647;
  --warn: #B54708;
  --bad: #B42318;
  --radius: 14px;
  color-scheme: light;
}
html.dark { --bg: #141A17; --card: #1D2521; --ink: #EEF2EF; --muted: #9AA8A0; --line: #2C3732; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.45 "Hind Siliguri", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
a { color: var(--primary); }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
h3 { font-size: 1rem; margin: 0; }
hr { border: 0; border-top: 1px dashed var(--line); margin: .75rem 0; }
.app { max-width: 720px; margin: 0 auto; min-height: 100vh; }
.page { padding: 12px 16px 24px; }
.page.with-nav { padding-bottom: 96px; }
.center-page { display: flex; align-items: center; justify-content: center; min-height: 70vh; }
.center { text-align: center; display: flex; justify-content: center; padding: 24px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.error { color: var(--bad); }
.hint { color: var(--muted); font-size: .8rem; }
.notice { background: #FFFAEB; color: var(--warn); border: 1px solid #FEDF89; border-radius: 10px; padding: 10px 12px; margin: 12px 16px; }

/* Header */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--primary); color: #fff; padding-top: max(10px, env(safe-area-inset-top)); }
.top .logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: #fff; flex-shrink: 0; }
.top .logo.mark { display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 1.2rem; }
.top-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-text .muted { color: #CFE3D8; font-size: .85rem; }
.cover { width: 100%; max-height: 180px; object-fit: cover; border-radius: var(--radius); margin-bottom: 12px; }

/* Cards and controls */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 12px 18px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 46px; }
.button.secondary { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.button.small { min-height: 34px; padding: 6px 12px; font-size: .875rem; }
.button.wide { width: 100%; margin-top: 10px; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.icon-button { border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; color: inherit; padding: 6px; }
.link { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
label { display: block; font-size: .875rem; color: var(--muted); margin: 10px 0 4px; }
label.check, label.option { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 1rem; margin: 8px 0; }
input, textarea, select { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--primary); flex-shrink: 0; }
input:focus, textarea:focus, button:focus-visible, .item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search { margin: 4px 0 10px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.lang { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.35); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0; }
.row-between.total { font-size: 1.1rem; margin-top: 10px; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.segmented button { border: 0; background: var(--card); color: var(--ink); padding: 8px 10px; font: inherit; font-size: .85rem; cursor: pointer; }
.segmented button.on { background: var(--primary); color: #fff; }

/* Menu */
.items { display: grid; gap: 10px; }
.item { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; cursor: pointer; }
.item.off { opacity: .55; cursor: default; }
.item-photo { width: 92px; height: 92px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #F1ECE1; }
.item-photo.none { display: grid; place-items: center; font-size: 2rem; }
.item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.item-text p { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.add { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1.3rem; font-weight: 700; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: #EEF5F1; color: var(--primary); }
.tag.hot { background: #FEF3F2; }
.status-chip { font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: #EEF5F1; color: var(--primary); white-space: nowrap; }
.status-chip.off, .status-chip.s-Rejected, .status-chip.s-Cancelled { background: #FEF3F2; color: var(--bad); }
.status-chip.s-Placed { background: #FFFAEB; color: var(--warn); }
.status-chip.s-Ready { background: var(--accent); color: #fff; }

/* Sheet */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.overlay.open { opacity: 1; }
.sheet { background: var(--bg); width: 100%; max-width: 720px; max-height: 90vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
  transform: translateY(30px); transition: transform .2s; padding-bottom: env(safe-area-inset-bottom); }
.overlay.open .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.sheet-head h2 { margin: 0; }
.sheet-body { overflow-y: auto; padding: 0 16px 16px; }
.sheet-photo { width: 100%; max-height: 240px; object-fit: cover; border-radius: var(--radius); }
fieldset.group { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; margin: 10px 0; }
fieldset.group legend { padding: 0 6px; font-weight: 600; }
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--card); }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #F1ECE1; color: var(--ink); font-size: 1.2rem; cursor: pointer; }
.step-value { min-width: 26px; text-align: center; font-weight: 600; }

/* Cart, orders, bill */
.line { display: flex; gap: 10px; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line.off { opacity: .6; }
.line-text { flex: 1; min-width: 0; }
.line-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
h2.section { margin: 16px 0 8px; }
.order-items { margin: 8px 0; padding-inline-start: 18px; }
.progress { display: flex; gap: 4px; list-style: none; padding: 0; margin: 10px 0; }
.progress li { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.progress li.done { background: var(--primary); }
.request-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 8px; }
.checkout { text-align: center; }
.qr { width: 220px; height: 220px; max-width: 100%; background: #fff; padding: 8px; border-radius: 12px; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; letter-spacing: 2px; word-break: break-all; }
.account { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.empty { text-align: center; padding: 40px 12px; }
.big-icon { font-size: 3rem; }
.stars { display: inline-flex; gap: 4px; }
.stars button { border: 0; background: none; font-size: 1.8rem; color: var(--line); cursor: pointer; padding: 0 2px; }
.stars button.on { color: #F5B301; }
.stars.static { color: #F5B301; font-size: 1.6rem; }

/* Bottom navigation */
.bottom-nav { position: fixed; bottom: 0; inset-inline: 0; z-index: 6; display: flex; justify-content: center; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav .tab { flex: 1; max-width: 180px; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 0;
  background: none; color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer; }
.bottom-nav .tab.on { color: var(--primary); font-weight: 600; }
.tab-icon { font-size: 1.3rem; }
.badge { position: absolute; top: 4px; inset-inline-start: calc(50% + 8px); background: var(--accent); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 6px; min-width: 18px; }

/* Toast and spinner */
.toast { position: fixed; inset-inline: 16px; bottom: 90px; z-index: 30; margin: 0 auto; max-width: 480px; background: #1F2A24; color: #fff; padding: 12px 16px;
  border-radius: 12px; opacity: 0; transform: translateY(10px); transition: all .2s; pointer-events: none; text-align: center; }
.toast.show { opacity: 1; transform: none; }
.toast.ok { background: var(--ok); } .toast.warn { background: var(--warn); } .toast.error { background: var(--bad); }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.powered { text-align: center; color: var(--muted); font-size: .75rem; padding: 16px; }
.join h1 { color: var(--primary); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  body { background: #fff; }
  .no-print, .top, .bottom-nav, .powered { display: none !important; }
  .card { border: 0; padding: 0; }
}
