/*
 * ETC Catalog - каталог прошивок, 2026-08-17.
 * Загружается только на index.php (главная и страницы категорий), см. css/css.php.
 * Опирается на токены темы из etc-poster-v3.css, своих цветов не заводит.
 */

/* Текст на заливке фирменным зелёным: в тёмной теме зелёный светлый (нужен тёмный
   текст), в светлой - глубокий (нужен белый). Одна переменная вместо правок в 10 местах. */
html.etc-poster-v3 { --etc-on-green: #06120c; }
html.etc-poster-v3[data-etc-theme="light"] { --etc-on-green: #ffffff; }

/* ============================================================
   1. Оболочка уровня
   ============================================================ */

html.etc-poster-v3 .etc-cat-shell {
  position: relative;
  padding: 26px 0 40px;
  overflow: hidden;
}

html.etc-poster-v3 .etc-cat-shell::before {
  content: "";
  position: absolute;
  top: -180px;
  left: 50%;
  z-index: 0;
  width: min(1100px, 120%);
  height: 420px;
  background: radial-gradient(ellipse at center, var(--etc-green-soft), transparent 68%);
  transform: translateX(-50%);
  pointer-events: none;
}

html.etc-poster-v3 .etc-cat-shell > .container {
  position: relative;
  z-index: 1;
}

html.etc-poster-v3 .etc-cat-shell--listing {
  padding: 18px 0 0;
  overflow: visible;
}

html.etc-poster-v3 .etc-cat-shell--listing::before {
  display: none;
}

/* ============================================================
   2. Путь по каталогу
   ============================================================ */

html.etc-poster-v3 .etc-cat-path {
  margin: 0 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

html.etc-poster-v3 .etc-cat-path::-webkit-scrollbar { display: none; }

html.etc-poster-v3 .etc-cat-path__list {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

html.etc-poster-v3 .etc-cat-path__item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .01em;
}

html.etc-poster-v3 .etc-cat-path__item + .etc-cat-path__item::before {
  content: "";
  width: 5px;
  height: 5px;
  border-top: 1.5px solid var(--etc-line-strong);
  border-right: 1.5px solid var(--etc-line-strong);
  transform: rotate(45deg);
}

html.etc-poster-v3 .etc-cat-path__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--etc-muted);
  text-decoration: none;
  transition: color .18s ease, background .18s ease;
}

html.etc-poster-v3 .etc-cat-path__link:hover {
  background: var(--etc-green-soft);
  color: var(--etc-text);
}

html.etc-poster-v3 .etc-cat-path__link i { font-size: 11px; opacity: .75; }

html.etc-poster-v3 .etc-cat-path__current {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--etc-green-soft);
  color: var(--etc-green);
  font-weight: 800;
}

/* ============================================================
   3. Шапка уровня
   ============================================================ */

html.etc-poster-v3 .etc-cat-head {
  margin: 0 0 26px;
  max-width: 880px;
}

html.etc-poster-v3 .etc-cat-head__kicker {
  display: inline-flex;
  align-items: center;
  margin: 0 0 10px;
  color: var(--etc-amber);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

html.etc-poster-v3 .etc-cat-head__title {
  margin: 0 0 16px;
  color: var(--etc-text);
  font-size: clamp(24px, 3.4vw, 40px);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -.025em;
}

/* длинные названия из админки («ЛЕГКОВЫЕ АВТОМОБИЛИ И КОММЕРЧЕСКИЙ ТРАНСПОРТ»)
   в 40px занимают три строки и съедают первый экран */
html.etc-poster-v3 .etc-cat-head__title--long {
  font-size: clamp(21px, 2.4vw, 30px);
  line-height: 1.14;
}

html.etc-poster-v3 .etc-cat-head__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

html.etc-poster-v3 .etc-cat-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--etc-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--etc-panel-2) 82%, transparent);
  color: var(--etc-muted);
  font-size: 12.5px;
  font-weight: 700;
}

html.etc-poster-v3 .etc-cat-stat--accent {
  border-color: color-mix(in srgb, var(--etc-green) 34%, transparent);
  background: var(--etc-green-soft);
  color: var(--etc-green);
}

