/* ============ XozmagUz — dark / light UI ============ */
:root {
  --bg: #18191d;
  --surface: #232429;
  --surface-2: #2c2d33;
  --surface-3: #36373e;
  --line: #34353c;
  --text: #f5f5f7;
  --muted: #9b9ca5;
  --faint: #6c6d76;
  --accent: #f0a35e;        /* mis rang — chegirma, belgilar */
  --accent-ink: #1b1208;
  --danger: #ff6b6b;
  --ok: #45c486;
  --pill: #ffffff;
  --pill-ink: #141519;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --wrap: 1240px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f4f6;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --surface-3: #e3e3e8;
  --line: #e6e6eb;
  --text: #15161a;
  --muted: #676873;
  --faint: #9c9da6;
  --accent: #d9792a;
  --accent-ink: #ffffff;
  --danger: #e5484d;
  --ok: #1f9d63;
  --pill: #15161a;
  --pill-ink: #ffffff;
  --shadow: 0 18px 50px rgba(20, 22, 30, .14);
  color-scheme: light;
}
[data-theme="light"] .card-img, [data-theme="light"] .citem .thumb { box-shadow: 0 1px 0 rgba(0,0,0,.04); }
[data-theme="light"] .tabbar { box-shadow: 0 -6px 24px rgba(20,22,30,.06); }
body { transition: background-color .25s, color .25s; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Manrope, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 22px; height: 22px; flex: none; }
.ico-sm { width: 16px; height: 16px; }
.emoji { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; line-height: 1; }

/* ---------- Layout ---------- */
.page { padding: 0 16px calc(var(--tab-h) + var(--safe-b) + 24px); outline: none; min-height: 60vh; }
.wrap { max-width: var(--wrap); margin: 0 auto; }
.section { margin-top: 26px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.sec-head h2 { font-size: 19px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.sec-head a, .sec-head button.link { color: var(--muted); font-weight: 600; font-size: 14px; }
.muted { color: var(--muted); }
.page-title { font-size: 22px; font-weight: 800; margin: 18px 0 4px; letter-spacing: -.02em; }

/* ---------- Mobile top bar ---------- */
.mbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: calc(var(--safe-t) + 10px) 16px 10px;
}
.mbar-row { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.mbar-title { flex: 1; font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  color: var(--text); position: relative; transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.filled { background: var(--surface); }
.badge {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 800; display: grid; place-items: center; line-height: 1;
}
.hello { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--surface-2);
  display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.hello small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.hello b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.searchbox {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 14px; margin-top: 10px;
  background: var(--surface); border-radius: var(--r); color: var(--muted);
  border: 1px solid transparent; transition: border-color .15s;
}
.searchbox:focus-within { border-color: var(--surface-3); }
.searchbox input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); height: 100%; font-size: 15px; }
.searchbox input::placeholder { color: var(--faint); }
.searchbox .ico { color: var(--faint); }

.lang-pill {
  height: 34px; padding: 0 12px; border-radius: 17px; background: var(--surface);
  font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px;
}

/* ---------- Bottom tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: 11px; font-weight: 700; position: relative;
}
.tab .ico { width: 24px; height: 24px; }
.tab.active { color: var(--text); }
.tab.active::before {
  content: ''; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--text);
}
.tab .badge { top: 6px; right: calc(50% - 22px); }

/* ---------- Desktop header ---------- */
.dheader, .dfooter { display: none; }

/* ---------- Banners (Special offers) ---------- */
.banners {
  display: grid; grid-auto-flow: column; grid-auto-columns: 86%;
  gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -16px; padding: 4px 16px; scrollbar-width: none;
}
.banners::-webkit-scrollbar, .hscroll::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.banner {
  scroll-snap-align: center; position: relative; overflow: hidden;
  min-height: 150px; border-radius: var(--r-lg); padding: 20px;
  background: var(--surface-2);
  display: flex; flex-direction: column; justify-content: center; text-align: left;
}

.banner .pct { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.banner .ttl { font-size: 16px; font-weight: 700; margin-top: 8px; max-width: 60%; }
.banner .txt { font-size: 12.5px; color: var(--muted); margin-top: 4px; max-width: 58%; }
.banner { color: #fff; background: #1d1e22; isolation: isolate; }
.banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; z-index: -2; transition: transform .4s; }
.banner::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(14,15,18,.92) 0%, rgba(14,15,18,.65) 45%, rgba(14,15,18,0) 75%); }
.banner:hover > img { transform: scale(1.04); }
.banner .txt { color: rgba(255,255,255,.72); }
.banner .cta { margin-top: 12px; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; background: #fff; color: #141519; font-size: 12px; font-weight: 800; }
.banner .cta .ico { width: 14px; height: 14px; }
.dots { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--surface-3); transition: width .2s, background .2s; }
.dots i.on { width: 18px; background: var(--text); }

