:root {
  --navy: #1b2a41; --navy2: #24385a; --gold: #f4b942; --red: #c62828; --green: #1a8f3c;
  --bg: #f1f3f6; --card: #fff; --text: #1d2330; --muted: #6b7280; --line: #e5e7eb;
  --radius: 10px; --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: hidden; font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.bar { display: flex; align-items: center; gap: 12px; max-width: 1280px; margin: auto; padding: 10px 14px; }
.logo { color: #fff; text-decoration: none; font-weight: 800; font-size: 20px; white-space: nowrap; letter-spacing: .3px; }
.logo span { background: var(--gold); color: var(--navy); padding: 2px 7px; border-radius: 6px; margin-right: 2px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: #fff; color: var(--muted); border-radius: 8px; padding: 0 12px; min-width: 0; }
.search input { border: 0; outline: 0; padding: 10px 0; width: 100%; color: var(--text); background: transparent; }
.cart-btn { display: flex; align-items: center; gap: 6px; background: transparent; border: 0; color: #fff; cursor: pointer; position: relative; padding: 6px; }
.cart-btn b { background: var(--gold); color: var(--navy); border-radius: 999px; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: 12px; padding: 0 6px; }
.cats { display: flex; gap: 8px; overflow-x: auto; max-width: 1280px; margin: auto; padding: 0 14px 10px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats button { flex: none; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13.5px; }
.cats button.on { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 700; }

.hero { background: linear-gradient(90deg, var(--gold), #ffd36e); color: var(--navy); text-align: center; padding: 14px; }
.hero h1 { margin: 0; font-size: 22px; }
.hero p { margin: 2px 0 0; font-weight: 600; font-size: 13.5px; }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; max-width: 1280px; margin: 16px auto 90px; padding: 0 14px; }
.sec { grid-column: 1 / -1; margin: 10px 0 -4px; font-size: 18px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; transition: transform .15s; }
.card:hover { transform: translateY(-2px); }
.pic { aspect-ratio: 1; background: #fff; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.pic img { width: 100%; height: 100%; max-width: 100%; object-fit: contain; }
.ph { width: 100%; height: 100%; background: #f6f7f9; }
.info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.name { font-weight: 600; font-size: 14.5px; min-height: 2.8em; }
.pack { color: var(--muted); font-size: 12.5px; }
.price { font-size: 19px; font-weight: 800; margin-top: auto; }
.btn { border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; font-weight: 700; }
.btn.primary { background: var(--gold); color: var(--navy); }
.btn.primary:hover { filter: brightness(.96); }
.btn.primary:disabled { opacity: .6; cursor: wait; }
.btn.block { width: 100%; padding: 13px; font-size: 16px; }
.add { width: 100%; margin-top: 6px; }
.qty { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; border: 2px solid var(--gold); border-radius: 8px; overflow: hidden; }
.qty button { border: 0; background: var(--gold); color: var(--navy); width: 40px; height: 36px; font-size: 20px; font-weight: 800; cursor: pointer; }
.qty b { flex: 1; text-align: center; }
.empty { text-align: center; color: var(--muted); }

/* Sticky bar */
.sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--navy); color: #fff; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 10px rgba(0,0,0,.2); }
.sticky b { font-size: 18px; display: block; }
.sticky small { opacity: .8; }

/* Drawer / modal */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: .2s; z-index: 30; }
.backdrop.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: #fff; z-index: 40; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s; }
.drawer.on { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 18px; }
.x { border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 16px; }
.drawer-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: 8px; }
.row { display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line .thumb { width: 56px; height: 56px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.line .thumb img, .line .thumb .ph { width: 100%; height: 100%; object-fit: contain; font-size: 10px; padding: 2px; }
.line .nm { font-weight: 600; font-size: 14px; }
.line .sub { color: var(--muted); font-size: 12.5px; }
.line .qty { margin: 4px 0 0; width: 120px; }
.line .qty button { height: 28px; width: 32px; font-size: 16px; }
.line .amt { font-weight: 700; text-align: right; }

.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: end center; pointer-events: none; }
.modal .sheet { pointer-events: auto; background: #fff; width: min(520px, 100%); max-height: 94dvh; display: flex; flex-direction: column;
  border-radius: 16px 16px 0 0; transform: translateY(105%); transition: transform .25s; }
.modal.on .sheet { transform: none; }
@media (min-width: 700px) { .modal { place-items: center; } .modal .sheet { border-radius: 16px; } }
.form-body { overflow-y: auto; padding: 12px 16px; display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 13.5px; }
input, textarea { border: 1px solid #cfd4dc; border-radius: 8px; padding: 10px 12px; font-weight: 400; font-size: 16px; width: 100%; background: #fff; }
input:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.phone { display: flex; }
.phone span { border: 1px solid #cfd4dc; border-right: 0; border-radius: 8px 0 0 8px; padding: 10px; background: #f6f7f9; font-weight: 400; }
.phone input { border-radius: 0 8px 8px 0; }
.btn.loc { display: flex; align-items: center; justify-content: center; gap: 8px; background: #e8f0fe; color: #1a56c4; }
.loc-status { margin: -6px 0 0; font-size: 13px; color: var(--muted); min-height: 0; }
.loc-status.ok { color: var(--green); }
.loc-status.bad { color: var(--red); }
.summary { background: #f8f9fb; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; }
.summary .row { font-size: 15px; margin-top: 6px; }
.err { color: var(--red); margin: 0; font-weight: 600; min-height: 0; }
.err:empty, .loc-status:empty { display: none; }
.hp { position: absolute; left: -9999px; }
.muted { color: var(--muted); text-align: center; }
.center { text-align: center; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); align-items: center; gap: 4px; }
.center h2 { margin: 8px 0 0; }
.tick { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; font-size: 36px; display: grid; place-items: center; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 20px 14px 90px; }

@media (max-width: 600px) {
  .bar { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
  .logo { flex: 1; }
  .cart-btn span { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 10px; }
  .name { font-size: 13.5px; }
  .price { font-size: 17px; }
}

/* UPI payment */
.pay { display: grid; gap: 10px; width: 100%; overflow-y: auto; }
.pay h2 { margin: 0; }
.pay p { margin: 0; }
.amount { font-size: 34px; font-weight: 800; color: var(--navy); }
.upi-btn { text-decoration: none; display: block; text-align: center; background: var(--green); color: #fff; }
.qrbox { display: flex; align-items: center; justify-content: center; gap: 14px; text-align: left; border: 1px dashed var(--line); border-radius: 10px; padding: 10px; }
.qrbox svg, .qrbox img { width: 140px; height: 140px; display: block; }
.utr { display: grid; gap: 8px; text-align: left; border-top: 1px solid var(--line); padding-top: 12px; }
#thanksStep { display: grid; justify-items: center; gap: 6px; }
#thanksStep[hidden] { display: none; }
.qrbox svg { width: 150px; height: 150px; }
.manual { background: #fff8e6; border: 1px solid #f4d58d; border-radius: 10px; padding: 10px 12px; text-align: left; font-size: 13.5px; }
.upirow { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.upirow code { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px; font-size: 14px; word-break: break-all; }
.upirow .btn { background: var(--navy); color: #fff; padding: 8px 12px; white-space: nowrap; }
