
/* ============================== tokens ============================== */
/* Цвета взяты с фасада магазина на Урицкого, 65: синяя вывеска, зелёная стена */
:root {
  --blue: #1A8FE3;        /* вывеска — только крупный текст и фоны */
  --blue-deep: #0E6DB5;   /* ссылки и мелкий текст, контраст 4.9:1 на белом */
  --blue-dark: #0B5A96;
  --green: #1E8E3E;       /* «Позвонить», статус «открыто» */
  --green-dark: #197A34;
  --green-dot: #3DBB4F;

  --ink: #10233A;
  --ink-soft: #4A5A6E;
  --ink-mute: #7C8898;
  --paper: #FFFFFF;
  --tint: #EAF4FC;
  --tint-2: #F5F9FD;
  --line: #D5E3EF;
  --line-strong: #B9CCDD;
  --rose: #C62828;
  --dot-off: #B8C4D1;
  --stock-bg: #EDF8F0;
  --stock-line: #BFE5C9;
  --cover: #F5F9FD;         /* подложка фото товара: фото на белом фоне, в тёмной теме остаётся светлой */
  --fab: var(--ink);
  --fab-text: #fff;
  --on-accent: #fff;
  color-scheme: light;

  /* совместимость со старыми именами из ветки grow */
  --bg: var(--paper);
  --bg-2: var(--paper);
  --card: var(--paper);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --text: var(--ink);
  --muted: var(--ink-soft);
  --muted-2: var(--ink-mute);
  --green-soft: var(--tint);
  --green-deep: var(--ink);
  --accent: var(--blue-deep);

  --font: 'Golos Text', 'Segoe UI', Roboto, Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --container: 1180px;
  --measure: 44rem;
  --tap: 48px;
}