html.etc-poster-v3 a.etc-cat-stat--up {
  color: var(--etc-text);
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease;
}

html.etc-poster-v3 a.etc-cat-stat--up:hover {
  border-color: var(--etc-line-strong);
  background: var(--etc-panel-3);
}

html.etc-poster-v3 .etc-cat-stat--up i { font-size: 10px; opacity: .7; }

/* ============================================================
   4. Корень каталога: плитки типов техники
   ============================================================ */

html.etc-poster-v3 .etc-cat-gates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

html.etc-poster-v3 .etc-cat-gate {
  position: relative;
  display: flex;
  gap: 18px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--etc-line);
  border-radius: var(--etc-radius-lg);
  background: linear-gradient(155deg, color-mix(in srgb, var(--etc-panel-2) 94%, var(--etc-green) 6%), var(--etc-panel));
  box-shadow: inset 0 1px rgba(255, 255, 255, .05), var(--etc-shadow-soft);
  color: var(--etc-text);
  text-decoration: none;
  transition: transform .24s cubic-bezier(.2, .7, .2, 1), border-color .24s ease, box-shadow .24s ease;
}

html.etc-poster-v3 .etc-cat-gate::after {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  width: 46px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--etc-green), var(--etc-amber));
  transition: width .28s cubic-bezier(.2, .7, .2, 1);
}

html.etc-poster-v3 .etc-cat-gate:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--etc-green) 42%, transparent);
  box-shadow: inset 0 1px rgba(255, 255, 255, .07), 0 26px 52px rgba(0, 0, 0, .3);
}

html.etc-poster-v3 .etc-cat-gate:hover::after { width: calc(100% - 32px); }

html.etc-poster-v3 .etc-cat-gate__poster {
  position: relative;
  flex: 0 0 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 149 / 200;
  overflow: hidden;
  border: 1px solid var(--etc-line);
  border-radius: 14px;
  background: #fff;
}

html.etc-poster-v3 .etc-cat-gate__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}

html.etc-poster-v3 .etc-cat-gate:hover .etc-cat-gate__poster img { transform: scale(1.04); }

html.etc-poster-v3 .etc-cat-gate__initial {
  color: #0b1210;
  font-size: 34px;
  font-weight: 850;
}

html.etc-poster-v3 .etc-cat-gate__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  padding-top: 4px;
}

html.etc-poster-v3 .etc-cat-gate__index {
  margin-bottom: 8px;
  color: var(--etc-amber);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .16em;
}

html.etc-poster-v3 .etc-cat-gate__title {
  margin-bottom: 10px;
  color: var(--etc-text);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.22;
  letter-spacing: -.01em;
}

html.etc-poster-v3 .etc-cat-gate__count {
  display: inline-flex;
  align-self: flex-start;   /* в колоночном флексе иначе растягивается на всю карточку */
  align-items: baseline;
  gap: 6px;
  margin-bottom: auto;
  padding: 6px 14px 6px 12px;
  border: 1px solid color-mix(in srgb, var(--etc-green) 28%, transparent);
  border-radius: 999px;
  background: var(--etc-green-soft);
  color: var(--etc-green);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color .22s ease, background .22s ease;
}

html.etc-poster-v3 .etc-cat-gate__count b {
  font-size: 14.5px;
  font-weight: 850;
  letter-spacing: -.01em;
}

html.etc-poster-v3 .etc-cat-gate:hover .etc-cat-gate__count {
  border-color: color-mix(in srgb, var(--etc-green) 55%, transparent);
  background: color-mix(in srgb, var(--etc-green) 16%, transparent);
}

html.etc-poster-v3 .etc-cat-gate__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--etc-green);
  font-size: 12.5px;
  font-weight: 800;
}

html.etc-poster-v3 .etc-cat-gate__cta i { transition: transform .2s ease; }
html.etc-poster-v3 .etc-cat-gate:hover .etc-cat-gate__cta i { transform: translateX(4px); }

