/* Стили новых страниц КИАС (главная, каталог, страницы пород и карточка лошади).
   Перенесены из образца редизайна (redesign/assets/kias.css), цвета сняты с макета.
   Сетка: 1440 → 1024 → 390, края 32 / 24 / 16 px. */

:root {
  --green-950: #0e3523;   /* активный чип */
  --green-900: #133a28;   /* полоса экосистемы */
  --green-800: #143c27;   /* кнопка «Найти» */
  --green-700: #1d5238;
  --lime: #c4f52f;        /* «Каталог», галочка проверки, подчёркивание */
  --lime-hover: #b6e81f;
  --ink: #0d1210;
  --ink-2: #2a2d31;
  --muted: #6e7286;       /* порода, регион — серо-синий как на макете */
  --muted-2: #8c8f9b;
  --eco-label: #bcd5c8;
  --line: #e7e9e7;
  --field: #8f9a95;       /* рамка поиска */
  --tile: #f3f4f2;        /* фон плиток и чипов */
  --mint: #edf4ef;        /* плашка «КИАС селект» */
  --bg: #ffffff;
  --danger: #e5484d;

  --radius: 12px;
  --radius-sm: 8px;
  --gutter: 32px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ---------- Основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--green-700); outline-offset: 2px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1440px; margin: 0 auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 20px; height: 20px; flex: none; }
.ico--sm { width: 16px; height: 16px; }

/* ---------- Полоса «Экосистема КИАС» ---------- */
.eco { background: var(--green-900); color: #fff; }
.eco__inner { display: flex; align-items: stretch; justify-content: space-between; gap: 24px; height: 40px; }
.eco__nav {
  display: flex; align-items: stretch; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.eco__nav::-webkit-scrollbar { display: none; }
.eco__label {
  display: flex; align-items: center; flex: none;
  margin-right: 46px;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--eco-label);
}
.eco__label b { margin-left: .5em; color: #fff; font-weight: 700; }
.eco__link {
  position: relative; display: flex; align-items: center; flex: none;
  padding: 0 22px; margin-right: 18px;
  font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .86);
  white-space: nowrap; transition: color .15s;
}
.eco__link:hover { color: #fff; }
.eco__link.is-active { color: #fff; font-weight: 600; }
.eco__link.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; border-radius: 2px 2px 0 0; background: var(--lime);
}
.eco__actions { display: flex; align-items: center; gap: 14px; flex: none; }
.eco__btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .9); white-space: nowrap;
}
.eco__btn:hover, .eco__icon:hover { color: #fff; }
.eco__btn .ico--sm { width: 14px; height: 14px; margin-left: -2px; }
.eco__help { margin-right: 6px; }
.eco__icon { position: relative; display: inline-flex; color: rgba(255, 255, 255, .9); }
.eco__icon .ico { width: 22px; height: 22px; }
.eco__sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .18); }
.eco__post {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 14px; margin-left: 4px;
  border: 1px solid rgba(255, 255, 255, .28); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.eco__post:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .5); }
.eco__post .ico { width: 16px; height: 16px; }

.fav-count {
  position: absolute; top: -5px; right: -8px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--lime); color: var(--green-950);
  font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center;
}

/* ---------- Белая шапка ---------- */
.head { background: #fff; position: relative; z-index: 20; }
.head__inner { display: flex; align-items: center; min-height: 76px; padding-block: 12px; }

.logo { display: flex; align-items: center; gap: 18px; flex: none; color: var(--ink); }
.logo__mark { width: 40px; height: 50px; color: var(--green-900); }
.logo__text { display: flex; flex-direction: column; }
.logo__name { font-size: 29px; font-weight: 800; line-height: 1; letter-spacing: -.01em; }
.logo__sub { margin-top: 3px; font-size: 12px; line-height: 1.2; color: var(--ink-2); }

.catalog { position: relative; margin-left: 40px; flex: none; }
.catalog__btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 14px 0 16px; border-radius: var(--radius-sm);
  background: var(--lime); color: var(--ink);
  font-size: 15px; font-weight: 600; transition: background .15s;
}
/* Меню на <details>/<summary>: убираем стандартный треугольник */
.catalog__btn { list-style: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
.catalog__btn::-webkit-details-marker { display: none; }
.catalog__btn::marker { content: ''; }
.catalog__btn:hover, .catalog[open] .catalog__btn { background: var(--lime-hover); }
.catalog__btn .ico { width: 18px; height: 18px; }
.catalog__btn .ico--sm { width: 16px; height: 16px; margin-left: -4px; transition: transform .2s; }
.catalog[open] .catalog__btn .ico--sm { transform: rotate(180deg); }
.catalog__menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
  min-width: 260px; padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(13, 18, 16, .12);
}
.catalog__item { display: block; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 14.5px; }
.catalog__item:hover { background: var(--tile); }
.catalog__item--main { font-weight: 600; }
.catalog__label {
  margin: 8px 12px 4px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2);
}

