/* =============================================================================
   Тонкий слой поверх оригинального CSS Ainergy.
   Только наши правки/поведение и стили компонентов, которыми мы управляем сами
   (шапка при скролле, мобильное меню, модалка заявки, cookie).
   Оригинальные классы (button_*, card_*) переиспользуются как есть.
   ========================================================================== */

:root {
  --ink: #0d0d0d;
  --accent: #5ef692;
  --accent-strong: #51e985;
}

body.no-scroll { overflow: hidden; }
html:has(body.no-scroll) { overflow: hidden !important; }

/* Ховеры без блеклого зелёного (перебиваем оригинальный a:hover !important). */
body:not(.has-hero) .site-header .site-nav__item:hover { color: #0d0d0d !important; opacity: 0.6; }
body.has-hero .site-header .site-nav__item:hover { color: #fff !important; opacity: 0.7; }
.site-models__card:hover,
.site-models__card:hover h3 { color: #0d0d0d !important; }
.site-models__card:hover p { color: #6b6b70 !important; }
body.has-hero .site-models__card:hover,
body.has-hero .site-models__card:hover h3 { color: #fff !important; }
body.has-hero .site-models__card:hover p { color: rgba(255, 255, 255, 0.6) !important; }

/* --- Шапка: подложка при скролле / на страницах без героя ---------------- */
.site-header {
  transition: transform 0.3s ease, background-color 0.25s ease, backdrop-filter 0.25s ease, box-shadow 0.25s ease;
}
/* Внутренние страницы: белая шапка, тёмный логотип и текст. */
body:not(.has-hero) .site-header {
  background-color: #fff;
  box-shadow: 0 1px 0 rgba(13, 13, 13, 0.07);
}
/* Главная: прозрачная над видео-героем, тёмная подложка при скролле. */
body.has-hero .site-header.is-scrolled {
  background-color: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* Скрытие при скролле вниз. */
.site-header.is-hidden { transform: translateY(-100%); }

/* Логотипы: светлый (тёмный текст) на белой шапке, тёмный (белый текст) над героем. */
.site-logo__light,
.site-logo__dark { height: 26px; width: auto; }
.site-logo__dark { display: none; }
body.has-hero .site-logo__light { display: none; }
body.has-hero .site-logo__dark { display: block; }

/* Пункты навигации: тёмные на белой шапке, белые над героем.
   Специфичность выше правил оригинальных button_* классов. */
body .site-header .site-nav__item { color: #0d0d0d !important; }
body.has-hero .site-header .site-nav__item { color: #fff !important; }

/* Кнопка «Заказать демо» в шапке: белая с тёмным текстом всегда. */
.site-cta { background: #fff !important; color: #0d0d0d !important; }
body.has-hero .site-cta { box-shadow: none; }
body:not(.has-hero) .site-cta { box-shadow: inset 0 0 0 1px rgba(13, 13, 13, 0.1); }

/* Бургер (три полоски). */
.site-burger { flex-direction: column; gap: 4px; align-items: center; justify-content: center; }
.site-burger span { display: block; width: 20px; height: 2px; border-radius: 2px; background: #0d0d0d; }
body.has-hero .site-burger span { background: #fff; }

/* --- Мобильное меню-оверлей ---------------------------------------------- */
.site-mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(13, 13, 13, 0.98);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.site-mobile-nav[hidden] { display: none; }
.site-mobile-nav nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  width: 100%;
  max-width: 420px;
}
.site-mobile-nav a {
  color: #fff;
  font-size: 1.4rem;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
}
.site-mobile-nav button { margin-top: 20px; }

/* --- Модалка заявки ------------------------------------------------------ */
.site-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13, 13, 13, 0.55);
  backdrop-filter: blur(4px);
}
.site-modal.is-open { display: flex; }
.site-modal__card {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  padding: 26px 28px 24px;
}
.site-modal__sub { margin: 4px 0 16px; font-size: 0.92rem; }
.site-modal__card h3 { margin-bottom: 4px; }
.site-modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #9a9aa0;
}
.site-modal__close:hover { color: var(--ink); }
.site-modal__sub { color: #6b6b70; margin: 4px 0 20px; }
.site-modal__success { text-align: center; padding: 16px 0; }

.site-field { margin-bottom: 9px; }
.site-field input,
.site-field textarea {
  width: 100%;
  padding: 11px 15px;
  border: 1px solid #e7e6ea;
  border-radius: 12px;
  font: inherit;
  background: #f7f6f9;
}
.site-field input:focus,
.site-field textarea:focus { outline: none; border-color: var(--accent-strong); }
.site-field textarea { resize: vertical; min-height: 60px; }
.site-field__privacy {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.6rem;
  line-height: 1.3;
  color: #6b6b70;
  margin: 10px 0;
}
/* Форсируем мелкий размер и на вложенных span/ссылках (оригинальные a/span крупнее). */
.site-field__privacy,
.site-field__privacy * {
  font-size: 11px !important;
  line-height: 1.3 !important;
}
.site-field__privacy input { margin-top: 3px; flex-shrink: 0; width: auto; }
.site-field__submit { width: 100%; justify-content: center; margin-top: 4px; }
.site-field__status { font-size: 0.85rem; margin-top: 10px; }
.site-field__status.is-error { color: #d1435b; }

/* --- Cookie-баннер: гарантируем позиционирование, если оригинал не задал -- */
.site-cookie[hidden] { display: none !important; }

/* --- Статья (блог / глоссарий) ------------------------------------------ */
.article { padding: 120px 0 80px; }
.article .container { max-width: 820px; }
.article__back {
  display: inline-block;
  color: #6b6b70;
  font-size: 0.95rem;
  margin-bottom: 20px;
}
.article__back:hover { color: var(--accent-strong); }
.article__head h1 {
  font-family: Manrope, sans-serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--ink);
}
.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: #6b6b70;
  font-size: 0.95rem;
  margin-bottom: 32px;
}
.article__cover {
  width: 100%;
  border-radius: 20px;
  margin-bottom: 36px;
}

/* Типографика тела статьи (контент приходит из Strapi как чистый HTML). */
.article-content { font-size: 1.08rem; line-height: 1.7; color: #1a1a1e; }
.article-content > *:first-child { margin-top: 0; }
.article-content h2 {
  font-family: Manrope, sans-serif;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  margin: 1.6em 0 0.5em;
  letter-spacing: -0.01em;
}
.article-content h3 { font-family: Manrope, sans-serif; font-size: 1.3rem; margin: 1.4em 0 0.4em; }
.article-content p { margin: 0 0 1.1em; }
.article-content a { color: #10893e; text-decoration: underline; }
.article-content ul, .article-content ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.article-content li { margin-bottom: 0.5em; }
.article-content img { border-radius: 14px; margin: 1.4em 0; height: auto; }
.article-content blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--accent);
  color: #444;
  font-size: 1.15rem;
}
.article-content table { width: 100%; border-collapse: collapse; margin: 1.4em 0; }
.article-content th, .article-content td { border: 1px solid #e7e6ea; padding: 10px 14px; text-align: left; }
.article-banner {
  background: var(--accent-soft, #cdf9dc);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 1.6em 0;
}
.article-banner h3 { margin: 0 0 8px; }
.article__cta { margin-top: 48px; padding-top: 32px; border-top: 1px solid #e7e6ea; }

/* --- Списки (блог / глоссарий) ------------------------------------------ */
.listing { padding-top: 120px; }
.listing h1 {
  font-family: Manrope, sans-serif;
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.02em;
  margin-bottom: 40px;
}
.listing__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.listing__grid--terms { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.listing__card {
  display: block;
  border: 1px solid #e7e6ea;
  border-radius: 18px;
  padding: 24px;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  color: inherit;
}
.listing__card:hover {
  box-shadow: 0 12px 40px rgba(13, 13, 13, 0.08);
  transform: translateY(-2px);
  border-color: #d7d6da;
}
.listing__cover {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  aspect-ratio: 16 / 10;
  background: #f7f6f9;
}
.listing__cover img { width: 100%; height: 100%; object-fit: cover; }
.listing__card h3 { font-family: Manrope, sans-serif; font-size: 1.2rem; margin: 0 0 10px; }
.listing__card p { color: #6b6b70; margin: 0; font-size: 0.98rem; }
.listing__card--term { display: flex; align-items: center; min-height: 96px; }
.listing__card--term h3 { margin: 0; }

/* --- Дропдаун «Модели применения» --------------------------------------- */
.site-models {
  position: fixed;
  top: 0;
  padding-top: 56px; /* фон панели уходит под шапку — без «щели» (JS уточняет по высоте шапки) */
  left: 0;
  right: 0;
  z-index: 40;
  background: #fff;
  box-shadow: 0 24px 48px rgba(13, 13, 13, 0.12);
}
.site-header { z-index: 60; }
.site-models[hidden] { display: none; }
.site-models__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px clamp(20px, 4vw, 40px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.site-models__card {
  display: block;
  padding: 22px 24px;
  border-radius: 16px;
  color: #0d0d0d;
  background: transparent;
  transition: background-color 0.18s ease;
}
.site-models__card:hover { background: #f2f1f4; color: #0d0d0d; }
.site-models__card h3 { font-family: Manrope, sans-serif; font-size: 1.05rem; line-height: 1.2; margin: 0 0 10px; color: inherit; }
.site-models__card p { color: #6b6b70; font-size: 0.9rem; line-height: 1.45; margin: 0; }

/* Тёмный вариант дропдауна — на главной (над видео-героем). */
body.has-hero .site-models { background: #0d0d0d; border-top-color: rgba(255, 255, 255, 0.08); }
body.has-hero .site-models__card { color: #fff; }
body.has-hero .site-models__card:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
body.has-hero .site-models__card p { color: rgba(255, 255, 255, 0.6); }
@media (max-width: 960px) {
  .site-models { top: 0; bottom: 0; overflow-y: auto; z-index: 70; }
  .site-models__inner { grid-template-columns: 1fr; padding-top: 88px; }
}

/* --- Модалка заявки: поведение полей и чекбокса ------------------------- */
.site-field input,
.site-field textarea { transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease; }
.site-field input:hover,
.site-field textarea:hover { border-color: #c9c8cd; background: #fff; }
.site-field input:focus,
.site-field textarea:focus {
  background: #fff;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(94, 246, 146, 0.18);
}
.site-field__privacy { align-items: flex-start; gap: 10px; line-height: 1.4; }
.site-field__privacy input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-top: 1px;
  border: 1.5px solid #c9c8cd;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
}
.site-field__privacy input:hover { border-color: var(--accent-strong); }
.site-field__privacy input:checked { background: var(--ink); border-color: var(--ink); }
.site-field__privacy input:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.site-field__privacy a { color: #0d0d0d; text-decoration: underline; }
.site-field__req { color: #d1435b; }
.site-field__submit { width: 100%; justify-content: center; padding: 14px 24px; margin-top: 6px; font-size: 1rem; }

/* --- Футер: родной CSS Ainergy (styles_*, footerMiddle_*, footerBottom_*).
   Убираем отступ от вырезанного тикера (был margin-top:190px). ------------- */
.site-footer .footerMiddle_middle__QDDGX { margin-top: 0 !important; }
.site-footer .card_card__i61Dt { padding-top: clamp(32px, 4vw, 48px) !important; }
.site-footer__bottom a { color: rgba(255, 255, 255, 0.6); }
.site-footer__bottom a:hover { color: #fff; }

/* --- Внутренние страницы: шапка в потоке (sticky), без белой полосы-разрыва - */
body:not(.has-hero) .site-header { position: sticky !important; top: 0; }
body:not(.has-hero) .article { padding-top: 48px; }
body:not(.has-hero) .listing { padding-top: 48px; }

/* --- Лента партнёров (marquee вправо) ----------------------------------- */
.site-ticker { overflow: hidden; width: 100%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.site-ticker__track {
  display: flex;
  align-items: center;
  gap: 56px;
  width: max-content;
  animation: ticker-move 45s linear infinite;
}
.site-ticker:hover .site-ticker__track { animation-play-state: paused; }
.site-ticker__logo { height: 40px; width: auto; flex: 0 0 auto; }
@keyframes ticker-move {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

/* --- Свайперы без JS-инициализации: показываем все слайды сеткой --------- */
.swiper-wrapper { transform: none !important; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.swiper-slide { width: auto !important; max-width: 100%; flex: 1 1 200px; height: auto !important; margin: 0 !important; }
.swiper-scrollbar,
.swiper-button-next,
.swiper-button-prev,
.swiper-pagination { display: none !important; }

/* --- Кнопка «Модели применения» в мобильном меню ------------------------ */
.site-mobile-nav__models {
  background: none;
  border: 0;
  color: #fff;
  font: inherit;
  font-size: 1.4rem;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}
