/* =========================================================
   AGIBOT × ТрейдМи — landing
   Визуальный стиль: индиго-акцент, спокойная типографика.
   Две темы. По умолчанию — из админки (Роботы → Настройки сайта → Оформление),
   посетитель меняет её кнопкой в шапке, выбор хранится в его браузере.
   Тема приходит в <html data-theme>: все цвета заданы переменными, тёмная — базовая.
   ========================================================= */

/* Тёмная тема. Подвал остаётся в ней и при светлой */
:root, .footer {
  --bg: #1b1b1b;
  --bg-alt: #141414;
  --surface: #262626;
  --surface-2: #2e2e2e;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --text: #ffffff;
  --text-2: #d6d6d6;
  --muted: #9b9b9b;
  --accent: #5b4fe9;
  --accent-hover: #6e63f2;
  --accent-soft: rgba(91, 79, 233, .16);
  --ok: #7dd87d;
  --err: #ff6b6b;
  --header-bg: rgba(27, 27, 27, .92);
  --bar-bg: rgba(27, 27, 27, .96);
  --overlay: rgba(0, 0, 0, .7);
  --hero-bg:
    radial-gradient(50% 90% at 100% 0%, rgba(47, 141, 240, .22) 0%, rgba(47, 141, 240, 0) 70%),
    radial-gradient(60% 90% at 70% 110%, rgba(91, 79, 233, .3) 0%, rgba(91, 79, 233, 0) 70%),
    #141414;
  --hero-glow: radial-gradient(closest-side, rgba(91, 79, 233, .5) 0%, rgba(91, 79, 233, .3) 70%, rgba(91, 79, 233, 0) 100%);
  --hero-lines: .55;
  --hero-floor: rgba(255, 255, 255, .12);
  --hero-card: rgba(255, 255, 255, .07);
  --robot-shadow: rgba(0, 0, 0, .55);
}

