/* ============ Tajima Catalog — общие стили ============ */
:root {
  --black: #111214;
  --dark: #1c1d21;
  --yellow: #f5c400;
  --yellow-dark: #d4a900;
  --white: #ffffff;
  --gray-bg: #f4f4f5;
  --gray-line: #e3e3e6;
  --gray-text: #6b6c72;
  --green: #1e9e4a;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(17, 18, 20, .07);
  --shadow-hover: 0 8px 24px rgba(17, 18, 20, .14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: 'Montserrat', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--black);
  background: var(--white);
  line-height: 1.55;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ============ Шапка ============ */
.header {
  background: var(--black);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  min-width: 0;
}
.logo__badge { height: 28px; width: auto; flex: none; display: block; }
/* Логотип Висал АН: тёмный SVG — на белой плашке для тёмного фона */
.logo__visalm {
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  flex: none;
}
.logo__visalm img { height: 20px; width: auto; display: block; }
.footer__logo {
  height: 30px;
  width: auto;
  background: #fff;
  border-radius: 6px;
  padding: 5px 10px;
  box-sizing: content-box;
  display: block;
  margin-top: 28px;
}
.order-btn.order-btn--visalm {
  background: #fff;
  color: var(--black);
  border: 1px solid var(--gray-line);
  margin-top: 10px;
}
.order-btn.order-btn--visalm img { height: 26px; width: 26px; border-radius: 6px; object-fit: cover; }
.logo__sub {
  font-size: 11px;
  color: #b9bac0;
  letter-spacing: .04em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Поиск в шапке (тёмная тема) — рядом с поиском в заголовке раздела каталога (светлая тема ниже) */
.header__search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 20px;
  padding: 4px 4px 4px 14px;
  flex: 1;
  max-width: 260px;
  min-width: 130px;
}
.header__search input {
  background: none; border: none; outline: none; color: #fff; font: inherit; font-size: 13px; width: 100%;
}
.header__search input::placeholder { color: #9a9ba1; }
.header__search button {
  background: var(--yellow); border: none; border-radius: 50%; width: 24px; height: 24px; font-size: 11px; cursor: pointer; flex: none;
}
@media (max-width: 860px) { .header__search { order: 10; max-width: none; flex-basis: 100%; margin-top: 8px; } }

/* Поиск — встроен в заголовок раздела каталога, не в шапку (светлая тема) */
.section__head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.catalog-search {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--gray-line);
  border-radius: 20px;
  padding: 4px 4px 4px 16px;
  width: 100%;
  max-width: 320px;
  margin-top: 4px;
}
.catalog-search input {
  background: none;
  border: none;
  outline: none;
  font: inherit;
  font-size: 14px;
  color: var(--black);
  width: 100%;
}
.catalog-search input::placeholder { color: var(--gray-text); }
.catalog-search button {
  background: var(--yellow);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 13px;
  cursor: pointer;
  flex: none;
}
@media (max-width: 700px) { .catalog-search { max-width: none; } }

.header__contacts {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.header__phone {
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}
.header__phone:hover { color: var(--yellow); }
/* Мини-корзина в шапке */
.header__cart {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--white);
}
.header__cart svg { width: 22px; height: 22px; display: block; }
.header__cart:hover { color: var(--yellow); }
.header__cart-badge {
  position: absolute;
  top: -7px;
  right: -9px;
  background: var(--yellow);
  color: var(--black);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  border-radius: 50%;
  min-width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.msngr {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 20px;
  white-space: nowrap;
  transition: transform .15s, filter .15s;
}
.msngr:hover { transform: translateY(-1px); filter: brightness(1.1); }
.msngr svg, .msngr img { width: 16px; height: 16px; flex: none; display: block; }
.msngr--wa { background: #25d366; color: #fff; }
.msngr--tg { background: #2aabee; color: #fff; }
.msngr--max { background: linear-gradient(135deg, #4A7DF5 0%, #7C4CF0 55%, #9B3FE0 100%); color: #fff; }

/* ============ Hero ============ */
.hero {
  background: linear-gradient(135deg, var(--black) 0%, #26272c 60%, #3a3b40 100%);
  color: var(--white);
  /* Снизу отступа нет: его задаёт полоса-ремарка (.hero__joke-bar), чтобы
     текст в ней стоял ровно посередине, а не прижимался к линии сверху. */
  padding: 64px 0 0;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -80px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(245, 196, 0, .18) 0%, transparent 70%);
}
/* Сетка hero: текст слева, слайдер-витрина справа */
.hero__grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 56px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero__slide {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
}
.hero__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 28px 28px 78px;
  box-sizing: border-box;
  transition: opacity .35s;
}
.hero__slide-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(17, 18, 20, .85);
  color: #fff;
  padding: 12px 16px 15px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  min-height: 64px;
  display: flex;
  align-items: center;
}
.hero__slide-caption span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero__slide:hover .hero__slide-caption { background: rgba(17, 18, 20, .95); }
.hero__slide-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, .18);
}
.hero__slide-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--yellow);
}
@keyframes hs-bar { from { width: 0; } to { width: 100%; } }

