/* ───────── Admiral Un · Telegram do'koni ───────── */
/* Toza, sodda uslub: oq kartochkalar, ingichka chegaralar, bitta to'q yashil aksent.
   Shisha effekti, gradient va nurli fonlar yo'q — mahsulot o'zi ko'rinib turadi. */

:root {
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f0f3ef;
  --border: #e2e7e1;
  --border-strong: #cfd7ce;
  --text: #132019;
  --muted: #64716a;
  --accent: #13774a;
  --accent-press: #0e5f3a;
  --accent-soft: #e5f1ea;
  --on-accent: #ffffff;
  --danger: #d6363f;
  --bar: rgba(255, 255, 255, 0.96);
  --tile: var(--surface-2);
  --shadow-sm: 0 1px 2px rgba(19, 32, 25, 0.06);
  --shadow-md: 0 10px 28px -8px rgba(19, 32, 25, 0.18);
  --sack-0: #13774a; --sack-1: #2f6f8f; --sack-2: #8a5a1c; --sack-3: #55615a;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --safe-t: calc(env(safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-b: calc(env(safe-area-inset-bottom, 0px) + var(--tg-safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100dvh;
  padding-bottom: calc(140px + var(--safe-b));
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.lock { overflow: hidden; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:focus-visible, input:focus-visible, .card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { display: block; }

.app { position: relative; max-width: 960px; margin: 0 auto; }

/* ───────── Ochilish ekrani ───────── */
.splash {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: var(--surface);
  transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-logo {
  display: grid; place-items: center; width: 84px; height: 84px; border-radius: 24px;
  background: var(--accent); color: var(--on-accent);
  animation: splash-in 0.6s var(--spring) backwards;
}
.splash-logo svg { width: 46px; height: 46px; }
.splash b { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; animation: rise 0.5s var(--ease) 0.15s backwards; }

/* ───────── Yuqori panel ───────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  height: calc(var(--safe-t) + 60px); padding: var(--safe-t) 16px 0;
  background: var(--bg);
  transition: transform 0.3s var(--ease);
}
.topbar.hide { transform: translateY(-100%); pointer-events: none; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: var(--on-accent); }
.logo svg { width: 21px; height: 21px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-text b { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.brand-text small { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar-btn, .avatar-lg {
  flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 800;
}
.avatar-btn { width: 38px; height: 38px; font-size: 15px; transition: transform 0.2s var(--spring); }
.avatar-btn:active { transform: scale(0.92); }
.avatar-btn img, .avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

.icon-btn {
  position: relative; flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.2s var(--spring), background 0.2s;
}
.icon-btn:active { transform: scale(0.92); background: var(--surface-2); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.bump { animation: bump 0.45s var(--spring); }

.badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center;
  border-radius: 10px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 800; box-shadow: 0 0 0 2px var(--surface);
  transform: scale(0); transition: transform 0.3s var(--spring);
}
.badge.show { transform: scale(1); }
.badge.bump { animation: bump 0.4s var(--spring); }

/* ───────── Sahifalar ───────── */
.page { display: none; }
.page.active { display: block; animation: page-in 0.35s var(--ease); }
.page-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px 6px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.page-note { margin: 2px 20px 14px; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ───────── Qidiruv maydoni ───────── */
.search {
  position: relative; display: flex; align-items: center; flex: 1; min-width: 0;
  height: 46px; padding: 0 12px 0 14px; gap: 10px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search > svg { flex: none; width: 20px; height: 20px; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); color: var(--muted);
  transform: scale(0); opacity: 0; transition: transform 0.25s var(--spring), opacity 0.2s;
}
.search-clear svg { width: 12px; height: 12px; }
.search.has-text .search-clear { transform: scale(1); opacity: 1; }

/* ───────── Kategoriyalar ───────── */
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px 4px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat-item {
  flex: none; display: flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--spring);
}
.cat-item:active { transform: scale(0.95); }
.cat-ic { display: none; }
.cat-name { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; }
.cat-item.active { background: var(--accent); border-color: var(--accent); }
.cat-item.active .cat-name { color: var(--on-accent); }

/* ───────── Bo'lim sarlavhasi ───────── */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 20px 2px; }
.sec-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.sec-head span { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ───────── Mahsulot kartochkalari ───────── */
/* Bir ustunli ro'yxat: har bir mahsulot alohida qatorda — rasm chapda, ma'lumot o'ngda */
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 16px 0; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

.card {
  position: relative; display: flex; flex-direction: row; align-items: stretch; height: 120px; cursor: pointer; outline: none; overflow: hidden;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
  animation: rise 0.5s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 40ms);
  transition: transform 0.15s var(--spring), border-color 0.2s, box-shadow 0.2s;
}
.card.still { animation: none; }
.card:active:not(:has(.ctrl:active)) { transform: scale(0.97); }
.card.in-cart { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.thumb { flex: none; display: grid; place-items: center; width: 108px; padding: 8px; background: var(--surface); border-right: 1px solid var(--border); }
.thumb .emoji { font-size: 52px; line-height: 1; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.sack { width: 58%; height: auto; overflow: visible; }

/* Haqiqiy mahsulot surati: "contain" — qadoq (quti yoki qop) hech qachon kesilmaydi, to'liq ko'rinadi */
.thumb-photo { position: relative; width: 100%; height: 100%; }
.card .thumb-photo { height: 104px; }
.card .thumb-photo img, .detail-hero .thumb-photo img, .ri-tile .thumb-photo img, .mini-thumb .thumb-photo img {
  display: block; width: 100%; height: 100%; object-fit: contain; padding: 0;
}

.tag {
  position: absolute; z-index: 2; top: 10px; left: 10px; padding: 3px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 800;
}

.info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; }
.name { font-size: 15.5px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.unit { padding: 3px 9px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; }
.info .unit { padding: 0; background: none; color: var(--muted); font-weight: 600; }
.info .unit::after { content: "·"; margin-left: 6px; }
.cat { font-size: 12px; color: var(--muted); }
.price { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; }
.info .price { margin-top: auto; padding-top: 8px; }
.info .price b { font-size: 18px; }
.price b { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.price small { font-size: 12px; color: var(--muted); font-weight: 600; }

/* Rasm burchagidagi "+" tugmasi / hisoblagich */
.ctrl { position: absolute; z-index: 3; right: 12px; bottom: 12px; }
.ctrl.pop > * { animation: pop 0.4s var(--spring); }
.add-btn {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--accent); color: var(--on-accent);
  transition: transform 0.2s var(--spring), background 0.2s;
}
.add-btn:active { transform: scale(0.88); background: var(--accent-press); }
.add-btn svg { width: 19px; height: 19px; }

.stepper {
  display: flex; align-items: center; gap: 2px; height: 38px; padding: 3px;
  border-radius: 11px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.st-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); transition: transform 0.2s var(--spring); }
.st-btn:last-child { background: var(--accent); color: var(--on-accent); }
.st-btn:active { transform: scale(0.85); }
.st-btn svg { width: 15px; height: 15px; }
.qty-num { min-width: 24px; text-align: center; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.qty-num.tick { animation: tick 0.25s var(--ease); }

/* Yuklanish skeleti */
.card.skeleton { pointer-events: none; }
.sk { height: 13px; margin-top: 4px; border-radius: 6px; background-color: var(--surface-2); }
.sk.w60 { width: 60%; } .sk.w40 { width: 40%; }
.card.skeleton .thumb { background-color: var(--surface-2); }
.card.skeleton .thumb, .sk {
  background-image: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.7) 50%, transparent 80%);
  background-size: 220% 100%; background-repeat: no-repeat; animation: sk 1.4s ease-in-out infinite;
}

/* Bo'sh holatlar */
.empty { display: none; flex-direction: column; align-items: center; gap: 6px; padding: 56px 32px; text-align: center; color: var(--muted); font-size: 14px; }
.empty.show { display: flex; animation: rise 0.4s var(--ease); }
.empty b { color: var(--text); font-size: 17px; }
.empty-emoji { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 8px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.empty-emoji svg { width: 30px; height: 30px; }
.empty-state { display: none; flex-direction: column; align-items: center; gap: 6px; padding: 64px 32px; text-align: center; color: var(--muted); font-size: 14px; }
.empty-state b { color: var(--text); font-size: 18px; }

.link-btn { color: var(--accent); font-weight: 700; font-size: 14px; padding: 8px 4px; }
.ghost-btn { margin-top: 14px; padding: 12px 22px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-strong); font-weight: 700; color: var(--text); }
.ghost-btn:active { background: var(--surface-2); }

/* ───────── Asosiy tugma ───────── */
.cta {
  position: relative; width: 100%; height: 54px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 14px; background: var(--accent); color: var(--on-accent);
  font-size: 16px; font-weight: 800;
  transition: transform 0.2s var(--spring), background 0.2s, opacity 0.2s;
}
.cta:active { transform: scale(0.98); background: var(--accent-press); }
.cta svg { width: 20px; height: 20px; }
.cta.split { justify-content: space-between; padding: 0 20px; }
.cta.split b { font-size: 16px; font-variant-numeric: tabular-nums; }
.cta.busy { pointer-events: none; opacity: 0.7; }

/* ───────── Pastki qism: savatga o'tish tugmasi + tab-bar ───────── */
.bottom-stack {
  position: fixed; z-index: 35; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.bottom-stack.away { transform: translateY(110%); opacity: 0; pointer-events: none; }

.mini-cart {
  display: none; align-items: center; gap: 12px; width: auto; max-width: 560px; height: 56px; margin: 0 12px; padding: 0 14px 0 7px;
  border-radius: 14px; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-md);
  transition: transform 0.2s var(--spring);
}
@media (min-width: 600px) { .mini-cart { margin: 0 auto; width: calc(100% - 24px); } }
.mini-cart.show { display: flex; animation: rise 0.35s var(--spring); }
.mini-cart:active { transform: scale(0.98); }
.mini-cart.pop { animation: pop 0.4s var(--spring); }
.mc-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: rgba(255, 255, 255, 0.16); }
.mc-icon svg { width: 20px; height: 20px; }
.mc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.mc-text b { font-size: 14.5px; font-weight: 800; }
.mc-text small { font-size: 11.5px; font-weight: 600; opacity: 0.85; }
.mc-total { flex: none; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mc-arrow { flex: none; width: 19px; height: 19px; }

/* Standart tab-bar: ekran tagiga yopishgan, har bir bo'limning yorlig'i doim ko'rinadi */
.dock { background: var(--surface); border-top: 1px solid var(--border); padding-bottom: var(--safe-b); }
.nav { display: flex; align-items: stretch; max-width: 560px; height: 58px; margin: 0 auto; }
.nav-item, .nav-btn {
  position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); transition: color 0.2s;
}
.nav-item:active, .nav-btn:active { color: var(--text); }
.nav-item svg, .nav-btn svg { flex: none; width: 24px; height: 24px; }
.nav-label > span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; letter-spacing: 0.01em; }
.nav-item.active { color: var(--accent); }
.nav-item.active svg { stroke-width: 2.2; }
.nav-item.bump svg { animation: bump 0.45s var(--spring); }
.nav .badge { top: 5px; right: auto; left: 50%; margin-left: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; font-size: 10px; }
@media (max-width: 350px) { .nav-label > span { font-size: 10px; } .nav-item svg, .nav-btn svg { width: 22px; height: 22px; } }

