/* Ranglar: fon/matn Telegram mavzusidan, asosiy rang — o'zimizniki */
:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --surface: var(--tg-theme-secondary-bg-color, #f4f4f6);
  --text: var(--tg-theme-text-color, #16161a);
  --hint: var(--tg-theme-hint-color, #8a8a93);
  --line: rgba(128, 128, 140, 0.18);
  --accent: #ff6b1a;
  --accent-press: #ec5a0b;
  --accent-text: #ffffff;
  --accent-soft: rgba(255, 107, 26, 0.12);
  --accent-shadow: rgba(255, 107, 26, 0.35);
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, 0.12);
  --success: #2f9e5b;
  --success-soft: rgba(47, 158, 91, 0.14);
  --info: #2481cc;
  --info-soft: rgba(36, 129, 204, 0.14);
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(20, 20, 30, 0.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Telegram'dan tashqarida (brauzerda) qorong'i rejim */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--tg-theme-bg-color, #121214);
    --surface: var(--tg-theme-secondary-bg-color, #1e1e22);
    --text: var(--tg-theme-text-color, #f2f2f5);
    --hint: var(--tg-theme-hint-color, #8d8d96);
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  padding-bottom: calc(96px + var(--safe-bottom));
}

button { font-family: inherit; font-size: inherit; color: inherit; }

.hidden { display: none !important; }

/* ---------- Yuqori panel ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px 10px;
  background: var(--bg);
}

.topbar h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

/* Til: ikkala til ko'rinib turadi, tanlangani ajralib turadi; bosilsa almashadi */
.lang-btn {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 3px;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.lang-btn span {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--hint);
}
.lang-btn span.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* Ichki sahifalarda tugma ixcham — joy do'kon nomiga qolsin */
.topbar.compact .pill-btn { padding: 8px 10px; }
.topbar.compact .pill-label { display: none; }

.dev-bar { padding: 0 16px 10px; }

/* ---------- Qidiruv va toifalar ---------- */

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px;
  padding: 0 14px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--hint);
}

.search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.search input::-webkit-search-cancel-button { display: none; }

/* Toifa plitkalari (Restoranlar, Coffee, Market...) */
.cat-tiles {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 16px 4px;
  scrollbar-width: none;
}

.cat-tiles::-webkit-scrollbar { display: none; }

.cat-tile {
  position: relative;
  flex-shrink: 0;
  width: 104px;
  height: 108px;
  border: none;
  border-radius: 18px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s;
}

.cat-tile:active { transform: scale(0.96); }

.cat-tile.active { box-shadow: inset 0 0 0 2.5px var(--text); }

.cat-emoji {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 34px;
  line-height: 1;
}

.cat-label {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.1px;
}

.cat-count { margin-top: 2px; font-size: 11px; font-weight: 600; opacity: 0.6; }

.group-head { padding: 16px 2px 0; }
.group-head:first-child { padding-top: 0; }
.group-head h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.3px; }
.group-head p { margin: 2px 0 0; color: var(--hint); font-size: 13px; }

.shop-group { display: flex; flex-direction: column; gap: 18px; }

/* Qidiruvda topilgan mahsulotlar (do'konlar ro'yxati ustida) */
.product-results { padding-top: 16px; }
.product-results .group-head { padding: 0 18px; }
.product-results .product-grid { padding-bottom: 0; }
.group-head h2 .count { color: var(--hint); font-size: 15px; font-weight: 700; }
.product-shop {
  display: block;
  max-width: 100%;
  margin-top: 4px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* ---------- Do'konlar ---------- */

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 12px;
}

.shop {
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.cover {
  position: relative;
  height: 150px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
}

.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-closed {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(10, 10, 14, 0.55);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.cover-closed small { font-size: 13px; font-weight: 500; opacity: 0.85; }

/* Rasmsiz muqova va plitkalar: toifaga qarab mayin fon */
.tone-restoran { background: linear-gradient(135deg, #ffe3cf, #ffc29b); color: #6b2a06; }
.tone-coffee { background: linear-gradient(135deg, #f3e6d8, #dcbd9c); color: #4a2a12; }
.tone-market { background: linear-gradient(135deg, #dcf5e3, #aee3bf); color: #0f4d27; }
.tone-gullar { background: linear-gradient(135deg, #ffe1ec, #f8b6cf); color: #7a1840; }
.tone-shirinliklar { background: linear-gradient(135deg, #f1e4ff, #d9bdf7); color: #4b1f78; }
.tone-dorixona { background: linear-gradient(135deg, #e0f4f8, #b3e2ec); color: #0b4f5e; }
.tone-default { background: linear-gradient(135deg, #e8e8ee, #d4d4de); color: var(--text); }

/* filter emas — u ichidagi haqiqiy rasmni ham qoraytirib yuboradi */
@media (prefers-color-scheme: dark) {
  .tone-restoran { background: linear-gradient(135deg, #4d3122, #3a2318); color: #ffc29b; }
  .tone-coffee { background: linear-gradient(135deg, #3f3329, #2e251d); color: #e6c7a6; }
  .tone-market { background: linear-gradient(135deg, #1f3d2a, #172e20); color: #a6e3ba; }
  .tone-gullar { background: linear-gradient(135deg, #4a2536, #381c29); color: #f8b6cf; }
  .tone-shirinliklar { background: linear-gradient(135deg, #3a2a4d, #2b1f3b); color: #d9bdf7; }
  .tone-dorixona { background: linear-gradient(135deg, #17393f, #112b30); color: #9fdbe8; }
  .tone-default { background: linear-gradient(135deg, #2c2c33, #23232a); }
}

/* ---------- Toifalarning o'z rangi (do'kon sahifasida) ---------- */

body[data-cat="restoran"] { --accent: #ff6b1a; --accent-press: #ec5a0b; --accent-soft: rgba(255, 107, 26, 0.12); --accent-shadow: rgba(255, 107, 26, 0.35); }
body[data-cat="coffee"] { --accent: #9a5b2e; --accent-press: #834b23; --accent-soft: rgba(154, 91, 46, 0.14); --accent-shadow: rgba(154, 91, 46, 0.35); }
body[data-cat="market"] { --accent: #17a34a; --accent-press: #12893d; --accent-soft: rgba(23, 163, 74, 0.13); --accent-shadow: rgba(23, 163, 74, 0.32); }
body[data-cat="gullar"] { --accent: #e0457b; --accent-press: #c9356a; --accent-soft: rgba(224, 69, 123, 0.13); --accent-shadow: rgba(224, 69, 123, 0.33); }
body[data-cat="shirinliklar"] { --accent: #9b51e0; --accent-press: #8440c7; --accent-soft: rgba(155, 81, 224, 0.13); --accent-shadow: rgba(155, 81, 224, 0.33); }
body[data-cat="dorixona"] { --accent: #0e9bb5; --accent-press: #0b849b; --accent-soft: rgba(14, 155, 181, 0.13); --accent-shadow: rgba(14, 155, 181, 0.32); }

@media (prefers-color-scheme: dark) {
  body[data-cat="coffee"] { --accent: #c0844f; --accent-press: #a9713f; }
}

.shop-info { padding: 10px 2px 0; }

.shop-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.shop-meta {
  margin-top: 2px;
  color: var(--hint);
  font-size: 14px;
}

.empty-state {
  text-align: center;
  color: var(--hint);
  padding: 48px 24px;
}

.empty-state .big-emoji { font-size: 44px; display: block; margin-bottom: 8px; }

/* ---------- Do'kon sahifasi ---------- */

.shop-hero { padding: 4px 16px 0; }

/* Do'kon ichida qidiruv — muqova ostida */
.catalog-search { margin-top: 14px; }

.shop-hero .cover { height: 140px; }

.hero-tagline {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #1a1a1f;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

/* Katalog bo'limlari: yopishqoq tablar + sarlavhalar */
.section-tabs {
  position: sticky;
  top: 58px;
  z-index: 4;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-top: 12px;
  padding: 8px 16px;
  background: var(--bg);
  scrollbar-width: none;
}

.section-tabs:empty { display: none; }
.section-tabs::-webkit-scrollbar { display: none; }

.section-tab {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.section-tab.active { background: var(--accent); color: var(--accent-text); }

.section-title {
  margin: 0;
  padding: 16px 16px 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.section-title span { color: var(--hint); font-size: 15px; font-weight: 600; }

.catalog-section .product-grid { padding-top: 10px; }

/* Tab bosilganda oxirgi bo'lim ham tablar ostigacha ko'tarila olsin */
.section-tabs:not(:empty) + .catalog .catalog-section:last-child { min-height: calc(100vh - 140px); }

.hero-name {
  margin: 12px 0 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}

.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.success { background: var(--success-soft); color: var(--success); }

.notice {
  margin: 12px 16px 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 10px;
  padding: 14px 16px;
}

.product {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.product-img {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  overflow: hidden;
}

.product-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-body {
  flex: 1;
  padding: 10px 10px 4px;
}

.product-price {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.product-name {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc {
  margin-top: 3px;
  color: var(--hint);
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-action { padding: 8px 10px 10px; }

.add-btn {
  width: 100%;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: var(--bg);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.add-btn:disabled { color: var(--hint); cursor: default; }

body[data-cat] .add-btn:not(:disabled) { background: var(--accent-soft); color: var(--accent); }

/* ---------- Toifaga mos katalog ko'rinishi ---------- */

/* Market: mahsulot ko'p va mayda — 3 ustun, ixcham kartochka */
body[data-cat="market"] .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
body[data-cat="market"] .product { border-radius: 16px; }
body[data-cat="market"] .product-img { font-size: 34px; }
body[data-cat="market"] .product-body { padding: 8px 8px 2px; }
body[data-cat="market"] .product-price { font-size: 14px; }
body[data-cat="market"] .product-name { font-size: 12px; }
body[data-cat="market"] .product-desc { display: none; }
body[data-cat="market"] .product-action { padding: 6px 8px 8px; }
body[data-cat="market"] .add-btn,
body[data-cat="market"] .product-action .stepper { height: 32px; font-size: 13px; border-radius: 10px; }
body[data-cat="market"] .product-action .stepper button { width: 28px; font-size: 17px; }
body[data-cat="market"] .product-skeleton { height: 190px; }

/* Gullar: buketlar tik turadi — baland rasm */
body[data-cat="gullar"] .product-img { aspect-ratio: 4 / 5; }
body[data-cat="gullar"] .shop-hero .cover { height: 170px; }

/* Coffee va shirinliklar: yumshoq, dumaloqroq shakllar */
body[data-cat="coffee"] .product,
body[data-cat="shirinliklar"] .product { border-radius: 24px; }
body[data-cat="coffee"] .product-img { margin: 8px 8px 0; border-radius: 18px; }
body[data-cat="shirinliklar"] .product-img { margin: 8px 8px 0; border-radius: 18px; aspect-ratio: 5 / 4; }
body[data-cat="coffee"] .add-btn,
body[data-cat="shirinliklar"] .add-btn,
body[data-cat="coffee"] .product-action .stepper,
body[data-cat="shirinliklar"] .product-action .stepper { border-radius: 999px; }

/* Bosh sahifada ham toifa ruhi: gullar muqovasi balandroq, market ixchamroq */
.shop-gullar .cover { height: 170px; }
.shop-market .cover { height: 120px; }

/* "− 1 +" boshqaruvi */
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-text);
  overflow: hidden;
}

.stepper button {
  width: 40px;
  height: 100%;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
}

.stepper button:disabled { opacity: 0.4; cursor: default; }

.stepper span { font-weight: 700; font-size: 15px; }

.stepper.small { height: 32px; width: 104px; border-radius: 10px; }
.stepper.small button { width: 32px; font-size: 18px; }

/* ---------- Savat tugmasi ---------- */

.cart-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 18px;
  border: none;
  border-radius: 18px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 8px 24px var(--accent-shadow);
  cursor: pointer;
}

.cart-bar:active { background: var(--accent-press); }

.cart-bar-left { display: inline-flex; align-items: center; gap: 8px; }

.cart-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* ---------- Savat oynasi ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.45);
}

.sheet {
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  padding: 8px 16px calc(16px + var(--safe-bottom));
}

.sheet-handle {
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  margin: 2px auto 10px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.sheet-header h2 { margin: 0; font-size: 22px; font-weight: 800; }

.sheet-header-actions { display: flex; align-items: center; gap: 8px; }

.text-btn {
  border: none;
  background: none;
  color: var(--hint);
  font-size: 14px;
  cursor: pointer;
}

.cart-group { margin-top: 12px; }

.cart-group-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item:last-child { border-bottom: none; }

.cart-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  position: relative;
}

.cart-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-name {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price { color: var(--hint); font-size: 13px; margin-top: 2px; }

.form-section { margin-top: 18px; }

.form-section h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }

.form-section > * + * { margin-top: 8px; }

.field {
  display: block;
  width: 100%;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}

.field:focus { border-color: var(--accent); }

textarea.field { resize: vertical; }

.input-row { display: flex; gap: 8px; }
.input-row .field { flex: 1; min-width: 0; }

.soft-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  min-height: 44px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.soft-btn.wide { width: 100%; margin-top: 8px; }

#delivery-fields > * + * { margin-top: 8px; }

.segmented {
  display: flex;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface);
}

.segment {
  flex: 1;
  border: none;
  border-radius: 9px;
  padding: 10px 6px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.segment.active {
  background: var(--bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.hint-text { margin: 0; color: var(--hint); font-size: 13px; }
.hint-text:empty { display: none; }

.sheet-footer {
  position: sticky;
  bottom: calc(-16px - var(--safe-bottom));
  margin: 18px -16px 0;
  padding: 10px 16px calc(16px + var(--safe-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.primary-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border: none;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn:active { background: var(--accent-press); }
.primary-btn:disabled { opacity: 0.6; }

.order-status {
  margin: 0 0 8px;
  text-align: center;
  font-size: 14px;
}

.order-status:empty { display: none; }
.order-status.error { color: var(--danger); }
.order-status.success { color: var(--success); font-weight: 600; }

/* ---------- Buyurtmalarim ---------- */

.order-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 16px 16px;
}

.order-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.order-head {
  flex-wrap: wrap;
  row-gap: 4px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.order-title { font-size: 16px; font-weight: 700; }
.order-total { font-size: 16px; font-weight: 800; white-space: nowrap; }
.order-date { color: var(--hint); font-size: 13px; margin-top: 2px; }

.order-part {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.order-part-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-weight: 600;
}

.order-part-item { color: var(--hint); font-size: 14px; }

.status-badge {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--surface);
}

.status-new { background: rgba(245, 166, 35, 0.16); color: #c27a00; }
.status-accepted, .status-assigned, .status-taxi_called { background: var(--success-soft); color: var(--success); }
.status-on_the_way, .status-ready { background: var(--info-soft); color: var(--info); }
.status-completed { background: var(--line); color: var(--hint); }
.status-rejected { background: var(--danger-soft); color: var(--danger); }

/* ---------- Yuklanish ---------- */

.skeleton {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--surface) 25%, var(--line) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

.shop-skeleton { height: 190px; }
.product-skeleton { height: 250px; }

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* ---------- Bosh sahifa: Do'konlar | Xizmatlar ---------- */

.home-switch {
  display: flex;
  gap: 4px;
  margin: 0 16px 12px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface);
}
.home-tab {
  flex: 1;
  border: none;
  border-radius: 11px;
  padding: 10px 6px;
  background: transparent;
  color: var(--hint);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.home-tab.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }

/* ---------- Xizmatlar: yuk tashish, ustalar ---------- */

.tone-svc-yuk { background: linear-gradient(135deg, #fff1d6, #ffd99a); color: #5a3a00; }
.tone-svc-elektrik { background: linear-gradient(135deg, #fffbd6, #fbe98a); color: #5c4b00; }
.tone-svc-santexnik { background: linear-gradient(135deg, #dcecff, #a9cdf7); color: #0d3a6b; }
.tone-svc-konditsioner { background: linear-gradient(135deg, #e0f7fb, #b0e6f0); color: #0b4f5e; }
.tone-svc-maishiy { background: linear-gradient(135deg, #ececf1, #cfd0da); color: #2d2d38; }
.tone-svc-tozalash { background: linear-gradient(135deg, #dff7e6, #b2e7c1); color: #145030; }
@media (prefers-color-scheme: dark) {
  .tone-svc-yuk { background: linear-gradient(135deg, #4a3816, #3a2c11); color: #ffd99a; }
  .tone-svc-elektrik { background: linear-gradient(135deg, #4a4416, #3a3511); color: #fbe98a; }
  .tone-svc-santexnik { background: linear-gradient(135deg, #1b3350, #14273d); color: #a9cdf7; }
  .tone-svc-konditsioner { background: linear-gradient(135deg, #17393f, #112b30); color: #9fdbe8; }
  .tone-svc-maishiy { background: linear-gradient(135deg, #2f2f38, #24242b); color: #d4d4de; }
  .tone-svc-tozalash { background: linear-gradient(135deg, #1f3d2a, #172e20); color: #a6e3ba; }
}

.services-hint { margin: 14px 16px 0; color: var(--hint); font-size: 14px; }
.vehicle-list { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 12px; }
.vehicle-list .group-head { padding: 12px 2px 0; }
.vehicle-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.vehicle-photo {
  flex-shrink: 0;
  width: 104px;
  height: 104px;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}
.vehicle-photo img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vehicle-type { font-size: 18px; font-weight: 800; }
.vehicle-driver { margin-top: 2px; color: var(--hint); font-size: 14px; }
.vehicle-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; padding-top: 10px; }
.vehicle-actions .soft-btn { text-decoration: none; display: inline-flex; align-items: center; }
.primary-btn.center { justify-content: center; }
.vehicle-actions .primary-btn { width: auto; height: 44px; padding: 0 14px; font-size: 14px; border-radius: var(--radius-sm); }
.cargo-vehicle { margin: 0 0 4px; font-size: 15px; }
.cargo-to-title { margin-top: 16px; }

/* ---------- Yetkazib berish narxi (savatda har do'kon ostida) ---------- */

.cart-delivery {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 8px;
  padding: 8px 0 2px;
  font-size: 14px;
  color: var(--hint);
}
.cart-delivery b { color: var(--text); font-weight: 600; white-space: nowrap; }
.cart-delivery b.free { color: var(--success); }
/* "Yana 25 000 so'mlik qo'shsangiz — yetkazish bepul" */
.cart-nudge {
  flex-basis: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: var(--success);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Kartaga to'lov ---------- */

.segment:disabled { opacity: 0.4; cursor: not-allowed; }

#payment-mode { margin-bottom: 8px; }

/* Buyurtmadan keyin savat o'rnida faqat to'lov ma'lumoti */
.sheet.paying .cart-items,
.sheet.paying .form-section,
.sheet.paying .sheet-footer,
.sheet.paying #clear-cart-btn { display: none; }

.pay-done { display: flex; flex-direction: column; gap: 12px; padding-bottom: calc(8px + var(--safe-bottom)); }
.pay-done-title { font-size: 18px; font-weight: 800; }

.pay-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 8px;
}
.pay-card-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.pay-card-head b { color: var(--accent); white-space: nowrap; }

.pay-card-number {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
}
.pay-card-number span:first-child {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.pay-copy { color: var(--accent); font-size: 13px; font-weight: 700; white-space: nowrap; }
.pay-card-holder { margin-top: 6px; color: var(--hint); font-size: 13px; }

.reorder-btn { margin-top: 12px; }
.order-card .order-status { margin: 10px 0 0; }

.order-part .pay-card { background: var(--bg); }
.order-part .pay-card-number { background: var(--surface); }

.pay-state { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--accent); }
.pay-state.paid { color: var(--success); }

/* ---------- To'liq ekran va keng ekran (kompyuterdagi Telegram) ---------- */

/* To'liq ekranda Telegram o'z tugmalarini sahifa ustiga chiqaradi — sarlavha ular ostida qolmasin */
body.is-fullscreen .topbar {
  padding-top: calc(12px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
}

@media (min-width: 700px) {
  /* Kontent markazda, juda cho'zilib ketmaydi */
  .topbar, .dev-bar, #shops-view, #catalog-view, #orders-view {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
  }
  .topbar { padding-left: 24px; padding-right: 24px; }
  /* faqat yon tomonlar: yuqori oraliq (masalan .catalog-search — 14px) saqlanib qolsin */
  .search { margin-left: 24px; margin-right: 24px; }
  .cat-tiles { padding-left: 24px; padding-right: 24px; }
  .shop-list { padding: 16px 24px 12px; }
  .shop-hero { padding: 4px 24px 0; }
  .shop-hero .cover { height: 220px; }
  .section-tabs { padding-left: 24px; padding-right: 24px; }
  .section-title { padding-left: 24px; padding-right: 24px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; padding: 14px 24px; }
  body[data-cat="market"] .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .order-list { padding: 4px 24px 16px; }

  /* Do'konlar — ikki ustun */
  .shop-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
  .shop-group .cover, .shop-gullar .cover, .shop-market .cover { height: 170px; }

  /* Tile'lar sig'sa — aylantirmasdan bir qatorda */
  .cat-tile { flex: 1 1 0; width: auto; min-width: 120px; }

  /* Savat — pastdan chiqadigan varaq emas, ekran o'rtasidagi oyna */
  .overlay { align-items: center; justify-content: center; padding: 24px; }
  .sheet { width: 100%; max-width: 560px; max-height: 88vh; border-radius: 24px; }
  .sheet-handle { display: none; }
  .sheet-footer { bottom: -16px; }

  .cart-bar { left: 50%; right: auto; width: 520px; transform: translateX(-50%); }
  .order-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .order-list > .empty-state, .order-list > .skeleton { grid-column: 1 / -1; }
}

@media (min-width: 1000px) {
  .shop-group { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body[data-cat="market"] .product-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .shop-hero .cover { height: 260px; }
}

/* ---------- Hudud (tuman) tanlash ---------- */
.region-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 0 16px 8px; padding: 6px 12px; border: none; border-radius: 999px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  max-width: calc(100% - 32px);
}
.region-btn #region-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.region-caret { color: var(--hint); font-size: 12px; }
.region-hint { margin: 0 0 12px; color: var(--hint); font-size: 14px; }
.region-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.region-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  padding: 14px 16px; border: 2px solid transparent; border-radius: var(--radius); background: var(--surface);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.region-option.active { border-color: var(--accent); }
.region-option-name { font-size: 16px; font-weight: 700; }
.region-option-meta { color: var(--hint); font-size: 13px; }

/* ================================================================
   Harakat va sayqal — Yandex Eda / Korzinka Go uslubida:
   bo'limlar orasida silliq o'tish, oynalar pastdan sirpanib chiqadi,
   kartochkalar ketma-ket "ko'tariladi", rasmlar asta paydo bo'ladi,
   bosilganda yengil siqilish. Panel ham shu fayldan foydalanadi.
   (transform o'rniga translate/scale xossalari — mavjud transform'lar bilan to'qnashmaydi)
   ================================================================ */

:root {
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --shadow-card: 0 1px 2px rgba(20, 20, 30, 0.04), 0 6px 18px rgba(20, 20, 30, 0.07);
  --shadow-float: 0 12px 32px rgba(20, 20, 30, 0.16);
}
@media (prefers-color-scheme: dark) {
  :root {
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.28);
    --shadow-float: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}

body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.product-price, .order-total, .primary-btn-total, .cart-item-price, .stat b, .cart-bar { font-variant-numeric: tabular-nums; }

/* Yuqori panel va bo'lim tablari: yarim shaffof, orqasi xiralashadi (kontent ostidan o'tadi) */
.topbar, .section-tabs {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
}
.topbar { transition: box-shadow 0.25s ease; }
.topbar.scrolled { box-shadow: 0 1px 0 var(--line), 0 8px 20px rgba(20, 20, 30, 0.06); }

/* ---------- Bosilganda javob ---------- */
button, .shop, .product, .vehicle-card, .region-option, .cat-tile, .chip, .tab, .segment, .home-tab, .section-tab {
  transition: scale 0.16s var(--ease-out), background-color 0.22s ease, color 0.22s ease,
              box-shadow 0.22s ease, border-color 0.22s ease, opacity 0.22s ease, translate 0.25s var(--ease-out);
}
button:active:not(:disabled), .region-option:active { scale: 0.96; }
.shop:active, .vehicle-card:active, .primary-btn:active:not(:disabled), .cart-bar:active,
.p-row:active, .p-main:active, .t-btn:active, .cargo-row:active { scale: 0.985; }
.stepper button:active:not(:disabled) { scale: 0.82; }
.home-tab.active, .segment.active, .lang-btn span.active { transition: background-color 0.25s ease, box-shadow 0.25s ease; }

/* ---------- Bo'limlar orasida o'tish ---------- */
@keyframes viewForward { from { opacity: 0; translate: 32px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes viewBack { from { opacity: 0; translate: -32px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes viewFade { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
.view-forward { animation: viewForward 0.34s var(--ease-out) both; }
.view-back { animation: viewBack 0.34s var(--ease-out) both; }
.view-fade { animation: viewFade 0.3s var(--ease-out) both; }

/* ---------- Kartochkalar ketma-ket ko'tariladi ---------- */
@keyframes rise { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
.stagger-in :is(.shop, .product, .vehicle-card, .order-card, .group-head, .section-title, .stat, .card, .cargo-item, .p-row) {
  animation: rise 0.44s var(--ease-out) both;
}
.stagger-in :is(.shop, .product, .vehicle-card, .order-card, .stat, .card, .cargo-item, .p-row):nth-child(2) { animation-delay: 40ms; }
.stagger-in :is(.shop, .product, .vehicle-card, .order-card, .stat, .card, .cargo-item, .p-row):nth-child(3) { animation-delay: 80ms; }
.stagger-in :is(.shop, .product, .vehicle-card, .order-card, .stat, .card, .cargo-item, .p-row):nth-child(4) { animation-delay: 120ms; }
.stagger-in :is(.shop, .product, .vehicle-card, .order-card, .stat, .card, .cargo-item, .p-row):nth-child(5) { animation-delay: 160ms; }
.stagger-in :is(.shop, .product, .vehicle-card, .order-card, .stat, .card, .cargo-item, .p-row):nth-child(6) { animation-delay: 200ms; }
.stagger-in :is(.shop, .product, .vehicle-card, .order-card, .stat, .card, .cargo-item, .p-row):nth-child(7) { animation-delay: 240ms; }
.stagger-in :is(.shop, .product, .vehicle-card, .order-card, .stat, .card, .cargo-item, .p-row):nth-child(n+8) { animation-delay: 280ms; }

/* ---------- Oynalar (savat, so'rov, hudud, panel varaqlari) ---------- */
@keyframes overlayIn { from { background-color: rgba(0, 0, 0, 0); } }
@keyframes overlayOut { to { background-color: rgba(0, 0, 0, 0); } }
@keyframes sheetUp { from { translate: 0 100%; } to { translate: 0 0; } }
@keyframes sheetDown { from { translate: 0 0; } to { translate: 0 100%; } }
@keyframes sheetPop { from { opacity: 0; scale: 0.96; translate: 0 14px; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes sheetAway { to { opacity: 0; scale: 0.97; translate: 0 10px; } }
.overlay:not(.hidden) { animation: overlayIn 0.24s ease both; }
.overlay:not(.hidden) > .sheet { animation: sheetUp 0.38s var(--ease-out) both; }
.overlay.closing { animation: overlayOut 0.2s ease both; pointer-events: none; }
.overlay.closing > .sheet { animation: sheetDown 0.2s cubic-bezier(0.4, 0, 1, 1) both; }
.sheet { box-shadow: var(--shadow-float); overscroll-behavior: contain; }
@media (min-width: 700px) {
  .overlay:not(.hidden) > .sheet { animation-name: sheetPop; animation-duration: 0.3s; }
  .overlay.closing > .sheet { animation-name: sheetAway; }
}

/* ---------- Savat tugmasi ---------- */
@keyframes barIn { from { opacity: 0; translate: 0 140%; } to { opacity: 1; translate: 0 0; } }
@keyframes bump { 0% { scale: 1; } 35% { scale: 1.045; } 100% { scale: 1; } }
.cart-bar { box-shadow: 0 10px 28px var(--accent-shadow); }
.cart-bar.bar-in { animation: barIn 0.45s var(--ease-spring) both; }
.cart-bar.bump { animation: bump 0.4s var(--ease-out); }
.cart-bar.bump .cart-count { animation: bump 0.4s var(--ease-out); }

/* ---------- Rasmlar asta paydo bo'ladi ---------- */
:is(.cover, .product-img, .cart-thumb, .vehicle-photo, .p-thumb) img { opacity: 0; transition: opacity 0.4s ease, scale 0.6s var(--ease-out); }
:is(.cover, .product-img, .cart-thumb, .vehicle-photo, .p-thumb) img.is-loaded { opacity: 1; }

/* ---------- Do'kon kartochkasi (Yandex Eda uslubi) ---------- */
.cover { isolation: isolate; }
.cover:has(img)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.22));
  pointer-events: none;
}
.cover-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 1;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #16161a;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}
.shop-name { line-height: 1.2; }

/* ---------- Mahsulot kartochkasi ---------- */
.product { border: 1px solid transparent; }
.product-img { background-clip: padding-box; }
.add-btn { letter-spacing: -0.1px; }
@keyframes pop { 0% { scale: 0.85; opacity: 0; } 100% { scale: 1; opacity: 1; } }
.empty-state .big-emoji { animation: pop 0.45s var(--ease-spring) both; }

/* Sichqoncha bilan (kompyuter): ustiga kelganda yengil ko'tarilish */
@media (hover: hover) and (pointer: fine) {
  .shop:hover .cover { box-shadow: var(--shadow-card); }
  .shop:hover .cover img { scale: 1.04; }
  .product:hover { translate: 0 -3px; box-shadow: var(--shadow-card); }
  .product:hover .product-img img { scale: 1.05; }
  .cat-tile:hover { translate: 0 -2px; box-shadow: var(--shadow-card); }
  .cat-tile.active:hover { box-shadow: inset 0 0 0 2.5px var(--text), var(--shadow-card); }
  .vehicle-card:hover, .region-option:hover { box-shadow: var(--shadow-card); }
  .section-tab:not(.active):hover, .pill-btn:hover, .icon-btn:hover { background: color-mix(in srgb, var(--surface) 80%, var(--text) 8%); }
}

/* Fokus — klaviatura bilan ishlaganda ko'rinadi */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field:focus { box-shadow: 0 0 0 4px var(--accent-soft); transition: box-shadow 0.2s ease, border-color 0.2s ease; }

/* Tizimda "harakatni kamaytirish" yoqilgan bo'lsa — animatsiyasiz */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Yon tomonga aylanadigan qatorlar (bo'lim tablari, toifa plitkalari): chekkada keskin kesilmasin —
   faqat chekka oralig'ida asta yo'qoladi (birinchi va oxirgi element to'liq ko'rinadi) */
.section-tabs, .cat-tiles {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
}
@media (min-width: 700px) {
  .section-tabs, .cat-tiles {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  }
}
/* Keng ekran: Xizmatlar sahifasi, "Do'konlar | Xizmatlar" almashtirgichi va hudud tugmasi ham
   do'konlar sahifasi kabi markazda (1120px), yon oraliqlar 24px */
@media (min-width: 700px) {
  #services-view { max-width: 1120px; margin-left: auto; margin-right: auto; }
  .home-switch { width: calc(100% - 48px); max-width: 1072px; margin-left: auto; margin-right: auto; }
  .region-btn { margin-left: max(24px, calc((100% - 1072px) / 2)); }
  #service-chips { padding-left: 24px; padding-right: 24px; }
  .services-hint { margin-left: 24px; margin-right: 24px; }
  .vehicle-list { padding: 4px 24px 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .vehicle-list > .group-head, .vehicle-list > .empty-state, .vehicle-list > .skeleton { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .vehicle-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Uzun bir so'z (masalan ruscha «Грузоперевозки») so'z o'rtasidan bo'linmaydi — app.js: fitTileLabels
   shriftni sig'guncha kichraytiradi */
.cat-label { overflow-wrap: normal; }

/* ---------- Murojaatlar: shikoyat va taklif ---------- */
.complain-btn { display: inline-block; margin-top: 8px; padding: 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.ticket-line { margin-top: 8px; padding: 7px 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.ticket-owner, .ticket-answered { background: rgba(245, 166, 35, 0.14); color: #c27a00; }
.ticket-platform { background: var(--info-soft); color: var(--info); }
.ticket-resolved { background: var(--success-soft); color: var(--success); }
.suggest-btn { margin-top: 4px; }
.order-list > .suggest-btn { grid-column: 1 / -1; }
.status-rq-new { background: rgba(245, 166, 35, 0.16); color: #c27a00; }
.status-rq-accepted { background: var(--success-soft); color: var(--success); }
.status-rq-done { background: var(--line); color: var(--hint); }
.status-rq-rejected { background: var(--danger-soft); color: var(--danger); }
.ticket-target { margin: 0 0 4px; color: var(--hint); font-size: 14px; font-weight: 600; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  border: 1.5px solid transparent; border-radius: 999px; padding: 8px 14px;
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
}
.chip-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.file-pick { display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* ---------- Tor ekran (360px) ---------- */
.topbar.tight h1 { font-size: 21px; letter-spacing: -0.3px; }
.topbar.tight .pill-btn { padding: 8px 10px; }
.topbar.tight .lang-btn span { padding: 5px 7px; }
.topbar.tighter .wallet-pill .pill-label { display: none; }
.topbar.tightest .pill-label { display: none; }
/* Karta raqami doim bir qatorda; joy yetmasa «Nusxalash» pastga tushadi */
.pay-card-number { flex-wrap: wrap; row-gap: 4px; }
.pay-card-number span:first-child { white-space: nowrap; font-size: clamp(15px, 4.6vw, 17px); }
/* Xizmat plitkalari kengroq: nomlari uzunroq ("Konditsioner ustasi", "Грузоперевозки") */
#service-chips .cat-tile { width: 116px; }
.order-title small { white-space: nowrap; }

/* ================================================================
   Hamyon (token): oltin rang — pul emas, "sovg'a" ekani sezilsin
   ================================================================ */
:root {
  --gold: #f5a524;
  --gold-soft: rgba(245, 165, 36, 0.16);
  --gold-text: #a86400;
}
@media (prefers-color-scheme: dark) {
  :root { --gold-soft: rgba(245, 165, 36, 0.2); --gold-text: #ffc24d; }
}

/* Tanga belgisi: 🪙 emojisi Windows 10'da yo'q (bo'sh kvadrat) — CSS bilan chiziladi, hamma joyda bir xil.
   O'lchami matn shriftiga teng (1em), yonidagi matndan kichik oraliq bilan */
.coin-ic {
  display: inline-block;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  margin-right: 0.3em;
  border-radius: 50%;
  vertical-align: -0.14em;
  background: radial-gradient(circle at 34% 30%, #fff3c4 0 10%, #ffd45c 32%, #f5a524 64%, #cf7f08 100%);
  box-shadow: inset 0 0 0 0.075em rgba(150, 86, 0, 0.6), inset 0 0 0 0.16em rgba(255, 228, 150, 0.85);
}

/* Yuqoridagi tugma: tanga + balans; token mahsulotiga yetsa — oltin hoshiya, tanga vaqti-vaqti bilan "uradi" */
.wallet-pill { gap: 5px; }
.wallet-pill .coin-ic { font-size: 17px; margin-right: 0; }
.pill-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: #3d2600;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.wallet-pill.ready { background: var(--gold-soft); box-shadow: inset 0 0 0 1.5px var(--gold); }
@keyframes coinBeat { 0%, 78%, 100% { scale: 1; } 86% { scale: 1.22; } 93% { scale: 0.96; } }
.wallet-pill.ready .coin-ic { animation: coinBeat 2.6s ease-in-out infinite; }

/* ---------- Hamyonim sahifasi ---------- */
.wallet { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; }
.wallet-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 18px 18px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #ffd86b 0%, #f7b733 45%, #ef8f12 100%);
  color: #3a2400;
  box-shadow: 0 10px 28px rgba(239, 143, 18, 0.28);
}
/* Bezak: o'ng yuqori burchakda katta yarim shaffof tanga halqasi */
.wallet-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -44px;
  top: -56px;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  border: 16px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 14px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.wallet-card-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.72; }
.wallet-card-amount { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.wallet-coin { font-size: 34px; align-self: center; margin-right: 2px; box-shadow: inset 0 0 0 0.075em rgba(150, 86, 0, 0.6), inset 0 0 0 0.16em rgba(255, 228, 150, 0.85), 0 3px 10px rgba(120, 60, 0, 0.25); }
.wallet-card-amount b { font-size: 48px; font-weight: 800; letter-spacing: -1px; line-height: 1; font-variant-numeric: tabular-nums; }
.wallet-card-amount span:last-child { font-size: 18px; font-weight: 700; }
.wallet-card-rule { margin: 10px 0 0; max-width: 34em; font-size: 13px; line-height: 1.4; opacity: 0.85; }

/* Doimiy eslatma: eng arzon token mahsulotiga yetadi */
.wallet-notice { padding: 14px; border-radius: var(--radius); background: var(--success-soft); color: var(--success); }
.wallet-notice p { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.4; }
.wallet-go { margin-top: 10px; background: var(--success); color: #ffffff; }

/* Yetmasa: qancha qolgani */
.wallet-goal { padding: 14px; border-radius: var(--radius); background: var(--surface); }
.wallet-goal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; font-weight: 600; }
.wallet-goal-head b { white-space: nowrap; color: var(--gold-text); font-variant-numeric: tabular-nums; }
.wallet-bar { height: 8px; margin-top: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.wallet-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffd86b, #ef8f12); }

.wallet-subtitle { margin: 8px 2px 0; font-size: 17px; font-weight: 800; }
.wallet-rewards, .wallet-history { display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.reward-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.reward-row:disabled { cursor: default; opacity: 0.6; }
.reward-row .cart-thumb { width: 44px; height: 44px; font-size: 22px; }
.reward-info, .tx-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.reward-info b, .tx-info b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reward-info small, .tx-info small { color: var(--hint); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reward-cost { flex-shrink: 0; padding: 5px 10px; border-radius: 999px; background: var(--bg); color: var(--hint); font-size: 14px; font-weight: 800; white-space: nowrap; }
.reward-cost.ok { background: var(--gold-soft); color: var(--gold-text); }

.tx-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.reward-row:last-child, .tx-row:last-child { border-bottom: none; }
.tx-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
.tx-delta { flex-shrink: 0; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tx-delta.plus { color: var(--success); }
.wallet-empty { margin: 0; padding: 16px; border-radius: var(--radius); background: var(--surface); color: var(--hint); font-size: 14px; text-align: center; }
.wallet-skeleton { height: 150px; }
.wallet.stagger-in > * { animation: rise 0.44s var(--ease-out) both; }
.wallet.stagger-in > :nth-child(2) { animation-delay: 50ms; }
.wallet.stagger-in > :nth-child(3) { animation-delay: 100ms; }
.wallet.stagger-in > :nth-child(4) { animation-delay: 150ms; }
.wallet.stagger-in > :nth-child(n+5) { animation-delay: 200ms; }

/* ---------- Token mahsuloti: narx o'rnida token, savat o'rnida «Token bilan olish» ---------- */
.product-price.token, .order-total.token, .pay-state.token { color: var(--gold-text); }
/* "Yana 7 token kerak" tor kartochkada ikki qatorga tushishi mumkin — kesilmasin */
.product .add-btn.token-btn { height: auto; min-height: 38px; padding: 6px 8px; line-height: 1.2; }
.product .add-btn.token-btn:not(:disabled) { background: var(--gold-soft); color: var(--gold-text); }
.product .add-btn.token-btn:disabled { font-size: 13px; }

/* ---------- Token bilan olish oynasi ---------- */
.redeem-product { display: flex; align-items: center; gap: 12px; margin-top: 4px; padding: 12px; border-radius: var(--radius); background: var(--surface); }
.redeem-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.redeem-info b { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.redeem-info small { color: var(--hint); font-size: 13px; }
.redeem-cost { flex-shrink: 0; padding: 6px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-text); font-weight: 800; white-space: nowrap; }
.redeem-balance { margin: 10px 2px 0; color: var(--hint); font-size: 14px; font-weight: 600; }
.redeem-balance:empty { display: none; }
.redeem-balance.short { color: var(--danger); }
.pickup-only {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--info-soft);
  color: var(--info);
  font-size: 14px;
}
.pickup-only b { font-size: 15px; }
.token-primary { background: linear-gradient(135deg, #f7b733, #ef8f12); color: #3a2400; box-shadow: 0 8px 22px rgba(239, 143, 18, 0.3); }
.token-primary:active:not(:disabled) { background: linear-gradient(135deg, #efa91f, #e0820a); }
#redeem-done { margin-top: 14px; }

@media (min-width: 700px) {
  #wallet-view { max-width: 720px; margin-left: auto; margin-right: auto; }
  .wallet { padding: 4px 24px 16px; }
}
/* ---------- Yetkazish manzili: joylashuv (GPS yoki xarita) — narx masofaga qarab ---------- */
.location-row { display: flex; gap: 8px; }
.location-row .soft-btn { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.2; padding: 8px 10px; }
.cart-delivery b.need { color: var(--accent); font-weight: 700; }
.map-sheet { display: flex; flex-direction: column; }
.map-box {
  position: relative;
  height: min(58vh, 460px);
  margin-top: 6px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
#map { position: absolute; inset: 0; }
/* Belgi xarita markazida turadi, xarita uning ostida suriladi (uchi — aniq nuqta) */
.map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 500;
  translate: -50% -100%;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}
.map-hint { margin: 8px 2px 0; }
.leaflet-container { font: inherit; }
/* ---------- Chegirma: belgi, chizilgan asl narx, muddat (backend/pricing.py) ---------- */
.discount-badge {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  padding: 3px 8px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 12px; font-weight: 800; line-height: 1.3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.product-price.sale { color: var(--danger); }
.product-price.sale s { margin-left: 2px; color: var(--hint); font-size: 13px; font-weight: 600; }
/* Ombor qoldig'i kam: «Faqat 3 ta qoldi» (kartada), «Omborda 3 ta» (savatda, chegaraga yetganda) */
.stock-left { margin-top: 3px; color: var(--danger); font-size: 11.5px; font-weight: 700; }
.discount-until {
  display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 999px;
  background: var(--danger-soft); color: var(--danger); font-size: 11.5px; font-weight: 700;
}
/* «Hamyonim»: kunlik chegirma xabarini yoqish/o'chirish */
.notify-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 18px 0 8px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); cursor: pointer;
}
.notify-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notify-text small { color: var(--hint); font-size: 12.5px; line-height: 1.35; }
.notify-switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: 0 0 auto;
  width: 46px; height: 28px; margin: 0; border-radius: 999px; background: var(--line); cursor: pointer;
  transition: background-color 0.2s ease;
}
.notify-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s ease;
}
.notify-switch:checked { background: var(--success); }
.notify-switch:checked::after { transform: translateX(18px); }
.notify-switch:disabled { opacity: 0.6; }
/* ---------- Bosh sahifa: toifa bannerlari (katta rasm + ustida nomi), vertikal ro'yxat ---------- */
.cat-banners { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 4px; }
.cat-banner {
  position: relative; display: block; width: 100%; aspect-ratio: 3 / 1; min-height: 116px; padding: 0;
  border: none; border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; text-align: left; font: inherit;
  transition: transform 0.15s ease;
}
.cat-banner:active { transform: scale(0.985); }
.cat-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Rasm ustida — chapdan qorong'i gradient, oq matn o'qiladi */
.cat-banner.has-image { color: #fff; }
.cat-banner.has-image::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.3) 55%, rgba(0, 0, 0, 0.06) 100%);
}
.cat-banner-text {
  position: absolute; left: 16px; right: 34%; bottom: 14px; z-index: 1;
  display: flex; flex-direction: column; gap: 3px;
}
.cat-banner-text b { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.12; }
.cat-banner-text small { font-size: 13px; font-weight: 500; line-height: 1.3; opacity: 0.92; }
.cat-banner-count {
  position: absolute; top: 12px; left: 16px; z-index: 1; padding: 3px 9px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.35); color: #fff; font-size: 12px; font-weight: 700;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
/* Rasm hali yo'q: toifa rangi (tone-*) va katta belgi */
.cat-banner-emoji { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 64px; line-height: 1; }
.cat-banner:not(.has-image) .cat-banner-count { background: rgba(255, 255, 255, 0.55); color: inherit; }
.cat-banner.soon { opacity: 0.8; }
@media (min-width: 700px) {
  .cat-banners { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 12px 24px 4px; }
}
/* ---------- «⭐ Tavsiya etamiz»: katalog boshida gorizontal aylanadigan qator ---------- */
.featured-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 10px) / 2.25); gap: 10px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; scrollbar-width: none;
  padding: 10px 16px 14px;
}
.featured-row::-webkit-scrollbar { display: none; }
.featured-row .product { scroll-snap-align: start; }
.featured-badge {
  position: absolute; top: 8px; right: 8px; z-index: 1; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1;
  background: rgba(255, 255, 255, 0.92); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
@media (min-width: 700px) {
  .featured-row { grid-auto-columns: calc((100% - 30px) / 3.3); gap: 14px; padding: 14px 24px; scroll-padding: 0 24px; }
}
@media (min-width: 1000px) {
  .featured-row { grid-auto-columns: calc((100% - 42px) / 4.3); }
}/* ---------- Variantli mahsulot: o'lcham tanlash oynasi (Kichik/Katta, 1/2 porsiya) ---------- */
.variant-options { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.variant-option {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 10px 14px;
  border: 2px solid transparent; border-radius: var(--radius); background: var(--surface); color: var(--text);
  font: inherit; text-align: left; cursor: pointer; transition: border-color 0.2s ease, background-color 0.2s ease;
}
.variant-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.variant-radio {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--hint);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.variant-option.selected .variant-radio { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 10px var(--accent); }
.variant-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.variant-name small { color: var(--accent); font-size: 12.5px; font-weight: 600; }
.variant-price { flex-shrink: 0; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.variant-footer { display: flex; align-items: center; gap: 10px; }
.variant-footer .primary-btn { flex: 1; min-width: 0; margin: 0; }
.variant-footer .primary-btn:disabled { opacity: 0.55; }
/* Kartochkadagi «Tanlash · 2» — savatda bor (oddiy mahsulotning stepperiga o'xshab ajralib tursin) */
.product .add-btn.in-cart:not(:disabled) { background: var(--accent); color: var(--accent-text); }
/* Savatda: "Kapuchino — Katta (500ml)" — o'lcham kesilib qolmasin */
.cart-item-name.has-variant { white-space: normal; overflow-wrap: anywhere; }
.cart-variant { color: var(--hint); font-weight: 600; }
.variant-footer .primary-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.15; }
.variant-footer .primary-btn small { font-size: 13px; font-weight: 700; opacity: 0.9; font-variant-numeric: tabular-nums; }
/* Variantli mahsulot: o'lcham narxi — chegirmada (asl narx chizilgan) yoki token rejimida */
.variant-price.sale { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.variant-price.sale b { color: var(--danger); font-size: 15px; font-weight: 800; }
.variant-price.sale s { color: var(--hint); font-size: 12px; font-weight: 600; }
.variant-price.token { display: inline-flex; align-items: center; color: var(--gold-text); }
.variant-discount { flex-shrink: 0; padding: 5px 10px; border-radius: 999px; background: var(--danger-soft); color: var(--danger); font-weight: 800; }
/* Pulga: har o'lcham o'z soni bilan — nomi va narxi chapda, «+» yoki «− son +» o'ngda (bir oynada bir nechta o'lcham) */
.variant-option.multi { cursor: default; padding: 10px 10px 10px 14px; }
.variant-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.variant-info .variant-name { flex: none; }
.variant-option.multi .variant-price { font-size: 14px; }
.variant-option.multi .variant-price.sale { flex-direction: row; align-items: baseline; gap: 6px; }
.variant-option.multi .variant-price.sale b { font-size: 14px; }
.variant-step { flex-shrink: 0; }
.variant-plus {
  width: 44px; height: 36px; border: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  font-size: 22px; font-weight: 700; line-height: 1; cursor: pointer;
}
.variant-plus:active { scale: 0.92; }