/* ============================================================
   5. Панель управления списком (поиск, алфавит, счётчик)
   ============================================================ */

html.etc-poster-v3 .etc-cat-toolbar,
html.etc-poster-v3 .etc-cat-pillbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}

html.etc-poster-v3 .etc-cat-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 280px;
  min-width: 220px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--etc-line-strong);
  border-radius: 999px;
  background: var(--etc-panel-2);
  transition: border-color .18s ease, box-shadow .18s ease;
}

html.etc-poster-v3 .etc-cat-search:focus-within {
  border-color: var(--etc-green);
  box-shadow: 0 0 0 4px var(--etc-green-soft);
}

html.etc-poster-v3 .etc-cat-search > i {
  color: var(--etc-muted);
  font-size: 12px;
}

html.etc-poster-v3 .etc-cat-search__input {
  width: 100%;
  padding: 10px;
  border: 0;
  background: transparent;
  color: var(--etc-text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  outline: none;
}

html.etc-poster-v3 .etc-cat-search__input::placeholder { color: var(--etc-muted); font-weight: 500; }
html.etc-poster-v3 .etc-cat-search__input::-webkit-search-cancel-button { display: none; }

html.etc-poster-v3 .etc-cat-search__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--etc-panel-3);
  color: var(--etc-muted);
  font-size: 10px;
  cursor: pointer;
}

html.etc-poster-v3 .etc-cat-search__clear:hover { color: var(--etc-text); }

html.etc-poster-v3 .etc-cat-alpha {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 4px;
}

html.etc-poster-v3 .etc-cat-alpha__btn {
  min-width: 30px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--etc-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}

html.etc-poster-v3 .etc-cat-alpha__btn:hover {
  border-color: var(--etc-line);
  background: var(--etc-panel-2);
  color: var(--etc-text);
}

html.etc-poster-v3 .etc-cat-alpha__btn.is-active {
  border-color: color-mix(in srgb, var(--etc-green) 40%, transparent);
  background: var(--etc-green-soft);
  color: var(--etc-green);
}

html.etc-poster-v3 .etc-cat-toolbar__count,
html.etc-poster-v3 .etc-cat-pillbar__count {
  margin-left: auto;
  color: var(--etc-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* ============================================================
   6. Марки
   ============================================================ */

/* Ровная сетка: фиксированное число колонок на брейкпоинт и одинаковая высота карточек,
   чтобы 55 марок читались таблицей, а не «плиточным ковром» с рваными рядами. */
html.etc-poster-v3 .etc-cat-brands {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}

html.etc-poster-v3 .etc-cat-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 172px;
  padding: 16px 10px 14px;
  border: 1px solid var(--etc-line);
  border-radius: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--etc-panel-2) 92%, transparent), var(--etc-panel));
  box-shadow: inset 0 1px rgba(255, 255, 255, .04);
  color: var(--etc-text);
  text-align: center;
  text-decoration: none;
  transition: transform .2s cubic-bezier(.2, .7, .2, 1), border-color .2s ease, box-shadow .2s ease;
}

html.etc-poster-v3 .etc-cat-brand:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--etc-green) 50%, transparent);
  box-shadow: inset 0 1px rgba(255, 255, 255, .06), 0 18px 34px rgba(0, 0, 0, .26);
}

/* плашка логотипа одного размера у всех марок: исходники в админке разного тона,
   и без общей рамки ряд выглядит рваным */
html.etc-poster-v3 .etc-cat-brand__plate {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--etc-line);
  border-radius: 16px;
  background: var(--etc-panel-3);
}

html.etc-poster-v3 .etc-cat-brand__plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.9) brightness(.97);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), filter .25s ease;
}

html.etc-poster-v3 .etc-cat-brand:hover .etc-cat-brand__plate img {
  filter: none;
  transform: scale(1.06);
}

html.etc-poster-v3 .etc-cat-brand__initial {
  color: var(--etc-muted);
  font-size: 28px;
  font-weight: 850;
}