/* Полоса-ремарка под hero: короткая шутка, меняется вместе со слайдером
   товаров (см. initHeroJokes в js/app.js).
   Все правила компонента держим здесь одним куском, включая мобильные —
   разнесённые по разным брейкпоинтам куски уже один раз ломали корзину.
   min-height задан под две строки: без него смена текста дёргает вёрстку.
   Правила .hero p (крупный шрифт, max-width 560px) приходится перебивать
   явно — ремарка это подпись, а не абзац. */
/* Полоса лежит СНАРУЖИ .container — она тянется во всю ширину страницы,
   а не по сетке текста. Внутренние отступы повторяют контейнер, чтобы текст
   всё же начинался по одной линии с заголовком. */
.hero__joke-bar {
  position: relative;
  z-index: 1;
  margin-top: 44px;
}
.hero .hero__joke {
  margin: 0 auto;
  max-width: 1180px;
  padding: 18px 20px;
  font-size: 16px;
  font-style: italic;
  line-height: 1.45;
  letter-spacing: .01em;
  min-height: 42px;
  transition: opacity .25s ease;
}
.hero .hero__joke.is-fading { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .hero .hero__joke { transition: none; }
}
@media (max-width: 600px) {
  .hero__joke-bar { margin-top: 30px; }
  .hero .hero__joke { font-size: 15px; min-height: 60px; }
}

/* --- Вариант A: жёлтая линия во всю ширину страницы, текст с тёплым оттенком --- */
.hero__joke-bar--a { border-top: 1px solid rgba(245, 196, 0, .5); }
.hero__joke-bar--a .hero__joke { color: #cbbe92; }

/* --- Вариант B: без линии, жёлтая кавычка-ёлочка перед текстом, по центру --- */
.hero__joke-bar--b .hero__joke {
  text-align: center;
  color: #d7cba3;
}
.hero__joke-bar--b .hero__joke::before {
  content: '«';
  color: var(--yellow);
  font-style: normal;
  font-weight: 700;
  margin-right: 6px;
}
.hero__joke-bar--b .hero__joke::after {
  content: '»';
  color: var(--yellow);
  font-style: normal;
  font-weight: 700;
  margin-left: 6px;
}

/* --- Вариант C: тёмная плашка во всю ширину, жёлтые линии сверху и снизу --- */
.hero__joke-bar--c {
  background: rgba(0, 0, 0, .28);
  border-top: 1px solid rgba(245, 196, 0, .45);
  border-bottom: 1px solid rgba(245, 196, 0, .45);
}
.hero__joke-bar--c .hero__joke {
  text-align: center;
  color: #ded3b0;
  padding: 16px 20px;
  min-height: 58px;
}

/* --- Вариант D: жёлтая линия сверху + жирная засечка слева у текста --- */
.hero__joke-bar--d { border-top: 1px solid rgba(255, 255, 255, .12); }
.hero__joke-bar--d .hero__joke {
  position: relative;
  color: #cfc59f;
  padding-left: 34px;
}
.hero__joke-bar--d .hero__joke::before {
  content: '';
  position: absolute;
  left: 20px; top: 22px;
  width: 3px; height: 20px;
  background: var(--yellow);
  border-radius: 2px;
}

@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__slide { display: none; }
}