/* ---------- Categories ---------- */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.cat .ci {
  width: 62px; height: 62px; border-radius: 20px; background: color-mix(in srgb, var(--hue) 16%, var(--surface));
  color: var(--hue); display: grid; place-items: center; transition: transform .15s, background .15s;
}
.cat .ci .ico { width: 28px; height: 28px; }
.cat:hover .ci { background: color-mix(in srgb, var(--hue) 26%, var(--surface)); transform: translateY(-2px); }
.cat span { font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.2; }

.cat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.cat-tile {
  position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 1;
  border-radius: var(--r-lg); background: #1d1e22; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; padding: 12px;
}
.cat-tile > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .4s; }
.cat-tile::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(12,13,16,0) 35%, rgba(12,13,16,.55) 65%, rgba(12,13,16,.9) 100%); }
.cat-tile:hover > img { transform: scale(1.06); }
.cat-tile .ti { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: color-mix(in srgb, var(--hue) 70%, rgba(0,0,0,.2)); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.cat-tile .ti .ico { width: 18px; height: 18px; }
.cat-tile > div { display: flex; flex-direction: column; gap: 2px; }
.cat-tile b { font-size: 15px; line-height: 1.2; font-weight: 800; }
.cat-tile small { color: rgba(255,255,255,.72); font-weight: 600; font-size: 12px; }
.cat-tile.deal { grid-column: 1 / -1; aspect-ratio: 2.2 / 1; }
.cat-tile.deal > img { object-position: center 40%; }
.cat-tile.deal::after { background: linear-gradient(90deg, rgba(12,13,16,.9) 0%, rgba(12,13,16,.55) 45%, rgba(12,13,16,0) 75%); }
.cat-tile.deal b { font-size: 20px; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px; scrollbar-width: none; }
.chip {
  flex: none; height: 36px; padding: 0 16px; border-radius: 18px;
  border: 1.5px solid var(--surface-3); color: var(--text); font-weight: 700; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: .15s;
}
.chip.on { background: var(--pill); color: var(--pill-ink); border-color: var(--pill); }

/* ---------- Product grid & card ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: 44%; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: 16px; }
.hscroll > * { scroll-snap-align: start; }

.card { display: flex; flex-direction: column; min-width: 0; position: relative; }
.card-img {
  position: relative; aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden;
  background: radial-gradient(circle at 50% 60%, var(--tint, #3a3b42) 0%, var(--surface-2) 68%);
  display: grid; place-items: center;
}
.card-img .emoji { font-size: clamp(54px, 15vw, 84px); filter: drop-shadow(0 14px 16px rgba(0,0,0,.5)); transition: transform .25s; }
.card:hover .card-img .emoji { transform: scale(1.06) translateY(-2px); }
.card-img img, .pd-gallery img, .citem .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-img img { transform: scale(1.04); }
.pd-gallery img { position: absolute; inset: 0; }
.citem .thumb { overflow: hidden; }
/* Yurakcha: fonsiz, rasm ustida oq kontur + soya; bosilganda qizil to'ldiriladi */
.fav-btn {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; background: none;
  display: grid; place-items: center; color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.55)) drop-shadow(0 2px 8px rgba(0,0,0,.35));
  transition: transform .15s;
}
.fav-btn .ico { width: 23px; height: 23px; stroke-width: 2.1; }
.fav-btn:hover { transform: scale(1.1); }
.fav-btn:active { transform: scale(.9); }
.fav-btn.on { color: #ff4d5e; }
.fav-btn.on svg path { fill: currentColor; }
.fav-btn.on .ico { animation: heart .35s ease; }
@keyframes heart { 40% { transform: scale(1.3); } 70% { transform: scale(.92); } }
.disc {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  height: 22px; padding: 0 8px; border-radius: 11px; background: var(--accent); color: var(--accent-ink);
  font-size: 11.5px; font-weight: 800; display: grid; place-items: center;
}
.card-body { padding: 10px 2px 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { font-weight: 700; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.meta .star { color: var(--text); display: inline-flex; align-items: center; gap: 3px; }
.meta .star .ico { width: 13px; height: 13px; color: #ffc65c; }
.meta .sep { width: 1px; height: 12px; background: var(--surface-3); }
.meta .tag { padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text); font-size: 11px; }
.price-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; }
.price { font-weight: 800; font-size: 16px; letter-spacing: -.01em; line-height: 1.2; }
.old { color: var(--faint); text-decoration: line-through; font-size: 12px; font-weight: 600; }
.inst { display: inline-flex; align-self: flex-start; font-size: 11px; font-weight: 700; background: rgba(240, 163, 94, .14); color: var(--accent); padding: 3px 7px; border-radius: 6px; }
.add-btn {
  width: 36px; height: 36px; border-radius: 12px; background: var(--pill); color: var(--pill-ink);
  display: grid; place-items: center; flex: none; transition: transform .1s;
}
.add-btn:active { transform: scale(.92); }
.add-btn .ico { width: 18px; height: 18px; }
.add-btn.in { background: var(--surface-3); color: var(--text); }

/* ---------- Product page ---------- */
.pd-gallery {
  margin: 0 -16px; aspect-ratio: 1 / .92; position: relative;
  background: radial-gradient(circle at 50% 55%, var(--tint, #3a3b42) 0%, var(--surface) 70%);
  display: grid; place-items: center; overflow: hidden;
}

.pd-gallery .dots { position: absolute; bottom: 16px; left: 0; right: 0; }
.pd-info { padding-top: 18px; }
.pd-head { display: flex; align-items: flex-start; gap: 12px; }
.pd-head h1 { flex: 1; margin: 0; font-size: 22px; line-height: 1.25; font-weight: 800; letter-spacing: -.02em; }
.pd-head .fav-btn { position: static; width: 44px; height: 44px; color: var(--text); filter: none; flex: none; }
.pd-head .fav-btn .ico { width: 26px; height: 26px; }
.pd-head .fav-btn.on { color: #ff4d5e; }
.pd-meta { margin-top: 10px; }
.pd-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.pd-price .price { font-size: 26px; }
.pd-price .old { font-size: 15px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.label { font-weight: 800; font-size: 16px; margin: 0 0 10px; }
.desc { color: var(--muted); font-size: 14px; margin: 0; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.desc-more { color: var(--text); font-weight: 700; font-size: 14px; margin-top: 4px; }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch {
  width: 36px; height: 36px; border-radius: 50%; background: var(--c);
  display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.swatch.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.swatch.on::after { content: ''; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); mix-blend-mode: difference; }
.qty-row { display: flex; align-items: center; gap: 16px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 14px; padding: 4px; }
.stepper button { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.stepper button:hover { background: var(--surface-3); }
.stepper button:disabled { opacity: .35; cursor: default; background: none; }
.stepper span { min-width: 26px; text-align: center; font-weight: 800; }
.stepper.sm button { width: 28px; height: 28px; }
.stepper.sm { border-radius: 11px; padding: 3px; }
.stepper.sm span { min-width: 20px; font-size: 14px; }

/* Sticky action bar (mobile) */
.buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px calc(14px + var(--safe-b));
  background: var(--surface); border-radius: 24px 24px 0 0; border-top: 1px solid var(--line);
}
.buybar .tp { display: flex; flex-direction: column; }
.buybar .tp small { color: var(--muted); font-size: 12px; font-weight: 600; }
.buybar .tp b { font-size: 20px; letter-spacing: -.02em; white-space: nowrap; }
.btn {
  height: 52px; padding: 0 24px; border-radius: 26px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 800; font-size: 15px; transition: transform .1s, opacity .15s; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-pill { background: var(--pill); color: var(--pill-ink); }
.btn-ghost { background: var(--surface-3); color: var(--text); }
.btn-block { width: 100%; }
.buybar .btn { flex: 1; }
.has-buybar .page { padding-bottom: calc(110px + var(--safe-b)); }
.has-buybar .tabbar { display: none; }
.with-tabs .tabbar { display: grid; border-radius: 0; }
.with-tabs .buybar { bottom: calc(var(--tab-h) + var(--safe-b)); padding-bottom: 14px; }
.with-tabs .page { padding-bottom: calc(var(--tab-h) + 100px + var(--safe-b)); }
.with-tabs .toast { bottom: calc(var(--tab-h) + 96px + var(--safe-b)); }

/* ---------- Cart ---------- */
.cart-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.citem { display: flex; gap: 14px; padding: 12px; border-radius: var(--r-lg); background: var(--surface); align-items: stretch; }
.citem .thumb {
  width: 92px; height: 92px; border-radius: var(--r); flex: none; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 60%, var(--tint, #3a3b42) 0%, var(--surface-2) 70%);
}
.citem .thumb .emoji { font-size: 48px; }
.citem .cbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.citem .ctop { display: flex; gap: 8px; align-items: flex-start; }
.citem .ctop b { flex: 1; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.citem .trash { color: var(--muted); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; }
.citem .trash:hover { color: var(--danger); background: var(--surface-2); }
.cdot { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.cdot i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.citem .cbot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.citem.compact .thumb { width: 64px; height: 64px; }
.citem.compact .thumb .emoji { font-size: 34px; }
.qty-chip { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; }

.summary { background: var(--surface); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.summary .row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-weight: 600; font-size: 14px; }
.summary .row b { color: var(--text); }
.summary .row.total { color: var(--text); font-size: 17px; font-weight: 800; padding-top: 10px; border-top: 1px dashed var(--surface-3); }

/* ---------- Forms / checkout ---------- */
.card-box { background: var(--surface); border-radius: var(--r-lg); padding: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.input {
  width: 100%; height: 50px; padding: 0 14px; border-radius: 14px;
  background: var(--surface-2); border: 1.5px solid transparent; outline: none; font-size: 15px;
}
textarea.input { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--surface-3); background: var(--surface-3); }
.input.err { border-color: var(--danger); }
.ferr { color: var(--danger); font-size: 12.5px; font-weight: 600; }
.phone-wrap { display: flex; align-items: center; gap: 0; }
.phone-wrap .pre { height: 50px; display: grid; place-items: center; padding: 0 12px; background: var(--surface-3); border-radius: 14px 0 0 14px; font-weight: 700; }
.phone-wrap .input { border-radius: 0 14px 14px 0; }

.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r);
  background: var(--surface); border: 1.5px solid transparent; cursor: pointer; text-align: left; width: 100%;
}
.opt.on { border-color: var(--text); }
.opt .oi { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--text); }
.opt .oi b { font-size: 13px; }
.opt .ob { flex: 1; min-width: 0; }
.opt .ob b { display: block; font-size: 15px; }
.opt .ob small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.opt .op { font-weight: 800; white-space: nowrap; }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); flex: none; display: grid; place-items: center; }
.opt.on .radio { border-color: var(--text); }
.opt.on .radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--text); }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 60px 20px 30px; max-width: 420px; margin: 0 auto; }
.empty .big { width: 104px; height: 104px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: var(--surface); color: var(--muted); }
.empty .big .ico { width: 44px; height: 44px; stroke-width: 1.6; }
.empty h3 { font-size: 20px; margin: 18px 0 8px; font-weight: 800; }
.empty p { color: var(--muted); margin: 0 0 22px; font-size: 14px; }

/* ---------- Search ---------- */
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.recent li button.q { flex: 1; text-align: left; color: var(--muted); font-weight: 600; }
.recent li button.x { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--faint); display: grid; place-items: center; color: var(--faint); }
.results-head { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 14px; gap: 10px; font-weight: 800; }
.results-head span { color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }

/* ---------- Bottom sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 80; animation: fade .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; max-height: 88dvh; overflow: auto;
  background: var(--surface); border-radius: 28px 28px 0 0; padding: 10px 18px calc(18px + var(--safe-b));
  animation: up .25s cubic-bezier(.2, .8, .2, 1);
}
.sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 0 auto 14px; }
.sheet h3 { text-align: center; font-size: 19px; font-weight: 800; margin: 0 0 16px; }
.sheet .sh-sec { margin-bottom: 18px; }
.sheet .sh-sec > b { display: block; margin-bottom: 10px; font-size: 15px; }
.sheet .sh-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.sheet .chips { margin: 0; padding: 2px 0; flex-wrap: wrap; overflow: visible; }
.success { text-align: center; padding: 8px 4px 4px; }
.success .ring { width: 96px; height: 96px; border-radius: 50%; margin: 6px auto 16px; background: var(--pill); color: var(--pill-ink); display: grid; place-items: center; }
.success .ring .ico { width: 44px; height: 44px; }
.success p { color: var(--muted); margin: 0 0 20px; }
.success .btn { margin-top: 10px; }

.range { position: relative; height: 34px; }
.range input { position: absolute; inset: 0; width: 100%; appearance: none; -webkit-appearance: none; background: none; pointer-events: none; margin: 0; }
.range input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 22px; height: 22px; border-radius: 50%; background: var(--pill); border: 4px solid var(--surface); box-shadow: 0 0 0 1.5px var(--pill); cursor: pointer; }
.range input::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: var(--pill); border: 4px solid var(--surface); cursor: pointer; }
.range .track { position: absolute; left: 0; right: 0; top: 15px; height: 4px; border-radius: 2px; background: var(--surface-3); }
.range .fill { position: absolute; top: 15px; height: 4px; border-radius: 2px; background: var(--pill); }
.range-vals { display: flex; justify-content: space-between; font-weight: 700; font-size: 13px; color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--pill); color: var(--pill-ink); padding: 12px 18px; border-radius: 16px;
  font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow);
  transition: .25s; white-space: nowrap; max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast a { text-decoration: underline; font-weight: 800; }
.has-buybar .toast { bottom: calc(100px + var(--safe-b)); }

/* ---------- Profile ---------- */
.two-col { display: flex; flex-direction: column; gap: 22px; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 24px; }
.profile-head b { font-size: 19px; display: block; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--surface-2); border-radius: 14px; padding: 4px; }
.seg button { height: 40px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--pill); color: var(--pill-ink); }
.list { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.list > * { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.list > *:last-child { border-bottom: 0; }
.list .li-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.list .li-ico .ico { width: 19px; height: 19px; }
.list a, .list button { transition: background .15s; }
.list a:hover, .list button:hover { background: var(--surface-2); }
.list .li-end { color: var(--faint); display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.list .danger { color: var(--danger); }
.list .danger .li-ico { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.list .li-body { flex: 1; min-width: 0; }
.list .li-body small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.status { font-size: 11.5px; font-weight: 800; padding: 4px 9px; border-radius: 8px; background: var(--surface-3); white-space: nowrap; }
.status.new { background: rgba(240, 163, 94, .16); color: var(--accent); }
.status.done { background: rgba(69, 196, 134, .16); color: var(--ok); }
.status.cancelled { background: rgba(255, 107, 107, .14); color: var(--danger); }

.benefits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.benefit { background: var(--surface); border-radius: var(--r); padding: 14px; display: flex; gap: 12px; align-items: center; }
.benefit .bi { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); flex: none; }
.benefit b { display: block; font-size: 13.5px; }
.benefit small { color: var(--muted); font-size: 12px; font-weight: 600; }

.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r-lg); }

@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sk { to { background-position: -200% 0; } }
@keyframes pop { 50% { transform: scale(1.25); } }
.pop { animation: pop .3s; }

/* ====================== Tablet ====================== */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hscroll { grid-auto-columns: 30%; }
  .banners { grid-auto-columns: 48%; }
  .cats { grid-template-columns: repeat(8, 1fr); }
  .cat-tiles { grid-template-columns: repeat(3, 1fr); }
  .benefits { grid-template-columns: repeat(4, 1fr); }
  .sheet { max-width: 520px; margin: 0 auto; }
}

