:root { --red:#b71c1c; --navy:#1f3864; --gold:#ffc107; --bg:#fff8ec; --line:#ecdcc0; --text:#222; }
* { box-sizing: border-box; }
body { margin:0; font-family: Arial, "Noto Sans Tamil", sans-serif; background: var(--bg); color: var(--text); padding-bottom: 80px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.top { background: linear-gradient(90deg, var(--red), #e65100); color:#fff; padding: 18px 0; }
.top h1 { margin:0; font-size: 26px; }
.top p { margin: 6px 0 0; opacity:.9; font-size: 14px; }
.badge { background: var(--gold); color:#000; font-size: 13px; padding: 3px 8px; border-radius: 12px; vertical-align: middle; }

.cats { display:flex; gap:8px; overflow-x:auto; padding-top:12px; padding-bottom:12px; position: sticky; top:0; background: var(--bg); z-index: 5; border-bottom:1px solid var(--line); }
.cats a { white-space:nowrap; text-decoration:none; color: var(--navy); background:#fff; border:1px solid var(--line); padding:6px 12px; border-radius: 16px; font-size: 13px; }
.cats a:hover { background: var(--navy); color:#fff; }

.cat { margin-top: 22px; scroll-margin-top: 60px; }
.cat h2 { background: var(--navy); color:#fff; margin:0; padding: 10px 14px; border-radius: 8px 8px 0 0; font-size: 18px; }
.cat h2 small { color: var(--gold); font-weight: normal; margin-left: 8px; }

.table { background:#fff; border:1px solid var(--line); border-radius: 0 0 8px 8px; overflow:hidden; }
.row { display:grid; grid-template-columns: 44px 1fr 50px 90px 90px 80px 100px; align-items:center; gap:6px; padding: 8px 10px; border-top:1px solid var(--line); font-size: 14px; }
.row.head { background:#fdf0d8; font-weight:bold; border-top:0; font-size: 13px; }
.row.picked { background: #fff3cd; }
.row .name small { display:block; color:#777; font-size: 12px; }
.row .mrp { color:#888; }
.row .offer { color: var(--red); font-weight: bold; }
.row .amt { text-align:right; font-weight:bold; }
.row .qty input { width: 70px; padding: 6px; border:1px solid #ccc; border-radius: 6px; font-size: 15px; text-align:center; }

.checkout { margin-top: 28px; background:#fff; border:1px solid var(--line); border-radius: 8px; padding: 16px; scroll-margin-top: 60px; }
.checkout h2 { margin-top:0; color: var(--navy); }
.grid { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid label { display:flex; flex-direction:column; font-size: 13px; font-weight: bold; gap: 4px; }
.grid .full { grid-column: 1 / -1; }
.grid input, .grid textarea { padding: 9px; border:1px solid #ccc; border-radius: 6px; font: inherit; font-weight: normal; font-size: 15px; }

.bar { position: fixed; left:0; right:0; bottom:0; background: var(--navy); color:#fff; padding: 10px 0; z-index: 10; box-shadow: 0 -2px 8px rgba(0,0,0,.2); }
.bar-in { display:flex; justify-content: space-between; align-items:center; gap: 10px; flex-wrap: wrap; }
.bar s { opacity:.7; }
.bar .total { color: var(--gold); font-size: 20px; }
.bar-btns { display:flex; gap: 8px; }
button, .btn { background: var(--gold); color:#000; border:0; padding: 10px 18px; border-radius: 6px; font-weight: bold; font-size: 15px; cursor:pointer; text-decoration:none; display:inline-block; }
button.ghost { background: transparent; color:#fff; border:1px solid #fff; }
button:disabled { opacity:.6; }
.hp { position:absolute; left:-9999px; }

.done { padding-top: 24px; }
.done .summary .row { grid-template-columns: 1fr 60px 110px; }
.done .row.tot { font-weight: bold; background:#fff3e0; }
.err { color: var(--red); }
.warn { background:#fff3cd; padding: 10px; border-radius: 6px; }

@media (max-width: 700px) {
  .row { grid-template-columns: 30px 1fr 74px; grid-template-areas: "s n q" "s m a"; row-gap: 2px; }
  .row.head { display:none; }
  .row .sno { grid-area: s; color:#999; }
  .row .name { grid-area: n; }
  .row .unit { display:none; }
  .row .mrp { grid-area: m; font-size: 12px; }
  .row .offer { grid-area: m; margin-left: 70px; }
  .row .qty { grid-area: q; }
  .row .amt { grid-area: a; font-size: 13px; }
  .row .qty input { width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .top h1 { font-size: 21px; }
  .done .summary .row { grid-template-columns: 1fr 40px 90px; grid-template-areas: none; }
}

.order-head { display:flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.order-head > div { background:#fff; border:1px solid var(--line); border-radius: 8px; padding: 10px 14px; flex: 1 1 160px; }
.order-head small { display:block; color:#777; font-size: 12px; margin-bottom: 4px; }
.status { color:#fff; padding: 2px 10px; border-radius: 10px; font-size: 13px; }
.addr { background:#fff; border:1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; line-height: 1.5; }
.summary .row small { display:block; color:#777; font-size: 12px; }
.btn.ghost-dark { background:#fff; border:1px solid var(--navy); color: var(--navy); }
.track { max-width: 560px; }
.top-link { color:#fff; float:right; font-size: 14px; margin-top: 6px; }
@media print { .btn, .top p { display:none; } body { padding:0; background:#fff; } }

/* Combos */
.row.combo { background: #fffaf0; }
.row.combo .name { font-weight: bold; font-size: 15px; }
.free { display:inline-block; font-style: normal; background: #2e7d32; color:#fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-top: 4px; }
.contents { margin-top: 6px; font-weight: normal; }
.contents summary { cursor: pointer; color: var(--navy); font-size: 13px; text-decoration: underline; }
.contents ol { margin: 8px 0 4px; padding-left: 22px; columns: 2; column-gap: 24px; font-size: 13px; }
.contents li { break-inside: avoid; padding: 2px 0; }
.contents li span { margin-right: 6px; }
.contents li b { color: var(--red); }
.contents li.is-free { color: #2e7d32; font-weight: bold; }
.summary .combo-list { margin: 4px 0 0; padding-left: 18px; font-size: 12px; color: #555; columns: 2; }
@media (max-width: 700px) { .contents ol, .summary .combo-list { columns: 1; } }
.summary .combo-list li.is-free { color:#2e7d32; font-weight:bold; }

/* Shop selection */
body.no-bar { padding-bottom: 20px; }
.top-link + .top-link { margin-right: 14px; }
.shops { padding-top: 24px; display:grid; gap: 16px; }
.shop-card { display:flex; justify-content: space-between; align-items:center; gap: 16px; flex-wrap: wrap; background:#fff; border:1px solid var(--line);
  border-left: 6px solid var(--red); border-radius: 10px; padding: 18px 20px; text-decoration:none; color: var(--text); box-shadow: 0 2px 6px rgba(0,0,0,.05); }
.shop-card:hover { border-left-color: var(--gold); box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.shop-card h2 { margin: 0 0 4px; color: var(--navy); font-size: 22px; }
.shop-card p { margin: 3px 0; font-size: 14px; color:#555; }
.shop-card .ta { color: var(--red); font-weight: bold; }
.shop-card .go { text-align:right; font-size: 13px; color:#777; }
.shop-card .go b { display:block; margin-top: 6px; background: var(--gold); color:#000; padding: 10px 16px; border-radius: 6px; font-size: 15px; }
@media (max-width: 700px) { .shop-card .go { text-align:left; width: 100%; } }

/* One-shop cart lock */
.other-cart { background:#fff3cd; border:2px solid #ffb300; border-radius: 8px; padding: 12px 16px; margin-top: 14px; }
.other-cart p { margin: 6px 0; }
.other-cart .btn { margin-right: 6px; }
form.locked .row.item { opacity: .55; }
form.locked .qty input { background:#eee; cursor: not-allowed; }
.shop-card.has-cart { border-left-color: #2e7d32; }
.shop-card.locked { opacity: .7; }
.cart-note { display:block; font-style: normal; font-weight: bold; color:#2e7d32; margin-bottom: 4px; }
.shop-card.locked .cart-note { color: var(--red); }

/* Terms & Aadhaar */
.grid label small { font-weight: normal; color:#b71c1c; }
.terms { margin-top: 16px; background:#fffaf0; border:1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.terms h3 { margin: 0 0 6px; color: var(--navy); font-size: 16px; }
.terms ol { margin: 0 0 10px; padding-left: 20px; font-size: 13px; line-height: 1.5; color:#444; }
.terms ol li:first-child { color: var(--red); font-weight: bold; }
.terms .agree { display:flex; gap: 8px; align-items: flex-start; font-weight: bold; font-size: 14px; }
.terms .agree input { margin-top: 3px; width: 18px; height: 18px; }

/* Logo + WhatsApp */
.top h1 .logo { height: 42px; width: auto; vertical-align: middle; margin-right: 10px; border-radius: 6px; background:#fff; padding: 2px; }
.wa-btn { position: fixed; right: 16px; bottom: 84px; width: 54px; height: 54px; border-radius: 50%; background: #25d366; display:flex;
  align-items:center; justify-content:center; box-shadow: 0 4px 12px rgba(0,0,0,.25); z-index: 20; }
body.no-bar .wa-btn { bottom: 20px; }
