/* QLIC — витрина. Белый фон, чёрные элементы, бордовый акцент в логотипе и скидках. */
:root {
  --bg: #FFFFFF;
  --surface: #F5F5F5;
  --surface-2: #EDEDED;
  --surface-3: #DADADA;
  --ink: #000000;
  --ink-2: #262626;
  --ink-3: #4F4F4F;
  --muted: #6B6B6B;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.22);
  --accent: #7D1D2D;
  --sale: #7D1D2D;
  --ok: #2F6B3C;
  --warn: #8A5A00;
  --info: #2F4F6B;
  --radius: 14px;
  --radius-sm: 10px;
  --wrap: 1360px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Unbounded', 'Onest', system-ui, sans-serif;
  --font-logo: 'Unbounded', 'Arial Black', system-ui, sans-serif; /* логотип QLIC — Unbounded 700 (выбор владельца 07.11.2026, вариант 8) */
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ink-3); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--ink); color: var(--bg); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ---------- Верхняя полоса ---------- */
.topbar { background: var(--ink); color: var(--bg); font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; height: 36px; gap: 16px; }
.topbar .wrap > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar a { color: var(--bg); opacity: .85; }
.topbar a:hover { opacity: 1; color: var(--bg); }
.topbar__links { display: flex; gap: 22px; }

/* ---------- Шапка ----------
   Компьютер: вкладки | логотип | поиск и значки — в одну строку.
   Планшет: логотип и значки, ниже вкладки и поиск. Телефон: логотип и значки, вкладки, поиск. */
