/* =========================================================
   дом-щенков.рф — подбор породы и сравнения пород (группа choice).
   Подключается после main.css и pages.css. Только раскладка этих страниц:
   токены, плитки, кнопки, студийные плитки, таблица, CTA — из общих файлов.
   ========================================================= */

/* =========================================================
   ТЕСТ «Какая порода ваша» (/podbor-porody/)
   ========================================================= */
.cho-nojs { display: none; }
html:not(.js) .cho-nojs {
  display: block; padding: 22px 26px; border-radius: var(--r-tile);
  background: var(--tile); color: var(--muted); font-size: 16px; line-height: 1.5;
}
html:not(.js) .cho-quiz { display: none; }

.cho-q { padding: clamp(22px, 3vw, 44px); border-radius: var(--r-tile); background: var(--tile); }
.cho-q__top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.cho-q__count { min-width: 3.6em; font-size: 15px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.cho-q__count span { color: var(--ink); }
.cho-q__bar { height: 6px; border-radius: var(--r-pill); background: var(--page); overflow: hidden; }
.cho-q__fill {
  display: block; height: 100%; width: calc(var(--p, 0) * 100%);
  border-radius: inherit; background: var(--ink);
  transition: width .5s var(--ease);
}
.cho-q__back {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 16px 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: #fff;
  font-size: 14px; font-weight: 500; transition: border-color .2s;
}
.cho-q__back .i { width: 18px; height: 18px; transform: scaleX(-1); }
.cho-q__back:hover { border-color: var(--ink); }
.cho-q__back:disabled { visibility: hidden; }

.cho-q__step { min-width: 0; margin: clamp(26px, 3vw, 44px) 0 0; padding: 0; border: 0; }
.cho-q__title {
  float: left; width: 100%; padding: 0; margin-bottom: clamp(20px, 2.2vw, 30px);
  font-size: clamp(28px, 2.8vw, 44px); font-weight: 500; letter-spacing: -0.032em; line-height: 1.05;
  text-wrap: balance;
}
.cho-q__title:focus { outline: none; }
.cho-q__title:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; border-radius: 6px; }
.cho-q__opts { clear: both; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: var(--gap); }
.cho-q__opts--4 { --n: 4; }

.cho-opt__input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cho-opt {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
  padding: clamp(18px, 1.8vw, 26px);
  border-radius: var(--r-img); border: 2px solid transparent;
  background: var(--bg, var(--sand));
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color .2s, transform .35s var(--ease);
}
.cho-opt .ico { width: 48px; height: 48px; }
.cho-opt .ico .i { width: 22px; height: 22px; }
.cho-opt__txt { display: grid; gap: 5px; padding-right: 8px; }
.cho-opt__label { font-size: clamp(19px, 1.5vw, 23px); font-weight: 500; letter-spacing: -0.022em; line-height: 1.15; }
.cho-opt__line { font-size: 14.5px; line-height: 1.4; color: var(--ink-soft); }
.cho-opt__mark {
  position: absolute; top: 16px; right: 16px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid rgba(20, 20, 20, .16); background: rgba(255, 255, 255, .7); color: transparent;
  transition: background-color .2s, color .2s, border-color .2s;
}
.cho-opt__mark .i { stroke-width: 2.4; }
@media (hover: hover) {
  .cho-opt:hover { border-color: rgba(20, 20, 20, .22); transform: translateY(-2px); }
}
.cho-opt__input:checked + .cho-opt { border-color: var(--ink); }
.cho-opt__input:checked + .cho-opt .cho-opt__mark { background: var(--ink); border-color: var(--ink); color: #fff; }
.cho-opt__input:focus-visible + .cho-opt { outline: 2px solid var(--ink); outline-offset: 3px; }

.cho-q__foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px 20px; margin-top: clamp(20px, 2.4vw, 32px); }
/* «Дальше» — только когда в открытом вопросе уже выбран ответ (клавиатура, «Назад»): нажатие на вариант и так ведёт дальше */
.cho-q:not(:has(.cho-q__step:not([hidden]) .cho-opt__input:checked)) .cho-q__next,
.cho-q.is-auto .cho-q__next { display: none; }
.cho-q__hint { flex: 1 1 auto; font-size: 15px; font-weight: 500; color: var(--err); }
.cho-q__hint:empty { visibility: hidden; }