.hero__badge {
  display: inline-block;
  background: var(--yellow);
  color: var(--black);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.hero h1 {
  /* Нижняя граница 26px, а не 30px: слово «Профессиональный» при 30px/800
     занимает 336px, а на экране 375px под текст доступно ровно 336 — зазор
     нулевой, и на телефонах уже 376px слово обрезается (у .hero включён
     overflow:hidden, поэтому вместо переноса виден обрубок «Профессиональнь»).
     На больших экранах правка ничего не меняет: там работает не минимум,
     а 4.5vw. Проверять такие вещи надо шириной ТЕКСТА (measureText или
     scrollWidth), а не рамкой блока — рамка всегда влезает. */
  font-size: clamp(26px, 4.5vw, 48px);
  /* Страховка на случай экранов уже 320px и другой метрики шрифта на реальном
     устройстве: если слово всё же не влезет, оно перенесётся, а не обрежется.
     На обычных телефонах не срабатывает — при 26px слово влезает. */
  overflow-wrap: break-word;
  font-weight: 800;
  line-height: 1.15;
  max-width: 700px;
}
.hero h1 span { color: var(--yellow); }
.hero p {
  margin-top: 18px;
  font-size: 17px;
  color: #c9cad0;
  max-width: 560px;
}
.hero__cta {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 13px 26px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: transform .15s, filter .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn--yellow { background: var(--yellow); color: var(--black); }
.btn--yellow:hover { background: var(--yellow-dark); }
.btn--outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, .35);
}
.btn--outline:hover { border-color: var(--yellow); color: var(--yellow); }

/* ============ Преимущества ============ */
.trust {
  background: var(--gray-bg);
  padding: 36px 0;
  border-bottom: 1px solid var(--gray-line);
}
.trust__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.trust__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.trust__icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.trust__item b { display: block; font-size: 15px; }
.trust__item small { color: var(--gray-text); font-size: 13px; }

/* ============ Секции ============ */
.section { padding: 56px 0; }
.section__title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  margin-bottom: 8px;
}
.section__subtitle {
  color: var(--gray-text);
  margin-bottom: 32px;
}

/* ============ Плитки категорий ============ */
.cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.cat-card {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cat-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--yellow);
}
.cat-card__icon { color: var(--yellow-dark); }
.cat-card__icon svg, .cat-card__icon img { width: 38px; height: 38px; display: block; object-fit: contain; }
.cat-tab svg, .cat-tab img { width: 15px; height: 15px; vertical-align: -2.5px; margin-right: 5px; object-fit: contain; }
.cat-card__name { font-size: 18px; font-weight: 700; }
.cat-card__count { color: var(--gray-text); font-size: 14px; }
.cat-card__link {
  margin-top: auto;
  padding-top: 10px;
  color: var(--yellow-dark);
  font-weight: 700;
  font-size: 14px;
}

/* ============ Карточки товаров ============ */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}
.p-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.p-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
/* Вся карточка кликабельна через растянутую ссылку (position:absolute поверх
   всей карточки, z-index:1); кнопка «В корзину» лежит выше (z-index:2) и не
   срабатывает переход на страницу товара — итоговый li/div сам не является <a>,
   чтобы <button> внутри не оказался вложенной интерактивностью в <a>. */