/* ====================== Desktop ====================== */
@media (min-width: 900px) {
  body { font-size: 15px; }
  .mbar, .tabbar { display: none !important; }
  .page { padding: 0 24px 60px; max-width: var(--wrap); margin: 0 auto; }
  .has-buybar .page { padding-bottom: 60px; }

  .dheader {
    display: block; position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
  }
  .dh-top { display: flex; align-items: center; gap: 18px; max-width: var(--wrap); margin: 0 auto; padding: 14px 24px; }
  .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -.03em; flex: none; }
  .logo-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--pill); color: var(--pill-ink); display: grid; place-items: center; }
  .logo small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: -2px; }
  .catalog-btn { height: 46px; padding: 0 18px; border-radius: 14px; background: var(--pill); color: var(--pill-ink); font-weight: 800; display: inline-flex; align-items: center; gap: 8px; flex: none; }
  .dh-search { flex: 1; margin: 0; height: 46px; }
  .dh-actions { display: flex; align-items: center; gap: 4px; flex: none; }
  .dh-act { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 10px; border-radius: 12px; position: relative; min-width: 72px; }
  .dh-act:hover, .dh-act.active { color: var(--text); background: var(--surface); }
  .dh-act .badge { top: 0; right: 14px; }
  .lang-select { position: relative; }
  .lang-select select { appearance: none; height: 40px; padding: 0 30px 0 14px; border-radius: 12px; background: var(--surface); border: 0; font-weight: 800; font-size: 13px; cursor: pointer; }
  .lang-select::after { content: ''; position: absolute; right: 13px; top: 16px; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }
  .dh-nav { display: flex; gap: 4px; max-width: var(--wrap); margin: 0 auto; padding: 0 24px 10px; overflow-x: auto; scrollbar-width: none; }
  .dh-nav a .ico { width: 16px; height: 16px; }
  .dh-nav a { padding: 7px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
  .dh-nav a:hover, .dh-nav a.on { color: var(--text); background: var(--surface); }

  .mega { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .mega-in { max-width: var(--wrap); margin: 0 auto; padding: 22px 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .mega a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; font-weight: 700; }
  .mega a:hover { background: var(--surface-2); }
  .mega a .mi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--hue); background: color-mix(in srgb, var(--hue) 16%, var(--surface)); }
  .mega a small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }

  .dfooter { display: block; border-top: 1px solid var(--line); margin-top: 40px; }
  .df-in { max-width: var(--wrap); margin: 0 auto; padding: 36px 24px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; color: var(--muted); font-size: 14px; }
  .df-in h4 { color: var(--text); margin: 0 0 12px; font-size: 15px; }
  .df-in a { display: block; padding: 4px 0; }
  .df-in a:hover { color: var(--text); }
  .df-bottom { text-align: center; color: var(--faint); font-size: 13px; padding: 16px; border-top: 1px solid var(--line); }

  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 26px 18px; }
  .hscroll { grid-auto-columns: calc((100% - 4 * 18px) / 5); gap: 18px; margin: 0; padding: 2px 0; }
  .chips { margin: 0 0 18px; padding: 2px 0; }
  .banners { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; overflow: visible; }
  .banner { min-height: 170px; transition: transform .2s; }
  .banner:hover { transform: translateY(-3px); }
  .dots.banner-dots { display: none; }
  .hero-row { margin-top: 24px; }
  .cats { grid-template-columns: repeat(8, 1fr); gap: 14px; }
  .cat .ci { width: 76px; height: 76px; border-radius: 24px; font-size: 36px; }
  .cat span { font-size: 13px; }
  .cat-tiles { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .cat-tile { padding: 18px; }
  .cat-tile b { font-size: 17px; }
  .cat-tile.deal { grid-column: span 2; aspect-ratio: auto; }
  

  .pd { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; margin-top: 24px; align-items: start; }
  .pd-gallery { margin: 0; border-radius: var(--r-xl); position: sticky; top: 140px; aspect-ratio: 1; }
  
  .pd-info { padding-top: 0; }
  .pd-head h1 { font-size: 30px; }
  .buybar { position: static; border-radius: var(--r-lg); border: 1px solid var(--line); margin-top: 24px; padding: 18px; }

  .two-col { display: grid; grid-template-columns: 1fr 380px; gap: 28px; align-items: start; margin-top: 8px; }
  .two-col .aside { position: sticky; top: 140px; }
  .breadcrumbs { display: flex; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 20px; flex-wrap: wrap; }
  .breadcrumbs a:hover { color: var(--text); }
  .page-title { font-size: 28px; margin-top: 14px; }

  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: 480px; border-radius: var(--r-xl); padding: 26px; animation: fade .2s; }
  .sheet::before { display: none; }
  .toast { bottom: 28px; }
  .has-buybar .toast { bottom: 28px; }
  .m-only { display: none !important; }
}
@media (max-width: 899px) {
  .d-only { display: none !important; }
}