/* ---------- результат ---------- */
.is-done .sec-head__lead { display: none; } /* «Нажмите на вариант…» — уже не нужно */
.cho-res__tile { min-height: clamp(440px, 36vw, 540px); }
.cho-res__copy { max-width: min(640px, 56%); }
.cho-res__title {
  margin-top: clamp(18px, 2vw, 26px);
  font-size: clamp(40px, 4.4vw, 68px); font-weight: 500; letter-spacing: -0.035em; line-height: .98;
}
.cho-res__title:focus { outline: none; }
.cho-res__why { display: grid; gap: 10px; margin-top: 22px; }
.cho-res__why li { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: start; column-gap: 10px; font-size: 16px; font-weight: 500; line-height: 1.35; }
.cho-res__tick {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .78); color: var(--ok);
}
.cho-res__tick .i { stroke-width: 2.4; }
.cho-res__why li > :last-child { padding-top: 3px; }
.cho-res__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.cho-res__card {
  display: flex; flex-direction: column; gap: 16px;
  padding: var(--tile-pad); border-radius: var(--r-tile); background: var(--tile);
}
.cho-res__note { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: 12px; font-size: 15px; line-height: 1.45; }
.cho-res__note > span { padding-top: 5px; }
.cho-alt { display: flex; flex-direction: column; gap: 18px; height: 100%; }
.cho-alt__head { display: flex; align-items: center; gap: 14px; }
.cho-alt .face { width: 56px; height: 56px; }
.cho-alt__txt { display: grid; gap: 2px; }
.cho-alt__label { font-size: 14px; line-height: 1.35; color: var(--muted); }
.cho-alt__name { font-size: var(--fs-h3); font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; }
.cho-alt__links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: auto; }
.cho-res__again { justify-content: space-between; }
/* ссылка на результат (#rezultat-…) без ответов: второй породы нет — две плитки вместо трёх */
.cho-res__row:has(> .cho-res__alt[hidden]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cho-res__row:has(> .cho-res__alt[hidden]) > .cho-res__notes { grid-column: auto; }
.cho-res__again .btn .i { transform: none; }

/* ---------- «Быстрые ответы» ---------- */
.cho-ans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.cho-ans__card {
  min-width: 0; display: flex; flex-direction: column; align-items: flex-start;
  padding: var(--tile-pad); border-radius: var(--r-tile); background: var(--tile);
}
.cho-ans__card > .ico { margin-bottom: clamp(22px, 2.4vw, 36px); }
.cho-ans__title { font-size: var(--fs-h3); font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; }
.cho-ans__line { margin-top: 8px; font-size: 15px; line-height: 1.45; color: var(--muted); max-width: 42ch; }
.cho-ans__breeds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 22px; }
.cho-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 15px 0 4px; border-radius: var(--r-pill);
  background: var(--page); color: var(--ink);
  font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.cho-chip .face { width: 32px; height: 32px; }