.search {
  display: flex; align-items: center; flex: 0 1 682px; min-width: 0;
  height: 38px; margin-left: 22px;
  border: 1.5px solid var(--field); border-radius: var(--radius-sm); background: #fff;
  overflow: hidden; transition: border-color .15s;
}
.search:focus-within { border-color: var(--green-800); }
.search__ico { width: 20px; height: 20px; margin: 0 10px 0 14px; color: var(--ink-2); }
.search__input {
  flex: 1; min-width: 0; height: 100%; padding: 0 12px 0 0;
  border: 0; outline: 0; background: transparent; font-size: 15px;
}
.search__input::placeholder { color: #80838e; }
.search__input::-webkit-search-cancel-button { cursor: pointer; }
.search__btn {
  align-self: stretch; flex: none; width: 106px; margin: -1.5px -1.5px -1.5px 0;
  border-radius: var(--radius-sm);
  background: var(--green-800); color: #fff; font-size: 15px; font-weight: 600;
  transition: background .15s;
}
.search__btn:hover { background: var(--green-700); }

.region-btn {
  display: inline-flex; align-items: center; gap: 8px; flex: none; margin-left: 28px;
  font-size: 14.5px; font-weight: 500; white-space: nowrap;
}
.region-btn .ico { width: 21px; height: 21px; color: var(--ink-2); }
.region-btn .ico--sm { width: 16px; height: 16px; margin-left: -1px; }

/* Значки и «Разместить» в белой шапке — только на телефоне */
.head__icons, .head__post { display: none; }

/* ---------- Подвал ---------- */
.site-footer { margin-top: 56px; border-top: 1px solid var(--line); }
.foot__inner { display: flex; align-items: center; gap: 36px; min-height: 64px; padding-block: 14px; }
.foot__logo { display: inline-flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; }
.foot__mark { width: 26px; height: 32px; color: var(--green-900); }
.foot__nav { display: flex; gap: 32px; font-size: 13px; color: #4c4f65; }
.foot__nav a { white-space: nowrap; }
.foot__nav a:hover { color: var(--ink); }
.foot__note { margin-left: auto; font-size: 12.5px; color: var(--muted-2); text-align: right; white-space: nowrap; }

/* ---------- Кнопки и чипы ---------- */
.chip {
  display: inline-flex; align-items: center; height: 30px; padding: 0 19px; flex: none;
  border-radius: 10px; background: var(--tile); color: var(--ink-2);
  font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s;
}
.chip:hover { background: #e8eae7; }
.chip.is-active { background: var(--green-950); color: #fff; }
/* «Для спорта», «Для души»: назначение продавцы пока не указывают — активный чип приглушён */
.chip.is-active[data-filter="sport"], .chip.is-active[data-filter="soul"] { background: var(--green-700); color: rgba(255, 255, 255, .88); }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 28px; border: 1.5px solid #d3d9d5; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: var(--ink); transition: border-color .15s, background .15s;
}
.btn-outline:hover { border-color: var(--green-800); background: var(--tile); }
.btn-outline .ico { width: 18px; height: 18px; }

/* ---------- Карточка лошади (сетка) ---------- */
.hgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 16px; }
.hcard { position: relative; min-width: 0; }
.hcard__link { display: block; }
.hcard__photo {
  position: relative; aspect-ratio: 7 / 5; overflow: hidden;
  border-radius: 10px; background: var(--tile);
}
.hcard__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.hcard__link:hover .hcard__photo img { transform: scale(1.03); }
.hcard__nophoto {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; color: var(--muted-2);
}
.hcard__nophoto-mark { width: 44px; height: 55px; color: #c6ccc8; }
.hcard__check {
  position: absolute; top: 12px; left: 12px;
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--lime); color: var(--green-950);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.hcard__check .ico { width: 16px; height: 16px; stroke-width: 2.6; }
.hcard__fav {
  position: absolute; top: 8px; right: 8px;
  display: flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  color: #fff; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .45)) drop-shadow(0 1px 4px rgba(0, 0, 0, .35));
  transition: transform .15s;
}
.hcard__fav .ico { width: 27px; height: 27px; stroke-width: 1.6; }
.hcard__fav:hover { transform: scale(1.08); }
.hcard__fav[aria-pressed="true"] .ico { fill: var(--danger); stroke: var(--danger); }

.hcard__body { padding: 12px 8px 0; }
.hcard__title {
  font-size: 15.5px; font-weight: 500; line-height: 1.3; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hcard__price { margin-top: 2px; font-size: 19.5px; font-weight: 700; line-height: 1.3; letter-spacing: -.005em; }
.hcard__price.is-request { font-size: 17px; font-weight: 600; color: var(--ink-2); }
.hcard__meta, .hcard__loc { margin-top: 4px; font-size: 15.5px; line-height: 1.35; color: var(--muted); }
.hcard__loc { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; }
.hcard__loc span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hcard__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hcard__meta span + span::before { content: ' · '; }
.hcard__loc .ico { width: 19px; height: 19px; margin-top: 0; flex: none; }

/* ---------- Главная: плитки услуг ---------- */
.page-main { padding-top: 6px; }
.services { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.svc {
  position: relative; display: block; height: 96px; overflow: hidden;
  border-radius: 10px; background: var(--tile);
  transition: box-shadow .2s;
}
.svc:hover { box-shadow: 0 0 0 1.5px #d7ddd9 inset; }
/* Плитка, на которую ведёт поиск или меню «Каталог» */
.svc.is-hit, .svc:target { outline: 2px solid var(--green-800); outline-offset: 2px; }
/* Иллюстрация справа внизу плитки, как на макете */
.svc__img {
  position: absolute; right: 4px; bottom: 0; width: auto; height: 90%; max-width: 60%;
  object-fit: contain; object-position: right bottom;
  transition: transform .35s ease; transform-origin: right bottom;
}
.svc:hover .svc__img { transform: scale(1.04); }
.svc--logistics .svc__img, .svc--syndication .svc__img { height: 82%; bottom: 4px; }
.svc--legal-support .svc__img { height: 80%; max-width: 46%; bottom: 4px; }
.svc__title {
  position: relative; z-index: 1; display: block; max-width: 62%; padding: 14px 0 0 15px;
  font-size: 15.5px; font-weight: 600; line-height: 1.2; color: var(--ink);
  }

/* ---------- Главная: плашка «КИАС селект» ---------- */
.select-banner {
  display: flex; align-items: center; gap: 16px;
  margin-top: 24px; padding: 6px 20px 6px 18px; min-height: 49px;
  border-radius: 10px; background: var(--mint);
}
.select-banner__shield { width: 38px; height: 38px; flex: none; color: var(--green-900); stroke-width: 1.7; }
.select-banner__text { display: flex; flex-direction: column; min-width: 0; }
.select-banner__title { font-size: 15.5px; font-weight: 700; line-height: 1.25; }
.select-banner__sub { font-size: 13.5px; color: #66746e; line-height: 1.35; }
.select-banner__link {
  display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex: none;
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.select-banner__link .ico { width: 17px; height: 17px; transition: transform .15s; }
.select-banner__link:hover .ico { transform: translateX(3px); }

/* ---------- Главная: «Лошади и предложения» ---------- */
.horses { margin-top: 22px; scroll-margin-top: 12px; }
.horses__head { display: flex; align-items: center; gap: 12px 32px; margin-bottom: 14px; }
.horses__title { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; white-space: nowrap; }
.chips { display: flex; gap: 10px; }
/* Сортировка: видимая подпись, поверх — прозрачный системный список */
.sort {
  position: relative; display: inline-flex; align-items: center; gap: 7px; margin-left: auto; flex: none;
  height: 34px; font-size: 14px; font-weight: 500; color: var(--ink); border-radius: 6px;
}
.sort .ico { width: 19px; height: 19px; }
.sort .ico--sm { width: 16px; height: 16px; margin-left: 2px; }
.sort select {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
  appearance: none; -webkit-appearance: none; border: 0;
}
.sort:has(select:focus-visible) { outline: 2px solid var(--green-700); outline-offset: 3px; }
.horses__note { margin: -4px 0 16px; font-size: 14px; color: var(--muted); }
.horses__note button, .horses__note a { color: var(--green-800); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.horses__empty {
  grid-column: 1 / -1; padding: 48px 16px; border-radius: var(--radius); background: var(--tile);
  text-align: center; color: var(--muted);
}
.horses__empty b { display: block; margin-bottom: 6px; font-size: 18px; color: var(--ink); }
.horses__empty button { color: var(--green-800); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.horses__more { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 36px; }

/* ---------- Адаптивность ---------- */

/* Узкий ноутбук (1200–1365): пункты полосы экосистемы плотнее, чтобы «Международный рынок» не обрезался */
@media (max-width: 1365px) {
  .eco__label { margin-right: 20px; }
  .eco__link { padding: 0 14px; margin-right: 2px; }
  /* плитки уже — подпись мельче, чтобы «сопровождение» не заходило на фото */
  .svc__title { max-width: none; padding: 13px 0 0 13px; font-size: 14px; }
}
@media (max-width: 1279px) {
  .eco__label { display: none; }
  .eco__link:first-of-type { margin-left: -14px; }
}

/* Ноутбук: полосу экосистемы ужимаем, плитки услуг — по-прежнему одной полосой */
@media (max-width: 1199px) {
  :root { --gutter: 24px; }
  .eco__label { display: none; }
  .eco__link { padding: 0 12px; margin-right: 4px; }
  .eco__link:first-of-type { margin-left: -12px; }
  .catalog { margin-left: 28px; }
  .search { flex: 1 1 auto; }
  .region-btn { margin-left: 20px; }
  .svc { height: 84px; }
  .svc__img { max-width: 50%; }
  .svc__title { padding: 12px 0 0 11px; font-size: 13px; letter-spacing: -.01em; }
  .horses__title { font-size: 26px; }
  .hcard__price { font-size: 19px; }
  .hcard__meta, .hcard__loc { font-size: 14.5px; }
  /* Порода — одной строкой, пол и возраст — другой: в узкой карточке иначе обрезается возраст */
  .hcard__meta span { display: block; overflow: hidden; text-overflow: ellipsis; }
  .hcard__meta span + span::before { content: none; }
}

/* Планшет: полоса экосистемы прокручивается, справа только значки и «+ Разместить»;
   белая шапка в две строки — поиск во всю ширину; плитки услуг 3×2 */
@media (max-width: 1023px) {
  .eco__nav {
    /* затухание справа подсказывает, что ленту можно прокрутить */
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .eco__nav.is-end { -webkit-mask-image: none; mask-image: none; }
  .eco__actions .eco__btn:first-child, .eco__sep, .eco__login span, .eco__post-tail { display: none; }
  .eco__actions { gap: 16px; }

  .head__inner {
    display: grid; grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas: "logo catalog region" "search search search";
    gap: 10px 0; min-height: 0; padding-block: 12px 14px;
  }
  .logo { grid-area: logo; }
  .catalog { grid-area: catalog; }
  .search { grid-area: search; margin: 0; flex: none; }
  .region-btn { grid-area: region; justify-self: end; min-height: 44px; margin-block: -3px; }

  .services { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .svc { height: 92px; }
  .svc__img { max-width: 54%; }
  .svc__title { padding: 14px 0 0 15px; font-size: 15px; }
  .hgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .horses__head { flex-wrap: wrap; }

  /* Подвал: четыре ссылки и «©» в одну строку на планшете не помещаются — «©» на свою строку */
  .foot__inner { flex-wrap: wrap; gap: 4px 24px; }
  .foot__nav { flex-wrap: wrap; row-gap: 4px; }
  .foot__note { flex: 1 1 100%; margin: 0; text-align: left; }
}

/* Телефон: полоса экосистемы прокручивается, шапка в три строки, поиск на всю ширину */
@media (max-width: 767px) {
  :root { --gutter: 16px; }
  body { font-size: 14px; }

  .eco__inner { height: 38px; padding-inline: 0; }
  .eco__nav { padding-inline: 16px; scroll-padding-inline: 16px; }
  .eco__label { display: none; }
  .eco__link { padding: 0 10px; margin: 0; font-size: 13px; }
  .eco__link:first-of-type { margin-left: 0; }
  .eco__link:last-child { margin-right: 6px; }
  .eco__actions { display: none; }

  .head__inner {
    display: grid; grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo catalog icons" "search search search" "region post post";
    gap: 10px 10px; min-height: 0; padding-block: 10px 12px;
  }
  .logo { grid-area: logo; gap: 8px; }
  .logo__mark { width: 30px; height: 38px; }
  .logo__name { font-size: 22px; }
  .logo__sub { font-size: 11px; margin-top: 2px; }
  .catalog { grid-area: catalog; justify-self: end; margin: 0; }
  .catalog__btn { height: 38px; gap: 8px; padding: 0 12px; font-size: 14px; }
  .catalog__btn .ico--sm { display: none; }
  .catalog__menu { left: auto; right: -86px; min-width: 240px; }
  .head__icons { grid-area: icons; display: flex; align-items: center; gap: 2px; }
  .head__icon { position: relative; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; color: var(--ink); }
  .head__icon .ico { width: 23px; height: 23px; }
  .head__icon .fav-count { top: 2px; right: 0; }
  .search { grid-area: search; margin: 0; height: 44px; flex: none; }
  .search__ico { margin: 0 8px 0 12px; }
  .search__btn { width: 84px; }
  /* зона нажатия 44 px, строка шапки при этом не растёт */
  .region-btn { grid-area: region; justify-self: start; min-height: 44px; margin: -12px 0; font-size: 14px; }
  .region-btn .ico { width: 18px; height: 18px; }
  .head__post {
    grid-area: post; justify-self: end; display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; margin-block: -12px;
    font-size: 14px; font-weight: 600; color: var(--green-800);
  }
  .head__post .ico { width: 17px; height: 17px; }

  .page-main { padding-top: 4px; }
  .services {
    display: flex; gap: 8px; margin-inline: -16px; padding-inline: 16px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; scrollbar-width: none;
  }
  .services::-webkit-scrollbar { display: none; }
  .svc { flex: 0 0 200px; height: 92px; scroll-snap-align: start; }
  .svc__img { max-width: 56%; }
  .svc__title { padding: 12px 0 0 13px; font-size: 14.5px; }

  .select-banner {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px;
    margin-top: 16px; padding: 12px 14px;
  }
  .select-banner__shield { width: 34px; height: 34px; }
  .select-banner__title { font-size: 15px; }
  .select-banner__sub { font-size: 13px; }
  .select-banner__link { grid-column: 2; justify-self: start; min-height: 40px; margin: -8px 0 -10px; font-weight: 600; }

  .horses { margin-top: 24px; }
  .horses__head { gap: 12px; margin-bottom: 14px; }
  .horses__title { flex: 1 1 100%; font-size: 23px; white-space: normal; }
  .chips {
    flex: 1 1 100%; overflow-x: auto; scrollbar-width: none;
    margin-inline: -16px; padding-inline: 16px;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chips { gap: 6px; }
  .chip { height: 34px; padding: 0 12px; font-size: 13px; }
  .sort { margin-left: 0; }
  .hgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 10px; }
  .hcard__photo { border-radius: 8px; aspect-ratio: 4 / 3; }
  .hcard__check { top: 8px; left: 8px; width: 22px; height: 22px; }
  .hcard__check .ico { width: 14px; height: 14px; }
  .hcard__fav { top: 2px; right: 2px; }
  .hcard__fav .ico { width: 23px; height: 23px; }
  .hcard__body { padding: 8px 2px 0; }
  .hcard__title { font-size: 14px; }
  .hcard__price { margin-top: 2px; font-size: 17px; }
  .hcard__price.is-request { font-size: 14.5px; }
  .hcard__meta, .hcard__loc { margin-top: 3px; font-size: 13px; }
  .hcard__loc { gap: 4px; }
  .hcard__loc .ico { width: 15px; height: 15px; margin-top: 1px; }
  .horses__more { margin-top: 28px; }
  .horses__more .btn-outline { width: 100%; }

  .site-footer { margin-top: 40px; }
  .foot__inner { flex-wrap: wrap; gap: 4px 24px; padding-block: 12px 20px; }
  .foot__nav { flex-wrap: wrap; gap: 0 20px; }
  .foot__nav a { display: inline-block; padding-block: 12px; }
  .foot__note { flex: 1 1 100%; margin: 0; text-align: left; font-size: 12px; }
}

/* Узкий телефон (320 px): «Каталог» — только значок, регион и «Разместить» — каждый своей строкой */
@media (max-width: 359px) {
  .hgrid { grid-template-columns: minmax(0, 1fr); }
  .logo__sub { display: none; }
  .catalog__btn span { display: none; }
  .head__inner { grid-template-areas: "logo catalog icons" "search search search" "region region region" "post post post"; }
  .head__post { justify-self: start; }
}

/* =====================================================================
   Страница лошади (horse.html)
   1440: характеристики | галерея + описание | помощь; 1024: две колонки;
   телефон: одна колонка, галерея сразу после цены, кнопки продавца внизу экрана
   ===================================================================== */
:root {
  --cta: #22863f;          /* «Показать телефон»: зелёный с макета, чуть темнее ради читаемости */
  --cta-hover: #1d7537;
  --card-line: #eceeec;
  --danger-text: #c4352f;
}

.lot-page { padding-top: 6px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 14px; color: var(--muted-2); }
.crumbs a { transition: color .15s; }
.crumbs a:hover { color: var(--ink); }
.crumbs span[aria-hidden] { color: #b8bbc4; }
.crumbs__last { color: var(--ink-2); }

.lot-head { display: flex; align-items: flex-start; gap: 12px 32px; margin-top: 6px; }
.lot-head__main { min-width: 0; flex: 1 1 auto; }
.lot-title { font-size: 32px; font-weight: 700; line-height: 1.15; letter-spacing: -.012em; color: #0f241a; overflow-wrap: anywhere; }
.lot-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin-top: 4px; font-size: 14.5px; color: var(--muted);
}
.lot-meta__place { display: inline-flex; align-items: flex-start; gap: 6px; }
.lot-meta__place .ico { width: 18px; height: 18px; color: var(--ink-2); }
.lot-meta__dot { color: #b8bbc4; }
.badge-ok {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px 0 6px;
  border-radius: 12px; background: var(--lime); color: var(--green-950);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.badge-ok .ico { width: 15px; height: 15px; stroke-width: 2.6; }
.lot-price { flex: none; padding-top: 2px; font-size: 32px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; color: #0f241a; white-space: nowrap; }
.lot-price.is-request { font-size: 24px; font-weight: 600; color: var(--ink-2); padding-top: 6px; }

/* Сетка страницы */
.lot-grid {
  display: grid; margin-top: 14px; gap: 14px 18px;
  grid-template-columns: clamp(262px, 21.8%, 300px) minmax(0, 1fr) clamp(300px, 23.8%, 328px);
  grid-template-rows: auto auto auto 1fr;   /* последняя строка забирает лишнюю высоту боковых колонок */
  grid-template-areas:
    "seller seller seller"
    "specs gallery aside"
    "specs desc aside"
    "specs . aside";
}
.seller { grid-area: seller; }
.specs { grid-area: specs; align-self: start; }
.gallery { grid-area: gallery; }
.desc { grid-area: desc; }
.lot-aside { grid-area: aside; align-self: start; position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
/* Обёртка правой колонки работает только на 1024–1279 (две колонки); в остальных раскладках её как бы нет */
.lot-side { display: contents; }

.panel {
  border: 1px solid var(--card-line); border-radius: var(--radius); background: #fff;
  box-shadow: 0 1px 3px rgba(13, 18, 16, .04);
}

/* Полоса продавца */
.seller { display: flex; align-items: center; gap: 16px; padding: 7px 12px; }
/* Вместо фото продавца — знак КИАС на мятном фоне */
.seller__avatar {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 64px; height: 54px; border-radius: 10px;
  background: var(--mint); color: var(--green-900);
}
.seller__mark { width: 30px; height: 38px; }
.seller__info { flex: 1 1 auto; min-width: 0; }
.seller__top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.seller__name {
  min-width: 0; font-size: 16.5px; font-weight: 600; line-height: 1.3; color: var(--ink);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  overflow-wrap: anywhere;
}
.seller__ok {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  height: 24px; padding: 0 9px 0 6px; border-radius: 12px;
  background: var(--mint); color: var(--green-700); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.seller__ok .ico { width: 16px; height: 16px; stroke-width: 2; }
.seller__sub { margin-top: 3px; font-size: 14px; color: var(--muted); }
/* Части подписи не рвутся, точка-разделитель переносится вместе со следующей частью */
.seller__sub span { white-space: nowrap; }
.seller__sub span + span::before { content: '· '; }
.seller__actions { display: flex; gap: 14px; flex: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: 48px; padding: 0 26px; border-radius: var(--radius-sm);
  font-size: 15.5px; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn .ico { width: 22px; height: 22px; }
.btn--white { min-width: 176px; border: 1.5px solid #dfe3e0; background: #fff; color: var(--ink); }
.btn--white:hover { border-color: var(--green-800); background: var(--tile); }
.btn--green { min-width: 246px; background: var(--cta); color: #fff; }
.btn--green:hover { background: var(--cta-hover); }
.btn--green .ico { fill: currentColor; stroke-width: 1.2; }
/* Телефон скрыт: вместо номера — «Связаться через КИАС» (открывает форму) */
.btn__two { display: flex; flex-direction: column; line-height: 1.2; }
.btn__two small { font-size: 13px; font-weight: 500; color: var(--muted); }
.btn--kias { gap: 10px; animation: nudge .6s ease 2; }
.btn--kias .ico { fill: none; stroke-width: 1.8; }
.btn--kias .btn__two { align-items: flex-start; text-align: left; }
.btn--kias .btn__two b { font-weight: 600; }
.btn--kias .btn__two small { color: rgba(255, 255, 255, .82); font-size: 12px; }
@keyframes nudge { 50% { box-shadow: 0 0 0 6px rgba(34, 134, 63, .22); } }
.btn--lime { width: 100%; height: 56px; border-radius: 10px; background: var(--lime); color: var(--ink); font-size: 17px; }
.btn--lime:hover { background: var(--lime-hover); }
.btn--lime .ico { width: 26px; height: 26px; }

/* Характеристики */
.specs { padding: 20px 16px 16px; }
.specs__title, .desc__title, .help__title { font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -.005em; }
.specs__list { margin: 14px 0 0; padding: 0; }
.specs__row { display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: center; gap: 0 8px; min-height: 42px; padding: 4px 0; }
.specs__row dt { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.specs__row .ico { width: 26px; height: 26px; color: var(--ink); stroke-width: 1.85; }
/* У пустых строк значок приглушён, чтобы «—» отходили на второй план */
.specs__row:has(dd.is-empty) .ico { color: #b8bcc4; }
.specs__row dd { margin: 0; font-size: 15px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.specs__row dd small { margin-left: 4px; font-size: 13px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.specs__row dd.is-empty { color: #a7abb5; font-weight: 400; }
.specs__toggle {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 46px; margin-top: 14px;
  border-radius: 10px; background: #ebecee; font-size: 15px; font-weight: 500; color: var(--ink);
  transition: background .15s;
}
/* «Все характеристики» на <details>/<summary>: убираем стандартный треугольник */
.specs__toggle { list-style: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
.specs__toggle::-webkit-details-marker { display: none; }
.specs__toggle::marker { content: ''; }
.specs__toggle:hover { background: #e0e2e4; }
.specs__toggle .ico { width: 16px; height: 16px; transition: transform .2s; }
.specs__more[open] .specs__toggle .ico { transform: rotate(180deg); }
.specs__body { margin-top: 6px; }
.specs__sec { padding-top: 14px; }
.specs__sec h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 4px; }
.kv { margin: 0; }
.kv__row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv__row:last-child { border-bottom: 0; }
.kv__row dt { flex: 1 1 auto; min-width: 0; color: var(--muted); }
.kv__row dd { flex: 0 1 auto; max-width: 60%; margin: 0; text-align: right; font-weight: 500; overflow-wrap: break-word; }
.kv__row.is-stack { display: block; }
.kv__row.is-stack dd { max-width: none; margin-top: 4px; text-align: left; font-weight: 400; line-height: 1.45; }
.kv__row .is-danger { color: var(--danger-text); }
.kv__row .is-muted { color: var(--muted); font-weight: 400; }

/* Галерея */
.gallery { min-width: 0; }
.gallery__stage {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: var(--radius); background: var(--tile);
}
.gallery__stage:focus-visible { outline-offset: 3px; }
/* Фото и видео занимают всю сцену; лошадь обычно ниже центра кадра — не срезаем копыта */
.gallery__slot { position: absolute; inset: 0; }
.gallery__img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
/* Листание: следующее фото ещё грузится — прежнее (или заставка видео) остаётся на месте, чуть притушенное */
.gallery__slot > * { transition: opacity .15s; }
.gallery__slot.is-loading > * { opacity: .6; }
.gallery__video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.gallery__empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted-2); font-size: 15px;
}
.gallery__empty svg { width: 64px; height: 80px; color: #c6ccc8; }
.gallery__fav {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%;
  background: rgba(20, 28, 26, .55); color: #fff; box-shadow: none;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: transform .15s, background .15s;
}
.gallery__fav:hover { transform: scale(1.06); background: rgba(20, 28, 26, .72); }
.gallery__fav .ico { width: 23px; height: 23px; }
.gallery__fav[aria-pressed="true"] .ico { fill: var(--danger); stroke: var(--danger); }
.gallery__count {
  position: absolute; left: 14px; bottom: 14px; z-index: 2;
  padding: 5px 12px; border-radius: 16px; background: rgba(20, 20, 16, .62); color: #fff;
  font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.gallery__arrow {
  position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .9); color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  opacity: 0; transition: opacity .2s, background .15s;
}
.gallery__arrow--prev { left: 14px; }
.gallery__arrow--next { right: 14px; }
.gallery__arrow .ico { width: 24px; height: 24px; stroke-width: 2.2; }
.gallery__arrow:hover { background: #fff; }
.gallery__stage:hover .gallery__arrow, .gallery__arrow:focus-visible { opacity: 1; }
/* Идёт видео: счётчик убираем с полосы перемотки, стрелки чуть выше панели плеера */
.gallery__stage.is-video .gallery__count { display: none; }
.gallery__stage.is-video .gallery__arrow { top: 40%; }
@media (hover: none) { .gallery__arrow { opacity: 1; } }

/* Заставка видео: своё оформление, а не кадр — видео грузится только по клику */
.vposter {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  width: 100%; background: radial-gradient(circle at 50% 45%, #24563d 0, var(--green-900) 70%); color: #fff;
}
.vposter__mark { position: absolute; right: 6%; bottom: -8%; width: 34%; height: auto; color: rgba(255, 255, 255, .06); }
.vposter__play {
  display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; border-radius: 50%;
  background: var(--lime); color: var(--green-950); transition: transform .15s;
}
.vposter:hover .vposter__play { transform: scale(1.06); }
.vposter__play .ico { width: 34px; height: 34px; margin-left: 4px; }
.vposter__text { font-size: 16px; font-weight: 600; }
.vposter__hint { margin-top: -8px; font-size: 13px; color: rgba(255, 255, 255, .6); }

/* position: relative — offsetLeft миниатюр отсчитывается от ленты (нужно скрипту для прокрутки к активной) */
.gallery__thumbs {
  position: relative;
  display: flex; gap: 8px; margin-top: 8px; padding: 2px;
  overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none;
}
.gallery__thumbs::-webkit-scrollbar { display: none; }
.thumb {
  position: relative; flex: 0 0 calc((100% - 5 * 8px) / 6); aspect-ratio: 5 / 3; overflow: hidden;
  border-radius: 8px; background: var(--tile);
  outline: 3px solid transparent; outline-offset: -3px; transition: outline-color .15s, opacity .15s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: .88; }
.thumb.is-active { outline-color: var(--lime); }
.thumb.is-active::after { content: ''; position: absolute; inset: 0; border-radius: 8px; box-shadow: inset 0 0 0 4px rgba(196, 245, 47, .35); }
.thumb--video {
  display: flex; align-items: center; justify-content: center; color: #fff;
  background-color: var(--green-900); background-size: cover; background-position: center;
}
.thumb--video img { position: absolute; inset: 0; }
.thumb--video::before { content: ''; position: absolute; inset: 0; z-index: 1; background: rgba(14, 53, 35, .45); }
.thumb--video .thumb__play {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(255, 255, 255, .14);
}
/* Больше шести файлов: на шестой миниатюре «+N», остальные — стрелками */
.thumb__more {
  position: absolute; inset: 0; z-index: 3; display: none; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(14, 53, 35, .6); color: #fff; font-size: 17px; font-weight: 600; line-height: 1.15;
}
.thumb__more small { font-size: 11.5px; font-weight: 500; opacity: .85; }
@media (min-width: 768px) {
  .gallery__thumbs.is-capped .thumb:nth-child(n + 7) { display: none; }
  .gallery__thumbs.is-capped .thumb__more { display: flex; }
  /* Под «+N» видео-миниатюра: свой ▶ не показываем, иначе он просвечивает сквозь «+N» */
  .gallery__thumbs.is-capped .thumb:nth-child(6) .thumb__play { display: none; }
  /* Нажали «+N» — все миниатюры рядами по шесть */
  .gallery__thumbs.is-open { flex-wrap: wrap; overflow: visible; }
}
.thumb--video .thumb__play .ico { width: 18px; height: 18px; margin-left: 2px; }

/* Описание */
.desc__text { margin-top: 8px; font-size: 15.5px; line-height: 1.55; color: #4a4e5e; max-width: 72ch; }
.desc__text p + p { margin-top: 10px; }
.desc__text.is-empty { color: var(--muted); }

/* Правая колонка: помощь с покупкой и документы */
.help { padding: 20px 16px 18px; }
.help__sub { margin-top: 6px; font-size: 13px; color: var(--muted); text-wrap: balance; }
.help .btn--lime { margin-top: 16px; }
.help__list { list-style: none; margin: 16px 0 0; padding: 0 0 0 4px; }
.help__list li { display: flex; align-items: center; gap: 12px; min-height: 36px; font-size: 15px; color: var(--ink-2); }
.help__check {
  display: flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--green-900); color: #fff;
}
.help__check .ico { width: 15px; height: 15px; stroke-width: 2.6; }

.docs { padding: 18px 10px 10px; border-radius: var(--radius); background: #eff2f1; }
.docs__title { font-size: 17.5px; font-weight: 700; margin: 0 2px 12px; }
.docs__row {
  display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 10px;
  border-radius: var(--radius-sm); background: #fff; font-size: 13.5px; color: var(--muted);
}
.docs__row + .docs__row { margin-top: 6px; }
.docs__row .ico { width: 23px; height: 23px; color: var(--ink-2); stroke-width: 1.6; }
.docs__row span { flex: 1 1 auto; min-width: 0; }
.docs__link {
  flex: none; font-size: 14px; font-weight: 600; color: var(--green-800); cursor: pointer;
  text-decoration: underline; text-decoration-color: #7fc79a; text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}
.docs__link:hover { text-decoration-color: currentColor; }

/* Объявление не найдено */
.lot-missing { margin-top: 24px; padding: 56px 20px; border-radius: var(--radius); background: var(--tile); text-align: center; color: var(--muted); }
.lot-missing h1 { margin-bottom: 8px; font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.lot-missing p + p { margin-top: 6px; }
.lot-missing p a { color: var(--green-800); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.lot-missing__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 24px; margin-top: 22px; }
.lot-missing .btn-outline { background: #fff; }
.lot-missing__home { font-weight: 600; color: var(--green-800); text-decoration: underline; text-underline-offset: 3px; }

/* Узкий ноутбук и планшет: две колонки — галерея и описание слева, характеристики и помощь справа */
@media (max-width: 1279px) {
  .lot-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-areas:
      "seller seller"
      "gallery side"
      "desc side"
      ". side";
  }
  .lot-side { grid-area: side; display: flex; flex-direction: column; gap: 16px; }
  .lot-side > * { align-self: stretch; }
  .lot-aside { position: static; }
  .lot-title, .lot-price { font-size: 29px; }
}

@media (max-width: 1023px) {
  .lot-side { display: contents; }
  .lot-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas:
      "seller seller"
      "gallery gallery"
      "specs aside"
      "desc desc";
  }
  .seller__actions { gap: 10px; }
  .btn { padding: 0 18px; }
  .btn--white { min-width: 0; }
  .btn--green { min-width: 0; }
}

/* Телефон: одна колонка, кнопки продавца — липкая панель внизу экрана */
@media (max-width: 767px) {
  body.has-actionbar { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  /* Шапка в две строки: регион и «Разместить» на странице одной лошади не нужны, фото поднимается выше */
  .has-actionbar .region-btn, .has-actionbar .head__post { display: none; }
  .has-actionbar .head__inner { grid-template-areas: "logo catalog icons" "search search search"; }
  .lot-page { padding-top: 8px; }
  .crumbs { font-size: 13px; gap: 0 8px; align-items: center; }
  .crumbs a { padding: 8px 0; }
  .lot-head { flex-direction: column; gap: 10px; margin-top: 0; }
  .lot-title { font-size: 24px; line-height: 1.2; }
  .lot-meta { margin-top: 6px; font-size: 13.5px; gap: 4px 14px; }
  .lot-meta__dot { display: none; }
  .lot-meta__place .ico { width: 16px; height: 16px; margin-top: 1px; }
  .lot-price { padding: 0; font-size: 26px; }
  .lot-price.is-request { padding: 0; font-size: 21px; }

  .lot-grid {
    grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 14px;
    grid-template-areas: "gallery" "seller" "specs" "desc" "aside";
  }
  .lot-aside { gap: 12px; }

  .gallery__stage { aspect-ratio: 4 / 3; }
  .gallery__arrow { display: none; }
  .gallery__fav { top: 10px; right: 10px; width: 38px; height: 38px; }
  .gallery__fav .ico { width: 21px; height: 21px; }
  .gallery__count { left: 10px; bottom: 10px; padding: 4px 10px; font-size: 12.5px; }
  .gallery__thumbs { gap: 6px; margin-top: 6px; }
  .thumb { flex-basis: calc((100% - 4 * 6px) / 4.6); border-radius: 6px; }
  .thumb.is-active::after { border-radius: 6px; }
  .thumb--video .thumb__play { width: 28px; height: 28px; }
  .vposter__play { width: 64px; height: 64px; }
  .vposter__text { font-size: 15px; }

  .seller { gap: 12px; padding: 12px; }
  .seller__avatar { width: 48px; height: 48px; }
  .seller__mark { width: 24px; height: 30px; }
  .seller__name { font-size: 15px; }
  .seller__sub { font-size: 13px; }
  .seller__actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(13, 18, 16, .06);
  }
  .btn { height: 46px; padding: 0 10px; gap: 8px; font-size: 15px; }
  .btn .ico { width: 20px; height: 20px; }

  .specs, .help { padding: 16px 14px 14px; }
  .specs__title, .desc__title, .help__title { font-size: 19px; }
  .specs__row { grid-template-columns: 150px minmax(0, 1fr); min-height: 40px; }
  .desc__text { font-size: 15px; }
  .btn--lime { height: 52px; font-size: 16px; }
  .docs__row { padding: 6px 12px; font-size: 14px; }
  .docs__link { padding: 12px 0; margin: -12px 0; }
  .btn__two small { font-size: 12px; }
  /* «Связаться через КИАС» в нижней панели: без значка, текст по центру, чтобы влезал */
  .btn--kias { padding: 0 8px; min-width: 0; }
  .btn--kias .ico { display: none; }
  .btn--kias .btn__two { align-items: center; text-align: center; min-width: 0; }
  .btn--kias .btn__two b { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .btn--kias .btn__two small { font-size: 11.5px; }

  .site-footer { margin-top: 32px; }
}

/* Узкий телефон: «Написать» без значка и уже, чтобы «Связаться через КИАС» влезал целиком */
@media (max-width: 359px) {
  .seller__actions { grid-template-columns: 1fr 1.6fr; }
  .seller__actions .btn--white .ico { display: none; }
  .btn--kias .btn__two b { font-size: 13px; }
  .btn--kias .btn__two small { font-size: 11px; }
}

/* =====================================================================
   Форма заявки (модальное окно). На телефоне — панель снизу экрана
   ===================================================================== */
.np-modal {
  width: min(520px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0;
  border: 0; border-radius: 16px; background: #fff; color: var(--ink);
  box-shadow: 0 24px 64px rgba(13, 18, 16, .28);
}
.np-modal::backdrop { background: rgba(13, 24, 18, .55); }
.np-modal__form, .np-modal__done { padding: 22px 24px 24px; }
.np-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.np-modal__title { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.np-modal__title:focus { outline: none; }
.np-modal__close {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; margin: -8px -10px 0 0; border-radius: 50%; color: var(--ink-2);
}
.np-modal__close:hover { background: var(--tile); }
.np-modal__close .ico { width: 22px; height: 22px; }
.np-modal__sub { margin-top: 6px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.np-modal__lot {
  display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px;
  border-radius: 10px; background: var(--mint); color: var(--green-900); font-size: 14px; font-weight: 500;
}
.np-modal__lot .ico { width: 22px; height: 22px; }
.np-modal__lot span { min-width: 0; overflow-wrap: anywhere; }
.field { display: block; margin-top: 14px; }
.field__label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.field__input {
  display: block; width: 100%; height: 46px; padding: 0 14px;
  border: 1.5px solid #d3d9d5; border-radius: var(--radius-sm); background: #fff;
  font: inherit; font-size: 15px; color: var(--ink); outline: 0; transition: border-color .15s;
}
.field__input::placeholder { color: #9a9daa; }
.field__input:focus { border-color: var(--green-800); }
.field__input--area { height: auto; min-height: 104px; padding: 10px 14px; line-height: 1.45; resize: vertical; }
.field__input[aria-invalid="true"] { border-color: var(--danger); }
.consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); cursor: pointer; }
.consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--cta); }
.consent a { color: var(--green-800); text-decoration: underline; text-underline-offset: 3px; }
.consent.is-invalid { color: var(--danger-text); }
.np-modal__error { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: #fdecec; color: var(--danger-text); font-size: 14px; }
.np-modal__submit { width: 100%; margin-top: 18px; }
.np-modal__submit[disabled] { opacity: .7; cursor: progress; }
.np-modal__done { text-align: center; }
.np-modal__done-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-top: 8px;
  border-radius: 50%; background: var(--lime); color: var(--green-950);
}
.np-modal__done-ico .ico { width: 30px; height: 30px; stroke-width: 2.4; }
.np-modal__done .np-modal__title { margin-top: 12px; }
.np-modal__done p { margin-top: 8px; font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; }
.np-modal__done .np-modal__note { font-size: 14px; color: var(--muted); }
.np-modal__done .btn { margin-top: 18px; min-width: 160px; }
body.np-modal-open { overflow: hidden; }

@media (max-width: 767px) {
  .np-modal {
    width: 100%; max-width: 100%; max-height: calc(100% - 24px);
    margin: auto 0 0; border-radius: 16px 16px 0 0;
  }
  .np-modal__form, .np-modal__done { padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); }
  .np-modal__title { font-size: 20px; }
  .field__input { font-size: 16px; }   /* меньше 16 px — iPhone увеличивает страницу при вводе */
}

/* =====================================================================
   Каталог /catalog и страницы пород /catalog/poroda/<slug>
   1440: фильтры слева (272 px) | 3 карточки в ряд; 1024–1199: фильтры (240 px) | 2 в ряд;
   планшет: фильтры — панель справа по кнопке «Фильтры», 2 в ряд; телефон: панель снизу, 2 в ряд (320 px — 1)
   ===================================================================== */
.cat-page { padding-top: 6px; }
.cat-head { margin-top: 6px; }
.cat-title { font-size: 32px; font-weight: 700; line-height: 1.15; letter-spacing: -.012em; color: #0f241a; overflow-wrap: anywhere; }
.cat-intro { max-width: 860px; margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.cat-layout {
  display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 28px;
  align-items: start; margin-top: 18px;
}

/* Панель фильтров: на компьютере — колонка слева, прилипает при прокрутке (на любой высоте окна).
   Поля прокручиваются внутри панели, заголовок и кнопка «Показать N лошадей» всегда видны */
.cat-side { position: relative; z-index: 5; }
@media (min-width: 1024px) {
  .cat-side { position: sticky; top: 16px; }
  .cat-side .filters { max-height: calc(100vh - 32px); }
}
.cat-side__backdrop { display: none; }
.filters {
  display: flex; flex-direction: column;
  border: 1px solid var(--card-line); border-radius: var(--radius); background: #fff;
  box-shadow: 0 1px 3px rgba(13, 18, 16, .04);
}
.filters__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 6px; }
.filters__title { font-size: 19px; font-weight: 700; line-height: 1.2; }
.filters__clear { margin-left: auto; font-size: 13.5px; font-weight: 600; color: var(--green-800); text-decoration: underline; text-underline-offset: 3px; }
.filters__close { display: none; }
.filters__body { flex: 1 1 auto; min-height: 0; padding: 0 18px; overflow-y: auto; overscroll-behavior: contain; }
.fgroup { min-width: 0; margin: 0; padding: 13px 0; border: 0; border-top: 1px solid var(--line); }
.fgroup:first-child { border-top: 0; padding-top: 8px; }
.fgroup__label { display: block; margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
/* Подпись группы (<legend>) — обычной строкой над полями, а не на линии рамки */
legend.fgroup__label { float: left; width: 100%; }
legend.fgroup__label + * { clear: both; }
.fselect, .finput {
  display: block; width: 100%; height: 44px; padding: 0 12px;
  border: 1.5px solid #d3d9d5; border-radius: var(--radius-sm); background-color: #fff;
  font: inherit; font-size: 15px; color: var(--ink); outline: 0; transition: border-color .15s;
}
.fselect {
  padding-right: 36px; cursor: pointer; appearance: none; -webkit-appearance: none; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232a2d31' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
.finput { -moz-appearance: textfield; appearance: textfield; }
.finput::-webkit-outer-spin-button, .finput::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.finput::placeholder { color: #9a9daa; }
.fselect:hover, .finput:hover { border-color: #b9c2bd; }
.fselect:focus, .finput:focus { border-color: var(--green-800); }
.frange { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fcheck { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: 15px; cursor: pointer; }
.fcheck input, .fkias input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--cta); cursor: pointer; }
.fkias {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px;
  border-radius: 10px; background: var(--mint); cursor: pointer;
}
.fkias input { margin-top: 1px; }
.fkias__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.fkias__text b { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.fkias__text small { font-size: 12.5px; line-height: 1.35; color: #66746e; }
.fkias__ico { width: 22px; height: 22px; color: var(--green-900); stroke-width: 1.7; }
.filters__foot { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.filters__apply { width: 100%; min-width: 0; height: 46px; padding: 0 16px; }
.filters__reset { display: none; }

/* Полоса над сеткой: «Найдено N лошадей», сортировка; на планшете и телефоне — кнопка «Фильтры» */
.cat-results { min-width: 0; }
.cat-bar { display: flex; align-items: center; gap: 10px 20px; min-height: 36px; }
/* Строка «Найдено…» сжимается и переносит даже длинное слово без пробелов (запрос из поиска),
   чтобы не выталкивать сортировку за край и не давать прокрутку вбок */
.cat-found { min-width: 0; flex: 1 1 auto; font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; }
.cat-found b { font-weight: 700; color: var(--ink); }
.cat-found__page { color: var(--muted); }
.cat-sort { flex: none; margin-left: auto; }
.cat-sort__apply {
  height: 34px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--tile);
  font-size: 13.5px; font-weight: 600;
}
.fbtn { display: none; }
.fchips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 32px; padding: 0 10px 0 14px;
  border-radius: 10px; background: var(--tile); color: var(--ink-2);
  font-size: 13.5px; font-weight: 500; transition: background .15s;
}
.fchip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip .ico { width: 15px; height: 15px; color: var(--muted); }
.fchip:hover { background: #e8eae7; }
.fchip:hover .ico { color: var(--ink); }
.fchips__reset { margin-left: 4px; font-size: 13.5px; font-weight: 600; color: var(--green-800); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
.cat-empty {
  margin-top: 16px; padding: 48px 20px; border-radius: var(--radius); background: var(--tile);
  text-align: center; color: var(--muted);
}
.cat-empty b { display: block; margin-bottom: 6px; font-size: 19px; color: var(--ink); }
.cat-empty p { max-width: 560px; margin: 0 auto; line-height: 1.5; }
.cat-empty__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 24px; margin-top: 20px; }
.cat-empty .btn-outline { background: #fff; }

/* Страницы */
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 40px; }
.pager__nums { display: flex; align-items: center; gap: 4px; }
.pager__nums--narrow { display: none; }
.pager__num {
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 8px;
  border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--ink-2); transition: background .15s;
}
a.pager__num:hover { background: var(--tile); color: var(--ink); }
.pager__num.is-current { background: var(--green-950); color: #fff; }
.pager__gap { min-width: 22px; text-align: center; color: var(--muted-2); }
.pager__step {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px;
  border: 1.5px solid #d3d9d5; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.pager__step--next { flex-direction: row-reverse; }
.pager__step .ico { width: 18px; height: 18px; }
.pager__ico { display: inline-flex; }
a.pager__step:hover { border-color: var(--green-800); background: var(--tile); }
.pager__step.is-off { border-color: var(--line); color: #b8bbc4; }

/* Вопросы о породе и ссылки на породы */
.cat-sec { margin-top: 56px; }
.cat-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); }
.cat-h2 { margin-top: 2px; font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.faq__list { max-width: 920px; margin-top: 14px; border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0;
  font-size: 16.5px; font-weight: 600; line-height: 1.35; cursor: pointer; list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::marker { content: ''; }
.faq__item summary .ico { color: var(--muted); transition: transform .2s; }
.faq__item[open] summary .ico { transform: rotate(180deg); }
.faq__item summary:hover { color: var(--green-800); }
.faq__item p { max-width: 780px; padding: 0 0 18px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.breeds__list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.breeds__link {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px;
  border-radius: 10px; background: var(--tile); color: var(--ink-2);
  font-size: 14px; font-weight: 500; transition: background .15s, color .15s;
}
.breeds__link:hover { background: #e8eae7; color: var(--ink); }
.breeds__all { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-weight: 600; color: var(--green-800); }
.breeds__all .ico { width: 18px; height: 18px; transition: transform .15s; }
.breeds__all:hover .ico { transform: translateX(3px); }
/* Страница «Такой породы нет»: список пород под сообщением */
.lot-page .breeds { margin-top: 36px; }

@media (max-width: 1199px) {
  .cat-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-title { font-size: 28px; }
  .filters__head { padding: 14px 14px 6px; }
  .filters__body { padding: 0 14px; }
  .filters__foot { padding: 12px 14px 14px; }
}

/* Планшет и телефон: фильтры — выезжающая панель. Без скрипта открывается ссылкой #filters (:target) */
@media (max-width: 1023px) {
  .cat-layout { display: block; margin-top: 14px; }
  .cat-side { position: fixed; inset: 0; z-index: 90; display: none; }
  .cat-side:not(.is-js):target, .cat-side.is-open { display: block; }
  .cat-side__backdrop { display: block; position: absolute; inset: 0; background: rgba(13, 24, 18, .55); }
  .filters {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); max-height: none;
    border: 0; border-radius: 16px 0 0 16px; box-shadow: -12px 0 40px rgba(13, 18, 16, .22);
    animation: np-sheet-side .22s ease;
  }
  .filters__head { padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
  .filters__title { font-size: 20px; }
  .filters__clear { display: none; }
  .filters__close {
    display: flex; align-items: center; justify-content: center; flex: none;
    width: 44px; height: 44px; margin-left: auto; border-radius: 50%; color: var(--ink-2);
  }
  .filters__close:hover { background: var(--tile); }
  .filters__close .ico { width: 22px; height: 22px; }
  .filters__body { padding: 0 20px; }
  .fgroup:first-child { padding-top: 14px; }
  .filters__foot {
    flex-direction: row; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 16px rgba(13, 18, 16, .05);
  }
  .filters__apply { flex: 1 1 auto; width: auto; }
  .filters__reset {
    display: inline-flex; align-items: center; justify-content: center; flex: none; height: 46px; padding: 0 18px;
    border: 1.5px solid #dfe3e0; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600;
  }
  .filters__reset:hover { border-color: var(--green-800); background: var(--tile); }
  body.filters-open { overflow: hidden; }

  .fbtn {
    display: inline-flex; align-items: center; gap: 8px; flex: none; height: 40px; padding: 0 14px;
    border: 1.5px solid #d3d9d5; border-radius: 10px; background: #fff;
    font-size: 14.5px; font-weight: 600; color: var(--ink); transition: border-color .15s, background .15s;
  }
  .fbtn:hover { border-color: var(--green-800); background: var(--tile); }
  .fbtn .ico { width: 20px; height: 20px; }
  .fbtn__n {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    background: var(--lime); color: var(--green-950); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
  }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@keyframes np-sheet-side { from { transform: translateX(100%); } to { transform: none; } }
@keyframes np-sheet-up { from { transform: translateY(100%); } to { transform: none; } }

@media (max-width: 767px) {
  .cat-title { font-size: 24px; }
  .cat-intro { font-size: 14px; }
  .filters {
    top: auto; left: 0; width: 100%; max-height: calc(100% - 40px);
    border-radius: 16px 16px 0 0; box-shadow: 0 -12px 40px rgba(13, 18, 16, .22);
    animation-name: np-sheet-up;
  }
  .filters__head { padding: 10px 8px 10px 16px; }
  .filters__body { padding: 0 16px; }
  .filters__foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .fselect, .finput { font-size: 16px; }   /* меньше 16 px — iPhone увеличивает страницу при вводе */

  /* Первая строка: «Фильтры (N)» и сортировка, вторая — «Найдено N лошадей» */
  .cat-bar { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; }
  .cat-bar .fbtn { grid-column: 1; grid-row: 1; }
  .cat-sort { grid-column: 2; grid-row: 1; justify-self: end; max-width: 100%; min-width: 0; gap: 5px; font-size: 13.5px; }
  .cat-sort #cat-sort-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cat-sort__apply { grid-column: 2; justify-self: end; }
  .cat-found { grid-column: 1 / -1; grid-row: 2; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
  .fchips {
    flex-wrap: nowrap; overflow-x: auto; margin: 10px -16px 0; padding-inline: 16px; scrollbar-width: none;
  }
  .fchips::-webkit-scrollbar { display: none; }
  .fchip { flex: none; height: 34px; }
  .cat-grid { margin-top: 14px; }
  .cat-empty { padding: 36px 16px; }

  .pager { gap: 6px; margin-top: 28px; }
  .pager__step { padding: 0 11px; }
  .pager__step span:not(.pager__ico) { display: none; }
  .pager__num { min-width: 38px; height: 42px; padding: 0 4px; }
  .pager__nums--wide { display: none; }
  .pager__nums--narrow { display: flex; }
  .pager__gap { min-width: 14px; }

  .cat-sec { margin-top: 40px; }
  .cat-h2 { font-size: 20px; }
  .faq__item summary { padding: 14px 0; font-size: 15.5px; }
  .faq__item p { font-size: 14.5px; }
  .breeds__link { height: 34px; padding: 0 12px; font-size: 13.5px; }
}
/* Узкий телефон: «Фильтры (N)» и полная подпись сортировки в одну строку — без значка сортировки */
@media (max-width: 400px) {
  .cat-bar { gap: 10px 8px; }
  .fbtn { padding: 0 12px; gap: 7px; }
  .cat-sort > .ico:first-child { display: none; }
}
@media (max-width: 359px) {
  .cat-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
