/* Dadri Fresh Chicken — storefront styles */

:root {
  --brand: #d42027;
  --brand-dark: #a8151b;
  --brand-soft: #fff1f1;
  --brand-line: #fbd0d2;
  --wa: #15803d;
  --wa-dark: #166534;
  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #78716c;
  --line: #ece9e6;
  --bg: #faf8f6;
  --card: #ffffff;
  --warn-bg: #fffbeb;
  --warn-ink: #92400e;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgb(28 25 23 / 0.06);
  --shadow: 0 6px 20px rgb(28 25 23 / 0.08);
  --hdr: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  padding-bottom: 96px;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }
.center-text { text-align: center; }
button { font: inherit; }

/* ---------- header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: rgb(255 255 255 / 0.96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { border-radius: 10px; flex: none; }
.brand > div { min-width: 0; }
.brand h1 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-line { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.open-dot { width: 8px; height: 8px; border-radius: 50%; background: #a8a29e; flex: none; }
.open-dot.on { background: #16a34a; box-shadow: 0 0 0 3px #dcfce7; }
.top-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.txt-btn {
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.txt-btn:hover { background: #f5f5f4; }
.avatar-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avatar-btn:hover { border-color: var(--brand-line); }

/* ---------- banners ---------- */
.banner { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 0.9rem; }
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #fde68a; }