.cho-chip:hover { background: var(--ink); color: #fff; }

/* ---------- ссылки на сравнения ---------- */
.cho-pairs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: clamp(22px, 2.4vw, 34px); }
.cho-pairs__label { padding-left: 4px; font-size: 15px; font-weight: 500; color: var(--muted); }
.cho-pairs__list { display: flex; flex-wrap: wrap; gap: 8px; }
.cho-pair {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 18px 0 6px; border-radius: var(--r-pill);
  background: var(--tile); color: var(--ink);
  font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.cho-pair__faces { display: flex; }
.cho-pair__faces .face { width: 36px; height: 36px; border: 2px solid #fff; }
.cho-pair__faces .face + .face { margin-left: -10px; }
.cho-pair:hover { background: var(--ink); color: #fff; }

/* =========================================================
   «ЧЕМ ХОРОШ ЩЕНОК …» (/sravnenie/<breed>/)
   ========================================================= */
/* «Преимущества <породы>» (ui.advantages, по три в ряд): заголовки в ряду на одной высоте, лишняя высота плитки — снизу
   (плитка с описанием в одну строку иначе центрирует текст и опускает заголовок; как #chto-vhodit в puppy.css) */
#preimushchestva .adv { align-content: start; }
@media (min-width: 761px) { #preimushchestva .adv__title { align-self: start; } }

/* «Кому подойдёт» (правка 21.10): четыре карточки с фото — как на странице щенка (puppy.css .pp-fit): фото с отступом
   8 px на тоне породы, заголовок и строка под ним */
.cho-fits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.cho-fitc { display: flex; flex-direction: column; min-width: 0; padding: var(--inset); border-radius: var(--r-tile); background: var(--tile); }
.cho-fitc__photo { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-img); overflow: hidden; background: var(--tone); }
.cho-fitc__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cho-fitc__title { margin: 16px 10px 0; font-size: clamp(20px, 1.6vw, 24px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; }
.cho-fitc__line { margin: 6px 10px 12px; font-size: 15px; line-height: 1.45; color: var(--ink-soft); }

/* «Лучше подобрать другую породу»: три белые плашки — крестик, кому не подойдёт, и почему */
.cho-unfit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.cho-unfit__item {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 14px; row-gap: 10px; align-content: start; min-width: 0;
  padding: clamp(22px, 2.4vw, 32px); border-radius: var(--r-tile); background: var(--tile);
}
.cho-unfit__mark {
  grid-row: 1 / span 2; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--coral-50); color: var(--ink);
}
.cho-unfit__mark .i { stroke-width: 2.2; }
.cho-unfit__title { padding-top: 5px; font-size: clamp(19px, 1.5vw, 23px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.2; }
.cho-unfit__text { font-size: 15.5px; line-height: 1.5; color: var(--ink-soft); }

/* «Щенки <породы> в наличии» — 8 карточек, как на главной (.hm-pups); при трёх в ряд — первые 6, ряды полные */
@media (min-width: 901px) and (max-width: 1199px) {
  .cho-pups > .pups__item:nth-child(n + 7) { display: none; }
}

.cho-band__faces .face img { transform-origin: 50% 30%; }

/* =========================================================
   АДАПТИВ
   ========================================================= */
@media (max-width: 1199px) {
  .cho-q__opts--4 { --n: 2; }
  .cho-ans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cho-res__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cho-res__notes { grid-column: 1 / -1; }
}

@media (max-width: 1000px) {
  .cho-fits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cho-unfit { grid-template-columns: minmax(0, 1fr); }
  .cho-res__copy { max-width: 62%; }
}

@media (max-width: 900px) {
  .cho-q__opts { --n: 1; }
  .cho-q__opts--4 { --n: 2; }
  .cho-opt { min-height: 0; flex-direction: row; align-items: center; gap: 16px; padding: 16px 56px 16px 16px; }
  .cho-opt__txt { margin-top: 0; }
  .cho-opt__mark { top: 50%; margin-top: -15px; }
  .cho-q__opts--4 .cho-opt { flex-direction: column; align-items: flex-start; padding: 16px; }
  .cho-q__opts--4 .cho-opt__mark { top: 14px; margin-top: 0; right: 14px; }
}

@media (max-width: 760px) {
  .cho-q { padding: 18px 16px 18px; border-radius: var(--r-tile); }
  .cho-q__top { gap: 12px; }
  .cho-q__count { min-width: 0; font-size: 14px; }
  .cho-q__back { height: 36px; padding: 0 13px 0 10px; font-size: 13.5px; }
  .cho-q__step { margin-top: 22px; }
  .cho-q__title { font-size: clamp(24px, 6.6vw, 30px); margin-bottom: 16px; }
  .cho-opt { padding: 14px 52px 14px 14px; gap: 14px; border-radius: var(--r-img); }
  .cho-opt .ico { width: 44px; height: 44px; }
  .cho-opt__label { font-size: 18px; }
  .cho-opt__line { font-size: 13.5px; }
  .cho-opt__mark { right: 14px; width: 26px; height: 26px; margin-top: -13px; }
  .cho-q__opts--4 .cho-opt { padding: 14px; gap: 12px; }
  .cho-q__opts--4 .cho-opt__mark { top: 12px; right: 12px; }
  .cho-q__foot { margin-top: 18px; }
  .cho-q__next { flex: 1 1 auto; }
  .cho-q__hint:empty { display: none; }
  .cho-q__foot:has(.cho-q__hint:not(:empty)) { flex-wrap: wrap; }
  .cho-q__foot:has(.cho-q__hint:not(:empty)) .cho-q__hint { flex-basis: 100%; }

  .cho-res__tile { min-height: 0; }
  .cho-res__copy { max-width: none; }
  .cho-res__title { font-size: clamp(36px, 10vw, 46px); margin-top: 16px; }
  .cho-res__why { margin-top: 18px; }
  .cho-res__why li { font-size: 15px; }
  .cho-res__row, .cho-res__row:has(> .cho-res__alt[hidden]) { grid-template-columns: minmax(0, 1fr); }

  .cho-ans { grid-template-columns: minmax(0, 1fr); } /* карточки одна под другой */
  .cho-ans__card > .ico { margin-bottom: 20px; }

  .cho-pairs__list { flex-wrap: wrap; }
  .cho-pairs__list > li { max-width: 100%; }
  .cho-pair { height: auto; min-height: 48px; padding-block: 6px; white-space: normal; line-height: 1.25; }

  .cho-fits { gap: 10px; }
  .cho-fitc__title { margin: 12px 6px 0; font-size: 18px; }
  .cho-fitc__line { margin: 4px 6px 8px; font-size: 13.5px; }
  .cho-unfit__item { padding: 20px 18px; column-gap: 12px; }
  .cho-unfit__title { font-size: 19px; }
  .cho-unfit__text { font-size: 15px; }
}

@media (max-width: 560px) {
  .cho-res__again .cho-alt__links { flex-direction: column; align-items: flex-start; }
  .cho-fits { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cho-fitc__photo { aspect-ratio: 1 / .86; }
  .cho-fitc__title { margin: 14px 10px 0; font-size: 22px; }
  .cho-fitc__line { margin: 6px 10px 12px; font-size: 15px; }
}

@media (max-width: 420px) {
  .cho-q__opts--4 { --n: 1; }
  .cho-q__opts--4 .cho-opt { flex-direction: row; align-items: center; padding: 14px 52px 14px 14px; }
  .cho-q__opts--4 .cho-opt__mark { top: 50%; margin-top: -13px; right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .cho-q__fill, .cho-opt { transition: none; }
}