.p-card__stretched-link { position: absolute; inset: 0; z-index: 1; }
.cart-btn {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--gray-line);
  background: var(--white);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.cart-btn:hover { border-color: var(--yellow-dark); color: var(--yellow-dark); }
.cart-btn:disabled { opacity: .7; cursor: default; }

/* Слот «В корзину» на карточке товара — над растянутой ссылкой (z-index:2, как
   у .cart-btn), поэтому клик по степперу не проваливается в переход на товар.
   Заполняется JS-функцией refreshCartSlots() и остаётся в двух устойчивых
   состояниях: кнопка добавления (товара ещё нет в корзине) или степпер
   с количеством (уже добавлен) — без этого статус «добавлено» пропадал
   через секунду и терялся при переходах по каталогу. */
.cart-slot { position: relative; z-index: 2; margin-top: 8px; }
.cart-slot .cart-btn { margin-top: 0; }
.cart-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--yellow-dark);
  background: #fffbea;
  border-radius: 8px;
  overflow: hidden;
}
.cart-stepper__btn {
  width: 30px; height: 32px;
  border: none;
  background: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--yellow-dark);
  cursor: pointer;
  flex: none;
}
.cart-stepper__btn:hover { background: var(--yellow); color: var(--black); }
.cart-stepper__count {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
}
.cart-stepper__count small { font-weight: 500; color: var(--gray-text); margin-left: 3px; }
/* Крупный вариант степпера — на странице товара (product.php), где блок
   заказа заметно шире карточки в каталоге */
.cart-stepper--page { flex: none; min-width: 190px; }
.cart-stepper--page .cart-stepper__btn { width: 42px; height: 44px; font-size: 20px; }
.cart-stepper--page .cart-stepper__count { font-size: 15px; }
.cart-box__link { align-self: center; font-weight: 700; font-size: 14px; color: var(--yellow-dark); }
.cart-box__link:hover { text-decoration: underline; }
.p-card__img {
  aspect-ratio: 1 / 1;
  background: var(--white);
  padding: 18px;
  overflow: hidden;
  position: relative;
}
.p-card__img img { width: 100%; height: 100%; object-fit: contain; }

/* Водяной знак «Акция» — CSS-наложение поверх фото, не запекается в файл
   картинки (важно: в фиде/маркетплейсе должно остаться чистое фото). */
.badge-sale {
  position: absolute;
  top: 10px;
  left: -30px;
  width: 130px;
  transform: rotate(-45deg);
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
  padding: 4px 0;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  pointer-events: none;
  z-index: 2;
}
.p-card__body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  border-top: 1px solid var(--gray-line);
}
.p-card__name {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}
.p-card__sku { color: var(--gray-text); font-size: 12.5px; }
/* Цена и наличие в карточке. У акционных товаров цена длиннее (текущая +
   зачёркнутая старая), и «В наличии» разрывалось на две строки. Поэтому:
   цене разрешено переноситься внутри себя, а плашке наличия — нет
   (flex:none + nowrap), она всегда остаётся одной строкой справа. */
