/* Dashtobod Kids — Mini App katalogi. Brend rangi logodagi yashil-moviydan; tungi rejim Telegram mavzusiga qarab
   (html[data-theme], app.js), brauzerda — tizim sozlamasiga qarab. */
:root {
  --bg: #f2f4f5;
  --surface: #ffffff;
  --surface-2: #f4f6f7;
  --text: #172026;
  --text-2: #56626b;
  --hint: #86919a;
  --border: rgba(23, 32, 38, 0.09);
  --border-strong: rgba(23, 32, 38, 0.18);
  --accent: #0c7f72;
  --accent-press: #0a6a5f;
  --accent-ink: #0b7669;
  --accent-soft: #e1f2ef;
  --on-accent: #ffffff;
  --danger: #e5484d;
  --warn: #c2570c;
  --success: #248a4c;
  --success-soft: rgba(46, 160, 67, 0.13);
  --overlay: rgba(10, 16, 20, 0.45);
  --heart-bg: rgba(255, 255, 255, 0.94);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 18px rgba(16, 24, 40, 0.07);
  --radius: 16px;
  --tabbar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1315;
  --surface: #172024;
  --surface-2: #1f2a2f;
  --text: #e8eef0;
  --text-2: #a9b5ba;
  --hint: #7e8a90;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.2);
  --accent: #0f8a7c;
  --accent-press: #0c7568;
  --accent-ink: #4fc9b8;
  --accent-soft: rgba(38, 176, 158, 0.16);
  --warn: #f0913f;
  --success: #4cc27a;
  --overlay: rgba(0, 0, 0, 0.6);
  --heart-bg: rgba(23, 32, 36, 0.9);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0e1315;
    --surface: #172024;
    --surface-2: #1f2a2f;
    --text: #e8eef0;
    --text-2: #a9b5ba;
    --hint: #7e8a90;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.2);
    --accent: #0f8a7c;
    --accent-press: #0c7568;
    --accent-ink: #4fc9b8;
    --accent-soft: rgba(38, 176, 158, 0.16);
    --warn: #f0913f;
    --success: #4cc27a;
    --overlay: rgba(0, 0, 0, 0.6);
    --heart-bg: rgba(23, 32, 36, 0.9);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 22px; height: 22px; flex: none; }

main { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px); }
body.has-checkout-bar main { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 84px); }

