/* ===================== Mini App dizayni ===================== */
:root {
  --bg: var(--tg-theme-secondary-bg-color, #f1f2f6);
  --surface: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #ffffff));
  --surface-2: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #111418);
  --hint: var(--tg-theme-hint-color, #8a919b);
  --link: var(--tg-theme-link-color, #2481cc);
  --accent: var(--tg-theme-button-color, #2481cc);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --accent-soft: rgba(36, 129, 204, 0.12);
  --danger: var(--tg-theme-destructive-text-color, #e5484d);
  --sep: rgba(127, 127, 127, 0.16);
  --sep-strong: rgba(127, 127, 127, 0.28);
  --input-bg: var(--tg-theme-secondary-bg-color, #f1f2f6);
  --img-bg: #ffffff;
  --green: #16a34a;
  --amber: #d97706;
  --sale: #ef3d4a;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.06);
  --radius: 16px;
  --tabbar-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --accent-soft: color-mix(in srgb, var(--accent) 13%, transparent);
    --sep: color-mix(in srgb, var(--text) 9%, transparent);
    --sep-strong: color-mix(in srgb, var(--text) 16%, transparent);
  }
}
html[data-scheme="dark"] { --img-bg: #f4f5f7; --shadow: none; }
@media (prefers-color-scheme: dark) {
  html.no-tg {
    --bg: #0f1115; --surface: #1a1d23; --surface-2: #1a1d23; --text: #eef0f3; --hint: #8b929c;
    --input-bg: #0f1115; --img-bg: #f4f5f7; --shadow: none;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  min-height: 100vh;
}
html.sheet-open, html.sheet-open body { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; }
.icon { display: inline-block; flex: none; vertical-align: middle; }
.muted { color: var(--hint); }
.small { font-size: 13px; }
.green { color: var(--green); }
.accent { color: var(--accent); }
.right-text { text-align: right; max-width: 60%; }
.pad { padding: 0 12px 12px; }
.pad-x { padding-left: 12px; padding-right: 12px; }
.pad-top { padding-top: 4px; }
.bottom-space { height: 24px; }

/* ----------------------------- Ilova ----------------------------- */
#app { min-height: 100vh; }
.app { padding-bottom: 16px; min-height: 100vh; }
.app.has-tabs { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); }
.app.has-main { padding-bottom: calc(76px + var(--safe-b)); }
.app.has-tabs.has-main { padding-bottom: calc(var(--tabbar-h) + 76px + var(--safe-b)); }
.screen-host.enter-fwd { animation: enterFwd 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
.screen-host.enter-back { animation: enterBack 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.screen-host.enter-tab { animation: fadeIn 0.18s ease; }
@keyframes enterFwd { from { opacity: 0.3; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes enterBack { from { opacity: 0.3; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.splash, .center-spin { display: flex; align-items: center; justify-content: center; padding: 28px; }
.splash { min-height: 100vh; }
.center-spin.tall { min-height: 50vh; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--sep-strong); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.spinner.xs { width: 14px; height: 14px; border-width: 2px; margin-left: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------- Sarlavhalar ----------------------------- */
.screen-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 10px; background: var(--bg);
}
.screen-head.large .screen-title { font-size: 26px; }
.screen-head-text { flex: 1; min-width: 0; }
.screen-title { font-size: 20px; font-weight: 700; letter-spacing: -0.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-sub { color: var(--hint); font-size: 13px; margin-top: 1px; }
.screen-head-right { display: flex; gap: 4px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); transition: background 0.15s;
}
.icon-btn:active { background: var(--sep); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; color: var(--hint); }
.back-btn { margin-left: -6px; }

/* ------------------------------ Bosh sahifa ----------------------------- */
.home-top { padding: 14px 12px 8px; }
.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.brand-logo {
  width: 46px; height: 46px; border-radius: 14px; overflow: hidden; flex: none;
  background: var(--accent); color: var(--accent-text); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; box-shadow: var(--shadow);
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.brand-logo.xl { width: 84px; height: 84px; border-radius: 24px; font-size: 34px; margin: 0 auto 12px; }
.brand-text { min-width: 0; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.2; }
.brand-tag { color: var(--hint); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-bar {
  width: 100%; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px;
  background: var(--surface); border-radius: 14px; color: var(--hint); text-align: left; box-shadow: var(--shadow);
}

.notice {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 12px 12px; padding: 12px 14px;
  border-radius: 14px; font-size: 14px; line-height: 1.35;
}
.notice .icon { margin-top: 1px; }
.notice-info { background: var(--accent-soft); color: var(--text); }
.notice-info .icon { color: var(--accent); }
.notice-warn { background: rgba(245, 158, 11, 0.14); }
.notice-warn .icon { color: var(--amber); }
.notice-err { background: rgba(229, 72, 77, 0.12); }
.notice-err .icon { color: var(--danger); }
.notice.flat { margin: 12px 0 0; }

.banners { margin: 4px 0 14px; position: relative; }
.banner-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 0; padding: 0;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner {
  flex: 0 0 100%; scroll-snap-align: center; padding: 0 12px; position: relative; cursor: pointer;
}
.banner img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 18px; background: var(--surface); }
.banner-title {
  position: absolute; left: 24px; right: 24px; bottom: 12px; color: #fff; font-weight: 700; font-size: 16px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
.dots { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
.dots span { width: 6px; height: 6px; border-radius: 3px; background: var(--sep-strong); transition: all 0.25s; }
.dots span.on { width: 18px; background: var(--accent); }
.dots.on-image { position: absolute; left: 0; right: 0; bottom: 12px; margin: 0; }
.dots.on-image span { background: rgba(0, 0, 0, 0.18); }
.dots.on-image span.on { background: var(--accent); }

.section { margin: 6px 0 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 10px; }
.section-title { font-size: 19px; font-weight: 750; letter-spacing: -0.2px; display: flex; align-items: center; gap: 6px; }
.section-title.sm { font-size: 16px; }
.section-emoji { font-size: 17px; }
.link-btn { color: var(--link); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; padding: 4px 0; }

.cat-rail { display: flex; gap: 10px; overflow-x: auto; padding: 0 12px 4px; scrollbar-width: none; }
.cat-rail::-webkit-scrollbar { display: none; }
.cat-chip { flex: 0 0 76px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; text-align: center; line-height: 1.2; }
.cat-chip-img { width: 68px; height: 68px; border-radius: 20px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.cat-chip span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; }

/* ------------------------------ Rasm ----------------------------------- */
.img { position: relative; width: 100%; height: 100%; background: var(--img-bg); overflow: hidden; }
.img img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.25s; }
.img.contain img { object-fit: contain; }
.img.loaded img { opacity: 1; }
.img-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #b7bdc6; background: var(--surface-2); }
.img-ph { background: linear-gradient(135deg, rgba(127,127,127,0.08), rgba(127,127,127,0.03)); }

/* --------------------------- Mahsulot kartasi -------------------------- */
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 12px; }
@media (min-width: 560px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 860px) { .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pcard {
  background: var(--surface); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow); cursor: pointer; position: relative; transition: transform 0.12s;
}
.pcard:active { transform: scale(0.985); }
.pcard-media { position: relative; aspect-ratio: 1 / 1; }
.pcard.oos .pcard-media .img img { opacity: 0.45; }
.pcard-badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 8px; line-height: 1.25; }
.badge-sale { background: var(--sale); color: #fff; }
.badge-new { background: #7c3aed; color: #fff; }
.badge.big { position: absolute; top: 14px; left: 14px; font-size: 13px; padding: 5px 9px; border-radius: 10px; }
.fav-btn {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #9aa1ab;
  background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(6px);
}
.fav-btn.on { color: var(--sale); }
.fav-btn.on .icon { fill: currentColor; }
.oos-label {
  position: absolute; left: 8px; bottom: 8px; background: rgba(17, 20, 24, 0.72); color: #fff;
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 8px;
}
.pcard-body { padding: 9px 10px 10px; display: flex; flex-direction: column; flex: 1; }
.pcard-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.price { font-weight: 800; font-size: 15.5px; letter-spacing: -0.2px; white-space: nowrap; }
.price.sale { color: var(--sale); }
.old-price { color: var(--hint); text-decoration: line-through; font-size: 12px; white-space: nowrap; }
.old-price.lg { font-size: 15px; }
.pcard-name {
  font-size: 13.5px; line-height: 1.32; margin: 4px 0 8px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.64em;
}
.pcard-action { height: 34px; }
.btn-add {
  width: 100%; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-text);
  font-size: 13.5px; font-weight: 650; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-add:active { transform: scale(0.97); }
.btn-add:disabled { background: var(--sep); color: var(--hint); }

.rail { display: flex; gap: 8px; overflow-x: auto; padding: 0 12px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.pcard.rail { flex: 0 0 clamp(146px, 42vw, 190px); scroll-snap-align: start; }

/* -------------------------------- Stepper ------------------------------- */
.stepper {
  display: flex; align-items: center; justify-content: space-between; background: var(--accent-soft);
  border-radius: 10px; height: 34px; color: var(--accent); user-select: none;
}
.stepper-btn { width: 36px; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--accent); border-radius: 10px; }
.stepper-btn:active { background: var(--accent-soft); }
.stepper-btn:disabled { opacity: 0.35; }
.stepper-val { font-weight: 750; min-width: 22px; text-align: center; color: var(--text); }
.stepper-md { height: 40px; border-radius: 12px; }
.stepper-md .stepper-btn { width: 42px; }
.stepper-sm { width: 100%; }
.cart-row .stepper-sm { width: 112px; }

/* ------------------------------- Skeleton ------------------------------- */
.skel { background: linear-gradient(90deg, var(--sep) 0%, rgba(127,127,127,0.06) 50%, var(--sep) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-card { padding-bottom: 10px; cursor: default; }
.skel-img { aspect-ratio: 1 / 1; border-radius: 0; }
.skel-line { height: 12px; margin: 10px 10px 0; }
.skel-btn { height: 32px; margin: 12px 10px 0; border-radius: 10px; }
.w60 { width: 60%; } .w90 { width: 85%; }

/* ------------------------------- Bo'sh holat ---------------------------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 28px; }
.empty-icon {
  width: 84px; height: 84px; border-radius: 28px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 18px;
}
.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.empty-text { color: var(--hint); font-size: 14px; max-width: 300px; margin-bottom: 18px; }

/* -------------------------------- Tugmalar ------------------------------ */
.btn {
  height: 46px; padding: 0 18px; border-radius: 13px; font-weight: 650; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform 0.1s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft.ok { color: var(--green); background: rgba(22, 163, 74, 0.12); }
.btn-danger-soft { background: rgba(229, 72, 77, 0.12); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { height: 40px; font-size: 14px; border-radius: 11px; }
.btn-grow { flex: 1; }
.stack-btns { display: flex; flex-direction: column; gap: 8px; }

/* -------------------------------- Kategoriya ---------------------------- */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 12px 12px; }
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cat-card { background: var(--surface); border-radius: 16px; overflow: hidden; text-align: left; box-shadow: var(--shadow); }
.cat-card-img { aspect-ratio: 16 / 11; }
.cat-card-body { padding: 10px 12px 12px; }
.cat-card-name { font-weight: 650; font-size: 14.5px; line-height: 1.25; }
.cat-card-count { color: var(--hint); font-size: 12.5px; margin-top: 2px; }

.chips-row { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 10px; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 14px; border-radius: 17px; background: var(--surface); font-size: 14px; font-weight: 550;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; box-shadow: var(--shadow); border: 1px solid transparent;
}
.chip small { color: var(--hint); font-size: 11.5px; }
.chip.on { background: var(--accent); color: var(--accent-text); }
.chip.on small { color: var(--accent-text); opacity: 0.8; }
.toolbar { display: flex; gap: 8px; padding: 0 12px 10px; }
.tool-btn {
  flex: 1; height: 38px; border-radius: 12px; background: var(--surface); display: inline-flex; align-items: center;
  justify-content: center; gap: 7px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
}
.tool-btn.on { color: var(--accent); }
.tool-badge { background: var(--accent); color: var(--accent-text); font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.infinite { min-height: 2px; display: flex; justify-content: center; padding: 18px 0; }
.result-count { color: var(--hint); font-size: 13px; padding: 4px 14px 10px; }

/* ------------------------------- Bottom sheet --------------------------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.42); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 640px; max-height: 88vh; background: var(--surface-2); border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column; padding-bottom: var(--safe-b);
}
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--sep-strong); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 4px 18px; }
.sheet-title { font-size: 18px; font-weight: 750; }
.sheet-body { overflow-y: auto; padding: 6px 18px 16px; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--sep); }
.sheet-enter-active, .sheet-leave-active { transition: background 0.25s; }
.sheet-enter-active .sheet, .sheet-leave-active .sheet { transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sheet-enter-from, .sheet-leave-to { background: rgba(0, 0, 0, 0); }
.sheet-enter-from .sheet, .sheet-leave-to .sheet { transform: translateY(100%); }
.option-row { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid var(--sep); font-size: 15.5px; text-align: left; }
.option-row:last-child { border-bottom: 0; }
.f-group { padding: 10px 0 14px; border-bottom: 1px solid var(--sep); }
.f-group:last-of-type { border-bottom: 0; }
.f-title { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.f-price { display: flex; align-items: center; gap: 8px; }
.f-dash { color: var(--hint); }
.f-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.f-chips .chip { box-shadow: none; background: var(--input-bg); }
.f-chips .chip.on { background: var(--accent); }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 4px; font-weight: 600; }
.switch { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 14px; background: var(--sep-strong); position: relative; transition: background 0.2s; flex: none; cursor: pointer; }
.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; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }

/* --------------------------------- Qidiruv ------------------------------ */
.search-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: var(--bg); }
html.in-tg .search-head .back-btn { display: none; }
.search-input { flex: 1; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 14px; background: var(--surface); border-radius: 14px; color: var(--hint); box-shadow: var(--shadow); }
.search-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15.5px; }
.search-input input::-webkit-search-cancel-button { display: none; }

/* ------------------------------- Mahsulot ------------------------------- */
.product-screen { padding-top: 0; }
.gallery { position: relative; background: var(--img-bg); }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 1 / 1; max-height: 70vh; }
.gallery-actions { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 8px; }
.gallery-back { position: absolute; top: 12px; left: 12px; z-index: 2; }
.gallery.has-back .badge.big { top: 62px; }
.round-btn {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.9); color: #4b5563; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.round-btn.on { color: var(--sale); }
.round-btn.on .icon { fill: currentColor; }
.card {
  background: var(--surface); border-radius: var(--radius); margin: 0 12px 10px; padding: 14px 16px; box-shadow: var(--shadow);
}
.card-title { font-weight: 750; font-size: 16px; margin-bottom: 10px; }
.p-info { margin-top: -18px; position: relative; border-radius: 22px; padding-top: 16px; }
.p-price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.p-price { font-size: 26px; font-weight: 850; letter-spacing: -0.5px; }
.p-price.sale { color: var(--sale); }
.p-name { font-size: 18px; font-weight: 650; line-height: 1.3; margin: 6px 0 10px; letter-spacing: -0.1px; }
.p-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.stock-pill, .meta-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px;
  font-size: 12.5px; font-weight: 600; background: var(--input-bg);
}
.stock-pill { color: var(--green); background: rgba(22, 163, 74, 0.1); }
.stock-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stock-pill.low { color: var(--amber); background: rgba(217, 119, 6, 0.12); }
.stock-pill.out { color: var(--danger); background: rgba(229, 72, 77, 0.1); }
.meta-pill { color: var(--hint); }
.p-qty { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--sep); font-weight: 600; }
.p-qty .stepper { width: 132px; }
.p-qty-sum { margin-left: auto; font-weight: 800; }
.notify-box { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 12px 14px; border: 1.5px dashed var(--accent); border-radius: 14px; background: var(--accent-soft); color: var(--text); text-align: left; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.notify-box:active { transform: scale(0.99); }
.notify-box.on { border-style: solid; border-color: var(--green); background: rgba(22, 163, 74, 0.1); }
.notify-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: var(--accent-text); display: flex; align-items: center; justify-content: center; flex: none; }
.notify-box.on .notify-ico { background: var(--green); color: #fff; }
.notify-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notify-text b { font-size: 15px; font-weight: 700; }
.notify-text small { font-size: 13px; color: var(--hint); line-height: 1.35; }
.attrs { display: flex; flex-direction: column; gap: 9px; }
.attr { display: flex; align-items: baseline; gap: 6px; font-size: 14.5px; }
.attr-k { color: var(--hint); flex: none; max-width: 55%; }
.attr-dots { flex: 1; border-bottom: 1px dotted var(--sep-strong); transform: translateY(-4px); min-width: 12px; }
.attr-v { font-weight: 600; text-align: right; max-width: 55%; }
.desc { white-space: pre-line; font-size: 14.5px; line-height: 1.5; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }

/* --------------------------------- Savat -------------------------------- */
.cart-list { padding: 4px 14px; }
.cart-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sep); }
.cart-line:last-child { border-bottom: 0; }
.cart-img { width: 76px; height: 76px; border-radius: 12px; overflow: hidden; flex: none; cursor: pointer; }
.cart-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cart-name { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.cart-price { font-size: 13px; color: var(--hint); margin: 3px 0 8px; }
.cart-row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 8px; }
.cart-total { font-weight: 800; white-space: nowrap; }
.cart-err { color: var(--danger); font-size: 12.5px; display: flex; align-items: center; gap: 5px; margin: -2px 0 8px; }
.cart-line.bad .cart-img { opacity: 0.55; }
.free-card { padding: 12px 16px; }
.free-text { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 9px; }
.free-text .icon { color: var(--accent); }
.progress { height: 6px; border-radius: 3px; background: var(--sep); overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s; }
.sum-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; font-size: 14.5px; }
.sum-line span:first-child { color: var(--hint); }
.sum-line.strong { font-size: 18px; font-weight: 800; padding-top: 6px; }
.sum-line.strong span:first-child { color: var(--text); }
.sum-sep { height: 1px; background: var(--sep); margin: 8px 0; }

/* -------------------------------- Forma -------------------------------- */
.form-card .card-title { margin-bottom: 12px; }
.field { display: block; margin-bottom: 12px; }
.field-label { display: block; font-size: 13px; color: var(--hint); margin: 0 0 6px 2px; font-weight: 500; }
.input {
  width: 100%; border: 1.5px solid transparent; background: var(--input-bg); border-radius: 12px; padding: 11px 13px;
  font-size: 15.5px; outline: none; transition: border-color 0.15s, background 0.15s; resize: none;
}
.input:focus { border-color: var(--accent); background: var(--surface-2); }
.field.err .input { border-color: var(--danger); }
.field.err .field-label { color: var(--danger); }
.segment { display: flex; background: var(--input-bg); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.segment button { flex: 1; height: 38px; border-radius: 10px; font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--hint); transition: all 0.15s; }
.segment button.on { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.segment.sm { margin: 0; margin-left: auto; }
.segment.sm button { height: 30px; padding: 0 10px; font-size: 13px; flex: none; }
.hint-text { display: flex; gap: 6px; align-items: flex-start; color: var(--hint); font-size: 13px; margin-top: 10px; line-height: 1.35; }
.hint-text .icon { margin-top: 1px; }
.pickup-box { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--input-bg); line-height: 1.35; }
.pickup-box > .icon { color: var(--accent); margin-top: 2px; }
.pay-list { display: flex; flex-direction: column; gap: 8px; }
.pay-opt { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; border: 1.5px solid var(--sep); text-align: left; transition: border-color 0.15s, background 0.15s; }
.pay-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.pay-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--input-bg); display: flex; align-items: center; justify-content: center; color: var(--accent); flex: none; }
.pay-text { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.pay-text b { font-weight: 650; font-size: 15px; }
.pay-text small { color: var(--hint); font-size: 12.5px; margin-top: 2px; }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--sep-strong); flex: none; position: relative; }
.pay-opt.on .radio { border-color: var(--accent); }
.pay-opt.on .radio::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }
.row-btn { width: 100%; display: flex; align-items: center; gap: 10px; font-weight: 600; padding: 4px 0 14px; color: var(--accent); }
.row-btn .icon:last-child { margin-left: auto; color: var(--hint); }
.promo-row { display: flex; gap: 8px; margin-bottom: 8px; }
.promo-row .input { text-transform: uppercase; }
.promo-row .btn { flex: none; }
.promo-msg { font-size: 13px; display: flex; gap: 6px; align-items: center; margin-bottom: 12px; }
.promo-msg.good { color: var(--green); }
.promo-msg.bad { color: var(--danger); }
.mini-lines { display: flex; flex-direction: column; gap: 6px; }
.mini-line { display: flex; gap: 8px; font-size: 14px; align-items: baseline; }
.mini-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-qty { color: var(--hint); flex: none; }
.mini-sum { font-weight: 650; flex: none; }

/* ------------------------------ Muvaffaqiyat ---------------------------- */
.success-hero { text-align: center; padding: 34px 24px 20px; }
.success-hero h1 { font-size: 23px; font-weight: 800; margin-top: 16px; letter-spacing: -0.3px; }
.success-hero p { margin: 6px 0 0; }
.check-anim { width: 92px; height: 92px; margin: 0 auto; }
.check-anim svg { width: 100%; height: 100%; }
.check-anim circle { stroke: var(--green); stroke-width: 3; stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw 0.6s ease forwards; fill: rgba(22, 163, 74, 0.1); }
.check-anim path { stroke: var(--green); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw 0.4s 0.5s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.bank-card {
  border-radius: 16px; padding: 16px; color: #fff; margin-bottom: 4px; position: relative;
  background: linear-gradient(135deg, #1e3a8a, #2563eb 55%, #0ea5e9);
}
.bank-num { font-size: 20px; font-weight: 700; letter-spacing: 1.5px; font-variant-numeric: tabular-nums; }
.bank-holder { opacity: 0.85; font-size: 13px; margin: 6px 0 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.bank-card .btn-soft { background: rgba(255, 255, 255, 0.2); color: #fff; }
.paid-ok { display: flex; gap: 8px; align-items: center; color: var(--green); font-weight: 700; justify-content: center; padding: 6px; }

/* ------------------------------ Buyurtmalar ------------------------------ */
.order-list { display: flex; flex-direction: column; }
.order-card { display: block; width: auto; text-align: left; }
.order-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.order-no { font-weight: 750; font-size: 16px; }
.status { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.st-new { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.st-confirmed { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.st-delivering { background: rgba(217, 119, 6, 0.14); color: #c26a05; }
.st-completed { background: rgba(22, 163, 74, 0.12); color: var(--green); }
.st-cancelled { background: rgba(229, 72, 77, 0.12); color: var(--danger); }
.order-thumbs { display: flex; gap: 6px; margin: 12px 0; }
.thumb { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; border: 1px solid var(--sep); }
.thumb.more { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--hint); background: var(--input-bg); }
.order-bottom { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.order-bottom b { font-size: 16px; }
.steps { display: flex; margin-top: 16px; position: relative; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; font-size: 11.5px; color: var(--hint); }
.step::before { content: ""; position: absolute; top: 10px; left: -50%; right: 50%; height: 3px; background: var(--sep); }
.step:first-child::before { display: none; }
.step.done::before { background: var(--green); }
.step-dot { width: 23px; height: 23px; border-radius: 50%; background: var(--sep); position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 6px; border: 3px solid var(--surface); }
.step.done .step-dot { background: var(--green); }
.step.cur .step-dot { box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.2); }
.step.done .step-label { color: var(--text); font-weight: 600; }
.ord-item { display: flex; gap: 12px; align-items: center; padding: 8px 0; cursor: pointer; }
.ord-img { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; flex: none; border: 1px solid var(--sep); }
.ord-info { flex: 1; min-width: 0; }
.ord-name { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ord-sum { font-weight: 700; white-space: nowrap; }
.info-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; line-height: 1.35; font-size: 14.5px; }
.info-row > .icon { color: var(--accent); margin-top: 2px; }

/* --------------------------------- Profil ------------------------------- */
.profile-card { display: flex; align-items: center; gap: 14px; }
.avatar { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-text { flex: 1; min-width: 0; }
.profile-name { font-weight: 750; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { padding: 4px 0; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 16px; text-align: left; color: var(--text); min-height: 52px; }
.menu-item + .menu-item { border-top: 1px solid var(--sep); }
.menu-item:active:not(.static) { background: var(--sep); }
.mi-ico { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.mi-ico.blue { background: #2f80ed; } .mi-ico.green { background: #22a35a; } .mi-ico.violet { background: #7c4dff; }
.mi-ico.orange { background: #f2994a; } .mi-ico.sky { background: #2aabee; } .mi-ico.pink { background: #e1306c; } .mi-ico.gray { background: #6b7280; }
.mi-text { flex: 1; font-weight: 500; }
.mi-sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--hint); line-height: 1.35; margin-top: 2px; }
.mi-val { color: var(--hint); font-size: 14px; }
.mi-arrow { color: var(--hint); }
.mi-badge { background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 700; min-width: 22px; height: 22px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.footer-note { text-align: center; color: var(--hint); font-size: 12px; padding: 8px 0 16px; }
.about-hero { text-align: center; padding: 24px 16px; }
.about-hero h2 { font-size: 21px; font-weight: 800; }
.about-hero p { margin: 6px 0 0; }

/* --------------------------------- Tab bar ------------------------------ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--surface-2); border-top: 1px solid var(--sep);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--hint); font-size: 11px; font-weight: 600; position: relative; }
.tab.on { color: var(--accent); }
.tab.on .icon { stroke-width: 2.3; }
.tab-badge { position: absolute; top: 5px; left: calc(50% + 6px); background: var(--sale); color: #fff; font-size: 10.5px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid var(--surface-2); }
.tab-badge.pop { animation: pop 0.3s ease; }
@keyframes pop { 50% { transform: scale(1.3); } }

.main-fallback { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: 10px 12px calc(10px + var(--safe-b)); background: var(--surface-2); border-top: 1px solid var(--sep); }
.app.has-tabs ~ .main-fallback { bottom: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: 10px; border-top: 1px solid var(--sep); }
.main-fallback .btn { width: 100%; height: 50px; font-size: 16px; }

/* --------------------------------- Toast -------------------------------- */
.toasts { position: fixed; top: 10px; left: 0; right: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 16px; }
.toast { background: rgba(28, 31, 36, 0.94); color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; max-width: 420px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2); text-align: center; }
.toast-success { background: rgba(21, 128, 61, 0.95); }
.toast-error { background: rgba(200, 40, 50, 0.96); }
.toast-warn { background: rgba(180, 100, 10, 0.96); }
.toast-enter-active, .toast-leave-active { transition: all 0.25s; }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translateY(-12px); }

/* ------------------------------ Rasm ko'ruvchi -------------------------- */
.viewer { position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, 0.94); display: flex; align-items: center; }
.viewer-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; padding: 16px; }
.viewer-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; background: #fff; }
.viewer-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; display: flex; align-items: center; justify-content: center; }
.viewer-count { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: #fff; font-weight: 600; }
.fade-enter-active, .fade-leave-active { transition: opacity 0.2s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* --------------------------------- Xato -------------------------------- */
.fatal { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; }
.fatal .empty-icon { background: rgba(229, 72, 77, 0.1); color: var(--danger); }
.fatal h1 { font-size: 20px; margin-bottom: 8px; }
.fatal p { color: var(--hint); margin: 0 0 20px; max-width: 320px; }

@media (min-width: 700px) {
  .app, .tabbar, .main-fallback { max-width: 760px; margin-left: auto; margin-right: auto; }
  .tabbar, .main-fallback { left: 50%; transform: translateX(-50%); width: 100%; }
}