html.etc-poster-v3 .etc-cat-brand__name {
  max-width: 100%;
  overflow: hidden;
  color: var(--etc-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.etc-poster-v3 .etc-cat-brand__meta {
  margin-top: 4px;
  color: var(--etc-muted);
  font-size: 11px;
  font-weight: 650;
}

@media (max-width: 1399.98px) {
  html.etc-poster-v3 .etc-cat-brands { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

@media (max-width: 1199.98px) {
  html.etc-poster-v3 .etc-cat-brands { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
  html.etc-poster-v3 .etc-cat-brands { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============================================================
   7. Пилюли: модель, поколение, ЭБУ
   ============================================================ */

/* Сетка вместо «резинового» ряда: кнопки одинаковой ширины и высоты выстраиваются
   в ровные колонки на всех уровнях каталога - модель, поколение, ЭБУ, соседи. */
html.etc-poster-v3 .etc-cat-pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 10px;
}

/* Пилюля одна на все уровни каталога: модель, поколение, ЭБУ и соседние разделы
   на странице с товарами выглядят одинаково - иначе каталог рассыпается. */
html.etc-poster-v3 .etc-cat-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  padding: 0 8px 0 18px;
  overflow: hidden;
  border: 1px solid var(--etc-line-strong);
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--etc-panel-2) 94%, var(--etc-green) 6%), var(--etc-panel));
  box-shadow: inset 0 1px rgba(255, 255, 255, .05), 0 2px 6px rgba(0, 0, 0, .1);
  color: var(--etc-text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-decoration: none;
  transition: transform .18s cubic-bezier(.2, .7, .2, 1), border-color .18s ease,
              background .18s ease, box-shadow .18s ease;
}

html.etc-poster-v3 .etc-cat-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--etc-green) 22%, transparent), transparent 62%);
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
}

html.etc-poster-v3 .etc-cat-pill:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--etc-green) 70%, transparent);
  box-shadow: inset 0 1px rgba(255, 255, 255, .07), 0 14px 26px rgba(0, 0, 0, .2);
}

html.etc-poster-v3 .etc-cat-pill:hover::before { opacity: 1; }

html.etc-poster-v3 .etc-cat-pill:focus-visible {
  outline: none;
  border-color: var(--etc-green);
  box-shadow: 0 0 0 4px var(--etc-green-soft);
}

html.etc-poster-v3 .etc-cat-pill__label {
  position: relative;
  z-index: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* пилюля без счётчика (конечный ЭБУ) - тот же размер, симметричные поля */
html.etc-poster-v3 .etc-cat-pill--plain { padding: 0 18px; }

html.etc-poster-v3 .etc-cat-pill__count {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--etc-green) 14%, transparent);
  color: var(--etc-green);
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  transition: background .18s ease, color .18s ease;
}

html.etc-poster-v3 .etc-cat-pill:hover .etc-cat-pill__count {
  background: var(--etc-green);
  color: var(--etc-on-green);
}

/* текущий раздел в ленте соседей */
html.etc-poster-v3 .etc-cat-pill.is-current {
  border-color: color-mix(in srgb, var(--etc-green) 80%, transparent);
  background: linear-gradient(180deg, var(--etc-green), var(--etc-green-2));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--etc-green) 26%, transparent);
  color: var(--etc-on-green);
  cursor: default;
}

html.etc-poster-v3 .etc-cat-pill.is-current::before { opacity: 0; }

html.etc-poster-v3 .etc-cat-pill.is-current .etc-cat-pill__count {
  background: color-mix(in srgb, var(--etc-on-green) 16%, transparent);
  color: var(--etc-on-green);
}

/* ============================================================
   8. Соседние разделы на странице с товарами
   ============================================================ */

html.etc-poster-v3 .etc-cat-siblings {
  margin: 0 0 22px;
  padding: 16px 18px;
  border: 1px solid var(--etc-line);
  border-radius: var(--etc-radius-md);
  background: color-mix(in srgb, var(--etc-panel) 78%, transparent);
}

html.etc-poster-v3 .etc-cat-siblings__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

