/* =========================================================
   THE ONE ELECTRONICS — dizayn tizimi
   Ranglar logotipdan olingan: qora fon, oq matn, #4528F0 brend ko‘k‑binafsha
   Shriftlar: Unbounded (sarlavhalar, logotipdagi keng shrift uslubi), Montserrat (matn)
   Oraliqlar: 4/8 px tizimi
   ========================================================= */

:root {
  --bg: #060608;
  --bg-2: #0A0A0F;
  --surface: #101016;
  --surface-2: #16161E;
  --surface-3: #1D1D28;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);

  --text: #F5F5F8;
  --text-2: #B9B9C8;
  --muted: #88889A;   /* 4.8:1 on --surface-3, WCAG AA (was #7E7E90, 4.19:1) */

  --brand: #4528F0;
  --brand-2: #5A3FFF;
  --brand-3: #8C76FF;
  --brand-soft: rgba(69, 40, 240, .14);
  --brand-glow: rgba(69, 40, 240, .5);

  --sale: #FF4D6A;
  --ok: #2FD38A;
  --warn: #FFB547;

  --r-xs: 8px;
  --r-sm: 12px;
  --r: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  --container: 1320px;
  --gutter: clamp(16px, 3vw, 32px);
  --header-h: 72px;

  --ff-display: 'Unbounded', system-ui, sans-serif;
  --ff: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--ff-display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 2px solid var(--brand-3); outline-offset: 2px; border-radius: 6px; }