/* Светлая тема */
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f5f5fa;
  --surface: #f5f5fa;
  --surface-2: #ebebf3;
  --line: rgba(28, 28, 46, .1);
  --line-2: rgba(28, 28, 46, .2);
  --text: #1c1c24;
  --text-2: #4b4b58;
  --muted: #6e6e7c;
  --accent-hover: #4a3ed8;
  --accent-soft: rgba(91, 79, 233, .1);
  --ok: #1c8f4e;
  --err: #d6363f;
  --header-bg: rgba(255, 255, 255, .92);
  --bar-bg: rgba(255, 255, 255, .96);
  --overlay: rgba(20, 20, 35, .55);
  --hero-bg:
    radial-gradient(55% 90% at 6% 0%, #e6e0ff 0%, rgba(230, 224, 255, 0) 70%),
    radial-gradient(50% 85% at 100% 0%, #c9e0ff 0%, rgba(201, 224, 255, 0) 72%),
    radial-gradient(70% 90% at 72% 112%, #d5c9ff 0%, rgba(213, 201, 255, 0) 72%),
    #f5f3ff;
  --hero-glow: radial-gradient(closest-side, #cfc5ff 0%, #dcd5ff 72%, rgba(220, 213, 255, 0) 100%);
  --hero-lines: .4;
  --hero-floor: rgba(255, 255, 255, .85);
  --hero-card: rgba(255, 255, 255, .85);
  --robot-shadow: rgba(50, 40, 120, .22);
}
/* Карточки контрастнее фона секции: на сером — белые, на белом — серые */
:root[data-theme="light"] .section--alt { --surface: #ffffff; --surface-2: #f7f7fb; }
:root[data-theme="light"] .modal__box { --surface: #ffffff; --surface-2: #f5f5fa; --bg: #f5f5fa; }
/* Фото роботов сняты на белом: multiply растворяет этот белый в фоне карточки,
   поэтому у картинки появляются границы, и она не висит в воздухе */
:root[data-theme="light"] .media--light { background: var(--surface); }
:root[data-theme="light"] .media--light img { mix-blend-mode: multiply; }
:root[data-theme="light"] .item .media--light { background: none; }
/* В статьях картинки с текстом и своим белым полем: растворять их незачем */
:root[data-theme="light"] .post-card .media--light,
:root[data-theme="light"] .post-cover.media--light { background: #fff; }
:root[data-theme="light"] .post-card .media--light img,
:root[data-theme="light"] .post-cover.media--light img { mix-blend-mode: normal; }
/* Логотипы и значок переключателя: в разметке вариант для каждой темы */
:root[data-theme="light"] .only-dark,
:root[data-theme="dark"] .only-light { display: none; }

:root {
  --tg: #229ed9;

  --radius: 12px;
  --radius-lg: 16px;
  --gutter: clamp(16px, 3vw, 32px);
  --maxw: 1360px;
  --header-h: 76px;

  --font: "Onest", "PT Sans Caption", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }
p, figure { margin: 0; }
address { font-style: normal; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- typography ---------- */
.h2 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 400; }
.eyebrow { margin-bottom: 6px; font-size: 14px; color: var(--muted); }
.section__lead { margin-top: 8px; font-size: 17px; color: var(--text-2); max-width: 760px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 26px;
  border-radius: 999px;
  font: 500 15px/1 var(--font);
  white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--outline { border: 1px solid var(--line-2); color: var(--text); }
.btn--outline:hover { border-color: var(--text); }
.btn--light { background: #fff; color: #1b1b1b; }
.btn--light:hover { background: #ececec; }
.btn--tg { background: var(--tg); color: #fff; }
.btn--tg:hover { background: #1b8bc2; }
.btn--tg svg { width: 16px; height: 16px; fill: currentColor; }
/* Кнопка на trade-mi.ru: логотип вместо текста */
.btn--trademi { flex: none; padding: 0 14px; }
.trademi-logo { flex: none; width: auto; max-width: none; height: 32px; }
.btn--xs .trademi-logo { height: 26px; }
.btn--sm { height: 44px; padding: 0 22px; font-size: 14px; }
.btn--xs { height: 38px; padding: 0 16px; font-size: 13px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header__inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.logo { display: inline-flex; flex-direction: column; line-height: 1; }
.logo__img { display: block; width: auto; height: 26px; }
.footer .logo__img { height: 30px; }
.logo__sub { margin-top: 7px; font-size: 10px; line-height: 1.2; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
/* В шапке логотип и подпись в один ряд, через тонкий разделитель */
.header .logo { flex-direction: row; align-items: center; gap: 12px; flex: none; }
.header .logo__sub { margin-top: 0; padding-left: 12px; border-left: 1px solid var(--line-2); }
.nav { display: flex; gap: 24px; font-size: 14px; font-weight: 500; }
.nav a { white-space: nowrap; transition: color .2s; }
.nav a:hover { color: var(--accent-hover); }
.nav__trademi { display: none; }
.header__actions { flex: none; display: flex; align-items: center; gap: 16px; margin-left: auto; }
.header__phone { font-weight: 600; font-size: 15px; white-space: nowrap; }
.theme-toggle {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line-2); border-radius: 50%;
  transition: border-color .2s;
}
.theme-toggle:hover { border-color: var(--text); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.burger { display: none; width: 44px; height: 44px; position: relative; }
.burger span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--text); transition: transform .3s var(--ease), top .3s; }
.burger span:first-child { top: 17px; }
.burger span:last-child { top: 25px; }
.burger[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: calc(var(--header-h) + clamp(14px, 2vw, 28px)) 0 clamp(16px, 2vw, 28px);
  overflow: hidden;
  background: var(--hero-bg);
}
/* Фон баннера: волны и сетка точек, как на промо-картинках */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: url("../img/hero-lines.svg?v=2") right bottom / cover no-repeat;
  opacity: var(--hero-lines);
}
.hero::after {
  content: ""; position: absolute; top: 0; right: 0;
  width: 44%; height: 72%;
  background: radial-gradient(circle, var(--accent) 1.3px, transparent 1.6px) 0 0 / 22px 22px;
  opacity: .3;
  -webkit-mask-image: radial-gradient(farthest-side at 100% 0, #000 15%, transparent 100%);
  mask-image: radial-gradient(farthest-side at 100% 0, #000 15%, transparent 100%);
}
.hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.hero__tag {
  display: inline-block;
  margin-bottom: 14px; padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(91, 79, 233, .45);
  font-size: 13px; font-weight: 500;
}
.hero__title { max-width: 680px; font-size: clamp(36px, 4.6vw, 62px); font-weight: 400; line-height: 1.08; }
.hero__lead { margin-top: 12px; max-width: 520px; font-size: clamp(17px, 1.4vw, 19px); color: var(--text-2); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
/* Фокусные модели: обе целиком, на одной линии пола, под каждой название и цена */
.hero__stage { position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 12px; }
.hero__stage::before {
  content: ""; position: absolute; left: 50%; top: 46%;
  width: min(118%, 640px); aspect-ratio: 1;
  border-radius: 50%;
  background: var(--hero-glow);
  transform: translate(-50%, -50%);
}
/* Пол под роботами, чтобы они стояли, а не висели */
.hero__stage::after {
  content: ""; position: absolute; left: -4%; right: -4%; bottom: 36px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--hero-floor), transparent);
}
.hero__robot { position: relative; z-index: 1; display: grid; justify-items: center; gap: 10px; transition: transform .25s var(--ease); }
.hero__robot:hover { transform: translateY(-6px); }
.hero__robot img { width: auto; filter: drop-shadow(0 16px 14px var(--robot-shadow)); }
.hero__robot--x2 img { height: clamp(300px, 31vw, 430px); }
.hero__robot--c5 img { height: clamp(190px, 19.5vw, 270px); }
.hero__caption {
  display: grid; gap: 2px;
  padding: 7px 16px;
  border-radius: var(--radius);
  background: var(--hero-card);
  text-align: center; font-size: 14px; color: var(--text-2);
}
.hero__caption b { font-size: 16px; font-weight: 600; color: var(--text); }

/* ---------- facts ---------- */
.facts { background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.facts__inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.fact { padding: 14px 20px 14px 0; }
.fact + .fact { padding-left: 24px; border-left: 1px solid var(--line); }
.fact b { display: block; font-size: clamp(28px, 3vw, 40px); font-weight: 500; line-height: 1; }
.fact span { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }

/* ---------- sections ---------- */
.section { padding: clamp(26px, 3.4vw, 44px) 0; }
.section--alt { background: var(--bg-alt); }
.section__head { margin-bottom: 18px; max-width: 900px; }
.section__head--row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* ---------- use cases ---------- */
.uses { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.use {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  transition: background .25s, transform .25s var(--ease);
}
.use:hover { background: var(--surface-2); transform: translateY(-4px); }
.use__icon { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--accent-soft); fill: none; stroke: var(--accent-hover); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.use h3 { margin: 10px 0 4px; font-size: 17px; }
.use p { color: var(--muted); font-size: 15px; }

/* ---------- media ---------- */
.media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.media::before {
  content: attr(data-label);
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 14px; color: var(--muted);
}
.media:has(img)::before { content: none; }
.media img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.media--light { background: #fff; }
.media--light::before { color: #9a9a9a; }
.media--light img { object-fit: contain; padding: 6%; }

/* ---------- product ---------- */
.product__top { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(16px, 3vw, 40px); align-items: center; }
.product__top--reverse .product__media { order: 2; }
.product__media { aspect-ratio: 3 / 2; border: 1px solid var(--line); }
.badge {
  position: absolute; top: 16px; left: 16px; z-index: 1;
  padding: 7px 14px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 500;
}
.product__sku { margin-top: 8px; font-size: 14px; color: var(--muted); }
.product__summary { margin-top: 10px; font-size: 17px; color: var(--text-2); }
.price { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; }
.price__from { color: var(--muted); }
.price__val { font-size: clamp(30px, 3.2vw, 42px); font-weight: 600; line-height: 1; }
.product__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.checks { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.checks li { position: relative; padding-left: 32px; color: var(--text-2); }
.checks li b { color: var(--text); font-weight: 600; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.features { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 16px; }
.feature {
  grid-column: span 2;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
}
.feature:nth-child(4), .feature:nth-child(5) { grid-column: span 3; }
.feature h3 { font-size: 16px; margin-bottom: 4px; }
.feature p { font-size: 15px; color: var(--muted); }

.specs { margin-top: 10px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); }
.specs__title { font-size: 19px; margin-bottom: 16px; }
.specs table { width: 100%; border-collapse: collapse; font-size: 15px; }
.specs th, .specs td { padding: 7px 0; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.specs th { width: 38%; padding-right: 24px; font-weight: 400; color: var(--muted); }

/* ---------- official ---------- */
.official { display: grid; grid-template-columns: 1fr 1.6fr; gap: 24px; align-items: start; }
.official__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.official__list li { padding: 12px 16px; border-radius: var(--radius); background: var(--surface); display: grid; gap: 4px; }
.official__list b { font-size: 17px; font-weight: 500; }
.official__list span { color: var(--muted); font-size: 15px; }

/* ---------- catalog ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 40px; padding: 0 18px; border-radius: 999px;
  background: var(--surface);
  font-size: 14px; color: var(--text-2);
  transition: background .2s, color .2s;
}
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.is-active { background: var(--accent); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.item {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: transform .25s var(--ease), background .25s, border-color .25s;
}
.item:hover { transform: translateY(-4px); background: var(--surface-2); border-color: var(--accent); }
.item.is-hidden { display: none; }
.item__media { aspect-ratio: 4 / 3; border-radius: 0; }
.item__media img { transition: transform .5s var(--ease); }
.item:hover .item__media img { transform: scale(1.04); }
.item__body { padding: 10px 14px 12px; display: flex; flex-direction: column; flex: 1; }
.item__cat { font-size: 13px; color: var(--muted); }
.item h3 { font-size: 16px; margin: 2px 0 8px; }
.item__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.item__price { font-size: 17px; font-weight: 600; white-space: nowrap; }
.item--cta { background: var(--accent); color: #fff; }
.item--cta:hover { background: var(--accent-hover); }
.item--cta .item__body { justify-content: center; gap: 12px; padding: 28px 24px; }
.item--cta h3 { margin: 0; font-size: 22px; }
.item--cta p { color: rgba(255, 255, 255, .85); }
.item--cta .btn { align-self: flex-start; margin-top: 6px; }

.banner {
  margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  transition: border-color .2s;
}
.banner:hover { border-color: var(--accent); }
.banner__title { font-size: clamp(17px, 1.6vw, 21px); font-weight: 500; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 14px clamp(16px, 3vw, 40px); align-items: center; }
.about__media { aspect-ratio: 3 / 2; }
.about__text { margin-top: 10px; font-size: 17px; color: var(--text-2); }
.about__quote { margin-top: 10px; padding-left: 18px; border-left: 3px solid var(--accent); color: var(--text-2); }
.about__why { grid-column: 1 / -1; }
.about__why-title { font-size: 20px; font-weight: 400; margin: 2px 0 10px; }
.perks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.perks li { padding: 10px 14px; border-radius: var(--radius); background: var(--surface); }
.perks b, .perks i { font-size: clamp(32px, 3.4vw, 44px); font-weight: 500; font-style: normal; line-height: 1; }
.perks i { color: var(--accent-hover); }
.perks span { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.checks--grid { grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }

/* ---------- FAQ ---------- */
.faq__list { display: grid; gap: 6px; max-width: 980px; }
.qa { border-radius: var(--radius); background: var(--surface); }
.qa summary {
  list-style: none; cursor: pointer;
  position: relative;
  padding: 11px 44px 11px 16px;
  font-size: 16px; font-weight: 500;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; position: absolute; right: 18px; top: 50%;
  width: 12px; height: 12px; margin-top: -8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .25s;
}
.qa[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.qa p { padding: 0 16px 12px; color: var(--text-2); max-width: 820px; }

/* ---------- CTA form ---------- */
.cta {
  display: grid; grid-template-columns: 1fr 1.25fr; gap: 24px; align-items: center;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.section--cta { padding: clamp(14px, 2.2vw, 28px) 0; }
.cta .h2 { font-size: clamp(22px, 2.4vw, 32px); }
.cta__text p { margin-top: 6px; font-size: 15px; color: var(--text-2); max-width: 460px; }

.form { position: relative; display: grid; gap: 8px; }
/* Блок заявки: имя и телефон в один ряд, согласие рядом с кнопкой.
   Подписи заменяют плейсхолдеры, для экранных дикторов они остаются в разметке */
.cta .form { grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.cta .field:has(textarea), .cta .form__msg { grid-column: 1 / -1; }
.cta .field span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cta .consent { align-items: center; font-size: 12px; }
.cta .consent input { margin-top: 0; }
.cta .btn { height: 42px; }
.field { display: grid; gap: 4px; }
.field span { font-size: 12px; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.4 var(--font);
  resize: vertical;
  transition: border-color .2s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field.is-invalid input { border-color: var(--err); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); cursor: pointer; }
.consent input { margin-top: 2px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.consent a { text-decoration: underline; text-underline-offset: 2px; }
.consent.is-invalid { color: var(--err); }
.form__msg { font-size: 14px; text-align: center; }
.form__msg:empty { display: none; }
.form__msg.is-ok { color: var(--ok); }
.form__msg.is-err { color: var(--err); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; visibility: hidden; opacity: 0; transition: opacity .25s, visibility .25s; }
.modal.is-open { visibility: visible; opacity: 1; }
.modal__overlay { position: absolute; inset: 0; background: var(--overlay); }
.modal__box {
  position: relative; width: 100%; max-width: 460px; max-height: calc(100svh - 32px); overflow: auto;
  padding: 20px 20px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  transform: translateY(16px);
  transition: transform .3s var(--ease);
}
.modal.is-open .modal__box { transform: none; }
.modal__close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; font-size: 26px; line-height: 1; color: var(--muted); }
.modal__close:hover { color: var(--text); background: var(--surface-2); }
.modal__title { font-size: 22px; font-weight: 400; }
.modal__product { margin: 6px 0 12px; color: var(--accent-hover); font-weight: 500; min-height: 1.4em; }
body.is-locked { overflow: hidden; }

/* ---------- footer ---------- */
.footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 24px 0 12px; font-size: 14px; color: var(--muted); }
.footer__inner {
  display: grid; gap: 24px;
  grid-template-columns: 1.5fr 1fr 1fr 1.4fr;
  grid-template-areas: "brand catalog company contact";
}
.footer__brand { grid-area: brand; }
.footer__col--catalog { grid-area: catalog; }
.footer__col--company { grid-area: company; }
.footer__contact { grid-area: contact; }
.footer .logo { color: var(--text); }
.footer__note { margin-top: 10px; max-width: 360px; line-height: 1.6; }
.footer__title { margin-bottom: 4px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.footer__col { display: grid; gap: 6px; align-content: start; }
.footer__col a, .footer__bottom a, .footer__email { transition: color .2s; }
.footer__col a:hover, .footer__bottom a:hover, .footer__email:hover { color: var(--text); }
.footer__social { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.footer__social a {
  padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 13px; color: var(--text-2); transition: border-color .2s, color .2s;
}
.footer__social a:hover { border-color: var(--text); color: var(--text); }
.footer__contact { display: grid; gap: 8px; align-content: start; font-style: normal; }
.footer__phone { font-size: 22px; font-weight: 600; line-height: 1.2; color: var(--text); }
.footer__line { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
.footer__line svg { flex: none; width: 18px; height: 18px; margin-top: 1px; fill: none; stroke: var(--accent-hover); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.footer__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.footer__bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; margin-top: 16px; padding: 10px 72px 0 60px; border-top: 1px solid var(--line); font-size: 13px; }
.footer__bottom span { margin-right: auto; }

/* ---------- floating buttons ---------- */
.float { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: grid; gap: 12px; transition: opacity .2s, visibility .2s; }
.float.is-away { opacity: 0; visibility: hidden; }
.float__btn { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); transition: transform .2s; }
.float__btn:hover { transform: scale(1.06); }
.float__btn svg { width: 24px; height: 24px; fill: #fff; }
.float__btn--call { background: var(--accent); }
.float__btn--chat { background: #6bb33f; }
.float__btn--tg { background: var(--tg); }
.float__btn--tg svg { transform: translateX(-1px); }
.totop {
  position: fixed; left: 24px; bottom: 24px; z-index: 60;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.totop.is-visible { opacity: 1; visibility: visible; }
.totop svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================
   Responsive
   ========================================================= */
/* Телефон в шапке помещается только на широких окнах. Там шапке нужно больше места, чем контенту */
@media (min-width: 1501px) {
  .header > .container { max-width: 1500px; }
}
@media (max-width: 1500px) {
  .nav { gap: 22px; }
  .header__phone { display: none; }
  .header__actions { gap: 12px; }
}

/* Кнопка ТрейдМи занимает место, поэтому до бургера убираем подпись у логотипа */
@media (min-width: 1181px) and (max-width: 1320px) {
  .header .logo__sub { display: none; }
}

/* Шапка с бургером: логотип в один ряд с подписью не помещается рядом с полным меню уже на ~1180px */
@media (max-width: 1180px) {
  .header__inner { gap: 12px; }
  /* бургер слева, как привычно; -11px — чтобы полоски стояли ровно по краю контента */
  .burger { display: block; flex: none; margin-left: -11px; }
  .nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    padding: 4px var(--gutter) 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    font-size: 17px;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: all .25s var(--ease);
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 1200px) {
  .uses, .perks, .checks--grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  :root { --header-h: 64px; }

  .hero__inner { grid-template-columns: 1fr; }
  .hero__stage { order: -1; width: min(100%, 520px); margin-inline: auto; }
  /* Текст стоит под роботами: линии гаснут раньше, чтобы не мешать читать */
  .hero::before {
    opacity: calc(var(--hero-lines) * .6);
    -webkit-mask-image: linear-gradient(#000 30%, transparent 58%);
    mask-image: linear-gradient(#000 30%, transparent 58%);
  }
  .facts__inner { grid-template-columns: repeat(2, 1fr); }
  .fact { padding: 12px 12px 12px 0; }
  .fact + .fact { padding-left: 0; border-left: 0; }
  .fact:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line); }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }

  .product__top, .about, .cta, .official { grid-template-columns: 1fr; }
  .cta { gap: 14px; }
  .product__top--reverse .product__media { order: 0; }
  .features { grid-template-columns: 1fr 1fr; }
  .feature, .feature:nth-child(4) { grid-column: span 1; }
  .feature:nth-child(5) { grid-column: span 2; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .footer__inner { grid-template-columns: 1fr 1fr; grid-template-areas: "brand contact" "catalog company"; gap: 36px 24px; }
}

/* Кнопке ТрейдМи тесно в шапке: на узких экранах она переезжает в меню */
@media (max-width: 760px) {
  .header__actions .btn--trademi { display: none; }
  .nav__trademi { display: flex; align-items: center; gap: 8px; }
}

/* На самых узких телефонах подпись логотипа не помещается рядом с переключателем темы */
@media (max-width: 380px) {
  .header .logo__sub { display: none; }
}

@media (max-width: 640px) {
  .header__actions .btn { display: none; }
  .header .logo__img { height: 22px; }
  /* Первый экран: сверху обе фокусные модели, ниже текст */
  .hero__inner { gap: 12px; text-align: center; }
  .hero__robot { gap: 6px; }
  .hero__robot--x2 img { height: 62vw; }
  .hero__robot--c5 img { height: 40vw; }
  .hero__caption { padding: 5px 10px; font-size: 13px; }
  .hero__caption b { font-size: 14px; }
  .hero__tag { margin-bottom: 10px; }
  .hero__title { font-size: 34px; margin-inline: auto; }
  .hero__lead { margin-top: 8px; margin-inline: auto; font-size: 16px; }
  .hero__cta { margin-top: 14px; }
  /* цифры под баннером — по центру ячеек, в тон центрированному первому экрану */
  .fact, .fact:nth-child(even) { padding: 10px 6px; text-align: center; }
  .hero__cta .btn { flex: 1 1 100%; }
  .official__list, .checks--grid { grid-template-columns: 1fr; }
  /* «Применение» и преимущества роботов — горизонтальный нативный слайдер со snap,
     край следующей карточки виден как подсказка, что ряд листается */
  .uses, .features {
    display: flex; gap: 12px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
    margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .uses::-webkit-scrollbar, .features::-webkit-scrollbar { display: none; }
  .use, .feature { flex: 0 0 min(82%, 320px); scroll-snap-align: start; }
  .uses > .reveal, .features > .reveal { opacity: 1; transform: none; }
  .use:hover { transform: none; }
  .perks { grid-template-columns: 1fr 1fr; gap: 10px; }
  .perks li { padding: 10px 12px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .item__body { padding: 8px 10px 10px; }
  .item h3 { font-size: 15px; margin-bottom: 6px; }
  .item__cat { font-size: 12px; }
  .item__price { font-size: 15px; }
  .item__foot .btn { width: 100%; }
  .item--cta { grid-column: 1 / -1; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .banner { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 14px; }
  .product__cta .btn { flex: 1 1 100%; }
  .specs { padding: 12px 14px; }
  .specs th { width: 45%; padding-right: 12px; }
  .qa summary { padding: 11px 40px 11px 14px; font-size: 15px; }
  .qa summary::after { right: 16px; }
  .qa p { padding: 0 14px 12px; }
  .float { right: 16px; bottom: 16px; }
  .float__btn { width: 48px; height: 48px; }
  .totop { left: 16px; bottom: 16px; }
  /* Подвал: бренд → карточка контактов → меню в две колонки → нижняя строка.
     Снизу запас под плавающие кнопки звонка/чата и «наверх» */
  .footer { padding: 20px 0 calc(76px + env(safe-area-inset-bottom)); }
  .footer__inner { grid-template-columns: 1fr 1fr; grid-template-areas: "brand brand" "contact contact" "catalog company"; gap: 16px; }
  .footer__contact { padding: 12px 14px; border-radius: var(--radius-lg); background: var(--surface); }
  .footer__phone { font-size: 24px; }
  .footer__actions .btn { flex: 1 1 0; height: 44px; padding: 0 12px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 14px; padding-inline: 0; }
  .field input, .field textarea { font-size: 16px; }
  .cta { padding: 12px; gap: 8px; }
  .cta__text p { font-size: 14px; line-height: 1.45; }
  .cta .form { grid-template-columns: 1fr; }
  .modal__box { padding: 18px 14px 14px; }
}

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

/* =========================================================
   Внутренние страницы (WordPress)
   ========================================================= */
.page-top { padding: calc(var(--header-h) + 14px) 0 clamp(20px, 2.6vw, 32px); }
.container--narrow { max-width: 920px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.crumbs a { transition: color .2s; }
.crumbs a:hover { color: var(--text); }
.crumbs__sep { opacity: .5; }
.crumbs [aria-current] { color: var(--text-2); }

.page-head { margin-bottom: 16px; max-width: 900px; }
.page-title { font-size: clamp(30px, 4vw, 52px); font-weight: 400; line-height: 1.1; }
.page-intro { margin-top: 8px; font-size: 17px; color: var(--text-2); }
.page-intro p + p { margin-top: 10px; }
.post-meta { margin-top: 14px; font-size: 14px; color: var(--muted); }
.post-cover { margin-top: 16px; aspect-ratio: 16 / 9; }

.h2 a, .item h3 a { transition: color .2s; }
.h2 a:hover, .item h3 a:hover { color: var(--accent-hover); }

/* текст из редактора */
.prose { margin-top: 14px; font-size: 17px; line-height: 1.7; color: var(--text-2); max-width: 860px; }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin-top: 1.8em; font-size: clamp(22px, 2.4vw, 30px); font-weight: 500; color: var(--text); }
.prose h3 { margin-top: 1.5em; font-size: 20px; color: var(--text); }
.prose a { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose strong { color: var(--text); }
.prose blockquote { margin: 1.4em 0; padding-left: 18px; border-left: 3px solid var(--accent); }
.prose img { border-radius: var(--radius); }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li::marker { color: var(--accent-hover); }
.prose .map { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.prose .map iframe { display: block; width: 100%; height: 100%; border: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: left; }

/* фильтры-ссылки */
.filters--links { margin-bottom: 14px; }
a.chip { display: inline-flex; align-items: center; gap: 8px; }
.chip__count { font-size: 12px; opacity: .6; }

/* ---------- страница робота ---------- */
.robot__top { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(16px, 3vw, 40px); align-items: start; }
.gallery { position: sticky; top: calc(var(--header-h) + 20px); }
.gallery__main { aspect-ratio: 4 / 3; border: 1px solid var(--line); }
.gallery__main img { transition: opacity .2s; }
.gallery__thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.gallery__thumb { flex: none; width: 76px; height: 76px; padding: 4px; border-radius: 10px; background: #fff; border: 2px solid var(--line); transition: border-color .2s; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumb.is-active, .gallery__thumb:hover { border-color: var(--accent); }
.gallery__zoom {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 10px;
  cursor: zoom-in;
}
.gallery__zoom svg {
  width: 40px; height: 40px; padding: 9px;
  border-radius: 50%; background: rgba(20, 20, 30, .6);
  fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round;
  transition: background .2s;
}
.gallery__zoom:hover svg { background: var(--accent); }

/* Фото на весь экран */
.lightbox {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(10, 10, 14, .94);
  visibility: hidden; opacity: 0;
  transition: opacity .2s, visibility .2s;
}
.lightbox.is-open { visibility: visible; opacity: 1; }
.lightbox__stage { position: absolute; inset: 0; display: flex; overflow: auto; overscroll-behavior: contain; }
.lightbox__img {
  flex: none; display: block; margin: auto; height: auto; max-width: none;
  border-radius: 6px; background: #fff;
  opacity: 0; transition: opacity .15s;
  cursor: zoom-in; user-select: none; -webkit-user-select: none;
}
.lightbox__img.is-ready { opacity: 1; }
.lightbox.is-zoomed .lightbox__img { cursor: grab; border-radius: 0; }
.lightbox__btn {
  position: absolute; z-index: 1;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; background: rgba(20, 20, 30, .66);
  border: 1px solid rgba(255, 255, 255, .28);
  transition: background .2s;
}
.lightbox__btn:hover { background: var(--accent); }
.lightbox__btn svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lightbox__close { top: 6px; right: 12px; font-size: 28px; line-height: 1; }
.lightbox__nav { top: 50%; margin-top: -22px; }
.lightbox__nav--prev { left: 14px; }
.lightbox__nav--next { right: 14px; }
.lightbox__hint {
  position: absolute; left: 0; right: 0; bottom: 18px;
  text-align: center; font-size: 14px; color: rgba(255, 255, 255, .7);
  pointer-events: none;
}
.lightbox__count { margin-right: 12px; color: #fff; }
.lightbox__count:empty { display: none; }
.lightbox.is-zoomed .lightbox__hint { display: none; }
.robot__title { font-size: clamp(30px, 3.6vw, 46px); font-weight: 400; line-height: 1.1; }
.robot__kind { display: block; margin-bottom: 6px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.quick { margin: 12px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.quick div { display: grid; grid-template-columns: 44% 1fr; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.quick dt { color: var(--muted); }
.quick dd { margin: 0; }
.buy { margin-top: 12px; padding: 12px 16px; border-radius: var(--radius-lg); background: var(--surface); }
.buy .price { margin-top: 0; }
.buy__note { margin-top: 10px; font-size: 13px; color: var(--muted); }
.price__val--sm { font-size: 26px; }

.tabs {
  position: sticky; top: var(--header-h); z-index: 20;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 18px 0 0; padding: 8px 0;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 9px 16px; border-radius: 999px; font-size: 14px; color: var(--text-2); background: var(--surface); transition: background .2s, color .2s; }
.tabs a:hover { background: var(--accent); color: #fff; }
.robot__section { padding-top: 22px; }
.robot__section > .h2 { margin-bottom: 8px; }
.features--page { margin-top: 12px; }
.features--page .feature { grid-column: span 3; }
.specs__note { margin-top: 14px; font-size: 13px; color: var(--muted); }
.robot__section .specs { margin-top: 12px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; counter-reset: step; }
.steps li { position: relative; padding: 42px 14px 12px; border-radius: var(--radius); background: var(--surface); display: grid; gap: 8px; align-content: start; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; top: 12px; left: 14px; width: 24px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; }
.steps b { font-size: 17px; font-weight: 500; }
.steps span { font-size: 14px; color: var(--muted); }

.buybar { display: none; }

/* ---------- каталог ---------- */
.grid--catalog { margin-bottom: 22px; }
.compare .h2 { margin-bottom: 12px; }
.compare thead th { font-size: 13px; color: var(--muted); font-weight: 400; border-top: 0; }
.compare td a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.compare td a:hover { text-decoration-color: var(--accent-hover); }
.compare th, .compare td { width: auto !important; }

/* ---------- блог ---------- */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.post-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; transition: transform .25s var(--ease); }
.post-card:hover { transform: translateY(-4px); }
.post-card__media { aspect-ratio: 3 / 2; border-radius: 0; }
.post-card__media img { padding: 3%; }
.post-card__body { padding: 12px 14px; display: grid; gap: 6px; }
.post-card__date { font-size: 13px; color: var(--muted); }
.post-card h3 { font-size: 18px; line-height: 1.3; }
.post-card p { font-size: 14px; color: var(--muted); }
.pagination { display: flex; gap: 8px; margin-top: 32px; }
.pagination .page-numbers { min-width: 40px; height: 40px; padding: 0 12px; border-radius: 999px; display: grid; place-items: center; background: var(--surface); }
.pagination .current { background: var(--accent); color: #fff; }

/* ---------- контакты и прочее ---------- */
.contacts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0 0; }
.contacts div { padding: 10px 14px; border-radius: var(--radius); background: var(--surface); }
.contacts dt { font-size: 13px; color: var(--muted); }
.contacts dd { margin: 6px 0 0; color: var(--text); }
.contacts a { color: var(--text); text-decoration: none; }
.notfound { text-align: left; }
.notfound__code { font-size: clamp(80px, 14vw, 160px); line-height: 1; font-weight: 600; color: var(--accent); }
.notfound .product__cta { margin-top: 28px; }

@media (max-width: 1200px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .posts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .robot__top { grid-template-columns: 1fr; }
  .gallery { position: static; }
  .features--page .feature { grid-column: span 1; }
  .tabs { top: var(--header-h); }
}
@media (max-width: 640px) {
  .steps, .posts, .contacts { grid-template-columns: 1fr; }
  .quick div { grid-template-columns: 1fr 1fr; }
  .buy { padding: 12px; }
  .buy .product__cta .btn { flex: 1 1 100%; }
  .single-robot .float { bottom: 84px; }
  .lightbox__nav { top: auto; bottom: 6px; margin-top: 0; }
  .single-robot .totop { bottom: 84px; }
  .single-robot .footer { padding-bottom: calc(148px + env(safe-area-inset-bottom)); }
  .buybar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--bar-bg); border-top: 1px solid var(--line);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .buybar__price { font-size: 17px; font-weight: 600; }
  .compare th:nth-child(2), .compare td:nth-child(2) { display: none; }
}