/* ---------- hero ---------- */
.hero {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(120deg, #fff1f1 0%, #fff7ed 100%);
  border: 1px solid #fde4d4;
  overflow: hidden;
}
.hero-kicker { font-size: 0.78rem; font-weight: 700; color: var(--brand); letter-spacing: 0.02em; }
.hero-title { margin: 4px 0 8px; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; max-width: 20ch; }
.hero-meta { font-size: 0.82rem; color: var(--ink-2); font-weight: 600; }
.hero-art {
  flex: none;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.8rem;
  background: #fff;
  box-shadow: var(--shadow);
}
@media (min-width: 720px) {
  .hero { padding: 26px 28px; }
  .hero-title { font-size: 1.9rem; }
  .hero-art { width: 120px; height: 120px; font-size: 4rem; }
}

/* ---------- trust strip ---------- */
.trust {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 12px -16px 0;
  padding: 0 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.trust::-webkit-scrollbar { display: none; }
.trust li {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

/* ---------- section tabs ---------- */
.tabs {
  position: sticky;
  top: var(--hdr);
  z-index: 15;
  display: flex;
  gap: 4px;
  margin: 14px -16px 0;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgb(250 248 246 / 0.97);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--ink); color: #fff; }

/* ---------- menu ---------- */
.cat-section { scroll-margin-top: calc(var(--hdr) + 60px); padding-top: 18px; }
.cat-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 12px; }
.cat-title span { color: var(--muted); font-weight: 600; font-size: 0.85rem; margin-left: 4px; }

.items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .items { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 960px) { .items { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.item {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.item:focus-visible { outline: 3px solid var(--brand-line); outline-offset: 2px; }
.item.out { cursor: default; }
.item.out .item-img { filter: grayscale(0.8); opacity: 0.6; }

.item-media { position: relative; aspect-ratio: 4 / 3; }
.item-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { display: grid; place-items: center; }
.ph span { font-size: 3rem; filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.12)); }
.ph-curry { background: radial-gradient(circle at 30% 25%, #fff 0, #ffe4e1 55%, #fecdd3 100%); }
.ph-boneless { background: radial-gradient(circle at 30% 25%, #fff 0, #ffedd5 55%, #fed7aa 100%); }
.ph-pieces { background: radial-gradient(circle at 30% 25%, #fff 0, #fef3c7 55%, #fde68a 100%); }
.ph-whole { background: radial-gradient(circle at 30% 25%, #fff 0, #dcfce7 55%, #bbf7d0 100%); }
.ph-more, .ph-other { background: radial-gradient(circle at 30% 25%, #fff 0, #e0e7ff 55%, #c7d2fe 100%); }
.oos, .cart-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
}
.oos { background: var(--ink); color: #fff; }
.cart-badge { left: auto; right: 8px; background: var(--wa); color: #fff; }

.item-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; flex: 1; }
.item-body h3 { font-size: 0.95rem; font-weight: 700; line-height: 1.25; }
.item-desc {
  font-size: 0.78rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 6px; }
.item-price { display: grid; min-width: 0; }
.item-price b { font-size: 1.05rem; font-weight: 800; }
.item-price span { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }
.add-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1.5px solid var(--brand);
  background: #fff;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.add-btn i { font-style: normal; font-size: 1rem; line-height: 1; }
.add-btn:hover { background: var(--brand-soft); }
.add-btn:disabled { border-color: var(--line); color: #a8a29e; background: #fafaf9; cursor: not-allowed; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn.block { width: 100%; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.outline { border: 1.5px solid var(--brand); color: var(--brand); background: #fff; }
.btn.outline:hover { background: var(--brand-soft); }
.btn.whatsapp { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.whatsapp:hover { background: var(--wa-dark); }
.btn.ghost { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-dark); }
.btn:disabled { background: #e7e5e4; border-color: #e7e5e4; color: var(--muted); cursor: not-allowed; }
.link-btn { border: 0; background: none; color: var(--brand); font-weight: 700; cursor: pointer; text-decoration: underline; padding: 0 4px; }
.icon-btn { border: 0; background: none; font-size: 1.2rem; padding: 6px; cursor: pointer; color: var(--muted); line-height: 1; }

select, input, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* prevents zoom on iOS */
  color: var(--ink);
  padding: 11px 12px;
  border: 1px solid #d6d3d1;
  border-radius: 12px;
  background: #fff;
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.pill:hover { border-color: var(--brand-line); }
.pill.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.stepper button { width: 36px; height: 36px; border: 0; background: none; font-size: 1.2rem; color: var(--brand); cursor: pointer; }
.stepper span { min-width: 24px; text-align: center; font-weight: 800; }
.big-stepper button { width: 44px; height: 44px; font-size: 1.4rem; }
.big-stepper span { min-width: 32px; font-size: 1.05rem; }

/* ---------- floating cart bar ---------- */
.cartbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border: 0;
  border-radius: 16px;
  background: var(--wa);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 10px 28px rgb(21 128 61 / 0.35);
  cursor: pointer;
}

/* ---------- dialogs (bottom sheets on phones) ---------- */
dialog {
  width: min(560px, 100%);
  max-width: 100%;
  max-height: 92vh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: #fff;
  color: var(--ink);
  overscroll-behavior: contain;
}
dialog[open] { animation: sheet-up 0.22s ease-out; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@media (min-width: 600px) { dialog { margin: auto; border-radius: 22px; } }
dialog::backdrop { background: rgb(28 25 23 / 0.5); }
.sheet { padding: 18px 16px 20px; }
.sheet.center { text-align: center; display: grid; gap: 10px; }
.big { font-size: 3rem; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-head h2 { font-size: 1.2rem; font-weight: 800; }

/* item sheet */
.item-sheet { position: relative; flex-direction: column; overflow: hidden; }
.item-sheet[open] { display: flex; }
.is-media { flex: none; height: 190px; }
.is-media > * { width: 100%; height: 100%; }
.is-img { object-fit: cover; display: block; }
.is-media .ph span { font-size: 5rem; }
.is-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; background: rgb(255 255 255 / 0.92); color: var(--ink); box-shadow: var(--shadow-sm); }
.is-body { padding: 16px; overflow-y: auto; display: grid; gap: 14px; }
.is-body h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
#isDesc { margin-top: -10px; }
.is-rate { font-size: 0.9rem; color: var(--muted); margin-top: -8px; }
.is-rate b { color: var(--ink); font-size: 1rem; }
.is-group h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.opt {
  display: grid;
  gap: 2px;
  padding: 10px 8px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}
.opt b { font-size: 0.95rem; }
.opt span { font-size: 0.78rem; color: var(--muted); }
.opt.on { border-color: var(--brand); background: var(--brand-soft); }
.opt.on span { color: var(--brand-dark); }
.opt.opt-custom { border-style: dashed; }
.opt.opt-custom.on { border-style: solid; }
.custom-qty { margin-top: 10px; display: grid; gap: 6px; }
.custom-qty label { font-size: 0.85rem; font-weight: 700; }
.custom-input { display: flex; align-items: center; gap: 8px; }
.custom-input input {
  width: 140px; padding: 10px 12px; font: inherit; font-size: 1.1rem; font-weight: 700;
  border: 1.5px solid var(--brand); border-radius: 12px; background: #fff; color: var(--ink);
}
.custom-input input[aria-invalid="true"] { border-color: #b45309; background: #fffbeb; }
.custom-input span { font-weight: 700; color: var(--muted); }
.custom-qty .bad { color: #b45309; }
.is-qty { display: flex; align-items: center; justify-content: space-between; }
.is-qty h3 { margin: 0; }
.is-foot {
  flex: none;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}
.is-foot .btn { padding: 13px 10px; }

/* cart */
.empty { color: var(--muted); text-align: center; padding: 24px 0; }
.line { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line-info { display: grid; min-width: 0; }
.line-price { font-weight: 800; min-width: 56px; text-align: right; }
#cartTotals { padding: 10px 0; }
.row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.row.total { font-weight: 800; font-size: 1.1rem; border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 8px; }
.hint { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: #f0fdf4; color: #166534; font-size: 0.88rem; }
.hint.warn { background: var(--warn-bg); color: var(--warn-ink); }

#checkoutForm { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
#checkoutForm h3 { font-size: 1.05rem; font-weight: 800; }
#checkoutForm > label { display: grid; gap: 5px; font-size: 0.88rem; font-weight: 600; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0; display: grid; gap: 8px; }
legend { font-size: 0.88rem; font-weight: 700; padding: 0 4px; }
.radio { display: flex; align-items: flex-start; gap: 8px; font-size: 0.95rem; }
.radio input { width: auto; margin-top: 4px; }
.radio.disabled { opacity: 0.55; }
.loc { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.error { color: var(--brand); font-weight: 600; min-height: 1em; }
.who { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; background: #fafaf9; border: 1px solid var(--line); border-radius: 12px; font-size: 0.92rem; }

/* sign-up / account */
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 5px; font-size: 0.88rem; font-weight: 600; }
#authSub { margin: -2px 0 10px; }
.phone-input { display: flex; align-items: stretch; border: 1px solid #d6d3d1; border-radius: 12px; overflow: hidden; background: #fff; }
.phone-input > span { display: grid; place-items: center; padding: 0 12px; background: #f5f5f4; color: var(--muted); font-weight: 700; border-right: 1px solid #d6d3d1; }
.phone-input input { border: 0; border-radius: 0; }
.phone-input:focus-within { outline: 2px solid var(--brand); outline-offset: 1px; }
.phone-input input:focus { outline: none; }
.google-btn { display: flex; justify-content: center; min-height: 44px; margin: 6px 0 2px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85rem; margin: 10px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.account-info { display: grid; gap: 4px; }
.stack-btns { display: grid; gap: 8px; margin-top: 14px; }

/* payment */
.pay-amount { font-size: 2rem; font-weight: 800; text-align: center; margin: 4px 0 12px; color: var(--brand); }
#upiBox, #rzpBox { display: grid; gap: 10px; }
#utrForm { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
#utrForm label { display: grid; gap: 4px; font-size: 0.88rem; font-weight: 600; }
#payDialog .sheet > .btn { margin-top: 10px; }

/* tracking */
.track-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; display: grid; gap: 8px; }
.track-items { margin: 0; padding-left: 18px; font-size: 0.9rem; color: var(--muted); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 0.8rem; font-weight: 700; margin: 0; }
.badge.bad { background: #fee2e2; color: #991b1b; }
.steps { list-style: none; display: flex; padding: 0; margin: 0; gap: 4px; }
.steps li { flex: 1; font-size: 0.7rem; text-align: center; color: var(--muted); padding-top: 8px; border-top: 4px solid var(--line); }
.steps li.done { border-color: var(--wa); color: var(--ink); }
.steps li.now { font-weight: 800; color: var(--wa-dark); }
.live { display: grid; gap: 6px; padding: 10px; border: 1px solid #bbf7d0; background: #f0fdf4; border-radius: 12px; }
.live-head { display: flex; align-items: center; gap: 8px; color: #166534; }
.live-eta { font-weight: 700; }
.map { height: 230px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #e7e5e4; }
.pin { font-size: 26px; line-height: 34px; text-align: center; background: none; border: 0; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.4)); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #a8a29e; flex: none; }
.dot.on { background: var(--wa); box-shadow: 0 0 0 0 rgb(22 163 74 / 0.6); animation: pulse 1.6s infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 10px rgb(22 163 74 / 0); } }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--hdr) + 10px);
  transform: translate(-50%, -16px);
  background: var(--ink);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* footer */
.footer { margin-top: 36px; padding-top: 18px; padding-bottom: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
.footer p { margin: 4px 0; }
.footer a { color: var(--brand); font-weight: 700; }

@media (max-width: 380px) {
  .item-body h3 { font-size: 0.9rem; }
  .add-btn { padding: 6px 8px; }
  .brand h1 { font-size: 0.98rem; }
}