/* ---------- Theme toggle ---------- */
.theme-btn .ico { width: 20px; height: 20px; }

/* ---------- Auth ---------- */
.auth { max-width: 440px; margin: 0 auto; padding: 18px 0 30px; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head .ai { width: 64px; height: 64px; border-radius: 22px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--pill); color: var(--pill-ink); }
.auth-head .ai .ico { width: 28px; height: 28px; }
.auth-head h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.auth-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.auth .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth .btn { width: 100%; margin-top: 8px; }
.auth-alt { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; font-weight: 600; }
.auth-alt a { color: var(--text); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.notice { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--text); font-size: 13.5px; font-weight: 600; margin-bottom: 16px; }
.notice .ico { color: var(--accent); width: 20px; height: 20px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-wrap .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.input-wrap .eye .ico { width: 19px; height: 19px; }
.field .msg { font-size: 12.5px; font-weight: 600; min-height: 0; display: flex; align-items: center; gap: 6px; }
.field .msg .ico { width: 14px; height: 14px; }
.field .msg.err { color: var(--danger); }
.field .msg.ok { color: var(--ok); }
.field .msg.hint { color: var(--faint); }
.field .msg a { color: inherit; text-decoration: underline; font-weight: 800; }
.input.ok { border-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.phone-wrap .input.err, .phone-wrap .input.ok { border-left: 0; }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.strength i { height: 4px; border-radius: 2px; background: var(--surface-3); transition: background .2s; }
.strength[data-s="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength[data-s="2"] i:nth-child(-n+2) { background: #e9b949; }
.strength[data-s="3"] i:nth-child(-n+3) { background: #7cc46a; }
.strength[data-s="4"] i { background: var(--ok); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Guest card / profile ---------- */
.guest { text-align: center; padding: 26px 20px; }
.guest .ai { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.guest h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.guest p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.guest .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.count-pill { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--pill); color: var(--pill-ink); font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.recipient { display: flex; align-items: center; gap: 12px; }
.recipient .avatar { width: 44px; height: 44px; font-size: 15px; }
.recipient b { display: block; }
.recipient small { color: var(--muted); font-weight: 600; }
.recipient button { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: underline; }

/* ---------- Orders ---------- */
.orders { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.order { background: var(--surface); border-radius: var(--r-lg); padding: 16px; }
.order-top { display: flex; align-items: center; gap: 10px; }
.order-top b { font-size: 16px; }
.order-top small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.order-top .status { margin-left: auto; }
.order-thumbs { display: flex; gap: 8px; margin: 14px 0; overflow: hidden; }
.order-thumbs img, .order-thumbs span { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); }
.order-thumbs span { display: grid; place-items: center; font-weight: 800; color: var(--muted); font-size: 13px; }
.order-bot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.order-bot .price { font-size: 17px; }
.order-bot button { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 700; font-size: 13.5px; }
.order-bot button .ico { width: 16px; height: 16px; transition: transform .2s; }
.order.open .order-bot button .ico { transform: rotate(180deg); }
.order-more { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--surface-3); display: flex; flex-direction: column; gap: 14px; }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.timeline::before { content: ''; position: absolute; top: 13px; left: 12.5%; right: 12.5%; height: 2px; background: var(--surface-3); }
.timeline .bar { position: absolute; top: 13px; left: 12.5%; height: 2px; background: var(--ok); transition: width .3s; }
.timeline .st { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; position: relative; font-size: 11.5px; font-weight: 700; color: var(--faint); }
.timeline .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--surface-3); color: transparent; }
.timeline .dot .ico { width: 14px; height: 14px; }
.timeline .st.on { color: var(--text); }
.timeline .st.on .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.cancel-note { display: flex; align-items: center; gap: 8px; color: var(--danger); font-weight: 700; font-size: 14px; }
.cancel-note .ico { width: 18px; height: 18px; }
.oline { display: flex; align-items: center; gap: 12px; }
.oline img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.oline .on { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; }
.oline .on small { display: block; color: var(--muted); }
.oline b { font-size: 14px; white-space: nowrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv span { color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.kv span .ico { width: 15px; height: 15px; }
.kv b { text-align: right; font-weight: 700; }
@media (min-width: 900px) {
  .orders { display: grid; grid-template-columns: repeat(2, 1fr); align-items: start; }
  .auth { padding-top: 40px; }
}