html.etc-poster-v3 .etc-cat-siblings__kicker {
  color: var(--etc-amber);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

html.etc-poster-v3 .etc-cat-siblings__up {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--etc-muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

html.etc-poster-v3 .etc-cat-siblings__up:hover { color: var(--etc-green); }

/* лента соседей использует ту же пилюлю, что и уровни каталога - без «компактных» вариантов */

/* ============================================================
   9. SEO-текст и блок помощи
   ============================================================ */

html.etc-poster-v3 .etc-cat-seo {
  max-width: 900px;
  margin: 30px 0 0;
  color: var(--etc-muted);
  font-size: 14px;
  line-height: 1.65;
}

html.etc-poster-v3 .etc-cat-seo h2,
html.etc-poster-v3 .etc-cat-seo h3 {
  margin: 0 0 10px;
  color: var(--etc-text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
}

html.etc-poster-v3 .etc-cat-seo p { margin: 0 0 10px; }
html.etc-poster-v3 .etc-cat-seo strong { color: var(--etc-text); }
html.etc-poster-v3 .etc-cat-seo a { color: var(--etc-green); }

html.etc-poster-v3 .etc-cat-help {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 26px 0 0;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--etc-amber) 26%, transparent);
  border-radius: var(--etc-radius-md);
  background: var(--etc-amber-soft);
}

html.etc-poster-v3 .etc-cat-help__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--etc-amber) 20%, transparent);
  color: var(--etc-amber);
  font-size: 16px;
}

html.etc-poster-v3 .etc-cat-help__text {
  flex: 1 1 260px;
  color: var(--etc-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

html.etc-poster-v3 .etc-cat-help__text strong {
  display: block;
  color: var(--etc-text);
  font-size: 14.5px;
  font-weight: 800;
}

html.etc-poster-v3 .etc-cat-help__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--etc-amber), var(--etc-amber-2));
  color: #17100a;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease;
}

html.etc-poster-v3 .etc-cat-help__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .26);
  color: #17100a;
}

/* фильтр прячет элементы через [hidden]; display из правил выше это перебивает */
html.etc-poster-v3 .etc-cat-toolbar__count[hidden],
html.etc-poster-v3 .etc-cat-pillbar__count[hidden],
html.etc-poster-v3 .etc-cat-brand[hidden],
html.etc-poster-v3 .etc-cat-pill[hidden],
html.etc-poster-v3 .etc-cat-empty[hidden],
html.etc-poster-v3 .etc-cat-search__clear[hidden] {
  display: none !important;
}

html.etc-poster-v3 .etc-cat-empty {
  margin: 18px 0 0;
  padding: 18px;
  border: 1px dashed var(--etc-line-strong);
  border-radius: var(--etc-radius-md);
  color: var(--etc-muted);
  font-size: 13.5px;
  text-align: center;
}

/* ============================================================
   10. Блок каталога на главной
   ============================================================ */

html.etc-poster-v3 .etc-cat-home {
  padding: 12px 0 6px;
}

html.etc-poster-v3 .etc-cat-home__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
}

html.etc-poster-v3 .etc-cat-home__head h2 {
  margin: 0;
  color: var(--etc-text);
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 850;
  letter-spacing: -.025em;
}

html.etc-poster-v3 .etc-cat-home__all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid color-mix(in srgb, var(--etc-green) 40%, transparent);
  border-radius: 999px;
  background: var(--etc-green-soft);
  color: var(--etc-green);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: background .18s ease, transform .18s ease;
}

html.etc-poster-v3 .etc-cat-home__all:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--etc-green) 20%, transparent);
  color: var(--etc-green);
}

