/* ============================================================
   iOS uslubidagi dizayn tizimi
   Ranglar — Apple'ning system palitrasi, egri chiziqlar — iOS spring
   ============================================================ */
:root {
  /* Apple system ranglari */
  --blue:      #007AFF;
  --blue-dim:  rgba(0, 122, 255, .12);
  --red:       #FF3B30;
  --orange:    #FF9500;
  --green:     #34C759;

  --bg:        #F2F2F7;   /* systemGroupedBackground */
  --card:      #FFFFFF;
  --bar:       rgba(249, 249, 249, .82);
  --text:      #000000;
  --muted:     rgba(60, 60, 67, .6);
  --faint:     rgba(60, 60, 67, .3);
  --line:      rgba(60, 60, 67, .18);
  --fill:      rgba(118, 118, 128, .12);

  --shadow:    0 1px 3px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .06);

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;

  /* iOS harakat egri chiziqlari */
  --spring: cubic-bezier(.32, .72, 0, 1);
  --ease:   cubic-bezier(.25, .1, .25, 1);
  --pop:    cubic-bezier(.34, 1.56, .64, 1);
}

body.dark {
  --bg:     #000000;
  --card:   #1C1C1E;
  --bar:    rgba(28, 28, 30, .82);
  --text:   #FFFFFF;
  --muted:  rgba(235, 235, 245, .6);
  --faint:  rgba(235, 235, 245, .3);
  --line:   rgba(84, 84, 88, .5);
  --fill:   rgba(118, 118, 128, .24);
  --blue-dim: rgba(10, 132, 255, .18);
  --blue:   #0A84FF;
  --red:    #FF453A;
  --orange: #FF9F0A;
  --green:  #32D74B;
  --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .4);
}

/* Telegramdan tashqarida — qurilmaning o'z sozlamasi */
@media (prefers-color-scheme: dark) {
  body:not(.light) {
  --bg:     #000000;
  --card:   #1C1C1E;
  --bar:    rgba(28, 28, 30, .82);
  --text:   #FFFFFF;
  --muted:  rgba(235, 235, 245, .6);
  --faint:  rgba(235, 235, 245, .3);
  --line:   rgba(84, 84, 88, .5);
  --fill:   rgba(118, 118, 128, .24);
  --blue-dim: rgba(10, 132, 255, .18);
  --blue:   #0A84FF;
  --red:    #FF453A;
  --orange: #FF9F0A;
  --green:  #32D74B;
  --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .4);
}
}


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

/* Sahifa yon tomonga surilmasin — Telegram WebView'da "rezina" effekti chiqadi */
html, body {
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  letter-spacing: -.01em;
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
  touch-action: pan-y;              /* faqat tik yo'nalishda suriladi */
}

.hidden { display: none !important; }
.muted  { color: var(--muted); }

svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* barcha bosiladigan narsalar biroz "cho'kadi" */
button { font: inherit; color: inherit; transition: transform .2s var(--spring), opacity .2s var(--ease); }
button:active { transform: scale(.94); }

/* ============================================================ yuklanish */
.splash {
  min-height: 78vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; text-align: center; color: var(--muted);
}
.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--line); border-top-color: var(--blue);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================ navbar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  padding-top: calc(8px + env(safe-area-inset-top));
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid transparent;
  transition: border-color .25s var(--ease);
}
.topbar.scrolled { border-bottom-color: var(--line); }

.topbar h1 {
  flex: 1; margin: 0;
  font-size: 22px; font-weight: 700; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.icon-btn {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--fill); color: var(--blue);
  cursor: pointer;
}
.icon-btn svg { width: 20px; }

/* ============================================================ bannerlar */
.banners { padding: 12px 0 0; animation: fadeUp .5s var(--spring) backwards; }

