:root {
  --bg: #f7f3ec;
  --card: #ffffff;
  --ink: #1d1a16;
  --muted: #6f675d;
  --line: #e7dfd2;
  --brand: #1f3d2b;
  --brand-ink: #ffffff;
  --accent: #e0892f;
  --accent-soft: #fbeedd;
  --danger: #c23a2b;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(40, 30, 10, .08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.45;
  padding-bottom: 96px;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
button { font: inherit; cursor: pointer; }

/* Sarlavha */
.hero { background: var(--brand); color: var(--brand-ink); padding: 36px 0 42px; }
.hero h1 { margin: 0; font-size: clamp(28px, 7vw, 40px); font-weight: 800; letter-spacing: -.02em; }
.slogan { margin: 4px 0 16px; opacity: .8; }
.info { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.info li { background: rgba(255,255,255,.12); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.info a { color: inherit; text-decoration: none; }

/* Bo'lim tablari */
.tabs { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.tabs-inner { display: flex; gap: 8px; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; scrollbar-width: none; }
.tabs-inner::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Menyu */
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
.cat { padding-top: 24px; scroll-margin-top: 60px; }
.cat h2 { font-size: 22px; margin: 0 0 12px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
.item { display: flex; gap: 12px; background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.item.off { opacity: .5; }
.thumb { flex: none; width: 92px; height: 92px; border-radius: 12px; background: var(--accent-soft);
  display: grid; place-items: center; font-size: 44px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-name { font-weight: 700; margin: 0; }
.item-desc { color: var(--muted); font-size: 14px; margin: 2px 0 8px; }
.item-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: 800; }
.add-btn { border: 0; background: var(--accent); color: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 700; }
.add-btn:disabled { background: var(--line); color: var(--muted); cursor: default; }
.qty { display: inline-flex; align-items: center; background: var(--accent-soft); border-radius: 999px; }
.qty button { border: 0; background: transparent; width: 36px; height: 36px; font-size: 20px; font-weight: 700; color: var(--accent); }
.qty span { min-width: 22px; text-align: center; font-weight: 800; }

.foot { color: var(--muted); font-size: 14px; padding-top: 32px; text-align: center; }

/* Savat tugmasi */
.cartbar { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 10;
  max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  border: 0; border-radius: 999px; padding: 14px 18px; background: var(--brand); color: #fff;
  font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.cartbar-count { background: var(--accent); border-radius: 999px; min-width: 28px; height: 28px; display: grid; place-items: center; font-size: 14px; }
.cartbar-sum { margin-left: auto; }

/* Savat oynasi */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; }
.sheet { position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow: auto;
  background: var(--bg); border-radius: 20px 20px 0 0; max-width: 560px; margin: 0 auto; }
@media (min-width: 640px) { .sheet { bottom: 4vh; border-radius: 20px; max-height: 92vh; } }
.sheet-head { position: sticky; top: 0; background: var(--bg); display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); z-index: 1; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.icon-btn { border: 0; background: var(--card); width: 36px; height: 36px; border-radius: 50%; font-size: 16px; }
.sheet-body { padding: 16px; }
.cart-list { list-style: none; margin: 0; padding: 0; }
.cart-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-list .nm { flex: 1; min-width: 0; }
.cart-list .nm small { display: block; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }
.totals { padding: 12px 0; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); }
.totals .grand { color: var(--ink); font-weight: 800; font-size: 18px; padding-top: 8px; }
.totals .note { display: block; font-size: 13px; color: var(--accent); }

form h3 { margin: 16px 0 8px; }
form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
input, textarea { display: block; width: 100%; margin-top: 4px; font: inherit; font-weight: 400; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
input.bad, textarea.bad { border-color: var(--danger); }
.pay { border: 0; padding: 0; margin: 0 0 12px; }
.pay legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.radio { display: flex !important; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; margin-bottom: 8px !important; font-weight: 600; }
.radio input { width: auto; margin: 0; accent-color: var(--brand); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.hint { font-size: 13px; color: var(--muted); margin: -4px 0 12px; min-height: 1em; }
.error { color: var(--danger); font-weight: 600; min-height: 1em; margin: 0 0 8px; }
.ghost-btn { width: 100%; border: 1px dashed var(--brand); background: transparent; color: var(--brand);
  border-radius: 12px; padding: 12px; font-weight: 700; margin-bottom: 8px; }
.primary-btn { width: 100%; border: 0; background: var(--brand); color: #fff; border-radius: 14px; padding: 16px; font-weight: 800; font-size: 17px; }
.primary-btn:disabled { opacity: .6; }
.done { text-align: center; padding: 32px 16px; }
.done-icon { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 36px; display: grid; place-items: center; }
.done p { color: var(--muted); }
.done h3 { margin: 0 0 4px; font-size: 22px; }
.done-icon.cancel { background: var(--danger); }
.steps { list-style: none; margin: 20px auto; padding: 0; max-width: 320px; text-align: left; }
.steps li { position: relative; display: flex; align-items: center; gap: 12px; padding: 0 0 18px 0; color: var(--muted); font-weight: 600; }
.steps li::before { content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); z-index: 1; }
.steps li::after { content: ""; position: absolute; left: 11px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--brand); border-color: var(--brand); box-shadow: inset 0 0 0 4px var(--brand); }
.steps li.done::after { background: var(--brand); }
.steps li.current { color: var(--ink); }
.steps li.current::before { border-color: var(--accent); background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.steps li time { margin-left: auto; font-size: 13px; color: var(--muted); font-weight: 400; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(224, 137, 47, .25); } }
.track-meta { font-size: 14px; }

/* Holat va tarix tugmalari */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: -22px; margin-bottom: 6px; position: relative; z-index: 2; }
.quick-btn { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left;
  border: 0; border-radius: 14px; padding: 12px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.quick-btn.on { outline: 2px solid var(--accent); }
.quick-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); display: grid; place-items: center; font-size: 18px; }
.quick-txt { min-width: 0; font-weight: 700; font-size: 14px; line-height: 1.25; }
.quick-txt small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-btn.on .quick-txt small { color: var(--accent); }
@media (max-width: 440px) {
  .quick-btn { flex-direction: column; align-items: flex-start; gap: 8px; }
  .quick-ico { width: 32px; height: 32px; font-size: 16px; }
}
.live-dot { position: absolute; top: 10px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }

/* Kirish */
.hero .wrap { position: relative; }
.acct { position: absolute; right: 16px; top: -12px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 0; border-radius: 999px; padding: 8px 14px; background: rgba(255,255,255,.15); color: #fff; font-weight: 700; font-size: 14px; }
.hero h1 { padding-right: 110px; }
.auth { text-align: center; padding: 28px 16px; }
.auth h3 { margin: 0 0 8px; font-size: 22px; }
.auth p { color: var(--muted); margin: 0 0 18px; }
.auth-ico { font-size: 44px; margin-bottom: 8px; }
.tg-btn { display: block; width: 100%; border-radius: 14px; padding: 16px; background: #229ed9; color: #fff;
  font-weight: 800; font-size: 17px; text-decoration: none; }
.tg-btn.wait { opacity: .6; pointer-events: none; }
button.tg-btn { border: 0; font: inherit; font-weight: 800; font-size: 17px; cursor: pointer; }
button.tg-btn:disabled { opacity: .6; }
a.ghost-btn { display: block; text-decoration: none; text-align: center; }
.auth .ghost-btn { margin-top: 8px; }
.link-btn { border: 0; background: none; color: var(--brand); font-weight: 700; text-decoration: underline; padding: 4px 0; margin: -4px 0 12px; text-align: left; }
.auth .link-btn { margin-top: 12px; }
.spinner { width: 44px; height: 44px; margin: 0 auto 16px; border-radius: 50%; border: 4px solid var(--accent-soft); border-top-color: #229ed9; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Buyurtmalar tarixi */
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.history li { background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.h-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.h-id { font-weight: 800; }
.h-date { color: var(--muted); font-size: 13px; }
.h-items { margin: 6px 0; font-size: 14px; color: var(--muted); }
.h-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.h-total { font-weight: 800; }
.chip { flex: none; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.chip.ok { background: #e3efe7; color: var(--brand); }
.chip.no { background: #f8e1de; color: var(--danger); }
.h-open { border: 0; background: none; color: var(--brand); font-weight: 700; padding: 0; text-decoration: underline; }