/* ============================================================
   11. Появление списков
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  html.etc-poster-v3 .etc-cat-gate,
  html.etc-poster-v3 .etc-cat-brand,
  html.etc-poster-v3 .etc-cat-pill {
    animation: etcCatIn .42s cubic-bezier(.2, .7, .2, 1) both;
  }

  html.etc-poster-v3 .etc-cat-gate:nth-child(2) { animation-delay: .06s; }
  html.etc-poster-v3 .etc-cat-gate:nth-child(3) { animation-delay: .12s; }

  html.etc-poster-v3 .etc-cat-brand:nth-child(n+2),
  html.etc-poster-v3 .etc-cat-pill:nth-child(n+2) { animation-delay: .02s; }
  html.etc-poster-v3 .etc-cat-brand:nth-child(n+5),
  html.etc-poster-v3 .etc-cat-pill:nth-child(n+5) { animation-delay: .05s; }
  html.etc-poster-v3 .etc-cat-brand:nth-child(n+9),
  html.etc-poster-v3 .etc-cat-pill:nth-child(n+9) { animation-delay: .08s; }
  html.etc-poster-v3 .etc-cat-brand:nth-child(n+13),
  html.etc-poster-v3 .etc-cat-pill:nth-child(n+13) { animation-delay: .11s; }
}

@keyframes etcCatIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   12. Адаптив
   ============================================================ */

@media (max-width: 1199.98px) {
  html.etc-poster-v3 .etc-cat-gates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.etc-poster-v3 .etc-cat-gate__poster { flex-basis: 118px; }
}

@media (max-width: 767.98px) {
  html.etc-poster-v3 .etc-cat-shell { padding: 18px 0 30px; }
  html.etc-poster-v3 .etc-cat-gates { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  html.etc-poster-v3 .etc-cat-gate { gap: 14px; padding: 14px; }
  html.etc-poster-v3 .etc-cat-gate__poster { flex-basis: 96px; border-radius: 12px; }
  html.etc-poster-v3 .etc-cat-gate__cta { margin-top: 12px; }
  html.etc-poster-v3 .etc-cat-brands { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  html.etc-poster-v3 .etc-cat-brand { min-height: 148px; padding: 12px 7px 11px; border-radius: 14px; }
  html.etc-poster-v3 .etc-cat-brand__plate { width: 68px; height: 68px; margin-bottom: 9px; border-radius: 13px; }
  html.etc-poster-v3 .etc-cat-brand__name { font-size: 12px; }
  html.etc-poster-v3 .etc-cat-brand__meta { font-size: 10.5px; }
  html.etc-poster-v3 .etc-cat-pills { grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 8px; }
  html.etc-poster-v3 .etc-cat-pill { min-height: 44px; padding: 0 7px 0 14px; font-size: 13px; }
  html.etc-poster-v3 .etc-cat-pill--plain { padding: 0 14px; }
  html.etc-poster-v3 .etc-cat-pill__count { min-width: 28px; height: 26px; padding: 0 8px; }
  html.etc-poster-v3 .etc-cat-search { flex: 1 1 100%; }
  html.etc-poster-v3 .etc-cat-toolbar__count,
  html.etc-poster-v3 .etc-cat-pillbar__count { margin-left: 0; }
  html.etc-poster-v3 .etc-cat-help { padding: 14px; }
  html.etc-poster-v3 .etc-cat-help__btn { width: 100%; justify-content: center; }
}

/* Светлая тема: плашки логотипов и постеров остаются светлыми, тени мягче */
html.etc-poster-v3[data-etc-theme="light"] .etc-cat-gate:hover {
  box-shadow: 0 22px 44px rgba(18, 56, 36, .16);
}

html.etc-poster-v3[data-etc-theme="light"] .etc-cat-brand:hover {
  box-shadow: 0 14px 28px rgba(18, 56, 36, .14);
}

html.etc-poster-v3[data-etc-theme="light"] .etc-cat-pill {
  box-shadow: inset 0 1px rgba(255, 255, 255, .8), 0 2px 6px rgba(18, 56, 36, .07);
}

html.etc-poster-v3[data-etc-theme="light"] .etc-cat-pill:hover {
  box-shadow: inset 0 1px rgba(255, 255, 255, .9), 0 12px 22px rgba(18, 56, 36, .13);
}

/* ============================================================
   13. Витрины «Новинки / Акции / Рекомендуем»
   Штатный шаблон рисует подложку баннера цветом #e2e9ef - светло-серая плита
   поверх тёмной темы и белая заплатка поверх светлой. Держим её на токенах.
   ============================================================ */

html.etc-poster-v3 .etc-showcase-panel {
  border: 1px solid var(--etc-line);
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--etc-panel-2) 92%, var(--etc-green) 8%), var(--etc-panel)) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .05);
}