:root { --header-h: 73px; }
.header { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.header__main { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "tabs logo right"; align-items: center; height: 72px; gap: 16px; }
.genders { grid-area: tabs; display: flex; gap: 2px; min-width: 0; }
.genders a { padding: 8px 12px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.genders a.is-active { background: var(--ink); color: var(--bg); }
.genders a:not(.is-active):hover { background: var(--surface-2); color: var(--ink); }

.logo { white-space: nowrap; font-family: var(--font-logo); font-weight: 700; font-size: 28px; letter-spacing: -0.03em; line-height: 1; display: inline-flex; align-items: baseline; gap: 3px; color: var(--ink); }
.header .logo { grid-area: logo; }
.logo:hover { color: var(--ink); }
.logo__dot { width: .24em; height: .24em; border-radius: 1px; background: var(--accent); display: inline-block; transform: translateY(-1px); }

.header__right { grid-area: right; display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.actions { grid-area: actions; display: flex; justify-content: flex-end; gap: 2px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 10px; font-size: 12px; position: relative; min-width: 62px; }
.action:hover { background: var(--surface-2); color: var(--ink); }
.action svg { width: 22px; height: 22px; }
.badge-count { position: absolute; top: 2px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.badge-count:empty, .badge-count[data-count="0"] { display: none; }

.search { grid-area: search; position: relative; width: 240px; min-width: 150px; flex-shrink: 1; }
.search input { width: 100%; height: 40px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 0 44px 0 14px; }
.search input::placeholder { color: var(--muted); }
.search button { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: var(--ink); color: var(--bg); display: grid; place-items: center; cursor: pointer; }
.search svg { width: 16px; height: 16px; }

@media (max-width: 1180px) {
  :root { --header-h: 113px; }
  .header__main { grid-template-columns: 1fr auto; grid-template-areas: "logo actions" "tabs search"; grid-template-rows: 60px 52px; height: auto; gap: 0 16px; }
  .header__right { display: contents; }
  .header .logo { justify-self: start; font-size: 26px; }
  .search { width: 300px; justify-self: end; }
  /* 5 вкладок (с «Косметикой»): если не помещаются — прокручиваются, а не налезают на поиск */
  .genders { overflow-x: auto; scrollbar-width: none; }
  .genders::-webkit-scrollbar { display: none; }
  .genders a { padding: 8px 10px; }
}
@media (min-width: 761px) and (max-width: 960px) {
  .search { width: 240px; }
  .action { min-width: 44px; padding: 6px; }
  .action span:not(.badge-count) { display: none; }
  .badge-count { right: 0; }
}
@media (max-width: 760px) {
  :root { --header-h: 153px; }
  .header__main { grid-template-areas: "logo actions" "tabs tabs" "search search"; grid-template-rows: 56px 44px 52px; }
  .header .logo { font-size: 23px; }
  .genders { gap: 3px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 12px; align-self: start; }
  .genders::-webkit-scrollbar { display: none; }
  .genders a { flex: 1 0 auto; text-align: center; padding: 6px 4px; border: 1px solid var(--line-strong); font-size: 13px; }
  .genders a.is-active { border-color: var(--ink); }
  .search { width: 100%; align-self: start; }
  .action { min-width: 44px; padding: 6px; }
  .action span:not(.badge-count) { display: none; }
  .badge-count { right: 0; }
}

.burger { display: none; border: 0; background: none; padding: 8px; cursor: pointer; }
.burger svg { width: 24px; height: 24px; }

/* ---------- Сообщения ---------- */
.flash { margin: 16px 0 0; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.flash--ok { border-color: rgba(63, 107, 71, .35); }
.flash--error { border-color: rgba(180, 49, 42, .4); color: var(--sale); }
.flash--info { border-color: rgba(61, 90, 115, .35); }

/* ---------- Кнопки и формы ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 10px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font-weight: 600; cursor: pointer; transition: background .15s; white-space: nowrap; }
.btn:hover { background: var(--ink-2); color: var(--bg); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--light { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.btn--light:hover { background: var(--surface); color: var(--ink); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn--danger { background: transparent; color: var(--sale); border-color: rgba(180, 49, 42, .5); }
.btn--danger:hover { background: rgba(180, 49, 42, .08); color: var(--sale); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.link { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.link:hover { text-decoration-color: currentColor; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-size: 13px; font-weight: 600; }
.input, .select, .textarea { width: 100%; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); padding: 10px 14px; transition: border-color .15s, background .15s; }
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); background: #FFFFFF; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--sale); }
.field__error { color: var(--sale); font-size: 13px; }
.field__hint { color: var(--muted); font-size: 13px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex-shrink: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 6px 14px; font-size: 14px; cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip.is-active, .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- Типографика страниц ---------- */
.page { padding: 28px 0 72px; }
.page-title { font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 6px; }
.page-sub { color: var(--muted); margin: 0 0 24px; max-width: 64ch; }
.section { margin-top: 56px; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.section__title { font-size: 24px; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); }

/* ---------- Калькулятор (страница «Как это работает») ---------- */
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px; }
.calc__title { font-weight: 700; font-size: 18px; margin: 0 0 4px; }
.calc__row { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.calc__eur { position: relative; flex: 1; }
.calc__eur input { width: 100%; height: 56px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); font-size: 22px; font-weight: 600; padding: 0 44px 0 16px; }
.calc__eur span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--muted); }
.calc__arrow { color: var(--muted); display: grid; }
.calc__arrow svg { width: 22px; height: 22px; }
.calc__rub { flex: 1.2; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.calc__foot { font-size: 13px; color: var(--muted); margin-top: 14px; }
/* ---------- Главная ---------- */
.home-section { margin-top: 40px; }
.home-section:first-child { margin-top: 28px; }
/* Стена брендов: почти во всю ширину экрана, плитки в цветах логотипов, название на всю плитку.
   Высота плитки — от высоты экрана: 2 ряда + растворяющийся 3-й и кнопка «Ещё бренды» видны без прокрутки
   (на телефоне 3 + 1). Свёрнутая сетка (.is-collapsed) показывает 12 плиток (на телефоне 8), кнопка раскрывает
   остальные (app.js). Размер надписи подгоняет app.js (data-fit). */
.brand-wall {
  --tile-gap: 0px;
  --tile-h: clamp(96px, min(calc((100vh - var(--header-h) - 132px) / 3), calc((100vw - 48px) / 6)), 210px);
  position: relative;
  padding: clamp(12px, 1.4vw, 20px) clamp(12px, 1.6vw, 24px) 0;
}
@supports (height: 100svh) {
  .brand-wall { --tile-h: clamp(96px, min(calc((100svh - var(--header-h) - 132px) / 3), calc((100vw - 48px) / 6)), 210px); }
}
/* Плитки вплотную, с острыми углами и тонкими линиями между ними — как таблица (эскиз владельца 07.11.2026) */
.brand-grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--tile-gap); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.brand-grid.is-collapsed .brand-tile:nth-child(n+13) { display: none; }
/* Растворение последнего видимого ряда — слой поверх, плавно исчезает при раскрытии */
.brand-grid::after { content: ''; position: absolute; left: -4px; right: -4px; bottom: -2px; height: calc(var(--tile-h) + 6px); background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, .72) 42%, #fff 90%); pointer-events: none; opacity: 0; transition: opacity .3s ease; }
.brand-grid.is-collapsed::after { opacity: 1; }
@keyframes tile-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.brand-tile.is-revealing { animation: tile-in .34s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 24ms); }
.brand-tile {
  position: relative; display: flex; align-items: center; justify-content: center; min-width: 0;
  height: var(--tile-h, auto); padding: 6% 8%; border-radius: 0; overflow: hidden;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--tile-bg, #FFFFFF); color: var(--tile-fg, var(--ink));
}
.brand-tile:hover { color: var(--tile-fg, var(--ink)); }
.brand-tile:hover .brand-tile__name { transform: scale(1.05); }
.brand-tile__name { display: block; width: 100%; text-align: center; line-height: 1.02; transition: transform .25s ease; font-weight: 700; font-size: clamp(18px, 3vw, 44px); letter-spacing: -0.01em; overflow-wrap: normal; word-break: keep-all; }
[data-font="didone"] .brand-tile__name { font-family: 'Bodoni Moda', 'Didot', Georgia, serif; font-weight: 600; letter-spacing: .01em; }
[data-font="italic"] .brand-tile__name { font-family: 'Bodoni Moda', 'Didot', Georgia, serif; font-style: italic; font-weight: 700; }
[data-font="geometric"] .brand-tile__name { font-family: 'Jost', 'Futura', var(--font); font-weight: 600; letter-spacing: .04em; }
[data-font="heavy"] .brand-tile__name { font-family: 'Jost', 'Futura', var(--font); font-weight: 800; letter-spacing: -0.02em; }
.home-more { position: relative; z-index: 1; display: flex; justify-content: center; margin-top: 20px; }
.brand-grid.is-collapsed + .home-more { position: absolute; left: 0; right: 0; bottom: calc(var(--tile-h) - 68px); margin: 0; }
.home-paste { margin-top: 12px; }
.brand-wall:has(.brand-grid:not(.is-collapsed)) + .wrap .home-paste { margin-top: 28px; }
.home-more .btn { height: 50px; padding: 0 26px; border-radius: 999px; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5); }