.p-card__bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.p-card__price { font-size: 18px; font-weight: 800; min-width: 0; }
.p-card__bottom .stock { flex: none; white-space: nowrap; }
.stock {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.stock::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.stock--out { color: var(--gray-text); }
.stock--out::before { background: #c8c9ce; }

/* ============ Акции, описание, характеристики ============ */
.price-old { color: var(--gray-text); font-weight: 600; font-size: .75em; margin-left: 6px; }
.price-old--big { font-size: .5em; }
.sale-badge {
  display: inline-block;
  background: #e74c3c;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  vertical-align: middle;
  margin-left: 8px;
}
.product-page__desc { margin: 0 0 18px; color: #3a3b40; max-width: 560px; }
.product-page__specs { margin-bottom: 22px; }
.product-page__specs h3 { font-size: 16px; margin-bottom: 10px; }
.product-page__specs table { border-collapse: collapse; width: 100%; max-width: 560px; font-size: 14px; }
.product-page__specs td { padding: 7px 10px; border-bottom: 1px solid var(--gray-line); }
.product-page__specs td:first-child { color: var(--gray-text); width: 45%; }
/* Комплектация набора — маркированный список, маркеры в акцентном цвете */
.kit-list { list-style: none; padding: 0; margin: 0; max-width: 560px; }
.kit-list li { position: relative; padding-left: 18px; margin-bottom: 8px; font-size: 14px; line-height: 1.5; color: #3a3b40; }
.kit-list li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow-dark); }

/* ============ Страница категории ============ */
.breadcrumbs {
  padding: 18px 0 0;
  font-size: 13.5px;
  color: var(--gray-text);
}
.breadcrumbs a:hover { color: var(--yellow-dark); }
.cat-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0 30px;
}
.cat-tab {
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--gray-line);
  background: var(--white);
  cursor: pointer;
  transition: all .15s;
}
.cat-tab:hover { border-color: var(--yellow); }
.cat-tab.active { background: var(--black); color: var(--yellow); border-color: var(--black); }

/* ============ Карточка товара ============ */
.product-page {
  display: grid;
  grid-template-columns: minmax(280px, 480px) 1fr;
  gap: 48px;
  padding: 36px 0 64px;
}
.product-page__img {
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  padding: 30px;
  aspect-ratio: 1 / 1;
  background: var(--white);
  overflow: hidden;
  position: relative;
}
.product-page__img img { width: 100%; height: 100%; object-fit: contain; }
.product-page h1 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; line-height: 1.25; }
.product-page__sku { color: var(--gray-text); margin-top: 10px; font-size: 14.5px; }
.product-page__price-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 22px 0 6px;
  flex-wrap: wrap;
}
.product-page__price { font-size: 34px; font-weight: 800; }
.product-page__note { color: var(--gray-text); font-size: 13px; margin-bottom: 24px; }
.order-box {
  background: var(--gray-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 10px;
}
.order-box__title { font-weight: 700; margin-bottom: 14px; }
.order-box__btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.order-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  transition: transform .15s, filter .15s;
}
.order-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.order-btn svg, .order-btn img { width: 22px; height: 22px; flex: none; display: block; object-fit: contain; }
.order-btn--wa { background: #25d366; }
.order-btn--tg { background: #2aabee; }
.order-btn--max { background: linear-gradient(135deg, #4A7DF5 0%, #7C4CF0 55%, #9B3FE0 100%); }
.order-btn--phone { background: var(--black); color: var(--yellow); }
.order-box__source {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--gray-text);
  text-decoration: underline;
}
.order-box__source:hover { color: var(--black); }

/* ============ О компании ============ */
.about {
  background: var(--black);
  color: var(--white);
  padding: 56px 0;
}
.about h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; }
.about h2 span { color: var(--yellow); }
.about p { margin-top: 16px; color: #c9cad0; max-width: 760px; }

/* ============ Подвал ============ */
.footer {
  background: var(--dark);
  color: #b9bac0;
  padding: 40px 0 30px;
  font-size: 14px;
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}
.footer b { color: var(--white); display: block; margin-bottom: 10px; font-size: 15px; }
.footer a:hover { color: var(--yellow); }
.footer__contact { display: block; margin-bottom: 6px; }
/* Колонки подвала — flex, чтобы логотип и карта прижимались к низу на одну линию */
.footer__grid > div { display: flex; flex-direction: column; align-items: flex-start; }
.footer__logolink { display: block; margin-top: auto; padding-top: 18px; }
.footer__logolink .footer__logo { margin-top: 0; }
.footer__map { display: block; margin-top: auto; padding-top: 18px; max-width: 210px; width: 100%; }
.footer__map img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #34353b;
  display: block;
  transition: filter .2s;
}
.footer__map:hover img { filter: brightness(1.15); }
.footer__bottom {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid #34353b;
  font-size: 12.5px;
  color: #85868d;
}

/* ============ Добавление в корзину на странице товара ============ */
.cart-box { display: flex; align-items: center; gap: 14px; margin: 20px 0; }
.cart-box__qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--gray-line);
  border-radius: 8px;
  overflow: hidden;
  flex: none;
}
.qty-btn {
  width: 36px;
  height: 42px;
  border: none;
  background: var(--gray-bg);
  font-size: 18px;
  cursor: pointer;
}
.qty-btn:hover { background: var(--gray-line); }
.cart-box__qty input {
  width: 48px;
  height: 42px;
  border: none;
  border-left: 1px solid var(--gray-line);
  border-right: 1px solid var(--gray-line);
  text-align: center;
  font: inherit;
  font-size: 15px;
}
.cart-box .cart-btn {
  flex: 1;
  margin-top: 0;
  padding: 12px 16px;
  background: var(--yellow);
  border-color: var(--yellow);
  font-size: 14.5px;
}
.cart-box .cart-btn:hover { background: var(--yellow-dark); border-color: var(--yellow-dark); color: var(--black); }

