:root {
  color-scheme: dark;
  --bg: #111113; --surface: #1b1b1e; --raised: #26262a; --text: #f4f1ea; --muted: #9c978e; --line: #2d2d32;
  --accent: #f2a43a; --accent-ink: #1d1305; --price: #f2a43a;
  --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --top-h: 58px; --rail-w: 90px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.locked, html.locked body { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
svg { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.clamp1, .clamp2 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp1 { -webkit-line-clamp: 1; }
.clamp2 { -webkit-line-clamp: 2; }

/* Tepa qism */
.top { position: sticky; top: 0; z-index: 30; background: rgba(17,17,19,.94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-in { height: var(--top-h); max-width: 1320px; margin: 0 auto; padding: 0 12px 0 16px; display: flex; align-items: center; gap: 10px; }
.logo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-size: 19px; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.logo span { color: var(--accent); }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--raised); flex: none; }
.icon-btn.call { color: var(--accent); }

/* Qo'ng'iroq oynasi */
.calls { display: grid; gap: 10px; padding: 8px 20px 24px; }
.call-item { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px; border-radius: 16px; background: var(--raised); text-decoration: none; font-size: 19px; font-weight: 600; letter-spacing: .02em; transition: transform .12s; }
.call-item:active { transform: scale(.98); }
.call-ico { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.call-ico svg { width: 20px; height: 20px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 6px 0 12px; border-radius: 12px; background: var(--raised); }
.search svg { color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 16px; }
.search input::-webkit-search-cancel-button { display: none; }
.search button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); }

.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }

/* Chap panel: hamma bo'limlar doim ko'rinib turadi */
.rail { position: sticky; top: var(--top-h); align-self: start; height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h));
  overflow-y: auto; scrollbar-width: none; border-right: 1px solid var(--line); padding: 10px 6px 100px; display: flex; flex-direction: column; gap: 4px; }
.rail::-webkit-scrollbar { display: none; }
.ri { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px; border-radius: 14px;
  color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.2; text-align: center; transition: background .15s, color .15s; }
.ri img, .ri-ph { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 2px solid transparent; opacity: .7; transition: opacity .2s, border-color .2s; flex: none; }
.ri-ph { display: grid; place-items: center; background: var(--raised); font-size: 20px; font-weight: 700; color: var(--text); }
.ri.on { color: var(--text); background: var(--raised); }
.ri.on img, .ri.on .ri-ph { opacity: 1; border-color: var(--accent); }
.ri.on::before { content: ''; position: absolute; left: -6px; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }

