/* The guest ordering page. Phone first; on a laptop it sits in a centred column. */
body { background: var(--mist); font-size: 17px; padding-bottom: 96px; }
[hidden] { display: none !important; }

.bar { background: var(--khaddar); color: var(--paper); padding: 14px 0 12px; }
.bar-in, #app { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.bar h1 { font-size: 28px; color: var(--paper); }
.place { display: inline-block; margin-top: 6px; background: var(--pat); color: var(--ink); font-weight: 700; border-radius: 999px; padding: 2px 14px; font-size: 16px; }
.modes { display: inline-flex; margin-top: 8px; background: var(--khaddar-deep); border-radius: 999px; padding: 3px; }
.modes button { font: 600 16px/1 var(--body); color: #F3DCE2; background: none; border: 0; border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.modes button[aria-selected="true"] { background: var(--pat); color: var(--ink); }

/* Search and sections */
.tools { position: sticky; top: 0; z-index: 5; background: var(--mist); padding: 12px 0 4px; }
input, textarea { width: 100%; font: 400 17px/1.4 var(--body); color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 14px; }
input:focus, textarea:focus { border-color: var(--khaddar); outline: none; box-shadow: 0 0 0 3px rgba(123,30,43,.15); }
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 8px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { flex: none; text-decoration: none; font-size: 15px; font-weight: 600; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; color: var(--ink-soft); }
.cats a.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.cat h2 { font-size: 26px; color: var(--khaddar); margin: 22px 0 6px; scroll-margin-top: 120px; }
.item { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; background: var(--paper); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.item.noimg { grid-template-columns: minmax(0, 1fr); }
.item img { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 2px var(--pat); background: var(--mist); }
.item h3 { font: 600 17px/1.3 var(--body); margin: 2px 0 4px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; }
.opt + .opt { border-top: 1px dashed var(--line); }
.opt span { color: var(--ink-soft); }
.opt span b { color: var(--ink); font-weight: 700; }

/* Add / quantity control */
.add { font: 700 15px/1 var(--body); color: var(--khaddar); background: var(--paper); border: 1.5px solid var(--khaddar); border-radius: 999px; min-width: 84px; height: 36px; cursor: pointer; }
.add:hover { background: #FBEFF2; }
.qty { display: inline-flex; align-items: center; background: var(--khaddar); color: var(--paper); border-radius: 999px; height: 36px; min-width: 104px; justify-content: space-between; }
.qty button { width: 36px; height: 36px; border: 0; background: none; color: inherit; font: 700 20px/1 var(--body); cursor: pointer; border-radius: 999px; }
.qty b { min-width: 24px; text-align: center; }

.empty, .fatal { text-align: center; color: var(--ink-soft); padding: 40px 0; }
.fatal { color: var(--khaddar); font-weight: 600; }

/* Cart bar */
.cartbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); width: min(688px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 0 20px; height: 56px; border: 0; border-radius: 14px; background: var(--ink); color: var(--paper); font: 600 17px/1 var(--body); cursor: pointer; box-shadow: 0 6px 20px rgba(36,27,47,.3); }
.cartbar b { margin-right: auto; }
.cartbar span:last-child { color: var(--pat); }

/* Cart and checkout */
#v-cart h2, #v-status h2 { font-size: 32px; color: var(--khaddar); margin: 8px 0 12px; }
#v-cart h3 { font: 700 18px/1.3 var(--body); margin: 28px 0 8px; }
.back { background: none; border: 0; font: 600 16px/1 var(--body); color: var(--khaddar); padding: 16px 0 4px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; background: var(--paper); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.line small { display: block; color: var(--ink-soft); font-size: 15px; }
.sum { display: flex; justify-content: space-between; font-size: 20px; padding: 10px 2px 0; border-top: 2px solid var(--ink); margin-top: 12px; }
.hint { color: var(--ink-soft); font-size: 15px; margin: 6px 0 0; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }
.row .btn { flex: none; min-height: 46px; }
label { display: block; font-weight: 700; margin: 22px 0 6px; }
#b-loc { margin-top: 10px; min-height: 42px; }
#b-loc.done { border-color: #2E7D4F; color: #2E7D4F; }
.who { display: flex; align-items: center; justify-content: space-between; background: var(--paper); border-radius: 12px; padding: 10px 14px; }
.who button { background: none; border: 0; color: var(--khaddar); font: 600 15px/1 var(--body); text-decoration: underline; cursor: pointer; }
.err { background: #FBE7EB; color: var(--khaddar); border-radius: 10px; padding: 10px 14px; font-weight: 600; margin: 16px 0 0; max-width: none; }
.btn.wide { width: 100%; margin-top: 20px; min-height: 54px; font-size: 18px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Status */
#v-status { text-align: center; padding-top: 24px; }
#v-status p { margin: 0 auto 16px; }
.st-art { width: 96px; height: 96px; margin: 12px auto 20px; border-radius: 12px; background: url(../assets/phulkari.svg) center / 48px 48px; box-shadow: 0 0 0 6px var(--paper), 0 0 0 8px var(--pat); }
.st-art.wait { animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.9); } }
@media (prefers-reduced-motion: reduce) { .st-art.wait { animation: none; } }
.st-art.bad { filter: grayscale(1); opacity: .6; }
.st-lines { text-align: left; background: var(--paper); border-radius: 12px; padding: 8px 14px; margin: 8px 0 20px; }
.st-lines div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.st-lines div + div { border-top: 1px dashed var(--line); }
.st-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.st-big { display: block; margin: 4px 0 10px; color: var(--ink); font-size: 15px; }
.st-big b { display: block; font: 400 clamp(22px, 7vw, 30px)/1.15 var(--display); white-space: nowrap; }

/* ---- v3: size picker, item notes, delivery minimum, progress ---- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loading { text-align: center; color: var(--ink-soft); padding: 48px 0; }
.center { text-align: center; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--pat); outline-offset: 2px; }

/* "Choose" opens the size picker; once something is picked it reads "2 added". */
.add.choose.has { background: var(--khaddar); color: var(--paper); }

/* The size picker: a sheet that rises from the bottom on a phone. */
dialog.pick { border: 0; padding: 0; margin: auto auto 0; width: min(720px, 100%); max-height: 86vh; border-radius: 20px 20px 0 0; background: var(--paper); color: var(--ink); box-shadow: 0 -10px 40px rgba(36,27,47,.25); }
dialog.pick::backdrop { background: rgba(27,22,38,.55); }
dialog.pick[open] { animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { dialog.pick[open] { animation: none; } }
dialog.pick form { padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
dialog.pick form::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: -6px auto 14px; }
.pick-head { display: flex; align-items: center; gap: 14px; }
.pick-head img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--pat); }
.pick-head h2 { font-size: 26px; color: var(--khaddar); line-height: 1.15; }
#pick-opts .opt { min-height: 52px; }
@media (min-width: 760px) { dialog.pick { margin: auto; border-radius: 20px; } }

/* Cart */
.for { color: var(--ink-soft); margin: -6px 0 14px; }
.line { grid-template-areas: "name ctl" "note note"; }
.line > div:first-child { grid-area: name; }
.line > .lnote { grid-area: note; }
.lnote button { background: none; border: 0; padding: 4px 0 0; color: var(--khaddar); font: 600 15px/1.3 var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.lnote input { margin-top: 6px; padding: 8px 12px; font-size: 16px; }
.minbar { background: #FFF4DC; border-left: 4px solid var(--pat); border-radius: 8px; padding: 8px 12px; margin: 10px 0 0; font-weight: 600; }
.step { margin-top: 6px; }
.hint.good { color: #2E7D4F; font-weight: 600; }
.hint.warn { color: var(--khaddar); font-weight: 600; }

/* The code: one wide box, big digits, spaced like the SMS shows them. */
.code { display: flex; gap: 8px; margin-top: 10px; }
.code input { flex: 1; font: 700 26px/1 var(--body); letter-spacing: .45em; text-align: center; padding: 12px 8px; }
.code .btn { flex: none; min-height: 52px; }

/* Cart bar: the item count sits in a small gold disc. */
.cb-n { background: var(--pat); color: var(--ink); border-radius: 999px; padding: 4px 10px; font-size: 15px; }

/* Progress on the status screen */
.steps { list-style: none; display: flex; justify-content: center; gap: 0; padding: 0; margin: 4px auto 18px; max-width: 420px; counter-reset: s; }
.steps li { flex: 1; position: relative; padding-top: 34px; font-size: 15px; color: var(--ink-soft); counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line); font: 700 14px/22px var(--body); color: var(--ink-soft); z-index: 1; }
.steps li + li::after { content: ''; position: absolute; top: 12px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.steps li.done { color: var(--ink); font-weight: 600; }
.steps li.done::before { content: '✓'; background: #2E7D4F; border-color: #2E7D4F; color: #fff; }
.steps li.done + li.done::after { background: #2E7D4F; }
.steps li.now::before { border-color: var(--pat); color: var(--ink); animation: ping 1.6s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(233,169,42,.6); } 100% { box-shadow: 0 0 0 10px rgba(233,169,42,0); } }
@media (prefers-reduced-motion: reduce) { .steps li.now::before { animation: none; } }
/* The stepper sits inside a price row whose text is grey; keep it white on red. */
.opt .qty, .opt .qty b, .line .qty, .line .qty b { color: var(--paper); }
.st-lines small { display: block; color: var(--khaddar); font-size: 14px; }

/* ---- v4: not taking orders (POS off or paused). The menu stays readable; nothing can be added. ---- */
.shut { background: var(--ink); color: var(--paper); border-radius: 14px; padding: 16px 18px; margin: 14px 0 2px; }
.shut b { display: flex; align-items: center; gap: 10px; font: 400 22px/1.2 var(--display); }
.shut b::before { content: ''; flex: none; width: 10px; height: 10px; border-radius: 50%; background: #E0566F; box-shadow: 0 0 0 4px rgba(224,86,111,.25); }
.shut p { margin: 6px 0 0; color: #E4DCE9; }
.shut .btn { margin-top: 12px; min-height: 44px; }
.shut small { display: block; margin-top: 10px; color: #B9AEC4; font-size: 14px; }
body.shut-on [data-v], body.shut-on .add.choose { display: none; }
body.shut-on .item { opacity: .85; }