html.etc-poster-v3 .etc-showcase-panel h3 {
  color: var(--etc-text);
  font-weight: 850;
  letter-spacing: -.02em;
}

html.etc-poster-v3 .etc-showcase-panel > div > div > a {
  color: var(--etc-green);
  font-weight: 700;
  text-decoration: none;
}

html.etc-poster-v3 .etc-showcase-panel .tns-carousel-controls button {
  border: 1px solid var(--etc-line-strong);
  border-radius: 50%;
  background: color-mix(in srgb, var(--etc-panel) 70%, transparent);
  color: var(--etc-text);
}

html.etc-poster-v3 .etc-showcase-panel .tns-carousel-controls button:hover {
  border-color: var(--etc-green);
  color: var(--etc-green);
}

html.etc-poster-v3 .etc-showcase-panel img {
  mix-blend-mode: normal;
}


/* ============================================================
   14. Главная: порядок в контентных блоках
   Правила намеренно живут здесь: файл грузится на всех страницах, а селекторы
   привязаны к блокам, которые есть только на главной (#etc-news-wrap и его соседи).
   Разметку и скрипты блока подбора по автомобилю не трогаем.
   ============================================================ */

/* ============================================================
   1. Ритм секций
   ============================================================ */

html.etc-poster-v3 #etc-catalog-wrap,
html.etc-poster-v3 #etc-tiles-wrap,
html.etc-poster-v3 #etc-paycta-wrap,
html.etc-poster-v3 #etc-new-wrap,
html.etc-poster-v3 #etc-featured-wrap,
html.etc-poster-v3 #etc-news-wrap,
html.etc-poster-v3 #etc-news-wrap ~ .module.container {
  padding-top: 24px;
  padding-bottom: 24px;
}

/* ============================================================
   2. Заголовки контентных блоков
   ============================================================ */

html.etc-poster-v3 #etc-news-wrap .module > h3,
html.etc-poster-v3 #etc-news-wrap ~ .module.container > h3 {
  margin: 0 0 16px !important;
  font-size: clamp(20px, 2.2vw, 26px) !important;
  font-weight: 850 !important;
  line-height: 1.15;
  letter-spacing: -.02em;
}

html.etc-poster-v3 #etc-news-wrap .module > h3 > a,
html.etc-poster-v3 #etc-news-wrap ~ .module.container > h3 > a {
  color: var(--etc-text) !important;
  text-decoration: none !important;
}

html.etc-poster-v3 #etc-news-wrap .module > h3 > a:hover,
html.etc-poster-v3 #etc-news-wrap ~ .module.container > h3 > a:hover {
  color: var(--etc-green) !important;
}

/* ============================================================
   3. Статьи: сетка из шести карточек
   ============================================================ */

html.etc-poster-v3 #etc-news-wrap ~ .module.container > .moduleContent {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* больше шести материалов на главной не показываем - для остального есть «Все статьи» */
html.etc-poster-v3 #etc-news-wrap ~ .module.container > .moduleContent > .card:nth-child(n+7) {
  display: none;
}

html.etc-poster-v3 #etc-news-wrap ~ .module.container .card.card-product {
  margin: 0 !important;
  overflow: hidden;
}

html.etc-poster-v3 #etc-news-wrap ~ .module.container .card.card-product .card-body {
  padding: 14px !important;
}

html.etc-poster-v3 #etc-news-wrap ~ .module.container .card.card-product .row {
  align-items: center;
  margin: 0;
}

html.etc-poster-v3 #etc-news-wrap ~ .module.container .card.card-product .img-wrap {
  overflow: hidden;
  border: 1px solid var(--etc-line);
  border-radius: 14px;
}

html.etc-poster-v3 #etc-news-wrap ~ .module.container .card.card-product .img-wrap img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}