.banner-track {
  display: flex; gap: 10px;
  align-items: flex-start;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 16px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner-track img {
  flex: 0 0 100%;
  scroll-snap-align: center;
  height: 172px;
  object-fit: cover;
  border-radius: 18px;
  background: var(--card);
}

.dots { display: flex; justify-content: center; gap: 6px; padding: 12px 0 0; }
.dots i {
  width: 7px; height: 7px; border-radius: 4px;
  background: var(--faint);
  transition: width .32s var(--spring), background-color .32s var(--ease);
}
.dots i.on { width: 20px; background: var(--blue); }

/* ============================================================ kategoriyalar */
.chips {
  display: flex; gap: 8px;
  padding: 16px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto; cursor: pointer; border: 0;
  padding: 9px 17px;
  border-radius: 100px;
  background: var(--fill); color: var(--text);
  font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  white-space: nowrap;
  transition: background-color .28s var(--ease), color .28s var(--ease), transform .2s var(--spring);
}
.chip.on { background: var(--blue); color: #fff; }

/* ============================================================ mahsulotlar */
.section-title {
  margin: 4px 16px 12px;
  font-size: 24px; font-weight: 700; letter-spacing: -.024em;
}

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

.card {
  position: relative;
  background: var(--card); border-radius: var(--r);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  animation: cardIn .5s var(--spring) backwards;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
}

.card-photo { position: relative; cursor: pointer; overflow: hidden; }
.card-photo img {
  width: 100%;
  aspect-ratio: var(--ratio, 1);
  object-fit: var(--fit, cover);
  display: block; background: #fff;
  transition: transform .5s var(--spring);
}
.card-photo:active img { transform: scale(1.04); }
.card-photo .none {
  aspect-ratio: var(--ratio, 1); display: grid; place-items: center;
  font-size: 34px; opacity: .2;
}

.fav {
  position: absolute; top: 9px; right: 9px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .78); color: rgba(60, 60, 67, .55);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .10);   /* oq rasm ustida ham ko'rinsin */
  cursor: pointer;
}
.fav svg { width: 18px; transition: transform .35s var(--pop); }
.fav.on { color: var(--red); }
.fav.on svg { fill: var(--red); stroke: var(--red); animation: heart .42s var(--pop); }
@keyframes heart {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.sale {
  position: absolute; top: 9px; left: 9px;
  padding: 4px 8px; border-radius: 8px;
  background: var(--red); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: -.01em;
  animation: pop .4s var(--pop) backwards;
}
@keyframes pop { from { opacity: 0; transform: scale(.5); } }

.card-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-name {
  font-size: 15px; font-weight: 400; line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; cursor: pointer;
}
.price-row {
  display: flex; align-items: baseline; gap: 7px;
  flex-wrap: wrap; margin-top: auto;
}
.price-row b, .price-row s { white-space: nowrap; }
.price-row b { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.price-row b.cut { color: var(--blue); }
.price-row s { font-size: 13px; color: var(--muted); }

.stock { margin: 0; font-size: 13px; color: var(--orange); font-weight: 500; }

.btn-add {
  margin-top: 9px; width: 100%; padding: 11px;
  border: 0; border-radius: var(--r-sm);
  background: var(--blue); color: #fff;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  cursor: pointer;
  animation: pop .32s var(--pop) backwards;
}
.btn-add:disabled { background: var(--fill); color: var(--muted); }
.btn-add:disabled:active { transform: none; }

.stepper {
  margin-top: 9px;
  display: flex; align-items: center; gap: 6px;
  height: 41px;
  animation: pop .34s var(--pop) backwards;
}
/* − va + alohida doiralar, bitta ramka ichida emas */
.stepper button {
  flex: 0 0 41px;
  width: 41px; height: 41px;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--blue); color: #fff;
  font-size: 21px; line-height: 1;
  display: grid; place-items: center;
}
.stepper span {
  flex: 1; text-align: center;
  font-size: 17px; font-weight: 600; color: var(--text);
  animation: bump .28s var(--pop);
}
@keyframes bump { 0% { transform: scale(.7); opacity: .4; } }

/* ============================================================ ro'yxatlar */
.lines { padding: 4px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.view > .section-title:first-child { margin-top: 16px; }

.line {
  display: flex; gap: 12px; align-items: center;
  background: var(--card); border-radius: var(--r);
  padding: 11px; box-shadow: var(--shadow);
  animation: cardIn .45s var(--spring) backwards;
}
.line > img, .line > .none {
  width: 58px; height: 58px; flex: 0 0 58px;
  border-radius: 12px; object-fit: cover;
  display: grid; place-items: center; font-size: 24px;
  background: var(--bg);
}
.line .info { flex: 1; min-width: 0; }
.line .info b { display: block; font-size: 16px; font-weight: 400; letter-spacing: -.01em; }
.line .info span { font-size: 14px; color: var(--muted); }
.line .stepper { margin: 0; flex: 0 0 auto; width: 112px; height: 34px; gap: 4px; }
.line .stepper button { flex: 0 0 34px; width: 34px; height: 34px; font-size: 18px; }
.line .stepper span { font-size: 16px; }

.summary {
  margin: 20px 16px 6px; padding: 4px 16px;
  background: var(--card); border-radius: var(--r);
  box-shadow: var(--shadow);
}
.summary-row {
  display: flex; justify-content: space-between;
  padding: 12px 0; font-size: 16px;
}
.summary-row + .summary-row { border-top: .5px solid var(--line); }
.summary-row.total { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }

/* ============================================================ forma */
.form { padding: 0 16px; display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 7px; }
.form label > span { font-size: 13px; color: var(--muted); padding-left: 4px; }
.form label i { font-style: normal; opacity: .7; }

.form input, .form textarea {
  font: inherit; color: var(--text);
  background: var(--card);
  border: 1.5px solid transparent; border-radius: 12px;
  padding: 13px 15px; resize: none;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.form input:focus, .form textarea:focus { outline: 0; border-color: var(--blue); }
.form .bad { border-color: var(--red); animation: shake .4s var(--ease); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  30%, 70% { transform: translateX(4px); }
  50%      { transform: translateX(-4px); }
}

.btn-primary {
  margin: 20px 16px 0; width: calc(100% - 32px);
  padding: 16px; border: 0; border-radius: 14px;
  background: var(--blue); color: #fff;
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
  cursor: pointer;
}
.btn-primary:disabled { opacity: .5; }
.btn-primary:disabled:active { transform: none; }

.btn-ghost {
  border: 0; border-radius: 12px;
  background: var(--fill); color: var(--blue);
  padding: 12px 22px; font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn-text { border: 0; background: none; color: var(--blue); cursor: pointer; padding: 0 4px; font-size: 17px; }

.muted-center {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 64px 24px; color: var(--muted); text-align: center;
  animation: fadeUp .45s var(--spring) backwards;
}
.big-icon { font-size: 46px; }

/* ============================================================ profil */

/* rangli boshlanish — profilga o'ziga xoslik beradi */
.hero {
  position: relative;
  margin: 0 0 0;
  padding: 26px 20px 60px;
  text-align: center;
  color: #fff;
  background: linear-gradient(162deg, #46A6FF 0%, var(--blue) 52%, #0B5FD0 100%);
  border-radius: 0 0 28px 28px;
  animation: fadeUp .42s var(--spring) backwards;
}

.hero .avatar {
  width: 84px; height: 84px; margin: 0 auto 12px;
  border-radius: 50%; overflow: hidden;
  background: rgba(255, 255, 255, .22); color: #fff;
  display: grid; place-items: center;
  font-size: 32px; font-weight: 600;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .25), 0 8px 22px rgba(0, 0, 0, .18);
}
.hero .avatar img { width: 100%; height: 100%; object-fit: cover; }

.hero b {
  display: block; font-size: 23px; font-weight: 700; letter-spacing: -.024em;
}
.hero span {
  display: block; margin-top: 3px;
  font-size: 15px; color: rgba(255, 255, 255, .82);
}

/* uchta raqam — hero ustiga chiqib turadi */
.stats {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: -42px 16px 0;
  background: var(--card); border-radius: 18px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .10);
  animation: cardIn .5s var(--spring) backwards; animation-delay: .06s;
}
.stat {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 15px 4px 14px;
}
.stat + .stat { border-left: .5px solid var(--line); }
.stat-ico { font-size: 17px; margin-bottom: 3px; opacity: .9; }
.stat b { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); }

/* guruh sarlavhasi */
.group-label {
  margin: 28px 20px 8px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}

.empty-card {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 16px; padding: 22px;
  background: var(--card); border-radius: var(--r);
  box-shadow: var(--shadow);
  color: var(--muted); font-size: 15px;
}
.empty-ico { font-size: 20px; opacity: .55; }

/* buyurtma kartochkasi */
.order-card { display: block; }
.order-card .top { display: flex; justify-content: space-between; align-items: center; }
.order-card .top + .top { margin-top: 4px; }
.order-card .top span.muted { font-size: 14px; }
.order-card .st {
  font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 8px;
  background: var(--blue-dim); color: var(--blue);
}
.order-card .st.done      { background: rgba(52, 199, 89, .16); color: var(--green); }
.order-card .st.cancelled { background: rgba(255, 59, 48, .14); color: var(--red); }
.order-card .items { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* iOS uslubidagi sozlama qatorlari */
.rows {
  margin: 0 16px; overflow: hidden;
  background: var(--card); border-radius: var(--r);
  box-shadow: var(--shadow);
}
.row {
  width: 100%; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; text-align: left;
}
.row:active { transform: none; background: var(--fill); }
.row + .row { border-top: .5px solid var(--line); }
.row-ico { font-size: 19px; flex: 0 0 24px; text-align: center; }
.row-label { flex: 1; font-size: 17px; }
.row-value { font-size: 16px; color: var(--muted); }
.row-arrow { font-size: 22px; color: var(--faint); line-height: 1; }

.foot-note {
  margin: 18px 24px 0; font-size: 13px; color: var(--muted); text-align: center;
}
.brand {
  margin: 22px 20px 0; text-align: center;
  font-size: 12px; color: var(--faint); letter-spacing: .02em;
}

/* ============================================================ mahsulot sahifasi */
.page {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  background: var(--bg);
  animation: pushIn .38s var(--spring);
}
@keyframes pushIn { from { transform: translateX(100%); } }
.page.closing { animation: pushOut .3s var(--ease) forwards; }
@keyframes pushOut { to { transform: translateX(100%); } }

/* rasm ustidagi suzuvchi tugmalar */
.page-top {
  position: absolute; z-index: 2;
  left: 12px; right: 12px;
  top: calc(12px + env(safe-area-inset-top));
  display: flex; justify-content: space-between;
  pointer-events: none;
}
.page-top-right { display: flex; gap: 8px; }

.round-btn {
  pointer-events: auto;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .86); color: var(--text);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.round-btn svg { width: 21px; }
.round-btn.on { color: var(--red); }
.round-btn.on svg { fill: var(--red); stroke: var(--red); animation: heart .42s var(--pop); }

.page-scroll {
  flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.pd-photo { position: relative; background: #fff; }
.pd-photo img {
  width: 100%; aspect-ratio: 1; object-fit: contain;
  display: block; padding: 8px;
}
.pd-photo .sale { top: auto; bottom: 14px; left: 14px; font-size: 14px; padding: 6px 11px; }

.pd-block {
  background: var(--card);
  margin-bottom: 10px;
  padding: 16px 18px 18px;
}
.pd-block:first-of-type { border-radius: 20px 20px 0 0; margin-top: -20px; position: relative; }

.pd-block .price-row b { font-size: 27px; font-weight: 700; letter-spacing: -.03em; }
.pd-block .price-row s { font-size: 16px; }

.pd-block h1 {
  margin: 8px 0 0;
  font-size: 19px; font-weight: 500; line-height: 1.3; letter-spacing: -.01em;
}
.pd-block .stock { margin-top: 8px; font-size: 15px; }

.pd-head {
  margin: 0 0 8px;
  font-size: 17px; font-weight: 700; letter-spacing: -.02em;
}
.pd-desc {
  margin: 0; color: var(--muted);
  font-size: 16px; line-height: 1.5; white-space: pre-wrap;
}

/* o'xshash mahsulotlar — yon tomonga suriladi */
.rail {
  display: flex; gap: 12px;
  overflow-x: auto; scrollbar-width: none;
  margin: 0 -18px; padding: 4px 18px 2px;
  touch-action: pan-x; overscroll-behavior-x: contain;
}
.rail::-webkit-scrollbar { display: none; }
.rail .card { flex: 0 0 146px; }
.rail .card-name { font-size: 14px; min-height: 2.5em; }
.rail .price-row b { font-size: 15px; }

.pd-space { height: 20px; }

/* pastdagi doimiy panel */
.page-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--line);
}
.page-bar-price { display: flex; flex-direction: column; min-width: 0; }
.page-bar-price span { font-size: 12px; color: var(--muted); }
.page-bar-price b { font-size: 19px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.page-bar-act { flex: 1; }

/* miqdor + buyurtma tugmasi yonma-yon */
.page-bar-act.with-stepper {
  display: flex; align-items: center; gap: 12px;
}
.page-bar-act.with-stepper .stepper { flex: 0 0 132px; width: 132px; }
.page-bar-act.with-stepper .stepper button { flex: 0 0 44px; width: 44px; height: 44px; font-size: 21px; }
.page-bar-act.with-stepper .stepper span { font-size: 18px; }
.page-bar-act.with-stepper .btn-add { flex: 1; }
.page-bar-act .btn-add, .page-bar-act .stepper { margin: 0; height: 50px; }
.page-bar-act .stepper button { flex: 0 0 50px; width: 50px; height: 50px; font-size: 23px; }
.page-bar-act .btn-add { font-size: 17px; }

/* ============================================================ qidiruv */
.search {
  position: fixed; inset: 0; z-index: 35;
  background: var(--bg); overflow-y: auto;
  padding-bottom: 60px;
}
.search.opening { animation: searchIn .38s var(--spring); }
@keyframes searchIn { from { opacity: 0; transform: scale(.97); } }

.search-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; gap: 0; align-items: center;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--line);
}

/* iOS qidiruv maydoni: kulrang kapsula, ichida lupa */
.s-field {
  flex: 1; position: relative;
  display: flex; align-items: center; gap: 7px;
  background: var(--fill); border-radius: 11px;
  padding: 0 10px; height: 38px;
  transition: background-color .25s var(--ease);
}
.s-icon { width: 18px; height: 18px; color: var(--muted); flex: 0 0 18px; }

.s-field input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 17px; color: var(--text);
  background: none; border: 0; padding: 0;
}
.s-field input:focus { outline: 0; }
.s-field input::-webkit-search-cancel-button { display: none; }
.s-field input::placeholder { color: var(--muted); }

.s-clear {
  border: 0; background: none; padding: 0; cursor: pointer;
  width: 20px; height: 20px; color: var(--faint); flex: 0 0 20px;
  display: grid; place-items: center;
  animation: pop .26s var(--pop);
}
.s-clear svg { width: 18px; height: 18px; }

/* "Bekor" o'ngdan sirg'alib chiqadi */
#search-close {
  overflow: hidden; white-space: nowrap;
  max-width: 0; padding: 0; opacity: 0;
  transition: max-width .34s var(--spring), opacity .26s var(--ease),
              padding .34s var(--spring), margin .34s var(--spring);
}
.search.active #search-close {
  max-width: 96px; opacity: 1; padding: 0 2px 0 12px;
}