/* Блок «Вставьте ссылку на товар» */
/* Поле вставки ссылки — как поиск в шапке: серое поле, внутри справа чёрная квадратная кнопка */
.paste__field { position: relative; }
.paste__input { width: 100%; height: 56px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 12px; padding: 0 104px 0 18px; font-size: 16px; transition: border-color .15s, background .15s; }
.paste__input::placeholder { color: var(--muted); }
.paste__input.is-invalid { border-color: var(--sale); }
.paste__input:focus { outline: none; border-color: var(--ink); background: var(--bg); }
.paste__btn { position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; border: 0; border-radius: 9px; background: var(--ink); color: var(--bg); display: grid; place-items: center; cursor: pointer; transition: opacity .15s; }
.paste__btn svg { width: 20px; height: 20px; }
.paste__btn:hover { opacity: .85; }
.paste__btn:disabled { opacity: .3; cursor: not-allowed; }
.paste__ok { position: absolute; right: 60px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; animation: ok-in .25s ease both; }
.paste__ok svg { width: 16px; height: 16px; stroke-width: 2.4; }
@keyframes ok-in { from { opacity: 0; transform: translateY(-50%) scale(.6); } to { opacity: 1; transform: translateY(-50%) scale(1); } }
.paste__details { margin-top: 18px; }
.paste__details .chips { margin-top: 4px; }
.paste__sum { color: var(--muted); font-weight: 500; }
.paste__details > .link { display: inline-block; margin-top: 2px; }
/* Страница магазина: слева магазин и кнопка на сайт, справа форма вставки ссылки */
.store-page { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 40px; align-items: start; }
.store-page__head { display: flex; gap: 20px; align-items: center; margin-bottom: 22px; }
.store-page__note { max-width: 56ch; color: var(--ink-3); margin: 0 0 18px; }
.paste__error { margin: 12px 0 0; }
.paste__error.is-info { color: var(--ink-3); }
.paste__error:empty { display: none; }
.subchips { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.subchips .chip { font-size: 13px; padding: 5px 12px; }

/* ---------- Оплата ---------- */
.pay { display: grid; grid-template-columns: 1fr 360px; gap: 32px; align-items: start; }
.methods { display: grid; gap: 10px; }
.method { display: grid; grid-template-columns: 22px 44px 1fr; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; background: var(--bg); }
.method:hover { border-color: var(--ink); }
.method:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.method input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }
.method__icon { width: 44px; height: 44px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; }
.method__icon svg { width: 22px; height: 22px; }
.method b { display: block; }
.method span.muted { font-size: 13px; }
.method-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.method-badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--surface); font-size: 13px; font-weight: 500; }
.method-badge svg { width: 15px; height: 15px; }
.test-banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 10px; background: #FFF6DB; color: #6B4E00; font-size: 14px; margin-bottom: 18px; }
.test-banner svg { width: 18px; height: 18px; flex-shrink: 0; }
.gateway { max-width: 440px; margin: 48px auto; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.gateway__row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.gateway__sum { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin: 16px 0 4px; }
.paid-banner { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-radius: 14px; background: var(--ink); color: var(--bg); margin-bottom: 24px; }
.paid-banner svg { width: 28px; height: 28px; flex-shrink: 0; }

/* ---------- Иконки магазинов ---------- */
.store-icon { width: 48px; height: 48px; border-radius: 12px; background: #FFFFFF; border: 1px solid var(--line); display: grid; place-items: center; position: relative; overflow: hidden; flex-shrink: 0; }
.store-icon img { width: 30px; height: 30px; object-fit: contain; position: relative; z-index: 1; }
.store-icon__mono { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 15px; background: var(--ink); color: var(--bg); letter-spacing: -0.02em; }
.store-icon__mono[data-tone="1"] { background: #3A3A3A; }
.store-icon__mono[data-tone="2"] { background: var(--accent); }
.store-icon__mono[data-tone="3"] { background: #EDEDED; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.store-icon.has-img .store-icon__mono { display: none; }
.store-icon--sm { width: 32px; height: 32px; border-radius: 8px; }
.store-icon--sm img { width: 20px; height: 20px; }
.store-icon--sm .store-icon__mono { font-size: 11px; }
.store-icon--lg { width: 88px; height: 88px; border-radius: 20px; }
.store-icon--lg img { width: 56px; height: 56px; }
.store-icon--lg .store-icon__mono { font-size: 28px; }
.store-icon--logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

.region { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em; border: 1px solid var(--line-strong); color: var(--ink-3); }
.region--PT { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Плитки магазинов */
.stores-row { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.store-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-height: 132px; transition: border-color .15s, transform .15s; position: relative; }
.store-tile:hover { border-color: var(--ink); color: var(--ink); }
.store-tile__name { font-weight: 700; line-height: 1.25; }
.store-tile__meta { font-size: 12px; color: var(--muted); margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.store-tile .region { position: absolute; top: 14px; right: 14px; }

.stores-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.store-card { min-width: 0; display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; transition: border-color .15s; }
.store-card:hover { border-color: var(--ink); color: var(--ink); }
.store-card__body { min-width: 0; flex: 1; }
.store-card__name { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-card__cats { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.letters { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 24px; position: sticky; top: var(--header-h); background: var(--bg); padding: 10px 0; z-index: 5; }
.letters a { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; font-weight: 600; }
.letters a:hover { background: var(--ink); color: var(--bg); }
.letter-group { margin-bottom: 28px; scroll-margin-top: calc(var(--header-h) + 66px); }
.letter-group__title { font-size: 28px; font-weight: 700; margin: 0 0 12px; }
.stores-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.stores-toolbar .input { max-width: 360px; }
.empty-hint { padding: 40px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); }

/* Категории */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.cat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; }
.cat-tile:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cat-tile:hover .muted { color: rgba(255, 255, 255, .7); }
.cat-tile__name { font-weight: 700; font-size: 17px; }

/* ---------- Раскрывающиеся вопросы и список с иконками («Как это работает») ---------- */
.filters__group { padding: 16px 0; border-bottom: 1px solid var(--line); }
.filters__group:first-child { padding-top: 0; }
.info-list { margin: 28px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.info-list li { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; font-size: 14px; }
.info-list svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }

/* ---------- Заказ по ссылке ---------- */
.link-order { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.panel--dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.panel__title { font-size: 18px; font-weight: 700; margin: 0 0 16px; }
.detect { display: none; margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; gap: 12px; align-items: center; }
.detect.is-visible { display: flex; }
.detect--warn { border-color: rgba(148, 99, 18, .5); }
.detect__text { flex: 1; }
.summary-price { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0; }
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(step); width: 32px; height: 32px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.steps b { display: block; }

/* Автоматическая цена по ссылке */
.parse { margin-top: 10px; }
.parse__loading { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; color: var(--ink-3); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--ink); animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.parse__card { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--ink); border-radius: 12px; background: var(--bg); }
.parse__card.no-img { grid-template-columns: 1fr; }
.parse__img { width: 72px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.parse__title { font-weight: 600; line-height: 1.3; }
.parse__price { margin-top: 4px; font-size: 18px; }
.parse__price .muted { font-size: 14px; }
.parse__price s { color: var(--muted); font-size: 14px; margin-left: 4px; }
.parse__note { margin-top: 4px; }
.parse__fail { padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px dashed var(--line-strong); color: var(--ink-2); }
.chip[disabled] { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
.field__autofill { font-size: 12px; color: var(--ok); }

/* Как это работает (главная) */
.how { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: how; }
.how__step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; counter-increment: how; }
.how__step::before { content: counter(how); font-family: var(--font-display); font-size: 30px; font-weight: 600; display: block; margin-bottom: 14px; line-height: 1; }
.how__step b { display: block; margin-bottom: 6px; font-size: 16px; }
.how__step p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Корзина и оформление ---------- */
.cart { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; }
.cart-item { display: grid; grid-template-columns: 96px 1fr auto; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.cart-item:first-child { padding-top: 0; }
.cart-item__img { width: 96px; aspect-ratio: 3 / 4; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.cart-item__ph { width: 96px; aspect-ratio: 3 / 4; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.cart-item__ph svg { width: 28px; height: 28px; }
.cart-item__store { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.cart-item__title { margin: 4px 0 6px; }
.cart-item__meta { font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.cart-item__meta b { color: var(--ink); font-weight: 600; }
.cart-item__side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.cart-item__price { font-weight: 700; font-size: 17px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.qty button { width: 32px; height: 32px; border: 0; background: transparent; cursor: pointer; font-size: 16px; }
.qty button:hover { background: var(--surface-2); }
.qty span { min-width: 28px; text-align: center; font-weight: 600; }
.warn-note { margin-top: 8px; font-size: 13px; color: var(--warn); display: flex; gap: 6px; }
.warn-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.summary { position: sticky; top: calc(var(--header-h) + 16px); }
.summary__row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.summary__total { font-size: 20px; font-weight: 700; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }
.summary .btn { margin-top: 18px; }
.summary__hint { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); text-align: center; }
.summary__note { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; line-height: 1.4; }
.summary__note svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.radio-card { border: 1px solid var(--line-strong); border-radius: 12px; padding: 14px; display: flex; gap: 10px; cursor: pointer; background: var(--surface); }
.radio-card:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.radio-card input { accent-color: var(--ink); margin-top: 3px; }

/* ---------- Аккаунт ---------- */
.account { display: grid; grid-template-columns: 220px 1fr; gap: 40px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-nav button { padding: 10px 12px; border-radius: 8px; font-weight: 500; text-align: left; border: 0; background: none; cursor: pointer; }
.side-nav a:hover, .side-nav button:hover { background: var(--surface-2); color: var(--ink); }
.side-nav a.is-active { background: var(--ink); color: var(--bg); }
.order-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.order-row:hover { border-color: var(--ink); color: var(--ink); }
.order-row__thumbs { display: flex; gap: 6px; margin-top: 12px; }
.order-row__thumbs img, .order-row__thumbs span { width: 48px; height: 64px; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
/* ---------- Баланс ---------- */
.balance { display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-rows: auto 1fr; grid-template-areas: "card form" "hist form"; gap: 24px 32px; align-items: start; }
.balance__card { grid-area: card; display: flex; flex-direction: column; gap: 6px; padding: 24px; border-radius: var(--radius); background: var(--ink); color: var(--bg); }
.balance__card span { font-size: 14px; opacity: .7; }
.balance__sum { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.balance__topup { grid-area: form; position: sticky; top: calc(var(--header-h) + 16px); }
.balance__history { grid-area: hist; min-width: 0; }
.balance__h { font-size: 18px; margin: 0 0 8px; }
.balance__amount { font-size: 20px; font-weight: 600; }
.balance__quick { margin-top: 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.balance__quick .chip { padding: 6px 4px; text-align: center; white-space: nowrap; font-size: 13px; }
.methods--compact { gap: 8px; }
.methods--compact .method { padding: 10px 12px; grid-template-columns: 18px 36px 1fr; gap: 10px; }
.methods--compact .method__icon { width: 36px; height: 36px; }
.methods--compact .method__icon svg { width: 18px; height: 18px; }
.balance-ops { list-style: none; margin: 0; padding: 0; }
.balance-op { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.balance-op.is-pending { opacity: .6; }
.balance-op__sum { font-weight: 700; white-space: nowrap; }
.balance-op__sum.is-plus { color: var(--ok); }
.summary__balance { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.summary__short { font-weight: 700; }
.track b { font-size: 18px; letter-spacing: .02em; }
@media (max-width: 1024px) {
  .balance { grid-template-columns: 1fr; grid-template-rows: auto; grid-template-areas: "card" "form" "hist"; }
  .balance__topup { position: static; }
}
@media (max-width: 760px) {
  .balance__sum { font-size: 32px; }
  .balance__card { padding: 20px; }
}

.status { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--info { color: var(--info); }
.status--warn { color: var(--warn); }
.status--ok { color: var(--ok); }
.status--done { background: var(--ink); color: var(--bg); }
.status--muted { color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ''; position: absolute; left: 5px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.timeline li::after { content: ''; position: absolute; left: 9px; top: 18px; bottom: 0; width: 2px; background: var(--surface-3); }
.timeline li:last-child::after { display: none; }
.timeline li.is-done::before { background: var(--ink); }
.timeline li.is-current::before { background: var(--ink); box-shadow: 0 0 0 4px rgba(0, 0, 0, .18); }
.timeline li.is-done::after { background: var(--ink); }
.timeline b { display: block; }
.order-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }

/* ---------- Авторизация ---------- */
.auth { max-width: 440px; margin: 40px auto 0; }
.auth .panel { padding: 32px; }
.auth__switch { text-align: center; margin-top: 18px; color: var(--muted); }

/* ---------- Подвал ---------- */
.footer { background: var(--surface); color: var(--ink); margin-top: 80px; padding: 48px 0 32px; border-top: 1px solid var(--line); }
.footer a { color: var(--ink-3); }
.footer a:hover { color: var(--ink); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { margin: 0 0 12px; font-size: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.footer__bottom { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 20px; font-size: 13px; opacity: .7; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Уведомление (toast) ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 14px 18px; border-radius: 12px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; display: flex; gap: 14px; align-items: center; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: var(--bg); text-decoration: underline; font-weight: 600; }

/* ---------- Адаптив ---------- */
@media (max-width: 1024px) {
  .pay { grid-template-columns: 1fr; }
  .link-order, .cart, .order-layout, .store-page { grid-template-columns: 1fr; }
  .summary { position: static; }
  .how { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .account { grid-template-columns: 1fr; gap: 16px; }
  .side-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .side-nav a, .side-nav button { white-space: nowrap; flex-shrink: 0; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .topbar__links { display: none; }
  .topbar { font-size: 12px; }
  .brand-wall { --tile-h: clamp(80px, min(calc((100vh - var(--header-h) - 120px) / 4), calc((100vw - 24px) / 2 / 1.5)), 140px); }
  @supports (height: 100svh) {
    .brand-wall { --tile-h: clamp(80px, min(calc((100svh - var(--header-h) - 120px) / 4), calc((100vw - 24px) / 2 / 1.5)), 140px); }
  }
  .brand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-grid.is-collapsed .brand-tile:nth-child(n+9) { display: none; }
  .how { grid-template-columns: 1fr; }
  .row, .row-3, .radio-cards { grid-template-columns: 1fr; }
  .page-title { font-size: 26px; }
  .cart-item { grid-template-columns: 72px 1fr; }
  .cart-item__img, .cart-item__ph { width: 72px; }
  .cart-item__side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .footer__grid { grid-template-columns: 1fr; }
  .letters { flex-wrap: nowrap; overflow-x: auto; }
  .letters a { flex-shrink: 0; }
  .panel { padding: 20px; }
  .stores-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Юридические документы ---------- */
.legal { max-width: 820px; }
.legal h2 { font-size: 19px; margin: 28px 0 10px; }
.legal p, .legal li { line-height: 1.6; color: var(--ink-2); }
.legal ul { padding-left: 20px; }
.legal__req { list-style: none; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.legal__req li { padding: 2px 0; }
.legal-missing { background: #FFF1C2; color: #6B4E00; padding: 0 4px; border-radius: 4px; }
.footer__legal { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 32px; font-size: 13px; }
.footer__legal a { color: var(--ink-3); }
.footer__legal a:hover { color: var(--ink); }