/* Taomlar */
.feed { padding: 0 12px 40px; }
.cat { scroll-margin-top: var(--top-h); padding-top: 16px; }
.cat-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 2px 10px; font-size: 19px; font-weight: 600; }
.cat-title small { font-size: 13px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.items { display: grid; gap: 10px; }
.it { display: flex; gap: 12px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: transform .15s, border-color .15s; }
.it:active { transform: scale(.985); }
.it img, .it .noimg { width: 80px; height: 80px; border-radius: 12px; object-fit: cover; flex: none; background: var(--raised); }
.noimg { display: grid; place-items: center; color: #55555c; }
.noimg svg { width: 34px; height: 34px; stroke-width: 1.5; }
.ib { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ib h3 { font-size: 15.5px; font-weight: 500; line-height: 1.25; margin-bottom: 2px; }
.ib p { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.ir { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.ir .slot { margin-left: auto; }
.price { color: var(--price); font-weight: 600; font-size: 15px; white-space: nowrap; }
.soon { min-height: 50vh; display: grid; place-items: center; color: var(--muted); padding: 40px 20px; text-align: center; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 10px; stroke-width: 1.6; }

/* Qo'shish tugmasi va soni */
.slot { display: inline-flex; flex: none; }
.btn-add { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); transition: transform .12s ease; }
.btn-add svg { width: 18px; height: 18px; stroke-width: 2.6; }
.btn-add:active { transform: scale(.9); }
.stepper { display: inline-flex; align-items: center; height: 36px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.stepper button { width: 32px; height: 36px; display: grid; place-items: center; }
.stepper button svg { width: 16px; height: 16px; stroke-width: 2.6; }
.stepper span { min-width: 18px; text-align: center; font-weight: 700; font-size: 15px; }
.btn-add.lg { width: auto; height: 50px; padding: 0 22px; border-radius: 14px; font-weight: 700; font-size: 16px; }
.stepper.lg { height: 50px; border-radius: 14px; }
.stepper.lg button { width: 50px; height: 50px; }
.stepper.lg span { min-width: 28px; font-size: 18px; }

/* Pastdagi savat tugmasi */
.cartbar { position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 18px 0 14px; border-radius: 18px;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 12px 30px rgba(0,0,0,.4);
  transform: translateY(160%); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.cartbar.show { transform: none; }
.cb-ico { position: relative; display: grid; place-items: center; width: 34px; height: 34px; }
.cb-ico svg { width: 24px; height: 24px; }
.cb-ico b { position: absolute; top: -4px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; font-size: 12px; line-height: 20px; text-align: center; background: var(--accent-ink); color: var(--accent); }
.cb-label { flex: 1; text-align: left; font-weight: 700; font-size: 16px; }
.cb-sum { font-weight: 700; font-size: 16px; }

/* Oyna: telefonda pastdan chiqadi, kompyuterda markazda */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .25s; }
.sheet-wrap.open { opacity: 1; }
.sheet { position: relative; width: 100%; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); color: var(--text); border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.sheet-wrap.open .sheet { transform: none; }
@media (min-width: 900px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { max-width: 520px; border-radius: 24px; transform: translateY(30px) scale(.97); opacity: 0; transition: transform .25s, opacity .2s; }
  .sheet-wrap.open .sheet { opacity: 1; }
}
.sheet-x { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.08); color: var(--text); }
.sheet-x.on-img { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(0,0,0,.55); color: #fff; }
.sh-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 8px; }
.sh-title { font-size: 24px; font-weight: 600; line-height: 1.2; }

.fd-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--raised); }
.fd-noimg { height: 72px; }
.fd-body { padding: 20px 20px 24px; }
.fd-cat { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.fd-name { font-size: 26px; font-weight: 600; line-height: 1.2; margin: 6px 0 18px; }
.fd-label { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.fd-desc { color: var(--muted); font-size: 16px; white-space: pre-line; }
.fd-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--surface); border-top: 1px solid var(--line); }
.fd-price { font-size: 24px; font-weight: 700; color: var(--price); white-space: nowrap; }

.cs-list { list-style: none; margin: 0; padding: 0 20px; }
.cs-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cs-item img, .cs-item .noimg { width: 58px; height: 58px; border-radius: 14px; object-fit: cover; flex: none; background: var(--raised); }
.cs-item .noimg svg { width: 26px; height: 26px; }
.cs-info { flex: 1; min-width: 0; }
.cs-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-price { color: var(--muted); font-size: 14px; }
.cs-total { display: flex; justify-content: space-between; padding: 18px 20px 6px; font-size: 20px; font-weight: 700; }
.cs-note { padding: 0 20px; color: var(--muted); font-size: 14px; }
.cs-actions { padding: 18px 20px 24px; }
.cs-clear { width: 100%; height: 48px; border-radius: 14px; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.cs-empty { padding: 36px 20px 56px; text-align: center; color: var(--muted); }
.cs-empty svg { width: 44px; height: 44px; margin: 0 auto 10px; stroke-width: 1.5; }

/* Footer */
.site-footer { background: var(--surface); color: #ece7de; border-top: 1px solid var(--line); padding: 36px 16px calc(110px + env(safe-area-inset-bottom)); }
.ft-in { max-width: 1280px; margin: 0 auto; display: grid; gap: 18px; }
.ft-brand { font-size: 24px; font-weight: 700; color: var(--accent); }
.ft-info { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ft-info li { display: flex; gap: 10px; align-items: center; }
.ft-info svg { color: var(--accent); }
.ft-links { display: flex; flex-wrap: wrap; gap: 10px; }
.ft-btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 14px; text-decoration: none; font-weight: 500; background: rgba(255,255,255,.07); }
.ft-copy { font-size: 13px; opacity: .5; }

@media (min-width: 640px) {
  :root { --rail-w: 112px; }
  .feed { padding: 0 20px 40px; }
  .items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .ft-in { grid-template-columns: 1fr auto; align-items: center; }
  .ft-links { grid-column: 2; grid-row: 1 / span 2; }
}
@media (min-width: 1024px) {
  :root { --rail-w: 260px; }
  .top-in { padding: 0 24px; }
  .search { max-width: 420px; }
  .rail { padding: 20px 14px 40px; gap: 6px; }
  .ri { flex-direction: row; gap: 12px; padding: 8px 12px; font-size: 15px; text-align: left; }
  .ri img, .ri-ph { width: 42px; height: 42px; }
  .ri.on::before { left: -14px; top: 12px; bottom: 12px; }
  .ri:hover { color: var(--text); }
  .feed { padding: 4px 32px 40px; }
  .cat { padding-top: 22px; }
  .cat-title { font-size: 24px; margin-bottom: 14px; }
  .items { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .it { flex-direction: column; padding: 0; overflow: hidden; gap: 0; }
  .it:hover { border-color: #45454b; transform: translateY(-3px); }
  .it img, .it .noimg { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 0; }
  .ib { padding: 12px 14px 14px; }
  .ib h3 { font-size: 17px; }
  .ib p { font-size: 13.5px; }
}