/* ============ Страница корзины ============ */
.cart-list { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; }
.cart-row {
  display: grid;
  grid-template-columns: 72px 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
}
.cart-row__img { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--gray-bg); }
.cart-row__img img { width: 100%; height: 100%; object-fit: contain; }
.cart-row__name { font-weight: 600; font-size: 14.5px; }
.cart-row__name a:hover { color: var(--yellow-dark); }
.cart-row__sku { color: var(--gray-text); font-size: 12.5px; margin-top: 3px; }
.cart-row__price { font-weight: 800; font-size: 15px; white-space: nowrap; }
.cart-row__price small { display: block; font-weight: 500; color: var(--gray-text); font-size: 12px; }
.cart-row__remove {
  border: none; background: none; color: var(--gray-text); cursor: pointer; font-size: 13px; text-decoration: underline;
}
.cart-row__remove:hover { color: #c0392b; }
.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  border-top: 2px solid var(--gray-line);
  margin-top: 6px;
}
.cart-summary__total { font-size: 20px; font-weight: 800; }
.cart-empty { color: var(--gray-text); padding: 30px 0; }
@media (max-width: 560px) {
  /* Все 4 прямых потомка .cart-row переразмечены на этом же брейкпоинте разом
     (картинка+инфо в первой строке, степпер и цена/удаление — на всю ширину
     под ними) — если развести по разным медиа-запросам, степпер количества
     зажмётся в узкую колонку 56px и «+» пропадёт (был баг, так уже случалось). */
  .cart-row { grid-template-columns: 56px 1fr; }
  .cart-row__img { width: 56px; height: 56px; }
  .cart-row__info { grid-column: 2; }
  .cart-box__qty { grid-column: 1 / -1; margin-top: 10px; }
  .cart-row__meta { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
}

/* ============ Юридические страницы (о компании, доставка, ПДн, оферта) ============ */
.legal-page { max-width: 760px; padding: 26px 0 60px; }
.legal-page h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; margin-bottom: 22px; }
.legal-page h2 { font-size: 18px; font-weight: 700; margin: 28px 0 10px; }
.legal-page p, .legal-page li { color: #3a3b40; margin-bottom: 12px; }
.legal-page ul, .legal-page ol { padding-left: 22px; margin-bottom: 12px; }
.legal-page table { border-collapse: collapse; width: 100%; margin: 6px 0 20px; font-size: 14.5px; }
.legal-page td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--gray-line); vertical-align: top; }
.legal-page td:first-child { color: var(--gray-text); width: 42%; }
.legal-page .legal-note { background: var(--gray-bg); border-radius: var(--radius); padding: 14px 18px; font-size: 14px; color: var(--gray-text); margin: 10px 0 20px; }
.legal-page .legal-note--accent { border-left: 3px solid var(--yellow-dark); }