html.etc-poster-v3 #etc-news-wrap ~ .module.container .card.card-product:hover .img-wrap img {
  transform: scale(1.04);
}

html.etc-poster-v3 #etc-news-wrap ~ .module.container .card.card-product .title a {
  display: -webkit-box;
  overflow: hidden;
  color: var(--etc-text) !important;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.01em;
  text-decoration: none !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

html.etc-poster-v3 #etc-news-wrap ~ .module.container .card.card-product .title a:hover {
  color: var(--etc-green) !important;
}

/* первая аннотация остаётся, остальное (отзывы, просмотры, раздел) на главной - шум */
html.etc-poster-v3 #etc-news-wrap ~ .module.container .card.card-product .desc {
  display: -webkit-box;
  overflow: hidden;
  margin: 6px 0 0;
  padding: 0 !important;
  color: var(--etc-muted);
  font-size: 12.5px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

html.etc-poster-v3 #etc-news-wrap ~ .module.container .card.card-product .desc ~ .desc,
html.etc-poster-v3 #etc-news-wrap ~ .module.container .card.card-product .card-body p {
  display: none !important;
}

/* «Далее» - в фирменном зелёном вместо красной кнопки Bootstrap */
html.etc-poster-v3 #etc-news-wrap ~ .module.container .card.card-product .action-wrap .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  padding: 8px 14px !important;
  border: 1px solid color-mix(in srgb, var(--etc-green) 40%, transparent) !important;
  border-radius: 999px !important;
  background: var(--etc-green-soft) !important;
  color: var(--etc-green) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  box-shadow: none !important;
}

html.etc-poster-v3 #etc-news-wrap ~ .module.container .card.card-product .action-wrap .btn:hover {
  border-color: var(--etc-green) !important;
  background: color-mix(in srgb, var(--etc-green) 16%, transparent) !important;
}

/* ============================================================
   4. Кнопки «Все новости» / «Все статьи»
   ============================================================ */

html.etc-poster-v3 #etc-news-wrap .module .text-left,
html.etc-poster-v3 #etc-news-wrap ~ .module.container > .text-left {
  margin-top: 16px;
}

html.etc-poster-v3 #etc-news-wrap .module .text-left .btn,
html.etc-poster-v3 #etc-news-wrap ~ .module.container > .text-left .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px !important;
  border: 1px solid color-mix(in srgb, var(--etc-green) 40%, transparent) !important;
  border-radius: 999px !important;
  background: var(--etc-green-soft) !important;
  color: var(--etc-green) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  transition: transform .18s ease, background .18s ease;
}

html.etc-poster-v3 #etc-news-wrap .module .text-left .btn:hover,
html.etc-poster-v3 #etc-news-wrap ~ .module.container > .text-left .btn:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--etc-green) 16%, transparent) !important;
}

/* ============================================================
   5. Блок новостей: одна карточка вместо голого текста
   ============================================================ */

html.etc-poster-v3 #etc-news-wrap .box {
  padding: 16px 18px;
  border: 1px solid var(--etc-line);
  border-radius: var(--etc-radius-md);
  background: color-mix(in srgb, var(--etc-panel) 82%, transparent);
}

html.etc-poster-v3 #etc-news-wrap .box .title a {
  color: var(--etc-text) !important;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none !important;
}

html.etc-poster-v3 #etc-news-wrap .box .title a:hover { color: var(--etc-green) !important; }

html.etc-poster-v3 #etc-news-wrap .box .text-wrap {
  color: var(--etc-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ============================================================
   6. Адаптив
   ============================================================ */

@media (max-width: 991.98px) {
  html.etc-poster-v3 #etc-news-wrap ~ .module.container > .moduleContent {
    grid-template-columns: minmax(0, 1fr);
  }
  html.etc-poster-v3 #etc-news-wrap ~ .module.container > .moduleContent > .card:nth-child(n+5) {
    display: none;
  }
}

@media (max-width: 575.98px) {
  html.etc-poster-v3 #etc-news-wrap ~ .module.container .card.card-product .action-wrap .btn {
    width: 100%;
  }
}