.search-count {
  margin: 16px 20px 4px; font-size: 13px; color: var(--muted);
  animation: fadeUp .3s var(--spring);
}

.search .grid { padding-top: 12px; }

/* topilgan bo'lak ajratiladi */
mark {
  background: rgba(0, 122, 255, .16);
  color: inherit; border-radius: 3px; padding: 0 1px;
}
body.dark mark { background: rgba(10, 132, 255, .28); }

/* so'nggi qidiruvlar */
.recent { padding: 18px 16px 0; animation: fadeUp .34s var(--spring); }
.recent-head {
  margin: 0 4px 10px; font-size: 13px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}
.recent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.recent-list button {
  border: 0; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 100px;
  background: var(--card); color: var(--text);
  font-size: 15px; box-shadow: var(--shadow);
  animation: pop .34s var(--pop) backwards;
}

/* ============================================================ tanlov oynasi */
.sheet-back {
  position: fixed; inset: 0; z-index: 44;
  background: rgba(0, 0, 0, .4);
  animation: fadeIn .3s var(--ease);
}
@keyframes fadeIn   { from { opacity: 0; } }
@keyframes sheetUp  { from { transform: translateY(100%); } }
@keyframes sheetDown { to  { transform: translateY(100%); } }


.picker {
  position: fixed; left: 8px; right: 8px; z-index: 45;
  bottom: calc(8px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
  animation: sheetUp .42s var(--spring);
}
.picker.closing { animation: sheetDown .26s var(--ease) forwards; }

.picker-group {
  background: var(--card); border-radius: 14px; overflow: hidden;
}
.picker-item {
  width: 100%; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  padding: 17px 20px; text-align: left;
  font-size: 19px; color: var(--text);
}
.picker-item:active { transform: none; background: var(--fill); }
.picker-item + .picker-item { border-top: .5px solid var(--line); }
.picker-item .flag { font-size: 21px; }
.picker-item .tick { margin-left: auto; color: var(--blue); font-size: 19px; font-weight: 700; }
.picker-item.on { font-weight: 600; }

.picker-cancel {
  border: 0; cursor: pointer;
  padding: 17px; border-radius: 14px;
  background: var(--card); color: var(--blue);
  font-size: 19px; font-weight: 600;
}

/* savat pastki paneli — tab bar ustida turadi */
#cart-bar {
  position: fixed; left: 0; right: 0; z-index: 29;
  bottom: calc(66px + env(safe-area-inset-bottom));
  padding-bottom: 12px;
  animation: fadeUp .3s var(--spring);
}
/* panel matnni to'smasin */
#view-cart { padding-bottom: 76px; }