/* Admin paneldan yuklangan mahsulot rasmlari (shaffof fonli PNG/WebP tavsiya etiladi) */
.dimg { display: block; width: 100%; height: 100%; object-fit: contain; padding: 8%; transition: transform .45s var(--ease); }
.pcard:hover .pcard__media .dimg, .cat:hover .cat__art .dimg { transform: scale(1.05); }
.sres__img .dimg, .toast__img .dimg, .order__thumb .dimg, .pd__thumb .dimg { padding: 4%; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.ic { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- Tugmalar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 14px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: background .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 10px 30px -12px var(--brand-glow); }
.btn--primary:hover { background: var(--brand-2); box-shadow: 0 14px 36px -10px var(--brand-glow); }
.btn--ghost { background: var(--surface-2); border: 1px solid var(--line-2); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--white { background: #fff; color: #0a0a0f; }
.btn--white:hover { background: #e9e9f1; }
.btn--sm { height: 40px; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.btn--lg { height: 56px; padding: 0 28px; font-size: 16px; border-radius: 16px; }
.btn--block { width: 100%; }
.btn--icon { width: 48px; padding: 0; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text-2); font-weight: 500; font-size: 14px; white-space: nowrap;
  transition: .2s var(--ease);
}
.chip:hover { color: var(--text); border-color: rgba(255,255,255,.25); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip small { opacity: .6; font-weight: 500; }

.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.badge--sale { background: var(--sale); color: #fff; }
.badge--new { background: var(--brand); color: #fff; }
.badge--hit { background: #fff; color: #0a0a0f; }

/* ---------- Yuqori panel ---------- */
.topbar { border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.topbar__in { display: flex; align-items: center; justify-content: space-between; height: 40px; gap: 24px; }
.topbar__links { display: flex; gap: 22px; align-items: center; }
.topbar__links a:hover, .topbar__right a:hover { color: var(--text); }
.topbar__right { display: flex; gap: 18px; align-items: center; }
.topbar__phone { font-weight: 700; color: var(--text); }
.topbar__soc { display: flex; gap: 12px; }
.topbar__soc a { opacity: .75; } .topbar__soc a:hover { opacity: 1; }
.loc { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 50; background: rgba(6, 6, 8, .82); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); border-bottom: 1px solid var(--line); }
.header__in { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 12px; flex: none; }
.logo__mark { width: 26px; height: 42px; }
.logo__txt { display: flex; flex-direction: column; line-height: 1; }
.logo__txt b { font-family: var(--ff-display); font-weight: 800; font-size: 19px; letter-spacing: .02em; transform: scaleX(1.08); transform-origin: left; }
.logo__txt small { font-family: var(--ff); font-weight: 300; font-size: 12.5px; letter-spacing: .14em; margin-top: 5px; color: var(--text); }
.header__catalog { flex: none; }
.search { position: relative; flex: 1; max-width: 640px; }
.search input {
  width: 100%; height: 48px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--surface); padding: 0 52px 0 18px; outline: none; transition: border-color .2s, background .2s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--brand); background: var(--surface-2); }
.search__btn { position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); }
.search__btn:hover { color: #fff; background: var(--surface-3); }
.search__drop {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); padding: 8px;
  display: none; max-height: 420px; overflow: auto; z-index: 60;
}
.search__drop.is-open { display: block; }
.sres { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; width: 100%; text-align: left; }
.sres:hover, .sres.is-focus { background: var(--surface-3); }
.sres__img { width: 48px; height: 48px; border-radius: 10px; background: var(--surface); flex: none; }
.sres__name { font-weight: 600; font-size: 14px; }
.sres__price { font-size: 13px; color: var(--text-2); }
.sres--empty { padding: 16px; color: var(--muted); font-size: 14px; }

/* Til almashtirgich */
.langsw { display: inline-flex; flex: none; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); }
.langsw a { display: inline-flex; align-items: center; justify-content: center; height: 34px; min-width: 40px; padding: 0 10px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--text-2); transition: background .2s, color .2s; }
.langsw a:hover { color: var(--text); background: var(--surface-2); }
.langsw a.is-active { background: var(--brand); color: #fff; }
.hicons { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.hicon { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 6px 8px; border-radius: 12px; color: var(--text-2); font-size: 12px; font-weight: 500; }
.hicon:hover, .hicon.is-active { color: var(--text); background: var(--surface); }
.hicon__count { position: absolute; top: 2px; right: 12px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.hicon__count:empty, .hicon__count[data-n="0"] { display: none; }

.catnav { border-top: 1px solid var(--line); }
.catnav__in { display: flex; gap: 6px; height: 50px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.catnav__in::-webkit-scrollbar { display: none; }
.catnav a { padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.catnav a:hover { color: var(--text); background: var(--surface); }
.catnav a.is-active { color: #fff; background: var(--brand-soft); }
.catnav a.is-accent { color: var(--brand-3); }

/* ---------- Mobil tab‑bar ---------- */
.tabbar { display: none; }

/* ---------- Umumiy bo‘limlar ---------- */
main { min-height: 60vh; }
.section { padding: 56px 0; }
.section--tight { padding: 32px 0; }
.shead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.shead h2 { font-size: clamp(22px, 2.6vw, 34px); }
.shead p { color: var(--text-2); margin-top: 8px; }
.shead__link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-3); font-weight: 600; font-size: 14px; }
.shead__link:hover { color: #fff; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-3); }
.eyebrow::before { content: ''; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); padding: 20px 0 8px; }
.crumbs a:hover { color: var(--text); }
.page-title { font-size: clamp(26px, 3.4vw, 44px); margin: 8px 0 8px; }

/* ---------- Hero slayder ---------- */
.hero { padding: 24px 0 8px; }
.slider { position: relative; border-radius: var(--r-xl); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.slides { display: flex; transition: transform .7s var(--ease); }
.slide { flex: 0 0 100%; min-height: clamp(460px, 56vw, 580px); display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 24px; padding: clamp(28px, 5vw, 72px); position: relative; overflow: hidden; isolation: isolate; }
.slide__bg { position: absolute; inset: 0; z-index: -1; }
.slide__txt { max-width: 560px; }
.slide__tag { display: inline-flex; gap: 8px; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); font-size: 13px; font-weight: 600; margin-bottom: 22px; }
.slide__tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-3); box-shadow: 0 0 12px var(--brand-3); }
.slide h1, .slide h2 { font-size: clamp(34px, 5.2vw, 68px); font-weight: 700; letter-spacing: -.02em; }
.slide h1 span, .slide h2 span { color: var(--brand-3); }
.slide__sub { margin-top: 18px; font-size: clamp(15px, 1.4vw, 18px); color: var(--text-2); max-width: 460px; }
.slide__price { margin-top: 26px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.slide__price b { font-family: var(--ff-display); font-size: clamp(20px, 2.2vw, 28px); font-weight: 600; }
.slide__price span { color: var(--text-2); font-size: 14px; }
.slide__cta { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.slide__art { position: relative; height: 100%; display: grid; place-items: center; }
.slide__art svg { width: min(100%, 520px); height: auto; animation: float 7s ease-in-out infinite; will-change: transform; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.slider__nav { position: absolute; left: 0; right: 0; bottom: 24px; display: flex; justify-content: center; gap: 8px; }
.slider__dot { width: 8px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.3); transition: width .3s var(--ease), background .3s; }
.slider__dot.is-active { width: 28px; background: #fff; }
.slider__arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); display: grid; place-items: center; backdrop-filter: blur(8px); transition: background .2s; }
.slider__arrow:hover { background: rgba(255,255,255,.18); }
.slider__arrow--prev { left: 20px; } .slider__arrow--next { right: 20px; }

/* ---------- Kategoriya plitkalari ---------- */
.cats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.cat {
  position: relative; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  padding: 18px 18px 20px; overflow: hidden; transition: border-color .25s, transform .25s var(--ease), background .25s;
  display: flex; flex-direction: column;
}
.cat:hover { border-color: rgba(140, 118, 255, .45); transform: translateY(-4px); background: var(--surface-2); }
.cat__art { aspect-ratio: 1; margin: -6px -6px 6px; }
.cat__art svg { width: 100%; height: 100%; transition: transform .4s var(--ease); }
.cat:hover .cat__art svg { transform: scale(1.06); }
.cat__name { font-family: var(--ff-display); font-weight: 600; font-size: 15px; }
.cat__meta { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- Mahsulot kartasi ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid--5 { grid-template-columns: repeat(5, 1fr); }
.pcard {
  position: relative; display: flex; flex-direction: column; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); overflow: hidden; cursor: pointer;
  transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.pcard:hover { border-color: rgba(140, 118, 255, .4); transform: translateY(-4px); box-shadow: 0 30px 60px -30px rgba(69, 40, 240, .45); }
.pcard__media { position: relative; aspect-ratio: 1 / 1; background: radial-gradient(120% 90% at 50% 0%, #17172a 0%, var(--surface) 70%); }
.pcard__media svg { width: 100%; height: 100%; transition: transform .45s var(--ease); }
.pcard:hover .pcard__media svg { transform: scale(1.05); }
.pcard__badges { position: absolute; left: 14px; top: 14px; display: flex; gap: 6px; z-index: 2; flex-wrap: wrap; }
.fav { position: absolute; right: 12px; top: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.06); color: var(--text-2); border: 1px solid var(--line); transition: .2s; }
.fav:hover { color: #fff; background: rgba(255,255,255,.12); }
.fav.is-on { color: var(--sale); }
.fav.is-on svg { fill: currentColor; }
.pcard__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard__brand { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.pcard__name { font-family: var(--ff); font-weight: 700; font-size: 16px; line-height: 1.3; letter-spacing: 0; }
.pcard__link:focus-visible { outline: 2px solid var(--brand-3); outline-offset: 2px; border-radius: 4px; }
.pcard__meta { font-size: 13px; color: var(--text-2); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 2px; }
.sw { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.pcard__price { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; }
.pcard__price s { color: var(--muted); font-size: 13px; }
.pcard__price b { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.pcard__price b.is-sale { color: #FF7A8F; }
.pcard__inst { font-size: 12px; color: var(--brand-3); font-weight: 600; background: var(--brand-soft); border-radius: 8px; padding: 4px 8px; align-self: flex-start; }
.pcard__cta { display: flex; gap: 8px; margin-top: 12px; }
.pcard__cta .btn { flex: 1; height: 44px; }

/* gorizontal scroller */
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 60px) / 4); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.hscroll > * { scroll-snap-align: start; }
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; gap: 20px; }
.bento__card { position: relative; border-radius: var(--r-xl); overflow: hidden; padding: 32px; border: 1px solid var(--line); min-height: 260px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; cursor: pointer; isolation: isolate; transition: transform .3s var(--ease); }
.bento__card:hover { transform: translateY(-4px); }
.bento__card--big { grid-row: span 2; grid-template-columns: 1fr; align-content: space-between; }
.bento__card h3 { font-size: clamp(22px, 2.4vw, 34px); }
.bento__card p { color: var(--text-2); margin-top: 10px; font-size: 15px; }
.bento__card .price { margin-top: 18px; font-weight: 800; font-size: 18px; }
.bento__art svg { width: 100%; height: auto; }
.bento__card--big .bento__art { max-width: 460px; margin: 0 auto; width: 100%; }

/* ---------- Promo banner ---------- */
.promo { position: relative; border-radius: var(--r-xl); overflow: hidden; padding: clamp(28px, 5vw, 56px); background: var(--brand); display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; isolation: isolate; }
.promo::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 120% at 100% 0%, #7b66ff 0%, transparent 60%), radial-gradient(50% 90% at 0% 100%, #2a13b8 0%, transparent 70%); }
.promo h2 { font-size: clamp(24px, 3.2vw, 44px); }
.promo p { margin-top: 14px; color: rgba(255,255,255,.82); max-width: 520px; }
.promo__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.promo__stat { background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.18); border-radius: var(--r); padding: 18px; }
.promo__stat b { display: block; font-family: var(--ff-display); font-size: clamp(22px, 2.4vw, 32px); }
.promo__stat span { font-size: 13px; color: rgba(255,255,255,.8); }
.promo__mark { position: absolute; right: -40px; bottom: -80px; width: 260px; opacity: .12; z-index: -1; }

/* ---------- Brendlar, afzalliklar ---------- */
.brands { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.brand { height: 88px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--ff-display); font-weight: 600; font-size: 15px; color: var(--text-2); letter-spacing: .02em; transition: .2s; }
.brand:hover { color: #fff; border-color: var(--line-2); }
.perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.perk { padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.perk__ic { width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-3); display: grid; place-items: center; margin-bottom: 16px; }
.perk h4 { font-family: var(--ff); font-weight: 700; font-size: 16px; }
.perk p { color: var(--text-2); font-size: 14px; margin-top: 6px; }

.about { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 40px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); }
.about h2 { font-size: clamp(22px, 2.4vw, 30px); }
.about p { color: var(--text-2); margin-top: 12px; }
.about__nums { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.about__num { padding: 22px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.about__num b { font-family: var(--ff-display); font-size: 30px; display: block; }
.about__num span { color: var(--muted); font-size: 13px; }

/* ---------- Footer ---------- */
.footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--bg-2); }
.footer__top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr) 1.2fr; gap: 32px; padding: 56px 0 40px; }
.footer h5 { font-family: var(--ff); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer li a { color: var(--text-2); font-size: 14px; }
.footer li a:hover { color: #fff; }
.footer__about { color: var(--text-2); font-size: 14px; margin-top: 18px; max-width: 300px; }
.footer__phone { font-family: var(--ff-display); font-size: 20px; font-weight: 600; }
.footer__soc { display: flex; gap: 8px; margin-top: 16px; }
.footer__soc a { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-2); }
.footer__soc a:hover { color: #fff; background: var(--brand); border-color: var(--brand); }
.footer__bottom { border-top: 1px solid var(--line); padding: 20px 0; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.pays { display: flex; gap: 8px; flex-wrap: wrap; }
.pay { height: 30px; padding: 0 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-2); letter-spacing: .02em; }

/* ---------- Katalog sahifasi ---------- */
.catalog { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; padding-bottom: 24px; }
.catalog > section, .cart > div, .acc > section { min-width: 0; }
.side { position: sticky; top: calc(var(--header-h) + 66px); display: grid; gap: 16px; max-height: calc(100vh - var(--header-h) - 90px); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; padding-right: 4px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.panel h4 { font-family: var(--ff); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; font-weight: 700; }
.catlist { display: grid; gap: 2px; }
.catlist button { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; font-weight: 500; color: var(--text-2); text-align: left; width: 100%; }
.catlist button:hover { background: var(--surface-2); color: var(--text); }
.catlist button.is-active { background: var(--brand-soft); color: #fff; }
.catlist button span { font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; }
.checks { display: grid; gap: 4px; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; cursor: pointer; color: var(--text-2); font-size: 14px; }
.check:hover { color: var(--text); background: var(--surface-2); }
.check input { appearance: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; margin: 0; flex: none; transition: .15s; }
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after { content: ''; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--muted); }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.input { width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); padding: 0 14px; outline: none; transition: border-color .2s; }
.input:focus { border-color: var(--brand); }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; min-height: 96px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23B9B9C8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar__count { color: var(--text-2); font-size: 14px; }
.toolbar__right { display: flex; gap: 8px; align-items: center; }
.toolbar select { width: auto; min-width: 200px; }
.series-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; scrollbar-width: none; }
.series-row::-webkit-scrollbar { display: none; }
.group { margin-bottom: 36px; }
.group__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.group__head h3 { font-size: 20px; }
.group__head span { color: var(--muted); font-size: 13px; }
.empty { text-align: center; padding: 64px 24px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--text-2); }
.empty__ic { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 20px; background: var(--brand-soft); color: var(--brand-3); display: grid; place-items: center; }
.empty h3 { font-size: 20px; margin-bottom: 8px; color: var(--text); }
.empty p { margin-bottom: 20px; }
.filter-btn { display: none; }
.cat-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 32px; border-radius: var(--r-xl); background: radial-gradient(80% 140% at 100% 0%, rgba(69,40,240,.35), transparent 60%), var(--surface); border: 1px solid var(--line); margin: 8px 0 24px; overflow: hidden; }
.cat-hero p { color: var(--text-2); margin-top: 8px; }
.cat-hero__art { width: 180px; flex: none; margin: -30px 0; }

/* ---------- Modal (mahsulot) ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.is-open { display: block; }
.modal__bd { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(6px); animation: fade .25s; }
.modal__panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(1180px, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow);
  animation: pop .35s var(--ease); scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent;
}
.modal__close { position: sticky; top: 16px; margin: 16px 16px -64px auto; z-index: 5; width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; place-items: center; }
.modal__close:hover { background: var(--surface-3); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.98); } }

.pd { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; padding: 40px; }
.pd__gallery { position: sticky; top: 0; align-self: start; }
.pd__art { border-radius: var(--r-xl); background: radial-gradient(90% 80% at 50% 10%, #1a1733 0%, var(--surface) 70%); border: 1px solid var(--line); aspect-ratio: 1; }
.pd__art svg { width: 100%; height: 100%; }
.pd__thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pd__thumbs:empty { display: none; }
.pd__thumb { width: 72px; height: 72px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.pd__thumb.is-active { border-color: var(--brand-3); box-shadow: 0 0 0 1px var(--brand-3); }
.pd__thumb svg { width: 100%; height: 100%; }
.pd__crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.pd h1, .pd h2 { font-size: clamp(24px, 2.8vw, 36px); margin: 10px 0 6px; }
/* The product's own page (S2): the popup's look, on the page */
.pd-page { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-xl); margin: 8px 0 48px; }
.pd-page .pd__gallery { top: 96px; }
.pd__gallery, .pd__info { min-width: 0; }   /* long text wraps instead of widening the page */
.pd__variant { color: var(--text-2); font-size: 14px; }
.pd__price { margin: 22px 0 6px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pd__price b { font-family: var(--ff-display); font-size: clamp(26px, 3vw, 34px); font-weight: 600; }
.pd__price s { color: var(--muted); }
.opt { margin-top: 22px; }
.opt__label { font-size: 14px; color: var(--text-2); margin-bottom: 10px; }
.opt__label b { color: var(--text); font-weight: 600; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.color { width: 44px; height: 44px; border-radius: 50%; padding: 4px; border: 2px solid transparent; transition: border-color .2s; }
.color i { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), inset 0 -6px 10px rgba(0,0,0,.25); }
.color.is-active { border-color: #fff; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { min-height: 48px; padding: 8px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 14px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; transition: .2s; text-align: left; }
.pill small { font-weight: 500; color: var(--muted); font-size: 12px; }
.pill:hover { border-color: rgba(255,255,255,.3); }
.pill.is-active { border-color: var(--brand); background: var(--brand-soft); }
.pill.is-active small { color: var(--brand-3); }
/* An option that is out of stock with the current choice (R4) */
.color.is-out, .pd__thumb.is-out, .pill.is-out { opacity: .45; }
.pill.is-out small { text-decoration: line-through; }
.inst { margin-top: 24px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.inst__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 14px; }
.inst__head b { font-size: 15px; }
.inst__months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.inst__months button { height: 40px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.inst__months button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.inst__sum { display: flex; justify-content: space-between; margin-top: 14px; font-size: 14px; color: var(--text-2); }
.inst__sum b { color: var(--text); font-size: 18px; }
.pd__actions { display: flex; gap: 10px; margin-top: 22px; }
.pd__actions .btn--primary { flex: 1; }
.pd__actions .fav { width: 56px; height: 56px; border-radius: 16px; flex: none; }
.pd__perks { display: grid; gap: 10px; margin-top: 22px; }
.pd__perk { display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--text-2); }
.pd__perk .ic { color: var(--brand-3); }
.pd__tabs { padding: 0 40px 40px; }
.tabnav { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabnav button { padding: 14px 16px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabnav button.is-active { color: #fff; border-color: var(--brand); }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.spec { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; font-weight: 500; }
.pd__desc { color: var(--text-2); max-width: 760px; font-size: 15px; }
.pd__desc p + p { margin-top: 12px; }

/* ---------- Savat ---------- */
.cart { display: grid; grid-template-columns: 1fr 400px; gap: 28px; align-items: start; }
.citems { display: grid; gap: 12px; }
.citem { display: grid; grid-template-columns: 112px 1fr auto; gap: 18px; align-items: center; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.citem__img { width: 112px; height: 112px; border-radius: var(--r); background: var(--bg-2); cursor: pointer; }
.citem__img svg { width: 100%; height: 100%; }
.citem__name { font-weight: 700; font-size: 16px; cursor: pointer; }
.citem__name:hover { color: var(--brand-3); }
.citem__var { color: var(--text-2); font-size: 13px; margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.citem__var i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); display: inline-block; }
.citem__tools { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.qty { display: inline-flex; align-items: center; height: 40px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-2); }
.qty button { width: 40px; height: 100%; display: grid; place-items: center; color: var(--text-2); }
.qty button:hover { color: #fff; }
.qty span { min-width: 28px; text-align: center; font-weight: 700; }
.linkbtn { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; padding: 8px; border-radius: 10px; }
.linkbtn:hover { color: var(--text); background: var(--surface-2); }
.linkbtn--danger:hover { color: var(--sale); }
.citem__price { text-align: right; align-self: start; padding-top: 4px; }
.citem__price b { display: block; font-size: 18px; font-weight: 800; white-space: nowrap; }
.citem__price s { color: var(--muted); font-size: 13px; }
.citem__price small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.summary { position: sticky; top: calc(var(--header-h) + 66px); display: grid; gap: 16px; }
.sumrow { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; color: var(--text-2); }
.sumrow b { color: var(--text); font-weight: 600; }
.sumrow--total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; font-size: 16px; color: var(--text); }
.sumrow--total b { font-family: var(--ff-display); font-size: 22px; }
.sumrow .ok { color: var(--ok); }
.promo-in { display: flex; gap: 8px; }
.promo-in .input { flex: 1; }
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; }
.hint--ok { color: var(--ok); } .hint--err { color: var(--sale); }
/* Checkout errors next to the field (Y14) */
.field__err { font-size: 12px; color: var(--sale); }
.input[aria-invalid="true"] { border-color: var(--sale); }
/* Demo notice: checkout, orders and login are not live yet (Phase 1 stopgap, R1/R5) */
.demo-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); background: rgba(255, 181, 71, .08); border: 1px solid rgba(255, 181, 71, .28); color: var(--text-2); font-size: 13px; line-height: 1.5; text-align: left; }
.demo-note .ic { color: var(--warn); flex: none; margin-top: 1px; }
.demo-note a { color: var(--warn); font-weight: 600; white-space: nowrap; }
.radios { display: grid; gap: 8px; }
.radio { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); cursor: pointer; transition: .2s; font-size: 14px; }
.radio:hover { border-color: rgba(255,255,255,.28); }
.radio input { appearance: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); margin: 0; flex: none; display: grid; place-items: center; }
.radio input:checked { border-color: var(--brand); }
.radio input:checked::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio small { display: block; color: var(--muted); font-size: 12px; }
.radio__r { margin-left: auto; font-weight: 600; font-size: 13px; }
.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field--full { grid-column: 1 / -1; }
.steps { display: grid; gap: 16px; margin-top: 24px; }
.step h3 { font-family: var(--ff); font-size: 18px; font-weight: 700; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
.step h3 i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; font-size: 13px; }

/* ---------- Akkaunt ---------- */
.acc { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.acc__side { position: sticky; top: calc(var(--header-h) + 66px); display: grid; gap: 16px; }
.ucard { padding: 24px; border-radius: var(--r-lg); background: radial-gradient(120% 100% at 100% 0%, rgba(69,40,240,.45), transparent 60%), var(--surface); border: 1px solid var(--line); }
.avatar { width: 72px; height: 72px; border-radius: 22px; background: var(--brand); display: grid; place-items: center; font-family: var(--ff-display); font-size: 26px; font-weight: 700; margin-bottom: 16px; }
.ucard h3 { font-size: 18px; }
.ucard p { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.ucard__lvl { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); font-size: 12px; font-weight: 700; }
.accnav { display: grid; gap: 2px; padding: 8px; }
.accnav button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; font-weight: 500; color: var(--text-2); text-align: left; width: 100%; }
.accnav button:hover { background: var(--surface-2); color: var(--text); }
.accnav button.is-active { background: var(--brand-soft); color: #fff; }
.accnav button em { margin-left: auto; font-style: normal; font-size: 12px; background: var(--surface-3); padding: 2px 8px; border-radius: 999px; color: var(--text-2); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.stat span { font-size: 13px; color: var(--muted); }
.stat b { display: block; font-family: var(--ff-display); font-size: 20px; margin-top: 6px; font-weight: 600; }
.card { padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.card + .card { margin-top: 16px; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.card__head h3 { font-family: var(--ff); font-size: 18px; font-weight: 700; }
.order { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; background: var(--bg-2); }
.order + .order { margin-top: 12px; }
.order__head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.order__head b { font-size: 15px; }
.order__head span { color: var(--muted); font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status--new { background: var(--brand-soft); color: var(--brand-3); }
.status--way { background: rgba(255, 181, 71, .14); color: var(--warn); }
.status--done { background: rgba(47, 211, 138, .14); color: var(--ok); }
.order__items { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.order__thumb { width: 56px; height: 56px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.order__foot { display: flex; justify-content: space-between; margin-top: 14px; font-size: 14px; color: var(--text-2); gap: 12px; flex-wrap: wrap; }
.order__foot b { color: var(--text); }
.track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.track i { height: 4px; border-radius: 2px; background: var(--surface-3); }
.track i.on { background: var(--brand); }
.track-lbl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.addr { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }
.addr + .addr { margin-top: 10px; }
.addr .ic { color: var(--brand-3); margin-top: 2px; }
.addr__main { flex: 1; }
.addr__main b { display: block; }
.addr__main span { color: var(--text-2); font-size: 14px; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 14px; background: var(--surface-3); transition: .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .2s var(--ease); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(20px); }
.setrow { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setrow:last-child { border-bottom: 0; }
.setrow p { color: var(--muted); font-size: 13px; }
.auth { max-width: 480px; margin: 24px auto 0; padding: 36px; border-radius: var(--r-xl); background: radial-gradient(120% 80% at 50% 0%, rgba(69,40,240,.35), transparent 60%), var(--surface); border: 1px solid var(--line); text-align: center; }
.auth .logo { justify-content: center; margin-bottom: 20px; }
.auth h1 { font-size: 26px; }
.auth > p { color: var(--text-2); margin: 10px 0 24px; }
.auth form { display: grid; gap: 12px; text-align: left; }
.auth__note { font-size: 12px; color: var(--muted); margin-top: 16px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 20px; bottom: 92px; z-index: 200; display: grid; gap: 10px; }   /* above the chat button */
.toast { display: flex; gap: 12px; align-items: center; min-width: 300px; max-width: 380px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: tin .35s var(--ease); }
.toast__img { width: 48px; height: 48px; border-radius: 12px; background: var(--bg-2); flex: none; }
.toast__img svg { width: 100%; height: 100%; }
.toast__ic { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-3); display: grid; place-items: center; flex: none; }
.toast b { display: block; font-size: 14px; }
.toast span { font-size: 13px; color: var(--text-2); }
.toast a { margin-left: auto; color: var(--brand-3); font-weight: 700; font-size: 13px; white-space: nowrap; }
.toast.out { animation: tout .3s forwards; }
@keyframes tin { from { opacity: 0; transform: translateY(12px); } }
@keyframes tout { to { opacity: 0; transform: translateY(12px); } }

/* success modal */
.done { text-align: center; padding: 48px 32px; max-width: 520px; }
.done__ic { width: 88px; height: 88px; border-radius: 28px; background: var(--brand); display: grid; place-items: center; margin: 0 auto 20px; box-shadow: 0 20px 50px -12px var(--brand-glow); }
.done h2 { font-size: 26px; }
.done p { color: var(--text-2); margin: 12px 0 24px; }
.done__btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
/* Pay now with the shop's Payme / Click (brand colours, dark text on Payme's light teal) */
.done__pay { border: 1px solid var(--line); border-radius: var(--r-lg, 16px); padding: 16px; margin: -8px 0 20px; }
.done__pay p { margin: 0 0 12px; }
.done__pay .btn { width: 100%; justify-content: center; font-weight: 700; white-space: normal; height: auto; min-height: 48px; padding: 10px 16px; text-align: center; line-height: 1.3; }
@media (max-width: 480px) { .done { padding: 32px 18px; } .done__pay { padding: 12px; } }
.done .done__payhint { font-size: 13px; margin: 10px 0 0; }
.done__payhint a { color: var(--text); text-decoration: underline; }
.done__payhint .linkbtn { display: inline; padding: 0 4px; color: var(--text); text-decoration: underline; }
.btn--payme { background: #33cccc; color: #06283d; }
.btn--payme:hover { background: #5ad6d6; }
.btn--click { background: #0066ff; color: #fff; }
.btn--click:hover { background: #2a80ff; }
.done__bell { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.done__pay .done__bell .btn { font-weight: 600; }
.btn--uzum { background: #7000ff; color: #fff; }
.btn--uzum:hover { background: #8529ff; }

/* Filtr qoplamasi (mobil) */
.drawer-bd { display: none; }

/* =========================================================
   Moslashuvchan (responsive)
   ========================================================= */
@media (max-width: 1200px) {
  .grid--5 { grid-template-columns: repeat(4, 1fr); }
  .cats { grid-template-columns: repeat(3, 1fr); }
  .brands { grid-template-columns: repeat(4, 1fr); }
  .footer__top { grid-template-columns: 1fr 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .grid--5 { grid-template-columns: repeat(3, 1fr); }
  .hscroll { grid-auto-columns: calc((100% - 40px) / 3); }
  .catalog { grid-template-columns: 1fr; }
  .filter-btn { display: inline-flex; }
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(360px, 88vw); max-height: none; z-index: 120;
    background: var(--bg-2); padding: 20px; border-right: 1px solid var(--line-2);
    transform: translateX(-102%); transition: transform .35s var(--ease); align-content: start;
  }
  .side.is-open { transform: none; }
  .drawer-bd.is-open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 110; }
  .side__close { display: flex !important; }
  .cart { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .acc { grid-template-columns: 1fr; }
  .acc__side { position: static; }
  .perks { grid-template-columns: repeat(2, 1fr); }
  .pd { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px; }
  .pd__gallery { position: static; }
  .pd__art { max-width: 520px; margin: 0 auto; width: 100%; }
  .pd__thumbs { justify-content: center; }
  .pd__tabs { padding: 0 24px 32px; }
  .specs { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .bento__card--big { grid-column: 1 / -1; grid-row: auto; grid-template-columns: 1fr 1fr; }
  .bento__card { grid-template-columns: 1fr; }
  .promo { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .search { max-width: none; }
  .topbar__links a:nth-child(n+4) { display: none; }
}
.side__close { display: none; justify-content: space-between; align-items: center; }

@media (max-width: 820px) {
  :root { --header-h: 64px; }
  body { padding-bottom: 76px; }
  .topbar { display: none; }
  .header__in { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; gap: 12px; }
  .header__catalog, .hicons { display: none; }
  .search { order: 3; flex-basis: 100%; }
  .langsw { margin-left: auto; }
  .logo__mark { width: 22px; height: 36px; }
  .logo__txt b { font-size: 17px; }
  .catnav { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: rgba(10,10,15,.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line-2);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 12px; }
  .tabbar a.is-active { color: #fff; }
  .tabbar a.is-active .ic { color: var(--brand-3); }
  .tabbar .hicon__count { right: calc(50% - 22px); top: 0; }
  .slide { grid-template-columns: 1fr; text-align: left; padding: 28px 22px 64px; min-height: 0; }
  .slide__art { order: -1; max-width: 250px; margin: 0 auto -8px; }
  .slide__tag { margin-bottom: 14px; }
  .slider__arrow { display: none; }
  .section { padding: 40px 0; }
  .toolbar select { min-width: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .toasts { left: 16px; right: 16px; bottom: calc(146px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; max-width: none; }
  .cat-hero__art { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .grid, .grid--5 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hscroll { grid-auto-columns: 62%; gap: 12px; }
  .cats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .brands { grid-template-columns: repeat(2, 1fr); }
  .perks { grid-template-columns: 1fr; }
  .pcard__body { padding: 12px 12px 14px; }
  .pcard__name { font-size: 14px; }
  .pcard__price b { font-size: 15px; }
  .pcard__inst { font-size: 11px; }
  .pcard__cta .btn { height: 40px; font-size: 13px; padding: 0 10px; }
  .pcard__cta .btn span { display: none; }
  .fav { width: 34px; height: 34px; right: 8px; top: 8px; }
  .pcard__badges { left: 10px; top: 10px; }
  .bento { grid-template-columns: 1fr; }
  .bento__card--big { grid-template-columns: 1fr; }
  .bento__card { padding: 24px; }
  .promo__stats { grid-template-columns: 1fr 1fr 1fr; }
  .promo__stat { padding: 12px; }
  .about { padding: 24px; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .modal__panel { width: 100%; max-height: 100%; height: 100%; top: 0; left: 0; transform: none; border-radius: 0; animation: slideup .35s var(--ease); }
  @keyframes slideup { from { transform: translateY(24px); opacity: 0; } }
  .pd { padding: 16px; }
  .pd__tabs { padding: 0 16px 100px; }
  .pd__actions { position: sticky; bottom: 0; background: var(--bg-2); padding: 12px 0; margin-bottom: -12px; }
  /* On the product page the buttons stop above the bottom menu bar (.tabbar) */
  .pd-page .pd__actions { bottom: calc(71px + env(safe-area-inset-bottom)); z-index: 5; }
  /* Three buttons don't fit a phone: "Add to cart" + favorite stay, "Buy now" shows from 641px up */
  .pd__actions #pdBuy { display: none; }
  .pd__actions .btn { min-width: 0; }
  .spec { grid-template-columns: 1fr; gap: 4px; }
  .citem { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
  .citem > * { min-width: 0; }
  .citem__tools { flex-wrap: wrap; gap: 8px; }
  .citem__img { width: 80px; height: 80px; }
  .citem__price { grid-column: 2; text-align: left; padding: 0; }
  .cgrid { grid-template-columns: 1fr; }
  .inst__months button { font-size: 13px; }
  .auth { padding: 24px; }
  .cat-hero { padding: 22px; }
  .card { padding: 18px; }
}

/* ---------- Operator bilan chat (assets/js/chat.js) ---------- */
.chatbtn {
  position: fixed; right: 20px; bottom: 20px; z-index: 95; width: 58px; height: 58px; border-radius: 20px;
  display: grid; place-items: center; background: var(--brand); color: #fff; border: 0; cursor: pointer;
  box-shadow: 0 14px 36px -10px var(--brand-glow), 0 0 0 1px rgba(255,255,255,.08) inset; transition: transform .2s var(--ease), background .2s;
}
.chatbtn:hover { background: var(--brand-2); transform: translateY(-2px); }
.chatw.is-open .chatbtn { transform: scale(.92); }
.chatbtn__n[hidden] { display: none; }
.chatbtn__n { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #ff3b5c; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.chatbox {
  position: fixed; right: 20px; bottom: 92px; z-index: 96; width: 370px; height: min(560px, calc(100vh - 120px));
  display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 24px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); overflow: hidden; animation: chatin .25s var(--ease);
}
.chatbox[hidden] { display: none; }
@keyframes chatin { from { opacity: 0; transform: translateY(12px); } }
.chatbox__head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.chatbox__head > div { flex: 1; min-width: 0; }
.chatbox__head b { display: block; font-size: 15px; }
.chatbox__head small { display: block; color: var(--text-2); font-size: 12px; margin-top: 2px; }
.chatbox__av { width: 40px; height: 40px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.chatbox__av svg { width: 22px; height: 22px; }
.chatbox__x { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--text-2); background: none; border: 0; cursor: pointer; }
.chatbox__x:hover { background: rgba(255,255,255,.06); color: #fff; }
.chatbox__body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.chatmsg { max-width: 85%; display: flex; flex-direction: column; }
.chatmsg p { margin: 0; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chatmsg time { font-size: 11px; color: var(--muted); margin: 3px 6px 0; }
.chatmsg--staff { align-self: flex-start; }
.chatmsg--staff p { background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.chatmsg--me { align-self: flex-end; align-items: flex-end; }
.chatmsg--me p { background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.chatbox__note { align-self: center; text-align: center; font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.chatbox__form { padding: 10px 12px 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.chatbox__who { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chatbox__who[hidden] { display: none; }
.chatbox__who .input { height: 40px; font-size: 13px; padding: 0 12px; }
.chatbox__row { display: flex; gap: 8px; align-items: flex-end; }
.chatbox__row textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; padding: 11px 14px; font: inherit; font-size: 14px; line-height: 1.4; }
.chatbox__send { width: 44px; height: 44px; flex: none; border-radius: 14px; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; }
.chatbox__send:hover { background: var(--brand-2); }
.chatbox__err { margin: 0; font-size: 12px; color: #ff8a9c; }
/* Phones: above the bottom menu bar (and the product page's "Add to cart" bar); the chat fills the screen */
@media (max-width: 820px) {
  .chatbtn { right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); width: 52px; height: 52px; border-radius: 18px; }
  html[data-page="product"] .chatbtn { bottom: calc(160px + env(safe-area-inset-bottom)); }
  .chatbox { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; z-index: 130; }
  .chatbox__head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .chatbox__form { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .chatw.is-open .chatbtn { display: none; }
  .chatbox__row textarea, .chatbox__who .input { font-size: 16px; }   /* iPhone doesn't zoom in on 16px fields */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