/* Страница «Доставка и оплата» — две карточки (доставка/самовывоз) + карта +
   тёмная плашка контактов, по образцу visalm.ru/dostavka/, но в своей палитре
   (жёлтый акцент вместо их красного) и с инлайн-SVG иконками вместо эмодзи. */
.delivery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 20px 0 28px;
}
.delivery-card {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.delivery-card__icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-bg);
  border-radius: 10px;
  color: var(--yellow-dark);
  margin-bottom: 12px;
}
.delivery-card__icon svg { width: 22px; height: 22px; }
.delivery-card h2 {
  margin: 0 0 6px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--yellow);
  display: inline-block;
}
.delivery-list { list-style: none; padding: 0; margin: 14px 0; }
.delivery-list li { padding: 10px 0; border-bottom: 1px solid var(--gray-line); }
.delivery-list li:last-child { border-bottom: none; }
.delivery-list b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.delivery-list span { color: var(--gray-text); font-size: 13.5px; }
.delivery-map { display: block; margin-top: 16px; position: relative; }
.delivery-map img { border-radius: 8px; border: 1px solid var(--gray-line); }
.delivery-map span { display: block; text-align: center; margin-top: 6px; font-size: 13px; color: var(--yellow-dark); font-weight: 600; }
.delivery-map:hover span { text-decoration: underline; }

.contact-bar {
  background: var(--dark);
  color: #c9cad0;
  border-radius: var(--radius);
  padding: 24px 26px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}
.contact-bar__title { grid-column: 1 / -1; color: var(--white); font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.contact-bar b { display: block; color: var(--white); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 10px; }
.contact-bar a { display: block; margin-bottom: 6px; }
.contact-bar a:hover { color: var(--yellow); }

@media (max-width: 860px) {
  .delivery-grid { grid-template-columns: 1fr; }
  .contact-bar { grid-template-columns: 1fr; }
}

/* ============ Оформление заказа ============ */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; margin: 20px 0 60px; align-items: start; }
.checkout-form {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13.5px; font-weight: 600; }
.field__label i { color: #c0392b; font-style: normal; }
/* :not([type=radio]):not([type=checkbox]) — иначе этот же селектор растягивает
   на всю ширину и радиокнопки/чекбоксы, вложенные внутрь .field (они тоже
   технически "input" внутри .field), превращая их в огромные invisible-боксы. */
.field input:not([type="radio"]):not([type="checkbox"]), .field textarea {
  border: 1px solid var(--gray-line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  width: 100%;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--yellow-dark); }
.field textarea { resize: vertical; }
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.radio input { flex: none; width: auto; }
.checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--gray-text); cursor: pointer; }
.checkbox input { margin-top: 3px; flex: none; width: auto; }
.checkbox a { color: var(--black); text-decoration: underline; }
/* Honeypot-поле от спам-ботов — скрыто визуально, но доступно ботам, заполняющим все поля подряд */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.checkout-summary {
  background: var(--gray-bg);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 20px;
}
.checkout-summary h2 { font-size: 16px; margin-bottom: 14px; }
/* Позиция в сводке заказа — кликабельная ссылка на карточку товара (открывается
   в новой вкладке, чтобы не терять заполненную форму) с миниатюрой для быстрой
   визуальной сверки «то ли я кладу». */
/* Блок реквизитов юрлица. display задаётся классом, а НЕ инлайновым стилем:
   инлайновый display перебивает браузерное правило [hidden]{display:none},
   и блок оставался видимым при снятой галке (реальный баг, пойман на тесте). */
.company-fields { display: flex; flex-direction: column; gap: 16px; }
.company-fields[hidden] { display: none; }

