:root {
  --bg: #ffffff;
  --soft: #f4f4f8;
  --card: #ffffff;
  --ink: #1f2333;
  --muted: #747887;
  --line: #e9e9f0;
  --brand: #fc8019;
  --brand-dark: #e56f0c;
  --brand-soft: #fff1e4;
  --ok: #1ba672;
  --ok-dark: #14875c;
  --ok-soft: #e6f7ef;
  --warn: #c98200;
  --warn-soft: #fff4d9;
  --bad: #d0312d;
  --bad-soft: #fdeaea;
  --shadow: 0 2px 12px rgba(31, 35, 51, 0.08);
  --shadow-lg: 0 8px 24px rgba(31, 35, 51, 0.14);
  --radius: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  background: var(--soft);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
.hidden { display: none !important; }
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: 150px; background: var(--bg); }
.app.wide { max-width: 980px; background: transparent; }
.hscroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hscroll::-webkit-scrollbar { display: none; }

/* ---------- customer header ---------- */
.chead { padding: 14px 16px 6px; display: flex; align-items: center; gap: 12px; }
.chead .loc { flex: 1; min-width: 0; }
.chead h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.2px; display: flex; align-items: center; gap: 6px; }
.chead h1 .pin { color: var(--brand); font-size: 20px; }
.chead p { margin: 1px 0 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #fff;
  font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.searchwrap { position: sticky; top: 0; z-index: 15; background: var(--bg); padding: 8px 16px 10px; }
.search {
  display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 14px; padding: 0 14px; height: 48px;
}
.search input[type=text] { flex: 1; border: 0; border-radius: 0; background: none; outline: none; padding: 0; min-width: 0; height: 100%; font-size: 15.5px; }
.search input::placeholder { color: var(--muted); }
.search .clear { color: var(--muted); font-size: 18px; width: 30px; height: 30px; }
.openline { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: var(--ok); }
.openline.closed { color: var(--bad); }
.openline i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- photos ---------- */
.ph {
  position: relative; overflow: hidden; background: linear-gradient(135deg, #ffe2c4, #ffd0a6);
  display: flex; align-items: center; justify-content: center;
}
.ph .emo { font-size: 38px; opacity: 0.85; }
.ph img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.off .ph img { filter: grayscale(1); opacity: 0.7; }

/* ---------- hero slider ---------- */
.hero { gap: 12px; padding: 6px 16px 4px; scroll-padding-left: 16px; }
.slide {
  flex: none; width: 86%; height: 176px; border-radius: 22px; scroll-snap-align: start; position: relative;
  overflow: hidden; color: #fff; text-align: left; box-shadow: var(--shadow);
}
.slide .ph { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.slide::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(90deg, rgba(15, 12, 8, 0.86) 0%, rgba(15, 12, 8, 0.55) 45%, rgba(15, 12, 8, 0.05) 80%); }
.slide .txt { position: absolute; z-index: 1; left: 18px; top: 0; bottom: 0; width: 62%; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.slide .tag { align-self: flex-start; background: var(--brand); font-size: 10.5px; font-weight: 800; letter-spacing: 0.8px; padding: 3px 8px; border-radius: 6px; }
.slide b { font-size: 22px; line-height: 1.15; font-weight: 800; }
.slide .sub { font-size: 13px; opacity: 0.9; }
.slide .cta { align-self: flex-start; margin-top: 6px; background: #fff; color: var(--ink); font-weight: 800; font-size: 13px; padding: 7px 14px; border-radius: 999px; }
.dots { display: flex; justify-content: center; gap: 5px; padding: 10px 0 2px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: #d6d7df; transition: 0.25s; }
.dots i.on { width: 18px; background: var(--brand); }

/* ---------- sections ---------- */
.sec-title { font-size: 19px; font-weight: 800; letter-spacing: -0.2px; margin: 0; padding: 18px 16px 10px; }
.cats { gap: 14px; padding: 0 16px 6px; scroll-snap-type: none; }
.cat { flex: none; width: 78px; text-align: center; font-size: 13px; font-weight: 700; color: var(--ink); }
.cat .ph { width: 78px; height: 78px; border-radius: 50%; margin-bottom: 6px; box-shadow: var(--shadow); }
.cat .ph .emo { font-size: 30px; }
.best { gap: 12px; padding: 0 16px 16px; scroll-padding-left: 16px; }
.bcard { flex: none; width: 152px; scroll-snap-align: start; text-align: left; }
.bcard .ph { width: 152px; height: 128px; border-radius: 18px; cursor: pointer; }
.bcard .nm { font-weight: 700; font-size: 14.5px; margin-top: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.bcard .nm span:last-child { overflow: hidden; text-overflow: ellipsis; }
.bcard .pr { font-weight: 700; font-size: 14px; color: var(--muted); }
.picwrap { position: relative; flex: none; }
.picwrap .stepbox { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); }
.thick { height: 10px; background: var(--soft); }

/* ---------- menu filter bar ---------- */
.filterbar { position: sticky; top: 66px; z-index: 14; background: var(--bg); border-bottom: 1px solid var(--line); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line);
  font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.vegchip.on { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-dark); }

/* ---------- menu rows ---------- */
.catsec { scroll-margin-top: 124px; }
.cat-h { font-size: 18px; font-weight: 800; padding: 18px 16px 2px; margin: 0; }
.cat-h small { color: var(--muted); font-weight: 600; font-size: 14px; }
.row { display: flex; gap: 14px; padding: 18px 16px 26px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.catsec .row:last-child { border-bottom: 0; }
.row .info { flex: 1; min-width: 0; cursor: pointer; }
.row .tags { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.bestag { color: var(--brand-dark); font-size: 12px; font-weight: 800; }
.row .name { font-weight: 700; font-size: 17px; line-height: 1.25; }
.row .price { font-weight: 700; font-size: 15.5px; margin-top: 3px; }
.row .desc { color: var(--muted); font-size: 13.5px; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .ph { width: 132px; height: 122px; border-radius: 16px; cursor: pointer; }
.row.off .name, .row.off .price { color: var(--muted); }
.na { background: #fff; color: var(--muted); font-size: 12px; font-weight: 700; padding: 8px 10px; border-radius: 10px; box-shadow: var(--shadow); white-space: nowrap; display: block; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .big { font-size: 44px; display: block; margin-bottom: 6px; }

.veg { flex: none; width: 15px; height: 15px; border: 1.6px solid var(--ok); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; background: #fff; }
.veg::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.veg.non { border-color: var(--bad); }
.veg.non::after { background: var(--bad); }

/* ADD button / stepper (Swiggy style: white button, green text) */
.stepbox { display: block; }
.addbtn, .stepper {
  width: 104px; height: 40px; border-radius: 11px; background: #fff; color: var(--ok); font-weight: 800; font-size: 15.5px;
  box-shadow: 0 3px 10px rgba(31, 35, 51, 0.16); border: 1px solid #e3e4ea; display: flex; align-items: center; justify-content: center;
}
.addbtn:active { background: var(--ok-soft); }
.stepper { justify-content: space-between; overflow: hidden; }
.stepper button { width: 36px; height: 100%; color: var(--ok); font-size: 22px; font-weight: 700; line-height: 1; }
.stepper button:active { background: var(--ok-soft); }
.stepper span { min-width: 20px; text-align: center; }
.stepbox.pop .stepper, .stepbox.pop .addbtn { animation: pop 0.18s ease-out; }
@keyframes pop { 50% { transform: scale(1.08); } }

/* ---------- cart bar + bottom nav ---------- */
.cartbar { position: fixed; left: 0; right: 0; bottom: 74px; z-index: 20; padding: 0 12px; max-width: 560px; margin: 0 auto; animation: rise 0.22s ease-out; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } }
.cartbar button {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: var(--ok); color: #fff; padding: 14px 18px; border-radius: 16px; font-weight: 800; font-size: 15.5px;
  box-shadow: 0 8px 22px rgba(27, 166, 114, 0.4);
}
.cartbar small { display: block; font-weight: 600; opacity: 0.9; font-size: 12px; text-align: left; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
  display: flex; max-width: 560px; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom);
}
.nav button { flex: 1; padding: 9px 4px 11px; font-size: 11.5px; font-weight: 700; color: var(--muted); position: relative; }
.nav button svg { display: block; margin: 0 auto 2px; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav button.on { color: var(--brand); }
.badge {
  position: absolute; top: 4px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; line-height: 18px;
}

/* ---------- generic ---------- */
.pad { padding: 16px; }
.page { background: var(--soft); min-height: calc(100vh - 150px); }
.page-h { font-size: 22px; font-weight: 800; margin: 0; padding: 18px 16px 4px; background: var(--bg); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
h2 { font-size: 18px; margin: 18px 0 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 14px;
  background: var(--brand); color: #fff; font-weight: 800; text-decoration: none;
}
.btn:active { background: var(--brand-dark); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--brand-soft); color: var(--brand-dark); }
.btn.ok { background: var(--ok); }
.btn.ok:active { background: var(--ok-dark); }
.btn.bad { background: var(--bad-soft); color: var(--bad); }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: 14px; border-radius: 11px; }
.btn:disabled { opacity: 0.5; }
label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 12px 0 4px; }
input[type=text], input[type=tel], input[type=number], input[type=password], textarea, select {
  width: 100%; padding: 13px; border: 1.5px solid var(--line); border-radius: 13px; background: #fff; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); }
textarea { resize: vertical; min-height: 60px; }

/* ---------- sheets ---------- */
.overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; background: rgba(20, 22, 32, 0.55); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.18s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  background: var(--soft); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: up 0.24s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0.6; } }
.sheet h3 { margin: 0 0 14px; font-size: 20px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; }
.x { width: 36px; height: 36px; border-radius: 50%; background: #fff; font-size: 16px; box-shadow: var(--shadow); flex: none; }
.line { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; }
.total { border-top: 1.5px dashed var(--line); margin-top: 8px; padding-top: 10px; font-weight: 800; font-size: 18px; }
.citem { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.citem:last-child { border-bottom: 0; }
.citem .ph { width: 52px; height: 52px; border-radius: 12px; flex: none; }
.citem .ph .emo { font-size: 22px; }
.citem .info { flex: 1; min-width: 0; }
.citem .name { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.citem .stepper, .citem .addbtn { width: 92px; height: 36px; box-shadow: none; }
/* item detail sheet */
.sheet.detail { padding: 0 0 calc(18px + env(safe-area-inset-bottom)); background: #fff; }
.detail .ph { width: 100%; height: 300px; max-height: 46vh; }
.detail .ph .emo { font-size: 80px; }
.detail .x { position: absolute; right: 14px; top: 14px; z-index: 2; }
.detail .body { padding: 16px; }
.detail .dn { font-size: 22px; font-weight: 800; margin: 6px 0 2px; }
.detail .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.detail .foot .pr { font-size: 22px; font-weight: 800; }
.detail .stepper, .detail .addbtn { width: 128px; height: 48px; font-size: 17px; }
.rel { position: relative; }

/* ---------- orders ---------- */
.status { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; }
.status.pending { background: var(--warn-soft); color: var(--warn); }
.status.accepted { background: #e6eeff; color: #2457c5; }
.status.ready { background: var(--ok-soft); color: var(--ok-dark); }
.status.completed { background: #ececf1; color: #5b5e6b; }
.status.cancelled { background: var(--bad-soft); color: var(--bad); }
.steps { display: flex; margin: 16px 0 8px; }
.step { flex: 1; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); position: relative; }
.step::before { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--line); margin: 0 auto 6px; position: relative; z-index: 1; }
.step::after { content: ""; position: absolute; top: 8px; left: -50%; width: 100%; height: 3px; background: var(--line); }
.step:first-child::after { display: none; }
.step.done { color: var(--ink); }
.step.done::before, .step.done::after { background: var(--ok); }
.thumbs { display: flex; margin: 10px 0 2px; }
.thumbs .ph { width: 44px; height: 44px; border-radius: 12px; border: 2px solid #fff; margin-right: -8px; flex: none; }
.thumbs .ph .emo { font-size: 18px; }
.code { font-size: 28px; font-weight: 800; letter-spacing: 7px; }
.ready-box { background: var(--ok-soft); border: 1.5px solid #bfe8d4; border-radius: 16px; padding: 14px; margin-top: 12px; }
.partners { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.partner { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line); font-weight: 800; text-align: left; }
.partner:active { border-color: var(--brand); }
.partner .logo { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; flex: none; }
.addr { background: #fff; border: 1.5px dashed #cfd0da; border-radius: 12px; padding: 10px; margin-top: 8px; font-size: 14px; }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.actions .btn { flex: 1; }
.rider { background: #e6eeff; color: #2457c5; border-radius: 10px; padding: 8px 10px; font-weight: 700; font-size: 14px; margin-top: 10px; }

/* ---------- toast ---------- */
.toasts { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; max-width: 520px; width: 100%; box-shadow: var(--shadow-lg); font-weight: 600; animation: drop 0.25s ease-out; }
.toast.good { background: var(--ok); }
.toast.err { background: var(--bad); }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }

/* ---------- owner panel ---------- */
.top { background: linear-gradient(135deg, #fd9a3e, #f26a0c); color: #fff; padding: 18px 16px 22px; border-radius: 0 0 24px 24px; }
.top h1 { margin: 0; font-size: 22px; }
.top p { margin: 2px 0 0; opacity: 0.92; font-size: 14px; }
.top .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0; border: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, 0.24); color: #fff; white-space: nowrap; }
.pill.closed { background: #47281a; }
.tabs { display: flex; gap: 8px; padding: 12px 16px 0; overflow-x: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.grid .card { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 22px; }
.order.pending { border: 2px solid var(--warn); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(201, 130, 0, 0.18); } }
.item { display: flex; align-items: center; gap: 12px; }
.item .info { flex: 1; min-width: 0; }
.item .name { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.item .price { font-weight: 700; margin-top: 2px; }
.item .ph { width: 64px; height: 64px; border-radius: 14px; flex: none; }
.item .ph .emo { font-size: 26px; }
.switch { position: relative; width: 50px; height: 28px; flex: none; display: block; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; z-index: 2; cursor: pointer; }
.switch i { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #cfd0da; border-radius: 14px; transition: 0.2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: 0.2s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { left: 25px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-edit { display: flex; align-items: center; gap: 12px; }
.photo-edit .ph { width: 96px; height: 88px; border-radius: 14px; flex: none; }
.checkline { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; font-size: 15px; color: var(--ink); cursor: pointer; }
.checkline input { width: 20px; height: 20px; accent-color: var(--brand); }