/* ============================================================ tab bar */
.tabbar {
  position: fixed; z-index: 30;
  left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--line);
}
.tab {
  border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px;
  color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: -.01em;
  transition: color .25s var(--ease);
}
.tab:active { transform: scale(.9); }
.tab.on { color: var(--blue); }
.tab.on .tab-icon svg { animation: tabPop .4s var(--pop); }
@keyframes tabPop { 0% { transform: scale(.82); } 55% { transform: scale(1.12); } }
.tab-icon { position: relative; display: block; }
.tab-icon svg { width: 26px; height: 26px; }

.badge {
  position: absolute; top: -3px; right: -8px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-style: normal; font-weight: 600;
  display: grid; place-items: center;
  animation: pop .38s var(--pop);
}

/* ============================================================ ekran almashuvi */
.view { animation: fadeUp .34s var(--spring); }
#view-profile { padding-top: 0; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }

/* tab yo'nalishiga qarab sirg'aladi */
.view.slide { animation: slideIn .36s var(--spring); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 22px)); }
}

/* savatga qo'shilganda tab ikonkasi turtiladi */
.tab-icon.nudge svg { animation: nudge .5s var(--pop); }
@keyframes nudge {
  0%   { transform: scale(1) rotate(0); }
  25%  { transform: scale(1.22) rotate(-9deg); }
  55%  { transform: scale(1.08) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ============================================================ ro'yxat ko'rinishi */
.grid.list { grid-template-columns: 1fr; }
.grid.list .card { flex-direction: row; align-items: stretch; }
.grid.list .card-photo { flex: 0 0 118px; }
.grid.list .card-photo img,
.grid.list .card-photo .none { height: 100%; aspect-ratio: auto; min-height: 118px; }
.grid.list .fav { top: 7px; right: 7px; width: 29px; height: 29px; }
.grid.list .fav svg { width: 16px; }
.grid.list .card-body { padding: 13px 15px; }
.grid.list .card-name { min-height: 0; }
.grid.list .btn-add, .grid.list .stepper { max-width: 200px; }

/* ============================================================ harakatni kamaytirish */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* ============================================================
   Soha ohanglari — har bir biznes o'z ko'rinishida
   ============================================================ */

/* moda: o'tkir burchak, katta rasm, ingichka yozuv */
.mood-sharp .card { box-shadow: none; border: 1px solid var(--line); }
.mood-sharp .card-body { padding: 12px 4px 4px; }
.mood-sharp .card-name { font-weight: 400; letter-spacing: .01em; }
.mood-sharp .price-row b { font-weight: 600; letter-spacing: 0; }
.mood-sharp .btn-add { border-radius: 2px; text-transform: uppercase;
                       font-size: 12.5px; letter-spacing: .09em; font-weight: 600; }
.mood-sharp .stepper button { border-radius: 2px; }
.mood-sharp .chip { border-radius: 2px; font-weight: 500; letter-spacing: .04em;
                    text-transform: uppercase; font-size: 12.5px; }
.mood-sharp .section-title { font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
                             font-size: 15px; }
.mood-sharp .banner-track img { border-radius: 2px; }

/* restoran: iliq, yumaloq, katta rasm */
.mood-warm .card { box-shadow: 0 6px 20px rgba(225, 29, 72, .07); }
.mood-warm .section-title { font-size: 26px; }
.mood-warm .card-name { font-weight: 600; font-size: 16px; }
.mood-warm .btn-add { border-radius: 100px; font-weight: 700; }
.mood-warm .stepper { border-radius: 100px; }
.mood-warm .stepper button { border-radius: 50%; }
.mood-warm .chip { font-weight: 700; }

/* xo'jalik: zich, narx birinchi o'rinda */
.mood-dense .grid { gap: 8px; }
.mood-dense .card-body { padding: 8px 10px 10px; gap: 2px; }
.mood-dense .card-name { font-size: 13.5px; min-height: 2.4em; }
.mood-dense .price-row b { font-size: 18px; }
.mood-dense .card-photo img { padding: 8px; }
.mood-dense .btn-add { padding: 8px; font-size: 13.5px; }

/* kosmetika: havodor, nafis */
.mood-airy .grid { gap: 16px; }
.mood-airy .card { box-shadow: 0 8px 30px rgba(190, 24, 93, .08); }
.mood-airy .card-photo img { padding: 14px; }
.mood-airy .card-body { padding: 4px 16px 18px; }
.mood-airy .card-name { font-size: 14.5px; letter-spacing: .01em; }
.mood-airy .section-title { font-weight: 500; letter-spacing: .02em; }
.mood-airy .btn-add { border-radius: 100px; font-weight: 500; letter-spacing: .03em; }

/* elektronika: aniq, texnik */
.mood-tech .card { border: 1px solid var(--line); box-shadow: none; }
.mood-tech .card-photo img { padding: 12px; }
.mood-tech .card-name { font-size: 14px; }
.mood-tech .price-row b { font-size: 18px; letter-spacing: -.03em; }
.mood-tech .stock { font-weight: 600; }
.mood-tech .btn-add { border-radius: 8px; }
.mood-tech .chip { border-radius: 8px; }

/* xizmatlar: xotirjam, ro'yxat */
.mood-calm .card { box-shadow: 0 4px 16px rgba(13, 148, 136, .07); }
.mood-calm .card-name { font-weight: 600; }
.mood-calm .btn-add { border-radius: 12px; }
.mood-calm .chip { border-radius: 12px; }