/* ───────── To'liq ekranli oynalar (mahsulot, buyurtma, qidiruv) ───────── */
.detail, .checkout, .search-page {
  position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg);
}
.detail { z-index: 40; visibility: hidden; transform: translateX(100%); transition: transform 0.4s var(--ease), visibility 0s linear 0.4s; }
.detail.open { visibility: visible; transform: none; transition-delay: 0s; }
.checkout { z-index: 45; visibility: hidden; transform: translateX(100%); transition: transform 0.4s var(--ease), visibility 0s linear 0.4s; }
.checkout.open { visibility: visible; transform: none; transition-delay: 0s; }
.search-page { z-index: 46; visibility: hidden; opacity: 0; transform: translateY(12px); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s; }
.search-page.open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }

.detail-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 28px; }
.detail-top {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(var(--safe-t) + 10px) 16px 10px; background: var(--bar); border-bottom: 1px solid var(--border);
}
.detail-top h2 { flex: 1; margin: 0; text-align: center; font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-top { justify-content: flex-start; gap: 10px; }
.search-page .grid { padding-top: 16px; }
.search-page .empty { padding-top: 15vh; }

/* ───────── Mahsulot sahifasi ───────── */
.detail-hero {
  position: relative; display: grid; place-items: center; overflow: hidden;
  height: min(38vh, 320px); margin: 12px 16px 0; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
}
.detail-hero .sack { width: min(42%, 180px); }
.detail-hero .emoji { font-size: 88px; }
.detail-hero img { width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.detail-hero .thumb-photo { width: 84%; height: 84%; }
.detail-hero.swap > * { animation: pop 0.45s var(--spring); }

.qty-big { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 22px 0 6px; }
.round-btn {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.2s var(--spring), opacity 0.2s, background 0.2s;
}
.round-btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.round-btn:active { transform: scale(0.9); }
.round-btn:disabled { opacity: 0.35; pointer-events: none; }
.round-btn svg { width: 22px; height: 22px; }
.qty-display { min-width: 96px; text-align: center; font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.qty-display.tick { animation: tick 0.25s var(--ease); }

.total-pill {
  display: table; margin: 12px auto 6px; padding: 9px 22px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.unit-price { text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; }

.detail-card { margin: 22px 16px 0; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.dc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dc-head h3 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.dc-desc { margin: 10px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.dc-desc:empty { display: none; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-top: 14px; }
.info-cell { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.info-cell small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.info-cell b { font-size: 14px; font-weight: 800; white-space: nowrap; }

.more h4 { margin: 24px 18px 12px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.mini-list { display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 10px; scrollbar-width: none; }
.mini-list::-webkit-scrollbar { display: none; }
.mini { flex: none; width: 132px; text-align: left; transition: transform 0.2s var(--spring); }
.mini:active { transform: scale(0.96); }
.mini-thumb { display: grid; place-items: center; overflow: hidden; height: 112px; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.mini-thumb .sack { width: 54%; }
.mini-thumb .emoji { font-size: 40px; }
.mini b { display: block; margin-top: 8px; font-size: 13.5px; font-weight: 700; }
.mini small { display: block; margin-top: 2px; font-size: 13px; color: var(--accent); font-weight: 800; }

.detail-bar { padding: 12px 16px calc(var(--safe-b) + 14px); background: var(--bar); border-top: 1px solid var(--border); }

/* ───────── Savat sahifasi ───────── */
.cart-list { margin: 6px 16px 0; padding: 2px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.ri {
  display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border); max-height: 100px; overflow: hidden;
  animation: slide-in 0.35s var(--ease) backwards;
}
.ri:last-child { border-bottom: 0; }
.ri.leaving { animation: leave 0.3s var(--ease) forwards; }
.ri-tile { display: grid; place-items: center; width: 58px; height: 58px; padding: 5px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.ri-tile .sack { width: 72%; }
.ri-tile .emoji { font-size: 28px; }
.ri-tile img { width: 100%; height: 100%; object-fit: contain; }
.ri-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ri-info b { font-size: 15px; font-weight: 800; line-height: 1.25; }
.ri-info small { font-size: 12px; color: var(--muted); }
.ri-price { display: block; font-size: 14px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.ri .stepper { box-shadow: none; background: var(--surface-2); border-color: transparent; }
.ri .st-btn:first-child { background: var(--surface); }

.cart-summary {
  position: sticky; z-index: 5; bottom: calc(var(--safe-b) + 72px); margin: 14px 16px 0; padding: 16px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.sum-row { display: flex; align-items: baseline; justify-content: space-between; padding: 3px 0; }
.sum-row span { color: var(--muted); font-size: 14.5px; font-weight: 500; }
.sum-row b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sum-row.total { margin: 6px 0 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.sum-row.total span { color: var(--text); font-size: 16px; font-weight: 700; }
.sum-row.total b { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; }
#page-cart.is-empty .cart-list, #page-cart.is-empty .cart-summary, #page-cart.is-empty #clear-cart { display: none; }
#page-cart.is-empty #cart-empty, #page-orders.is-empty #orders-empty { display: flex; animation: rise 0.4s var(--ease); }
#page-orders.is-empty #orders-note { display: none; }

/* ───────── Buyurtmalar tarixi ───────── */
.order { margin: 0 16px 10px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); animation: rise 0.4s var(--ease) backwards; }
.o-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.o-code { font-size: 16px; font-weight: 800; letter-spacing: 0.02em; }
.o-date { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.pill { padding: 5px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; white-space: nowrap; }
.pill.demo { background: #fdecec; color: var(--danger); }
.o-sum { display: flex; align-items: baseline; justify-content: space-between; margin-top: 12px; }
.o-sum span { color: var(--muted); font-size: 13.5px; }
.o-sum b { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.o-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s var(--ease); }
.o-more > div { min-height: 0; overflow: hidden; }
.order.open .o-more { grid-template-rows: 1fr; }
.o-lines { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.o-line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; }
.o-line span { color: var(--muted); }
.o-line b { font-weight: 700; }
.o-info { margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; line-height: 1.6; }
.o-info div { display: flex; gap: 8px; }
.o-info em { flex: none; width: 76px; font-style: normal; color: var(--muted); }
.o-repeat { width: 100%; margin-top: 12px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 14.5px; transition: transform 0.2s var(--spring); }
.o-repeat:active { transform: scale(0.98); }

/* ───────── Qutilar va maydonlar ───────── */
.box { margin: 12px 16px 0; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.box h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.hint { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.field { display: block; margin-top: 14px; }
.field > span { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; color: var(--muted); }
.field > span em { font-style: normal; font-weight: 500; }
.field input, .field textarea {
  display: block; width: 100%; padding: 13px 14px; border-radius: 12px; resize: none;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 16px; outline: 0; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 0.8; }
.field input:focus, .field textarea:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .err { display: none; margin-top: 6px; color: var(--danger); font-size: 12.5px; font-weight: 600; }
.field.error input, .field.error textarea { border-color: var(--danger); animation: shake 0.4s; }
.field.error .err { display: block; }
.box .cta { margin-top: 18px; }

.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 12px; padding: 4px; border-radius: 13px; background: var(--surface-2); }
.seg::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: 10px;
  background: var(--accent);
  transform: translateX(calc(var(--i, 0) * (100% + 4px))); transition: transform 0.3s var(--ease);
}
.seg button { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 7px; height: 44px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--muted); transition: color 0.25s; }
.seg button svg { flex: none; width: 18px; height: 18px; }
.seg button.on { color: var(--on-accent); }

.collapse { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.35s var(--ease); }
.collapse > div { min-height: 0; overflow: hidden; padding: 0 4px; margin: 0 -4px; }
.collapse.off { grid-template-rows: 0fr; }
.collapse.off > div { visibility: hidden; transition: visibility 0s linear 0.35s; }

.co-items .o-line { padding: 6px 0; }
.co-body { padding-bottom: 28px; }
.icon-spacer { flex: none; width: 44px; }

/* ───────── Profil ───────── */
.profile-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px 4px; }
.avatar-lg { width: 66px; height: 66px; font-size: 27px; }
.pf-names { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-names b { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.pf-names small { font-size: 14px; color: var(--muted); }
.contact-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.contact-row:last-child { border-bottom: 0; padding-bottom: 0; }
.contact-row em { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.contact-row em svg { width: 18px; height: 18px; }
.contact-row a { color: var(--accent); font-weight: 700; text-decoration: none; }
.steps { margin: 10px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.7; color: var(--muted); }

/* ───────── Buyurtma yuborilgandan keyingi ekran ───────── */
.done {
  position: fixed; inset: 0; z-index: 150; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 32px; text-align: center; background: var(--bg);
  opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0s linear 0.3s;
}
.done > * { position: relative; }
.done.show { opacity: 1; visibility: visible; transition-delay: 0s; }
.done-art { width: 116px; height: 116px; margin-bottom: 8px; }
.done-art svg { width: 100%; height: 100%; overflow: visible; }
.d-ring, .d-tick { stroke-dasharray: 1; stroke-dashoffset: 1; }
.d-ring { stroke: var(--accent); }
.d-disc { fill: var(--accent); transform-origin: 60px 60px; transform: scale(0); }
.done.show .d-ring { animation: draw 0.7s var(--ease) 0.15s forwards; }
.done.show .d-disc { animation: disc 0.5s var(--spring) 0.3s forwards; }
.done.show .d-tick { animation: draw 0.4s var(--ease) 0.65s forwards; }
.done h2 { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: -0.01em; animation: rise 0.5s var(--ease) 0.45s backwards; }
.code-pill { padding: 6px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 800; letter-spacing: 0.05em; animation: rise 0.5s var(--ease) 0.5s backwards; }
.done p { margin: 0; max-width: 300px; font-size: 14.5px; line-height: 1.5; color: var(--muted); animation: rise 0.5s var(--ease) 0.55s backwards; }
.done-sum {
  width: min(100%, 340px); margin-top: 14px; padding: 14px 16px; border-radius: 16px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); animation: rise 0.5s var(--ease) 0.6s backwards;
}
.done-sum div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; }
.done-sum span { color: var(--muted); }
.done-sum b { font-weight: 700; }
.done-sum .total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 16px; }
.done-sum .total span { color: var(--text); font-weight: 700; }
.done-sum .total b { font-weight: 800; }

/* ───────── Xabarcha ───────── */
.toast {
  position: fixed; z-index: 180; left: 50%; top: calc(var(--safe-t) + 74px);
  max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 12px;
  background: var(--text); color: #fff; font-size: 14px; font-weight: 700; text-align: center;
  box-shadow: var(--shadow-md); pointer-events: none;
  transform: translate(-50%, -20px) scale(0.96); opacity: 0; transition: transform 0.35s var(--spring), opacity 0.2s;
}
.toast.show { transform: translate(-50%, 0) scale(1); opacity: 1; }

/* ───────── Animatsiyalar ───────── */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes leave { to { opacity: 0; transform: translateX(-24px); max-height: 0; padding-top: 0; padding-bottom: 0; border-color: transparent; } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes tick { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sk { from { background-position: 130% 0; } to { background-position: -90% 0; } }
@keyframes splash-in { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes disc { to { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
    transition-duration: 0.001ms !important; transition-delay: 0s !important;
  }
}