.field__hint { display: block; font-size: 12px; color: var(--gray-text); margin-top: 4px; }
.form-error {
  background: #fdeaea;
  border: 1px solid #f2c4c4;
  color: #8c2318;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 14px;
}

.checkout-summary__row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-line);
  transition: opacity .15s;
}
.checkout-summary__row:hover { opacity: .65; }
.checkout-summary__img {
  width: 44px; height: 44px;
  object-fit: contain;
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: 6px;
}
.checkout-summary__name { line-height: 1.35; }
.checkout-summary__price { font-weight: 700; white-space: nowrap; }
.checkout-summary__total { display: flex; justify-content: space-between; font-size: 17px; font-weight: 800; margin-top: 14px; padding-top: 14px; border-top: 2px solid var(--gray-line); }

.order-success { max-width: 520px; margin: 0 auto; padding: 50px 20px 70px; text-align: center; }
.order-success__icon { width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%; background: var(--yellow); display: flex; align-items: center; justify-content: center; }
.order-success__icon svg { width: 30px; height: 30px; }
.order-success h1 { font-size: clamp(22px, 3vw, 28px); margin-bottom: 14px; }
.order-success__number { font-size: 18px; margin-bottom: 16px; }
.order-success p { color: var(--gray-text); margin-bottom: 24px; }
/* Ремарка под кнопкой — тише делового текста, отделена воздухом */
.order-success__note {
  margin: 26px 0 0;
  font-size: 14px;
  font-style: italic;
  color: #9a9ba1;
}

/* ============ Страница 404 (404.php) ============ */
/* Все правила компонента держим одним куском, включая мобильные. */
.notfound { max-width: 620px; margin: 0 auto; padding: 44px 20px 70px; text-align: center; }
.notfound__code {
  font-size: clamp(64px, 12vw, 104px);
  font-weight: 800;
  line-height: 1;
  color: var(--yellow);
  letter-spacing: -.02em;
}
.notfound h1 { font-size: clamp(22px, 3vw, 28px); margin: 10px 0 12px; }
.notfound__lead { color: var(--gray-text); margin-bottom: 26px; }
.notfound__search { max-width: 380px; margin: 0 auto 24px; }
.notfound__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
/* .btn--outline белая — она сделана для тёмного hero. На светлой странице
   404 её попросту не видно, поэтому здесь перекрашиваем в тёмную. */
.notfound__actions .btn--outline { color: var(--black); border-color: var(--gray-line); }
.notfound__actions .btn--outline:hover { color: var(--black); border-color: var(--yellow); }
.notfound__cats {
  border-top: 1px solid var(--gray-line);
  padding-top: 22px;
  font-size: 14px;
}
.notfound__cats ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  margin-top: 12px;
}
.notfound__cats a { color: var(--gray-text); border-bottom: 1px solid transparent; }
.notfound__cats a:hover { color: var(--black); border-bottom-color: var(--yellow); }
.notfound__joke {
  margin-top: 34px;
  font-size: 14px;
  font-style: italic;
  color: #9a9ba1;
}
@media (max-width: 600px) {
  .notfound { padding-top: 30px; }
  .notfound__actions .btn { width: 100%; }
}

@media (max-width: 860px) {
  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-summary { position: static; }
}

/* ============ Адаптив ============ */
@media (max-width: 860px) {
  .product-page { grid-template-columns: 1fr; gap: 28px; }
  .header__phone { font-size: 14px; }
  /* .header__search переходит на новую строку с этой же ширины (order:10 выше) —
     без flex-wrap здесь родитель остаётся nowrap, а flex-basis:100% у поиска
     ломает шапку, сжимая логотип и контакты */
  .header__inner { flex-wrap: wrap; row-gap: 4px; }
}
@media (max-width: 640px) {
  .logo__badge { height: 24px; }
  .header__contacts .msngr span { display: none; }
  .msngr { padding: 8px 10px; }
  .hero { padding: 44px 0 52px; }
}
