/* Клиентский прайс — общий стиль двух брендов. Цвета бренда задаются в brand-*.css переменными. */
:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --ink: #10161d;
  --muted: #6b7480;
  --line: #e6e8ec;
  --accent: #4bbde8;
  --accent-ink: #06283a;
  --accent-soft: #e4f5fc;
  --accent-strong: #0b86bd;
  --radius: 24px;
  --header-h: 72px;
  --shadow: 0 1px 2px rgba(16, 22, 29, .04), 0 8px 24px rgba(16, 22, 29, .06);
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-brand="sm-qazyna"] {
  --accent: #77cb03;
  --accent-ink: #14300a;
  --accent-soft: #eef9dc;
  --accent-strong: #3f8a00;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.4; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; border-radius: 8px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top__in { max-width: 1440px; margin: 0 auto; height: 100%; padding: 0 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; flex: none; }
.brand img { height: 40px; width: auto; }
.brand b { font-size: 20px; font-weight: 800; letter-spacing: .08em; }
.search { flex: 1; max-width: 520px; position: relative; }
.search input {
  width: 100%; height: 46px; border-radius: 999px; border: 1.5px solid transparent; background: var(--bg);
  padding: 0 44px 0 46px; outline: none; transition: border-color .15s, background .15s;
}
.search input:focus { background: #fff; border-color: var(--accent); }
.search svg { position: absolute; left: 16px; top: 13px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search__x { position: absolute; right: 8px; top: 7px; width: 32px; height: 32px; border-radius: 50%; color: var(--muted); font-size: 20px; line-height: 1; display: none; }
.search__x.on { display: block; }
.search__x:hover { background: var(--line); }
.top__sp { flex: 1; }
.seg { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 4px; flex: none; }
.seg button { height: 38px; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); transition: background .15s, color .15s; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 22, 29, .14); }

/* ---------- Обложка ---------- */
.hero { max-width: 1440px; margin: 0 auto; padding: 24px 24px 0; }
.hero__in {
  background: var(--accent); color: var(--accent-ink); border-radius: 32px; padding: 40px 44px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; position: relative; overflow: hidden;
}
.hero__in::after {
  content: ""; position: absolute; right: -90px; top: -130px; width: 420px; height: 420px; border-radius: 50%;
  border: 56px solid rgba(255, 255, 255, .22); pointer-events: none;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(34px, 5vw, 64px); line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.hero p { margin: 0; font-size: 17px; font-weight: 500; max-width: 46ch; }
.hero__meta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; position: relative; z-index: 1; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, .55); font-size: 14px; font-weight: 600; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-strong); }
.chip.warn i { background: #d97706; }
.hero__ctl { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero .seg { background: rgba(255, 255, 255, .45); }
.dl { height: 46px; padding: 0 20px; border-radius: 999px; background: var(--accent-ink); color: #fff; font-weight: 700; font-size: 14.5px; white-space: nowrap; transition: transform .1s, opacity .15s; font-variant-numeric: tabular-nums; }
.dl + .dl { background: rgba(255, 255, 255, .7); color: var(--accent-ink); }
.dl:hover { opacity: .9; }
.dl:active { transform: scale(.97); }
.dl:disabled { opacity: .75; cursor: progress; }

/* ---------- Раскладка ---------- */
.wrap { max-width: 1440px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }
.nav { position: sticky; top: calc(var(--header-h) + 24px); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left;
  padding: 11px 14px; border-radius: 14px; font-weight: 600; font-size: 15px; color: #39424d; transition: background .15s, color .15s;
}
.nav button:hover { background: #e9ebef; }
.nav button[aria-current="true"] { background: var(--ink); color: #fff; }
.nav small { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav button[aria-current="true"] small { color: rgba(255, 255, 255, .7); }
.nav__contact { margin-top: 20px; padding: 16px; border-radius: 18px; background: #fff; font-size: 14px; color: var(--muted); }
.nav__contact a { display: block; margin-top: 4px; color: var(--ink); font-weight: 700; font-size: 17px; text-decoration: none; }

main { min-width: 0; }
.sec { scroll-margin-top: calc(var(--header-h) + 20px); margin-bottom: 44px; }
.sec h2 { margin: 0 0 18px; font-size: clamp(26px, 3vw, 36px); line-height: 1.1; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 12px; }
.sec h2 small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

/* ---------- Карточка ---------- */
.card {
  background: var(--card); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; text-align: left;
  position: relative; transition: transform .18s ease, box-shadow .18s ease; width: 100%; min-width: 0;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__open { position: absolute; inset: 0; border-radius: var(--radius); z-index: 1; }
.card__img { aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #fff; display: grid; place-items: center; }
.card__img img { width: 100%; height: 100%; object-fit: contain; transition: transform .25s ease; }
.card:hover .card__img img { transform: scale(1.04); }
.card__sku { margin-top: 12px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.card__name { margin: 4px 0 12px; font-size: 15.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.card__foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.price b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.add {
  position: relative; z-index: 2; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong);
  font-size: 26px; font-weight: 500; line-height: 1; display: grid; place-items: center; transition: background .15s, color .15s, transform .15s;
}
.add:hover { background: var(--accent); color: var(--accent-ink); }
.add:active { transform: scale(.92); }
.add.in { background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 800; }
.tag { position: absolute; top: 22px; left: 22px; z-index: 2; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--ink); color: #fff; }
.tag.sale { background: #e5484d; }
.tag.out { background: #9aa3ad; }

.empty { background: #fff; border-radius: var(--radius); padding: 48px 24px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 20px; margin-bottom: 6px; }
.foot { max-width: 1440px; margin: 0 auto; padding: 8px 24px 120px; color: var(--muted); font-size: 13.5px; }

/* ---------- Мобильные разделы ---------- */
.pills { display: none; }

/* ---------- Диалоги ---------- */
dialog { border: 0; padding: 0; background: transparent; color: inherit; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(16, 22, 29, .5); backdrop-filter: blur(3px); }
.sheet { background: #fff; border-radius: 28px; width: min(920px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; position: relative; }
.sheet__x { position: sticky; top: 12px; margin: 12px 12px -56px auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--bg); font-size: 24px; z-index: 3; }
.sheet__x:hover { background: var(--line); }
.item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.item__img { padding: 24px; display: grid; place-items: center; }
.item__img img { width: 100%; max-height: 520px; object-fit: contain; border-radius: 16px; }
.item__body { padding: 32px 32px 28px 8px; display: flex; flex-direction: column; min-width: 0; }
.item__sku { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 48px; }
.item h3 { margin: 6px 48px 16px 0; font-size: 24px; line-height: 1.2; font-weight: 800; overflow-wrap: anywhere; }
.item__prices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.pbox { border-radius: 16px; padding: 12px 14px; background: var(--bg); }
.pbox.main { background: var(--accent-soft); }
.pbox span { display: block; font-size: 13px; color: var(--muted); }
.pbox b { font-size: 22px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item__desc { white-space: pre-line; font-size: 15px; line-height: 1.5; color: #333c47; overflow-wrap: anywhere; margin-bottom: 20px; }
.item__act { margin-top: auto; display: flex; gap: 10px; align-items: center; position: sticky; bottom: 0; background: #fff; padding: 12px 0 4px; }
.qty { display: inline-flex; align-items: center; background: var(--bg); border-radius: 999px; height: 52px; flex: none; }
.qty button { width: 46px; height: 52px; font-size: 22px; border-radius: 999px; }
.qty input { width: 56px; text-align: center; border: 0; background: none; font-weight: 700; font-size: 17px; outline: none; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.btn { height: 52px; padding: 0 24px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16px; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: filter .15s, transform .1s; white-space: nowrap; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.98); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.ghost { background: var(--bg); color: var(--ink); }

/* ---------- Список ---------- */
.fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 25; height: 60px; padding: 0 26px; border-radius: 999px; background: var(--ink); color: #fff;
  font-weight: 700; font-size: 16px; display: none; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(16, 22, 29, .3);
}
.fab.on { display: inline-flex; animation: pop .25s ease; }
.fab i { font-style: normal; background: var(--accent); color: var(--accent-ink); min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; font-size: 14px; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
.list { padding: 28px; width: min(620px, calc(100vw - 32px)); }
.list h3 { margin: 0 56px 4px 0; font-size: 26px; font-weight: 800; }
.list__note { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.row img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; }
.row__n { font-weight: 600; font-size: 14.5px; line-height: 1.25; overflow-wrap: anywhere; }
.row__m { font-size: 13px; color: var(--muted); margin-top: 2px; }
.row__r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.row .qty { height: 38px; }
.row .qty button { width: 34px; height: 38px; font-size: 18px; }
.row .qty input { width: 44px; font-size: 15px; }
.row__s { font-weight: 700; font-size: 14.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 0; border-top: 2px solid var(--ink); font-size: 16px; font-weight: 600; }
.total b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.list__act { display: flex; gap: 10px; flex-wrap: wrap; }
.list__clear { margin-top: 14px; color: var(--muted); font-size: 14px; text-decoration: underline; }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 14.5px; z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.on { opacity: 1; }

/* ---------- Планшет и телефон ---------- */
@media (max-width: 960px) {
  :root { --header-h: 64px; }
  .wrap { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 0; }
  .nav { display: none; }
  .top__in { padding: 0 16px; gap: 10px; }
  .brand b { display: none; }
  .top__sp { display: none; }
  .search { max-width: none; min-width: 0; }
  .search input { padding-right: 36px; }
  .brand img { height: 34px; }
  .top .seg--mode { display: none; }
  .hero { padding: 16px 16px 0; }
  .hero__in { padding: 28px 24px; border-radius: 26px; }
  .pills {
    display: flex; gap: 8px; overflow-x: auto; position: sticky; top: var(--header-h); z-index: 20; background: var(--bg);
    padding: 12px 16px; margin: 8px -16px 8px; scrollbar-width: none;
  }
  .pills::-webkit-scrollbar { display: none; }
  .pills button { flex: none; height: 40px; padding: 0 16px; border-radius: 999px; background: #fff; font-weight: 600; font-size: 14.5px; white-space: nowrap; }
  .pills button[aria-current="true"] { background: var(--ink); color: #fff; }
  .sec { scroll-margin-top: calc(var(--header-h) + 76px); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .card { padding: 10px; border-radius: 20px; }
  .card__name { font-size: 14.5px; }
  .price b { font-size: 18px; }
  .add { width: 40px; height: 40px; }
  .tag { top: 16px; left: 16px; }
  .foot { padding: 8px 16px 120px; }
}
@media (max-width: 640px) {
  .seg--lang button { padding: 0 11px; font-size: 13px; }
  dialog.bottom { margin: auto 0 0; width: 100vw; max-width: 100vw; }
  dialog.bottom .sheet { width: 100vw; border-radius: 26px 26px 0 0; max-height: 92dvh; }
  .item { grid-template-columns: 1fr; }
  .item__img { padding: 20px 20px 0; }
  .item__img img { max-height: 300px; }
  .item__body { padding: 16px 20px 16px; }
  .item h3 { font-size: 21px; margin-right: 0; }
  .list { padding: 22px 18px; width: 100vw; }
  .fab { right: 16px; left: 16px; bottom: 16px; justify-content: center; }
  .btn { padding: 0 16px; }
}
@media (max-width: 380px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .price b { font-size: 16.5px; }
  .seg--lang button { padding: 0 9px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print { .top, .nav, .pills, .fab, .add { display: none !important; } .wrap { display: block; } }