/* Тёмная тема: та же вывеска, но ночью. Синий и зелёный чуть светлее ради контраста на тёмном. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #4DA8F0;
    --blue-deep: #7CC0F5;
    --blue-dark: #A6D4F8;
    --green: #3DBB4F;
    --green-dark: #5ACB6A;
    --green-dot: #3DBB4F;
    --ink: #E8EEF5;
    --ink-soft: #A9B7C6;
    --ink-mute: #7C8898;
    --paper: #0F1A26;
    --tint: #16243A;
    --tint-2: #132030;
    --line: #26374C;
    --line-strong: #3A4E66;
    --rose: #FF7A7A;
    --dot-off: #4A5A6E;
    --stock-bg: #12301C;
    --stock-line: #245A33;
    --fab: #4DA8F0;
    --fab-text: #0F1A26;
    --on-accent: #0F1A26;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --blue: #4DA8F0;
  --blue-deep: #7CC0F5;
  --blue-dark: #A6D4F8;
  --green: #3DBB4F;
  --green-dark: #5ACB6A;
  --green-dot: #3DBB4F;
  --ink: #E8EEF5;
  --ink-soft: #A9B7C6;
  --ink-mute: #7C8898;
  --paper: #0F1A26;
  --tint: #16243A;
  --tint-2: #132030;
  --line: #26374C;
  --line-strong: #3A4E66;
  --rose: #FF7A7A;
  --dot-off: #4A5A6E;
  --stock-bg: #12301C;
  --stock-line: #245A33;
  --fab: #4DA8F0;
  --fab-text: #0F1A26;
  --on-accent: #0F1A26;
  color-scheme: dark;
}

/* ============================== base ============================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 17px; line-height: 1.5; color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }

body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: clamp(1.5rem, 1rem + 2vw, 2.1rem); }
h2 { font-size: clamp(1.3rem, 1rem + 1.2vw, 1.6rem); }
h3 { font-size: 1.15rem; }
p { margin: 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-link { color: var(--blue-deep); text-decoration: underline; text-underline-offset: 3px; }
.text-link:hover { color: var(--blue); }
.text-muted { color: var(--ink-soft); }

/* Кнопки */
.btn {
  display: inline-flex; gap: 10px; align-items: center; justify-content: center;
  min-height: var(--tap);
  padding: 12px 20px; border-radius: var(--radius); font-weight: 600; font-size: 16px;
  border: 2px solid transparent; line-height: 1.2; text-align: center;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { flex: none; }
.btn--primary { background: var(--blue); color: var(--on-accent); }
.btn--primary:hover { background: var(--blue-deep); color: var(--on-accent); }
.btn--call { background: var(--green); color: #fff; }
.btn--call:hover { background: var(--green-dark); color: #fff; }
.btn--ghost, .btn--solid { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover, .btn--solid:hover { border-color: var(--ink); }
.btn--ghost .ic-tg { color: #2AABEE; }
.btn--ghost .ic-wa { color: #25D366; }
.btn--block { width: 100%; }
.btn--lg { min-height: 58px; padding: 14px 24px; font-size: 17px; }
.btn--sm { min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: var(--radius-sm); }

/* Промокод */
.code {
  font-weight: 600; color: var(--ink);
  padding: 1px 7px; border: 1.5px solid var(--ink); border-radius: 6px; white-space: nowrap;
}
.promo-code-chip { font-weight: 600; color: var(--ink); padding: 1px 7px; border: 1.5px solid var(--ink); border-radius: 6px; white-space: nowrap; }

/* Секции */
section { padding: 40px 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section__head p { color: var(--ink-soft); margin-top: 4px; font-size: 15px; }
.section__link { color: var(--blue-deep); font-weight: 500; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.section__link:hover { color: var(--blue); }
.section__link svg { display: none; }

.breadcrumbs { padding: 16px 0 0; font-size: 14px; color: var(--ink-soft); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--blue-deep); text-decoration: underline; }
.breadcrumbs span { color: var(--ink); }
.breadcrumbs svg { color: var(--ink-mute); }

@media (max-width: 720px) {
  .container { padding: 0 16px; }
  section { padding: 28px 0; }
  .section__head { margin-bottom: 14px; gap: 6px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ============================== header ============================== */
/* Шапка: логотип, поиск, телефон со статусом */
.header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header__row { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; padding: 14px 0; }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { width: 168px; height: auto; }

/* Поиск */
.search {
  display: flex; align-items: center; gap: 4px;
  background: var(--paper); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 3px 4px 3px 14px;
  max-width: 560px; width: 100%; justify-self: center;
  transition: border-color .15s;
}
.search:focus-within { border-color: var(--blue); }
.search__icon { color: var(--ink-mute); flex-shrink: 0; display: inline-flex; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; padding: 9px 8px; min-width: 0; font-size: 16px; }
.search input::placeholder { color: var(--ink-mute); }
.search__voice, .search__submit {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s, color .15s;
}
.search__voice { color: var(--ink-soft); }
.search__voice:hover { background: var(--tint); color: var(--blue-deep); }
.search__voice.recording { color: var(--rose); }
.search__submit { background: var(--blue); color: var(--on-accent); }
.search__submit:hover { background: var(--blue-deep); }

/* Телефон и статус справа */
.header__phone { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.header__phone-num { font-weight: 900; font-size: 24px; letter-spacing: -0.03em; color: var(--blue); font-variant-numeric: tabular-nums; }
.header__phone-num:hover { color: var(--blue-deep); }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; color: var(--ink-soft); margin-top: 3px; white-space: nowrap; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--dot-off); flex: none; }
.status.is-open { color: var(--green); }
.status.is-open::before { background: var(--green-dot); }

.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--tint); color: var(--blue-deep); }

@media (max-width: 900px) {
  .header__row { gap: 12px; }
  .brand img { width: 136px; }
  .header__phone-num { font-size: 20px; }
  .status { font-size: 13px; }
}
@media (max-width: 720px) {
  .header__row { grid-template-columns: auto 1fr; padding: 10px 0; row-gap: 8px; }
  .brand { grid-row: 1; grid-column: 1; }
  .header__phone { grid-row: 1; grid-column: 2; justify-self: end; }
  .search { grid-row: 2; grid-column: 1 / -1; max-width: none; padding: 2px 2px 2px 12px; }
  .search input { font-size: 16px; padding: 8px 6px; }
  .search__submit { display: none; }
  .header__phone { align-items: flex-end; }
  .header__phone-num { font-size: 22px; }
  .status { display: none; }
}

/* ============================== tabbar ============================== */
/* Нижняя навигация на мобильном */
.tabbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 6px env(safe-area-inset-right) calc(6px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
}
.tabbar__inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 2px; font-size: 11px; font-weight: 500; color: var(--ink-soft);
  min-height: 52px; justify-content: center; transition: color .15s;
}
.tabbar a:hover, .tabbar button:hover, .tabbar .is-active { color: var(--blue-deep); }
.tabbar a[href^="tel:"] { color: var(--green); }
.tabbar svg { width: 22px; height: 22px; }

@media (max-width: 720px) {
  .tabbar { display: block; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
}

/* ============================== cards ============================== */
/* Бейджи */
.badge { display: inline-flex; gap: 5px; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
.badge--stock { color: var(--green); border-color: var(--stock-line); background: var(--stock-bg); }
.badge--out { color: var(--ink-soft); }
.stock-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-dot); display: inline-block; }

/* Категории — как список, в колонках */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 40px; border-top: 1px solid var(--line); }
.cat-card {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
  transition: color .15s;
}
.cat-card:hover { color: var(--blue-deep); }
.cat-card__name { font-weight: 500; font-size: 17px; }
.cat-card__meta { font-size: 14px; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Сетка товаров */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.product-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s;
}
.product-card:hover { border-color: var(--ink); }
.product-card__cover {
  aspect-ratio: 4 / 3; background: var(--cover); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.product-card__cover img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.product-card__noimg { color: var(--line-strong); }
.product-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-card__cat { font-size: 13px; color: var(--ink-soft); }
.product-card__title {
  font-size: 15px; line-height: 1.35; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card__title:hover { color: var(--blue-deep); }
.product-card__footer { margin-top: auto; padding-top: 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.product-card__price { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.product-card__stock { font-size: 13px; color: var(--ink-mute); }
.product-card__stock.is-in { color: var(--green); }

@media (max-width: 900px) { .cats { grid-template-columns: 1fr 1fr; gap: 0 28px; } }
@media (max-width: 720px) {
  .products { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .product-card__body { padding: 10px 12px 12px; }
  .product-card__title { font-size: 14px; }
  .product-card__price { font-size: 17px; }
}
@media (max-width: 560px) {
  .cats { grid-template-columns: 1fr; }
  .cat-card__name { font-size: 16px; }
}
@media (max-width: 400px) { .products { grid-template-columns: 1fr 1fr; gap: 8px; } }

/* Распродажа */
.sale-tag {
  position: absolute; top: 10px; left: 10px;
  background: var(--rose); color: #fff;
  font-weight: 900; font-size: 15px; letter-spacing: -0.02em;
  padding: 4px 9px; border-radius: 8px;
}
.sale-tag--lg { position: static; font-size: 18px; padding: 5px 11px; }
.product-card__cover { position: relative; }
.product-card__price--sale { color: var(--rose); }
.product-card__price s, .product-detail__price s { color: var(--ink-mute); font-weight: 500; font-size: .7em; text-decoration: line-through; margin-left: 6px; }
.product-detail__price--sale { color: var(--rose); }
.products--sale { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ============================== forms ============================== */
.input {
  width: 100%;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 16px; background: var(--paper);
  outline: 0; transition: border-color .15s; min-height: var(--tap);
}
.input:focus { border-color: var(--blue); }

/* Чипы активных фильтров */
.chip {
  display: inline-flex; gap: 6px; align-items: center;
  background: var(--tint); color: var(--ink);
  padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 500;
}
.chip button, .chip a { color: var(--ink-soft); display: inline-flex; align-items: center; padding: 0; transition: color .15s; }
.chip button:hover, .chip a:hover { color: var(--rose); }
.chip--clear { background: transparent; color: var(--ink-soft); border: 1px dashed var(--line-strong); }
.chip--clear:hover { color: var(--rose); border-color: var(--rose); }

/* ============================== home ============================== */
/* Вывеска */
.sign { background: var(--tint); padding: 44px 0 48px; }
.sign__grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px 56px; align-items: start; }
.sign h1 { max-width: 22ch; }
.phone {
  display: block; width: fit-content; margin-top: 18px;
  font-size: clamp(3.6rem, 0.25rem + 20vw, 7.5rem);
  font-weight: 900; line-height: 0.95; letter-spacing: -0.045em;
  color: var(--blue); font-variant-numeric: tabular-nums;
}
.phone:hover { color: var(--blue-deep); }
.phone-full { margin-top: 14px; color: var(--ink-soft); font-size: 16px; max-width: 42ch; }
.phone-full a { color: var(--blue-deep); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.contacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }

/* Купон */
.coupon {
  display: grid; grid-template-columns: 1fr auto;
  border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--paper); overflow: hidden;
}
.coupon-body { padding: 20px 22px; }
.coupon-title { font-weight: 600; font-size: 20px; line-height: 1.3; }
.coupon-body p + p { margin-top: 6px; font-size: 16px; color: var(--ink-soft); }
.coupon-stub {
  position: relative; display: grid; place-items: center;
  padding: 16px 18px; border-left: 2px dashed var(--ink);
  font-weight: 900; font-size: 30px; letter-spacing: -0.03em; color: var(--blue); background: var(--tint);
}
.coupon-stub::before, .coupon-stub::after {
  content: ""; position: absolute; left: -11px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--tint); border: 2px solid var(--ink);
}
.coupon-stub::before { top: -11px; }
.coupon-stub::after { bottom: -11px; }

/* Правая колонка вывески: часы + как найти */
.sign__aside { display: flex; flex-direction: column; gap: 22px; }
.visit-short { font-size: 16px; }
.visit-short .addr { font-size: 20px; font-weight: 600; }
.hours { margin-top: 10px; display: grid; grid-template-columns: max-content 1fr; gap: 3px 18px; }
.hours dt { color: var(--ink-soft); }
.hours dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.visit-short .links { margin-top: 12px; display: flex; gap: 18px; flex-wrap: wrap; }

/* Ассортимент */
.range-note { margin-top: 18px; color: var(--ink-soft); font-size: 16px; }

/* Помощник */
.ask {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 26px 0;
}
.ask p { color: var(--ink-soft); margin-top: 4px; max-width: 56ch; }

/* Магазин и карта */
.store { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: start; }
address { font-style: normal; }
.addr-street { font-size: 22px; font-weight: 600; line-height: 1.3; }
.map {
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--tint);
  min-height: 280px; display: grid; place-items: center; overflow: hidden;
}
.map iframe { width: 100%; height: 360px; border: 0; display: block; }
.map .btn { margin: 24px; }
.map-links { margin-top: 12px; font-size: 16px; }

@media (max-width: 900px) {
  .sign__grid { grid-template-columns: 1fr; gap: 30px; }
  .store { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 720px) {
  .sign { padding: 30px 0 34px; }
  .contacts { grid-template-columns: 1fr; gap: 10px; }
  .ask { padding: 20px 0; }
  .ask .btn { width: 100%; }
}
@media (max-width: 559px) {
  .coupon { grid-template-columns: 1fr; }
  .coupon-stub { border-left: 0; border-top: 2px dashed var(--ink); padding: 10px; font-size: 26px; }
  .coupon-stub::before { top: -11px; left: -11px; }
  .coupon-stub::after { top: -11px; bottom: auto; left: auto; right: -11px; }
}

/* Блок распродажи */
.sale { background: var(--tint-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sale h2 { color: var(--rose); }

/* Нерабочее время: оставить номер */
.afterhours { margin-top: 22px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); display: grid; gap: 12px; }
.afterhours__text { display: grid; gap: 4px; font-size: 15px; color: var(--ink-soft); }
.afterhours__text b { color: var(--ink); font-size: 16px; }
.callback { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.callback input { min-width: 0; border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; font: inherit; font-size: 17px; background: var(--paper); color: var(--ink); }
.callback input:focus { outline: none; border-color: var(--blue); }
.callback__result { grid-column: 1 / -1; font-size: 15px; }
.callback__result:empty { display: none; }
.callback__result.is-ok { color: var(--green); }
.callback__result.is-error { color: var(--rose); }
.product-detail .afterhours { margin-top: 0; }
.chat-msg--cb .callback { margin-top: 8px; grid-template-columns: 1fr; }
.chat-msg--cb input { font-size: 16px; }
@media (max-width: 560px) { .callback { grid-template-columns: 1fr; } }

/* Заявки: текст + телефон, промо, модалка при уходе */
.callback--text { grid-template-columns: 1fr auto; }
.callback--text textarea { grid-column: 1 / -1; min-width: 0; border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; font: inherit; font-size: 16px; background: var(--paper); color: var(--ink); resize: vertical; }
.callback--text textarea:focus { outline: none; border-color: var(--blue); }
.afterhours--promo { border-color: var(--green); }
.afterhours__promo { color: var(--ink); }
.afterhours__promo b { color: var(--green); }
.exit-modal { position: fixed; inset: 0; z-index: 85; background: rgba(16,35,58,.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.exit-modal[hidden] { display: none; }
.exit-modal__inner { position: relative; width: 100%; max-width: 520px; }
.exit-modal__inner .afterhours { margin: 0; padding: 26px 24px 22px; background: var(--paper); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.exit-modal__close { position: absolute; right: 8px; top: 8px; z-index: 1; }
@media (max-width: 560px) { .callback--text { grid-template-columns: 1fr; } }

/* ============================== catalog ============================== */
.catalog-head { padding: 18px 0 8px; display: flex; gap: 16px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; }
.catalog-head__count { color: var(--ink-soft); font-size: 15px; margin-top: 6px; }
.catalog-head__sort { display: flex; gap: 10px; align-items: center; }
.catalog-head__sort label { font-size: 14px; color: var(--ink-soft); }
.catalog-head__sort select {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 34px 9px 12px; font-size: 15px; appearance: none; min-height: var(--tap);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234A5A6E' stroke-width='2' stroke-linecap='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 12px; }

.catalog-grid { display: grid; grid-template-columns: 260px 1fr; gap: 32px; padding: 8px 0 40px; align-items: flex-start; }

/* Фильтры */
.filters { background: var(--paper); }
.filters__head { font-weight: 600; font-size: 17px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.filter-group { padding: 14px 0; border-top: 1px solid var(--line); }
.filter-group h4 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.filter-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.filter-list label { display: flex; gap: 10px; align-items: center; font-size: 15px; cursor: pointer; padding: 4px 0; min-height: 32px; }
.filter-list input[type="checkbox"] { accent-color: var(--blue); width: 18px; height: 18px; }
.filter-list .count { margin-left: auto; color: var(--ink-mute); font-size: 13px; font-variant-numeric: tabular-nums; }
.filter-cat-link { display: block; font-size: 15px; padding: 6px 8px; border-radius: 8px; color: var(--ink); transition: background .15s; }
.filter-cat-link:hover { background: var(--tint); }
.filter-cat-link.is-active { background: var(--tint); font-weight: 600; }
.filter-price { display: flex; gap: 8px; align-items: center; }
.filter-price input { flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 15px; outline: 0; }
.filter-price input:focus { border-color: var(--blue); }
.filter-price span { color: var(--ink-mute); }
.filters__reset { margin-top: 14px; }

.filters-toggle {
  display: none; align-items: center; gap: 6px;
  padding: 10px 14px; border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); font-size: 15px; font-weight: 500; min-height: var(--tap);
}
.filters-toggle__count {
  background: var(--blue); color: var(--on-accent); font-size: 12px; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600;
}

.catalog-empty { padding: 48px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; color: var(--ink-soft); }
.catalog-empty__icon { display: inline-flex; color: var(--ink-mute); margin-bottom: 10px; }
.catalog-empty h3 { color: var(--ink); margin-bottom: 6px; }
.catalog-empty p { max-width: 46ch; margin-inline: auto; }

@media (max-width: 900px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .filters {
    position: fixed; inset: 0; left: -100%; top: 0; z-index: 75;
    max-width: 360px; width: 86%; height: 100%; border-radius: 0;
    transition: left .25s; overflow-y: auto; padding: 18px; border-right: 1px solid var(--line);
  }
  .filters.is-open { left: 0; box-shadow: 0 0 50px rgba(16,35,58,.2); }
  .filters-backdrop { display: none; position: fixed; inset: 0; background: rgba(16,35,58,.45); z-index: 74; }
  .filters-backdrop.is-on { display: block; }
  .filters-toggle { display: inline-flex; }
  .filters__close { display: inline-flex; margin-left: auto; }
}
@media (min-width: 901px) { .filters__close { display: none; } }
@media (max-width: 720px) {
  .catalog-head { padding: 14px 0 6px; gap: 12px; }
  .catalog-head__sort { width: 100%; justify-content: space-between; }
  .catalog-head__sort label { display: none; }
  .catalog-head__sort select { flex: 1; min-width: 0; }
  .filters-toggle { flex-shrink: 0; }
}

/* Ленивая подгрузка */
.load-more { display: flex; justify-content: center; padding: 28px 0 8px; }
.load-more.is-loading .btn { opacity: .5; pointer-events: none; }

/* Подсказка консультанта над результатами поиска */
.search-ai { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 18px; margin: 4px 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint-2); font-size: 15px; }
.search-ai b { font-weight: 600; }
@media (max-width: 720px) { .search-ai .btn { width: 100%; } }

/* ============================== product ============================== */
.product-page { padding-bottom: 32px; }
.product-detail { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; padding: 24px 0; }
.product-detail__media { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 90px; }
.product-detail__cover {
  position: relative; border-radius: var(--radius); aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border: 1px solid var(--line); background: var(--cover);
}
.product-detail__cover-icon { color: var(--line-strong); }
.product-detail__cover-img { width: 100%; height: 100%; object-fit: contain; padding: 24px; }
.product-detail__badges { position: absolute; top: 14px; left: 14px; display: flex; gap: 8px; }
.product-detail__thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.product-detail__thumb {
  aspect-ratio: 1; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--line); cursor: pointer; transition: border-color .15s; background: var(--cover); padding: 0; font: inherit;
}
.product-detail__thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.product-detail__thumb:hover, .product-detail__thumb.is-active, .product-detail__thumb:focus-visible { border-color: var(--blue); outline: none; }

.product-detail__main { display: flex; flex-direction: column; gap: 18px; }
.product-detail__cat { font-size: 15px; color: var(--ink-soft); }
.product-detail__title { font-size: clamp(1.4rem, 1rem + 1.5vw, 1.9rem); }
.product-detail__meta { font-size: 14px; color: var(--ink-soft); }
.product-detail__meta strong { color: var(--ink); font-weight: 500; }
.product-detail__lead { font-size: 17px; line-height: 1.55; }

.product-detail__specs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 15px; }
.spec { display: contents; }
.spec__icon { display: none; }
.spec__label { color: var(--ink-soft); }
.spec__val { font-weight: 500; }

.product-detail__buy { display: flex; flex-direction: column; gap: 16px; }
.product-detail__price { font-size: 38px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; color: var(--blue); font-variant-numeric: tabular-nums; }
.product-detail__price-hint { font-size: 14px; color: var(--ink-soft); margin-top: 6px; }
.product-detail__cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.product-detail__hint { font-size: 15px; color: var(--ink-soft); }
.product-detail__hint a { color: var(--blue-deep); text-decoration: underline; text-underline-offset: 3px; }
.product-detail__hint svg { display: none; }

/* Описание / характеристики */
.product-info { margin: 28px 0; border-top: 1px solid var(--line); }
.info-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.info-tab { padding: 14px 18px; font-size: 16px; font-weight: 500; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; flex-shrink: 0; }
.info-tab:hover { color: var(--ink); }
.info-tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.info-panel { display: none; padding: 24px 0; max-width: var(--measure); }
.info-panel.is-active { display: block; }
.info-panel h3 { margin-bottom: 12px; }
.info-panel p { margin: 0 0 12px; line-height: 1.6; }
.info-panel p:last-child { margin-bottom: 0; }
.info-panel .text-muted { font-size: 15px; }
.specs-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.specs-table tr { border-bottom: 1px solid var(--line); }
.specs-table td { padding: 10px 0; vertical-align: top; }
.specs-table td:first-child { color: var(--ink-soft); width: 220px; }

@media (max-width: 900px) {
  .product-detail { grid-template-columns: 1fr; gap: 22px; }
  .product-detail__media { position: static; }
  .product-detail__cover { aspect-ratio: 4 / 3; }
}
@media (max-width: 720px) {
  .product-detail { padding: 16px 0; }
  .product-detail__cta { grid-template-columns: 1fr; }
  .product-detail__price { font-size: 32px; }
  .info-tab { padding: 12px 14px; font-size: 15px; }
  .specs-table td:first-child { width: 45%; }
}

.info-panel ul, .info-panel ol { padding-left: 22px; margin: 0 0 12px; line-height: 1.6; }
.info-panel li { margin-bottom: 4px; }
.info-panel h3 { margin: 20px 0 8px; font-size: 1.05rem; }
.info-panel h3:first-child { margin-top: 0; }
.info-panel table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0 0 12px; }
.info-panel td, .info-panel th { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }

/* ============================== info ============================== */
.info-page { padding-top: 24px; padding-bottom: 40px; }
.info-page h1 { margin-bottom: 6px; }
.info-page__sub { color: var(--ink-soft); font-size: 16px; margin-bottom: 26px; }
.info-page__grid { display: grid; grid-template-columns: minmax(0, var(--measure)) 280px; gap: 40px; align-items: flex-start; }
.info-page__content h2 { margin: 28px 0 10px; }
.info-page__content h2:first-child { margin-top: 0; }
.info-page__content p { line-height: 1.6; margin: 0 0 14px; }
.info-page__content ul { padding-left: 22px; line-height: 1.7; }
.info-page__content li { margin-bottom: 6px; }
.info-page__content a { color: var(--blue-deep); text-decoration: underline; text-underline-offset: 3px; }
.info-page__aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 90px; }
.info-aside-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.info-aside-card h3 { margin-bottom: 6px; }
.info-aside-card p { color: var(--ink-soft); font-size: 15px; margin: 0 0 14px; }

@media (max-width: 900px) {
  .info-page__grid { grid-template-columns: 1fr; }
  .info-page__aside { position: static; }
}
@media (max-width: 720px) {
  .info-page { padding-top: 16px; padding-bottom: 28px; }
  .info-page__sub { margin-bottom: 18px; }
}

/* ============================== chat ============================== */
/* Кнопка помощника */
.fab-chat {
  position: fixed; bottom: 24px; right: 24px; z-index: 55;
  background: var(--fab); color: var(--fab-text);
  min-height: 52px; padding: 0 18px 0 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px;
  box-shadow: 0 6px 20px rgba(16,35,58,.25);
  transition: background .15s;
}
.fab-chat:hover { background: var(--blue-deep); }
.fab-chat__pulse { display: none; }

/* Панель чата */
.chat-overlay {
  position: fixed; inset: 0; z-index: 70; display: none;
  background: rgba(16,35,58,.45);
  align-items: stretch; justify-content: flex-end;
}
.chat-overlay.is-open { display: flex; }
.chat-panel {
  background: var(--paper); width: 460px; max-width: 100%;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--line);
}
.chat-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.chat-head__avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--tint); color: var(--blue-deep); display: inline-flex; align-items: center; justify-content: center; }
.chat-head__title { font-weight: 600; font-size: 16px; line-height: 1.2; }
.chat-head__sub { font-size: 13px; color: var(--ink-soft); }
.chat-head__close { margin-left: auto; }

.chat-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.chat-msg { padding: 12px 14px; border-radius: 14px; margin: 10px 0; max-width: 92%; line-height: 1.5; font-size: 15px; }
.chat-msg.user { background: var(--tint); margin-left: auto; }
.chat-msg.assistant { border: 1px solid var(--line); }
.chat-msg p { margin: 6px 0; }
.chat-msg p:first-child { margin-top: 0; }
.chat-msg p:last-child { margin-bottom: 0; }
.chat-msg a { color: var(--blue-deep); text-decoration: underline; }

.chat-suggest { padding: 8px 16px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.chat-suggest button {
  background: var(--paper); border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px;
  font-size: 14px; color: var(--ink-soft); transition: border-color .15s, color .15s;
}
.chat-suggest button:hover { border-color: var(--ink); color: var(--ink); }

.chat-form-wrap { padding: 12px 16px 16px; }
.chat-form {
  display: flex; gap: 6px; align-items: center;
  border: 2px solid var(--line); border-radius: var(--radius); padding: 3px 3px 3px 12px;
}
.chat-form:focus-within { border-color: var(--blue); }
.chat-form input { flex: 1; border: 0; background: transparent; outline: 0; padding: 10px 0; min-width: 0; font-size: 16px; }
.chat-form .voice-btn, .chat-form .send-btn { width: 42px; height: 42px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-form .voice-btn { color: var(--ink-soft); }
.chat-form .voice-btn:hover { color: var(--blue-deep); background: var(--tint); }
.chat-form .voice-btn.recording { color: var(--rose); }
.chat-form .send-btn { background: var(--blue); color: var(--on-accent); }
.chat-form .send-btn:hover { background: var(--blue-deep); }
.chat-form .send-btn:disabled { background: var(--line); cursor: not-allowed; }

.chat-loader { display: none; padding: 8px 18px; gap: 8px; align-items: center; color: var(--ink-soft); font-size: 14px; }
.chat-loader.is-on { display: inline-flex; }
.chat-loader-dots { display: inline-flex; gap: 4px; }
.chat-loader-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); animation: bounce 1.2s infinite ease-in-out; }
.chat-loader-dots span:nth-child(2) { animation-delay: .15s; }
.chat-loader-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.4); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* Карта в модалке (для внутренних страниц) */
.modal-map { display: none; position: fixed; inset: 0; z-index: 80; background: rgba(16,35,58,.55); align-items: center; justify-content: center; padding: 20px; }
.modal-map.is-open { display: flex; }
.modal-map__inner { background: var(--paper); border-radius: var(--radius-lg); padding: 16px; width: 100%; max-width: 800px; max-height: 90vh; display: flex; flex-direction: column; gap: 12px; position: relative; }
.modal-map__close { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; border-radius: 50%; }
.modal-map__close:hover { background: var(--tint); }
.modal-map__title { font-size: 17px; font-weight: 600; padding-right: 40px; }
.modal-map__frame { flex: 1; min-height: 440px; border-radius: 12px; overflow: hidden; background: var(--tint); }
.modal-map__frame iframe { width: 100%; height: 100%; border: 0; display: block; min-height: 440px; }

@media (max-width: 720px) {
  .fab-chat { bottom: calc(76px + env(safe-area-inset-bottom)); right: 14px; }
  .fab-chat span { display: none; }
  .fab-chat { padding: 0; width: 52px; justify-content: center; }
}

/* Карточки товаров в ответе консультанта */
.chat-products { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.chat-product { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); transition: border-color .15s; }
.chat-product:hover { border-color: var(--ink); }
.chat-product__name { font-size: 14px; font-weight: 500; line-height: 1.3; }
.chat-product__meta { font-size: 13px; color: var(--ink-soft); }
.chat-product__meta b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.chat-product__meta s { color: var(--ink-mute); font-weight: 400; margin-left: 4px; }
.chat-product__meta .is-in { color: var(--green); }

/* ============================== footer ============================== */
.footer { border-top: 1px solid var(--line); padding: 28px 0; margin-top: 24px; font-size: 14px; color: var(--ink-soft); }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; align-items: center; }
.footer a { color: var(--blue-deep); }
.footer a:hover { text-decoration: underline; }
.footer__links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer__bottom { margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 13px; color: var(--ink-mute); }
.footer__bottom img { height: 18px; opacity: .7; }
.footer__bottom a:hover img { opacity: 1; }

/* Переключатель темы */
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font: inherit; font-size: 13px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle svg { width: 16px; height: 16px; }