/* ---------- Tepa panel ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 6;
  padding: 10px 12px 10px;
  background: var(--bg);
  transition: box-shadow 0.2s;
}
.topbar.is-scrolled { box-shadow: 0 1px 0 var(--border); }
.topbar__row { display: flex; align-items: center; gap: 8px; }
.topbar__title { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar__title h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar__logo { width: 30px; height: 30px; border-radius: 50%; flex: none; }

.icon-btn {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.icon-btn--plain { background: transparent; box-shadow: none; margin-left: -6px; }
.icon-btn.is-active { background: var(--accent); color: var(--on-accent); }
.icon-btn:active { transform: scale(0.94); }

.count-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  margin-top: 10px;
  border-radius: 14px;
  padding: 0 4px 0 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: fade-in 0.15s ease;
}
.searchbar:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.searchbar__icon { width: 20px; height: 20px; color: var(--hint); }
.searchbar__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}
.searchbar__input:focus { outline: none; }
.searchbar__input::-webkit-search-cancel-button { display: none; }
.searchbar__clear {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--hint);
}
.searchbar__clear svg { width: 18px; height: 18px; }

.pills {
  display: flex;
  gap: 8px;
  margin: 10px -12px 0;
  padding: 2px 12px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-padding: 0 12px;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: none;
  height: 36px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.pill--active { background: var(--accent); color: var(--on-accent); }
.pill small { margin-left: 4px; font-weight: 500; opacity: 0.7; }

/* ---------- Katalog ---------- */
.view { animation: fade-in 0.18s ease; }
.status { margin: 40px 24px; text-align: center; color: var(--hint); }
.status__reset {
  display: block;
  margin: 12px auto 0;
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.filter-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 10px;
  border-radius: 12px;
  padding: 8px 6px 8px 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
}
.filter-summary span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-summary button {
  flex: none;
  border: 0;
  border-radius: 8px;
  padding: 4px 10px;
  background: transparent;
  color: inherit;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 820px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.pcard__open {
  display: flex;
  flex: 1;
  flex-direction: column;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.pcard__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  background: var(--surface-2);
  overflow: hidden;
}
.pcard__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pcard__media .photo__empty { display: grid; place-items: center; height: 100%; font-size: 44px; }
.pcard__body { display: flex; flex: 1; flex-direction: column; gap: 3px; padding: 10px 12px 0; }
.pcard__title {
  display: -webkit-box;
  min-height: 2.6em;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pcard__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin-top: 2px; font-size: 16px; font-weight: 800; }
.pcard__old { color: var(--hint); font-size: 12px; font-weight: 500; text-decoration: line-through; }
.pcard__sizes { overflow: hidden; color: var(--text-2); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.pcard__stock { color: var(--warn); font-size: 12px; font-weight: 700; }
.pcard__actions { padding: 8px 10px 10px; }

.badge {
  position: absolute;
  z-index: 1;
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}
.badge--sale { top: 8px; left: 8px; background: var(--danger); color: #fff; }
.badge--video { bottom: 8px; left: 8px; background: rgba(0, 0, 0, 0.6); color: #fff; font-weight: 600; }

.heart {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: var(--heart-bg);
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}
.heart svg { width: 20px; height: 20px; }
.heart.is-on { color: var(--danger); }
.heart.is-pop svg { animation: pop 0.32s ease; }
.heart--large { position: static; flex: none; width: 42px; height: 42px; background: var(--surface-2); box-shadow: none; }
.heart--large svg { width: 22px; height: 22px; }

.add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
}
.add-btn:active { background: var(--accent-press); }
.add-btn--in { background: var(--accent-soft); color: var(--accent-ink); }
.add-btn--in:active { background: var(--accent-soft); filter: brightness(0.96); }
.add-btn svg { width: 18px; height: 18px; }

.stepper {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.stepper button {
  height: 100%;
  border: 0;
  border-radius: 12px;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.stepper button:disabled { opacity: 0.35; }
.stepper span { overflow: hidden; font-size: 14px; font-weight: 700; text-align: center; white-space: nowrap; }

/* ---------- Pastki menyu ---------- */
.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 6px 8px calc(6px + var(--safe-bottom));
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--border), 0 -6px 18px rgba(16, 24, 40, 0.05);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  height: 52px;
  border: 0;
  border-radius: 14px;
  padding: 5px 0 0;
  background: transparent;
  color: var(--hint);
  font-size: 11px;
  font-weight: 600;
}
.tab__icon { position: relative; display: grid; place-items: center; }
.tab__icon svg { width: 24px; height: 24px; }
.tab--active { background: var(--accent-soft); color: var(--accent-ink); }
.tab__badge {
  position: absolute;
  top: -5px;
  left: 14px;
  min-width: 18px;
  height: 18px;
  border: 2px solid var(--surface);
  border-radius: 9px;
  padding: 0 4px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}
.tab__badge.is-bump { animation: pop 0.32s ease; }

.checkout-bar {
  position: fixed;
  right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  left: 0;
  z-index: 8;
  padding: 10px 12px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.checkout-bar .button { box-shadow: 0 6px 18px rgba(12, 127, 114, 0.28); }

/* ---------- Umumiy ---------- */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-align: center;
}
.button:active { background: var(--accent-press); }
.button:disabled { opacity: 0.55; }
.button--ghost { background: var(--accent-soft); color: var(--accent-ink); }
.button--ghost:active { background: var(--accent-soft); filter: brightness(0.95); }
.button--inline { display: inline-flex; width: auto; padding: 12px 22px; }
.button--icon { flex: none; width: 48px; padding: 0; }
.button + .button { margin-top: 8px; }

.hint { margin: 0 0 12px; color: var(--hint); font-size: 13px; }
.hint--flat { margin: 0; }
.hint--warn { color: var(--warn); font-weight: 600; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips--wrap { flex-wrap: wrap; overflow: visible; margin: 0 0 16px; }
.chip {
  flex: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 7px 13px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
.chip--active { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.chip--soldout { color: var(--hint); border-style: dashed; }

.section-title {
  margin: 20px 16px 10px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.empty { padding: 48px 28px; text-align: center; }
.empty__icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.empty__icon svg { width: 34px; height: 34px; }
.empty__icon--heart { background: rgba(229, 72, 77, 0.12); color: var(--danger); }
.empty__title { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.empty__text { margin: 0 0 18px; color: var(--text-2); }

.notice {
  margin: 0 12px 12px;
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}

.toast {
  position: fixed;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  left: 50%;
  z-index: 30;
  max-width: calc(100% - 32px);
  border-radius: 12px;
  padding: 10px 16px;
  background: rgba(20, 26, 30, 0.9);
  color: #fff;
  font-size: 14px;
  transform: translateX(-50%);
  animation: toast-in 0.2s ease;
}
body.has-checkout-bar .toast { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 80px); }

/* ---------- Savat ---------- */
.cart-list { display: grid; gap: 10px; margin: 0; padding: 0 12px; list-style: none; }
.cart-line {
  display: flex;
  gap: 12px;
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.cart-line__photo {
  flex: none;
  width: 78px;
  height: 96px;
  border: 0;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  background: var(--surface-2);
}
.cart-line__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cart-line__photo .photo__empty { display: grid; place-items: center; height: 100%; font-size: 30px; }
.cart-line__info { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.cart-line__top { display: flex; gap: 6px; align-items: flex-start; }
.cart-line__title {
  display: -webkit-box;
  flex: 1;
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cart-line__remove {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  margin: -4px -4px 0 0;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: var(--hint);
}
.cart-line__remove svg { width: 18px; height: 18px; }
.cart-line__meta { margin: 0; color: var(--text-2); font-size: 13px; }
.cart-line__bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.cart-line__price { font-size: 15px; font-weight: 800; white-space: nowrap; }
.cart-line .stepper { width: 112px; height: 34px; grid-template-columns: 34px minmax(0, 1fr) 34px; }

.summary {
  margin: 12px 12px 0;
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.summary__rows { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; margin: 0 0 10px; }
.summary__rows dt { color: var(--text-2); }
.summary__rows dd { margin: 0; text-align: right; white-space: nowrap; }
.summary__rows .is-total { color: var(--text); font-size: 18px; font-weight: 800; }

/* ---------- Sevimlilar: sotuvda yo'qlari ---------- */
.gone__list { display: grid; gap: 8px; margin: 0; padding: 0 12px; list-style: none; }
.gone__item {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  padding: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.gone__photo { flex: none; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: var(--surface-2); filter: grayscale(0.6); opacity: 0.8; }
.gone__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gone__photo .photo__empty { display: grid; place-items: center; height: 100%; font-size: 22px; }
.gone__info { flex: 1; min-width: 0; }
.gone__title { margin: 0; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.gone__note { margin: 2px 0 0; color: var(--hint); font-size: 12px; }

/* ---------- Profil ---------- */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 12px 0;
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 22px;
  font-weight: 800;
}
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-card__name { margin: 0; overflow: hidden; font-size: 18px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.profile-card__sub { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.profile-card__text { flex: 1; min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 12px 0; }
.stat {
  border: 0;
  border-radius: 14px;
  padding: 10px 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.stat b { display: block; font-size: 18px; font-weight: 800; }
.stat span { color: var(--text-2); font-size: 12px; }

.card {
  margin: 0 12px;
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 10px; }
.card__text { margin: 0 0 12px; color: var(--text-2); font-size: 14px; }

.orders { display: grid; gap: 10px; margin: 0; padding: 0 12px; list-style: none; }
.order {
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.order__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  width: 100%;
  border: 0;
  padding: 12px 14px;
  background: transparent;
  text-align: left;
}
.order__id { font-weight: 800; }
.order__date { color: var(--hint); font-size: 12px; }
.order__thumbs { display: flex; grid-column: 1 / -1; gap: 6px; }
.order__thumb { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.order__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.order__thumb .photo__empty { display: grid; place-items: center; height: 100%; font-size: 20px; }
.order__more { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 700; }
.order__sum { display: flex; grid-column: 1 / -1; justify-content: space-between; color: var(--text-2); font-size: 13px; }
.order__sum b { color: var(--text); font-size: 15px; }
.order__note { grid-column: 1 / -1; margin: 0; font-size: 13px; font-weight: 600; }
.order__details { margin: 0; padding: 0 14px 12px; list-style: none; border-top: 1px solid var(--border); }
.order__details li { display: flex; justify-content: space-between; gap: 10px; padding-top: 8px; font-size: 13px; }
.order__details li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.order__details li span:last-child { flex: none; font-weight: 600; }

.status-pill { align-self: start; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-pill--new { background: rgba(224, 112, 28, 0.14); color: var(--warn); }
.status-pill--confirmed { background: var(--accent-soft); color: var(--accent-ink); }
.status-pill--delivered { background: var(--success-soft); color: var(--success); }
.status-pill--cancelled { background: var(--surface-2); color: var(--hint); }

.codes { display: flex; flex-wrap: wrap; gap: 8px; }
.code {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px dashed var(--accent);
  border-radius: 12px;
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  text-align: left;
}
.code b { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: 0.03em; }
.code span { font-size: 12px; }

/* Nusxalanadigan matn (taklif havolasi): bosilsa buferga tushadi */
.copybox {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px dashed var(--accent);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  text-align: left;
}
.copybox span {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.copybox svg { width: 18px; height: 18px; }
.copybox + .hint { margin-top: 10px; }

.list { margin: 0 0 12px; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.list li:last-child { border-bottom: 0; }
.list li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list__remove {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: var(--surface-2);
  color: var(--text-2);
}
.list__remove svg { width: 16px; height: 16px; }

.contact { display: grid; gap: 8px; }
.contact__row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  text-decoration: none;
}
.contact__icon { flex: none; width: 24px; font-size: 18px; text-align: center; }
.contact__text { flex: 1; min-width: 0; }
.contact__text small { display: block; color: var(--hint); font-size: 12px; }
.contact__text b { display: block; overflow-wrap: anywhere; font-weight: 600; }

.skeleton { margin: 0 12px 10px; height: 90px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); animation: pulse 1.2s ease-in-out infinite; }

/* ---------- Pastdan chiqadigan oynalar ---------- */
.sheet { position: fixed; inset: 0; z-index: 12; }
.sheet__backdrop { position: absolute; inset: 0; background: var(--overlay); animation: fade-in 0.2s ease; }
.sheet__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 22px 22px 0 0;
  padding: 16px 16px calc(16px + var(--safe-bottom));
  background: var(--surface);
  animation: sheet-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (min-width: 640px) {
  .sheet__panel { right: auto; left: 50%; width: 560px; transform: translateX(-50%); animation: fade-in 0.2s ease; }
}
.sheet__panel--product { padding-top: 0; }
.sheet__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
}
.sheet__close svg { width: 18px; height: 18px; }
.sheet__close--soft { background: var(--surface-2); color: var(--text-2); }
.sheet__title { margin: 4px 44px 6px 0; font-size: 19px; font-weight: 800; line-height: 1.25; }
.sheet__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 10px; font-size: 22px; font-weight: 800; }
.sheet__price .pcard__old { font-size: 14px; }
.sheet__price .badge { position: static; align-self: center; }
.sheet__label { margin: 4px 0 8px; color: var(--text-2); font-size: 13px; font-weight: 700; }
.sheet__actions { display: flex; gap: 8px; margin-top: 4px; }
.sheet__actions .button + .button { margin-top: 0; }

.gallery-wrap { position: relative; margin: 0 -16px 12px; }
.gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background: var(--surface-2);
}
.gallery::-webkit-scrollbar { display: none; }
.gallery .photo {
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  max-height: 58vh;
  scroll-snap-align: center;
  font-size: 64px;
}
.gallery .photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery .photo--video { background: #000; }
.photo--video video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.gallery__dots { position: absolute; right: 0; bottom: 10px; left: 0; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.6); box-shadow: 0 0 2px rgba(0, 0, 0, 0.4); transition: width 0.2s; }
.dot--active { width: 16px; border-radius: 3px; background: #fff; }
.dot--video { border-radius: 2px; }

.product-head { display: flex; align-items: flex-start; gap: 10px; }
.product-head .sheet__title { flex: 1; margin-right: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.tags:empty { display: none; }
.tag { border-radius: 10px; padding: 5px 10px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.popular { margin: 0 0 12px; color: var(--text-2); font-size: 13px; }

.sizes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.sizes .chip { display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 7px 12px; font-weight: 700; }
.sizes .chip small { color: var(--hint); font-size: 11px; font-weight: 500; }
.sizes .chip--active small { color: inherit; opacity: 0.85; }

.picker__head { display: flex; align-items: center; gap: 12px; margin: 0 44px 14px 0; }
.picker__photo { flex: none; width: 60px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.picker__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.picker__photo .photo__empty { display: grid; place-items: center; height: 100%; font-size: 26px; }
.picker__info { min-width: 0; }
.picker__title { display: -webkit-box; margin: 0; overflow: hidden; font-weight: 700; line-height: 1.3; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.picker__price { margin: 2px 0 0; font-size: 17px; font-weight: 800; }
.picker__list { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.picker__row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 8px 8px 14px;
}
.picker__row.is-in { border-color: var(--accent); }
.picker__size { flex: 1; min-width: 0; }
.picker__size b { display: block; font-size: 16px; }
.picker__size small { color: var(--hint); font-size: 12px; }
.picker__size small.is-last { color: var(--warn); font-weight: 700; }
.picker__row .add-btn { width: 112px; height: 36px; }
.picker__row .stepper { width: 112px; height: 36px; grid-template-columns: 36px minmax(0, 1fr) 36px; }
.picker__actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.picker__actions .button + .button { margin-top: 0; }

/* ---------- Burger menyu ---------- */
.drawer { position: fixed; inset: 0; z-index: 15; }
.drawer__backdrop { position: absolute; inset: 0; background: var(--overlay); animation: fade-in 0.2s ease; }
.drawer__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(300px, 84vw);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 8px calc(16px + var(--safe-bottom));
  background: var(--surface);
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.2);
  animation: drawer-in 0.22s ease-out;
}
.drawer__head { display: flex; align-items: center; gap: 10px; margin: 0 4px 8px; padding: 0 4px 12px; border-bottom: 1px solid var(--border); }
.brand__logo { flex: none; width: 40px; height: 40px; border-radius: 50%; }
.brand__text { flex: 1; min-width: 0; }
.brand__name { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.2; }
.brand__tagline { margin: 0; color: var(--hint); font-size: 13px; }
.drawer__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: var(--surface-2);
  color: var(--text-2);
}
.drawer__close svg { width: 16px; height: 16px; }
.drawer__label { margin: 14px 12px 6px; color: var(--hint); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.drawer__items { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  padding: 8px 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.menu-item__icon { flex: none; width: 32px; font-size: 18px; text-align: center; }
.menu-item__thumb { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; overflow: hidden; background: var(--surface-2); font-size: 17px; }
.menu-item__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.menu-item__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item__count { flex: none; color: var(--hint); font-size: 13px; }
.menu-item--active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.menu-item--active .menu-item__count { color: inherit; }
.menu-item:not(.menu-item--active):active { background: var(--surface-2); }
@media (hover: hover) {
  .menu-item:not(.menu-item--active):hover { background: var(--surface-2); }
}

/* ---------- Filtr ---------- */
.toggle { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.filter-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.filter-actions .button + .button { margin-top: 0; }
#alert-button { margin-bottom: 12px; }

/* ---------- Rasmiylashtirish ---------- */
.checkout { display: grid; gap: 12px; }
.checkout .sheet__title { margin: 2px 44px 0 0; }
.co-items {
  display: grid;
  gap: 6px;
  margin: 0;
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--surface-2);
  font-size: 14px;
  list-style: none;
}
.co-items li { display: flex; justify-content: space-between; gap: 10px; }
.co-items li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.co-items li span:last-child { flex: none; font-weight: 600; white-space: nowrap; }
.co-section { margin: 6px 0 -4px; color: var(--hint); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.form-field { display: grid; gap: 4px; min-width: 0; }
.form-field__label { color: var(--text-2); font-size: 13px; }
.form-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.form-input.is-invalid { border-color: var(--danger); }
textarea.form-input { resize: vertical; }
.form-input--code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; }
.form-input--code::placeholder { font-family: inherit; text-transform: none; }
.form-error { margin: -4px 0 0; color: var(--danger); font-size: 13px; }
.co-codes { margin: 0; }
.co-promo { display: flex; gap: 8px; }
.co-promo .button { flex: none; width: auto; min-height: 0; padding: 10px 16px; }
.co-promo-applied { display: flex; align-items: center; gap: 8px; border-radius: 12px; padding: 10px 4px 10px 12px; background: var(--success-soft); font-size: 14px; }
.co-promo-applied span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.co-promo-applied button { border: 0; padding: 2px 10px; background: transparent; color: var(--hint); }
.co-payment { display: grid; gap: 8px; }
.co-payment .co-section { margin-bottom: 0; }
.co-option { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.co-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.co-option input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.co-totals { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; margin: 4px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
.co-totals dt { color: var(--text-2); overflow-wrap: anywhere; }
.co-totals dd { margin: 0; text-align: right; white-space: nowrap; }
.co-totals .co-discount { color: var(--success); }
.co-totals .co-total { margin-top: 2px; color: var(--text); font-size: 18px; font-weight: 800; }
.co-note { margin: -4px 0 0; }
.co-done { display: grid; gap: 12px; padding-top: 8px; }
.co-done__icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.co-done__icon svg { width: 32px; height: 32px; }
.co-done__title { margin: 0; font-size: 20px; text-align: center; }
.co-done__number { margin: -6px 0 0; color: var(--hint); text-align: center; }
.co-done__text { margin: 0; }
.co-card { display: grid; gap: 6px; border-radius: 14px; padding: 12px; background: var(--surface-2); }
.co-card p { margin: 0; }
.co-card__title { font-weight: 700; }
.co-card__number {
  border: 1px dashed var(--accent);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface);
  color: var(--text);
  font: 700 18px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.05em;
}
.co-card__line { font-size: 14px; }

/* ---------- Animatsiyalar ---------- */
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes drawer-in { from { transform: translateX(-100%); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
