/* ============ Энциклопедия пород ============ */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.breeds-page { background: var(--bg); }

.enc-hero {
  padding: clamp(34px, 5vw, 72px) 0 clamp(30px, 4vw, 54px);
  background:
    radial-gradient(700px 420px at 92% -10%, rgba(246, 197, 107, .3), transparent 70%),
    var(--bg);
}
.enc-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
.enc-hero h1 { margin-bottom: 16px; }
.enc-hero .lead { margin-bottom: 22px; max-width: 32em; }

.enc-search {
  position: relative;
  max-width: 470px;
  margin-bottom: 20px;
}
.enc-search input {
  width: 100%;
  padding: 16px 46px 16px 46px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.enc-search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(31, 92, 70, .12);
}
.enc-search-icon {
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
  font-size: .95rem;
  opacity: .55;
  pointer-events: none;
}
.enc-search-clear {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 0;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}
.enc-search-clear:hover { background: var(--line); }

.enc-facts { font-size: .86rem; }
.enc-facts li::before {
  content: "•";
  color: var(--accent);
  margin-right: 2px;
}

.enc-hero-visual {
  position: relative;
}
.enc-hero-visual img {
  width: 100%;
  height: clamp(280px, 34vw, 420px);
  object-fit: cover;
  object-position: center 30%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: block;
}
.enc-badge {
  position: absolute;
  left: -14px;
  bottom: 22px;
  background: #fff;
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: rotate(-2deg);
}
.enc-badge b {
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--brand);
  line-height: 1;
}
.enc-badge span { font-size: .8rem; font-weight: 600; color: var(--muted); max-width: 100px; line-height: 1.3; }

/* ---------- Фильтры ---------- */
.enc-catalog { padding: 10px 0 clamp(50px, 6vw, 80px); }

.enc-filters {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.filter-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.size-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  border: 1.5px solid var(--line-strong);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 15px;
  font: inherit;
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.chip-btn.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.filter-selects { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.filter-field { display: grid; gap: 5px; }
.filter-field > span {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.filter-field select {
  padding: 10px 12px;
  border-radius: 11px;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  font: inherit;
  font-size: .88rem;
  color: var(--ink);
  min-width: 150px;
}
.filter-field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 92, 70, .12);
}

.filter-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: .84rem;
  color: var(--muted);
}
#breedCount { font-weight: 700; color: var(--brand); }
.filter-hint { color: var(--muted-2); }

/* ---------- Каталог ---------- */
.breed-catalog {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.bcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--ink);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.bcard:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
  color: var(--ink);
}
.bcard-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.bcard-emoji { display: inline-flex; width: 40px; height: 40px; }
.bcard-emoji svg { width: 40px; height: 40px; border-radius: 50%; }
.bcard h3 { font-size: 1rem; margin: 0 0 4px; line-height: 1.25; }
.bcard-sub { margin: 0 0 9px; font-size: .8rem; color: var(--muted-2); }
.bcard-desc {
  margin: 0 0 12px;
  font-size: .86rem;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bcard-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: .74rem;
  color: var(--muted-2);
}
.bcard-meta b { color: var(--ink); font-weight: 600; }
.bcard-cost { grid-column: 1 / -1; padding-top: 5px; }

.tag {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.tag-easy { background: #E4F3EA; color: #26704F; }
.tag-mid { background: var(--yellow-soft); color: #8A6118; }
.tag-hard { background: var(--accent-soft); color: #A9461B; }

.enc-empty {
  text-align: center;
  padding: 46px 20px;
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}
.enc-empty p { margin-bottom: 16px; }

/* ---------- CTA ---------- */
.enc-cta { background: var(--bg-soft); padding: clamp(40px, 5vw, 66px) 0; }
.enc-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.enc-cta h2 { margin-bottom: 6px; }
.enc-cta p { margin: 0; color: var(--muted); max-width: 46em; }

/* ---------- Диалог породы ---------- */
.breed-dialog {
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  width: min(880px, calc(100% - 28px));
  max-height: min(90vh, 860px);
  background: #FFFDF9;
  color: var(--ink);
  box-shadow: 0 40px 100px rgba(20, 16, 12, .35);
  overflow: hidden;
}
.breed-dialog::backdrop { background: rgba(20, 16, 12, .58); backdrop-filter: blur(3px); }
.bd-inner {
  max-height: min(90vh, 860px);
  overflow-y: auto;
  padding: clamp(22px, 3.2vw, 34px);
  position: relative;
}
.bd-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.bd-close:hover { background: var(--line); color: var(--ink); }

.bd-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 44px;
  margin-bottom: 18px;
}
.bd-emoji {
  font-size: 2.6rem;
  width: 64px; height: 64px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 18px;
}
.bd-emoji svg { width: 64px; height: 64px; border-radius: 50%; }
.bd-title h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 3px; }
.bd-title p { margin: 0; font-size: .86rem; color: var(--muted); }
.bd-diff { margin-left: auto; }

.bd-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.bd-stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.bd-stat span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); font-weight: 700; margin-bottom: 2px; }
.bd-stat b { font-size: .9rem; font-weight: 600; }

.bd-tabs {
  position: relative;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.bd-tab {
  flex: none;
  border: 0;
  background: transparent;
  padding: 10px 14px;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-radius: 10px 10px 0 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.bd-tab:hover { color: var(--brand); background: rgba(31, 92, 70, .05); }
.bd-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.bd-panel { min-height: 170px; animation: fadeUp .25s ease both; }
.bd-disclaimer { margin: 10px 0 0; font-size: .74rem; color: var(--muted-2); line-height: 1.45; }
.bd-panel h3 { font-size: 1.05rem; margin: 0 0 8px; }
.bd-panel p { font-size: .94rem; color: var(--muted); line-height: 1.6; margin: 0 0 10px; }
.bd-panel ul { margin: 0 0 10px; padding-left: 18px; color: var(--muted); font-size: .92rem; display: grid; gap: 6px; }
.bd-panel li b { color: var(--ink); }
.bd-panel .bd-lead { font-size: 1rem; color: var(--ink); }
.bd-callout {
  background: var(--brand-soft);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: .88rem;
  color: var(--brand-deep);
  margin-top: 10px;
}
.bd-callout-warn {
  background: var(--accent-soft);
  color: #8A3A18;
}
.bd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bd-two > div {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.bd-two b { display: block; font-size: .8rem; margin-bottom: 4px; }
.bd-two p { margin: 0; font-size: .86rem; }

/* ---------- Расширенные блоки карточки ---------- */
.bd-timeline { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; }
.bd-timeline > div {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.bd-timeline span {
  display: block;
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted-2);
  font-weight: 700;
  margin-bottom: 3px;
}
.bd-timeline b { font-size: .86rem; font-weight: 600; color: var(--ink); }
.bd-fact {
  background: #FFF8EA;
  border: 1px solid #EAD9B4;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0 14px;
}
.bd-fact b {
  display: block;
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #8A6118;
  margin-bottom: 4px;
}
.bd-fact p { margin: 0; font-size: .9rem; color: var(--ink); }
.bd-traits { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.bd-trait {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  min-width: 110px;
}
.bd-trait small {
  display: block;
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted-2);
  font-weight: 700;
}
.bd-trait b { font-size: .82rem; color: var(--ink); font-weight: 600; }
.bd-trait.is-warn { background: #FFF3EF; border-color: #F0CFC2; }
.bd-trait.is-warn b { color: #8A3A18; }
.bd-panel ol { margin: 0 0 10px; padding-left: 20px; color: var(--muted); font-size: .92rem; display: grid; gap: 6px; }
.bd-panel ol li b { color: var(--ink); }
.bd-goto-cost { margin-top: 4px; }

/* ---------- Стоимость ---------- */
.cost-lead { font-size: .94rem; color: var(--ink) !important; }
.cost-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 10px; }
.cost-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.cost-card span {
  display: block;
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-2);
  font-weight: 700;
  margin-bottom: 6px;
}
.cost-card b { display: block; font-size: 1rem; color: var(--ink); line-height: 1.3; }
.cost-card small { display: block; margin-top: 2px; font-size: .74rem; color: var(--muted-2); }
.cost-note { font-size: .8rem !important; color: var(--muted-2) !important; }
.bd-budget {
  margin: 16px 0 4px;
  background: #FBF9F4;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.bd-budget label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.bd-budget-row { display: flex; gap: 8px; flex-wrap: wrap; }
.bd-budget-row input {
  flex: 1;
  min-width: 160px;
  padding: 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: .92rem;
  color: var(--ink);
}
.bd-budget-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 92, 70, .12); }
.bd-budget-result { margin: 10px 0 0 !important; font-size: .86rem !important; border-radius: 9px; padding: 9px 11px; }
.bd-budget-result.is-ok { background: #DDF0E4; color: #1F5C46; }
.bd-budget-result.is-tight { background: var(--yellow-soft); color: #8A6118; }
.bd-budget-result.is-no { background: #F7DADA; color: #8A1F1F; }
.cost-sources { margin-top: 10px; font-size: .78rem; color: var(--muted-2); line-height: 1.7; }
.cost-sources a { color: var(--brand); }

.pet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pet-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.pet-label {
  display: block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.pet-rating {
  display: inline-block;
  margin: 6px 0 8px;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.pet-good { background: #E4F3EA; color: #26704F; }
.pet-ok { background: var(--yellow-soft); color: #8A6118; }
.pet-caution { background: var(--accent-soft); color: #A9461B; }
.pet-high { background: #F7DADA; color: #8A1F1F; }
.pet-card p { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.5; }
.pet-disclaimer { margin: 10px 0 0; font-size: .76rem; color: var(--muted-2); }

.bd-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ---------- Подбор по условиям ---------- */
.fit-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.fit-panel summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}
.fit-panel summary::-webkit-details-marker { display: none; }
.fit-mark {
  width: 42px; height: 42px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow-soft);
  border-radius: 12px;
  font-size: 1.25rem;
}
.fit-title { display: grid; line-height: 1.3; }
.fit-title b { font-size: 1rem; }
.fit-title small { font-size: .8rem; color: var(--muted); }
.fit-toggle {
  margin-left: auto;
  font-size: 1.4rem;
  color: var(--brand);
  line-height: 1;
  transition: transform .2s ease;
}
.fit-panel[open] .fit-toggle { transform: rotate(45deg); }
.fit-body { padding: 0 18px 18px; border-top: 1px dashed var(--line); }

.fit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.fit-field { display: grid; gap: 5px; }
.fit-field span {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.fit-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: .88rem;
  color: var(--ink);
}
.fit-field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 92, 70, .12);
}
.fit-pets {
  border: 0;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}
.fit-pets legend {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 8px;
  width: 100%;
}
.fit-pets label { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--muted); }
.fit-pets input { accent-color: var(--brand); width: 16px; height: 16px; }
.fit-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fit-hint { font-size: .8rem; color: var(--muted-2); }
.fit-summary { font-size: .84rem; font-weight: 700; color: var(--brand); }

.bcard-fit {
  display: inline-block;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.fit-great { background: #DDF0E4; color: #1F5C46; }
.fit-ok { background: #E9F5EE; color: #26704F; }
.fit-maybe { background: var(--yellow-soft); color: #8A6118; }
.fit-no { background: #F7DADA; color: #8A1F1F; }

.bd-fit {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.bd-fit-great { background: #E9F5EE; border-color: #BFE0CD; }
.bd-fit-ok { background: #F3FAF6; border-color: #CFE3D8; }
.bd-fit-maybe { background: var(--yellow-soft); border-color: #EBD7A8; }
.bd-fit-no { background: #FFF3EF; border-color: #EFC3B1; }
.bd-fit b { display: block; font-size: .95rem; margin-bottom: 6px; }
.bd-fit ul { margin: 0; padding-left: 18px; font-size: .86rem; color: var(--muted); display: grid; gap: 4px; }
.bd-fit p { margin: 0; font-size: .86rem; color: var(--muted); }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .breed-catalog { grid-template-columns: repeat(3, 1fr); }
  .fit-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .enc-hero-grid { grid-template-columns: 1fr; }
  .enc-hero-visual { order: -1; }
  .enc-hero-visual img { height: 260px; }
  .enc-badge { left: 14px; bottom: 14px; }
  .breed-catalog { grid-template-columns: repeat(2, 1fr); }
  .bd-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .filter-row { align-items: stretch; }
  .fit-grid { grid-template-columns: 1fr; }
  .fit-actions { align-items: stretch; }
  .fit-actions .btn { width: 100%; }
  .size-chips { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .chip-btn { width: 100%; text-align: center; }
  .filter-selects { width: 100%; }
  .filter-field { flex: 1 1 140px; }
  .filter-field select { width: 100%; min-width: 0; }
  .filter-hint { display: none; }
  .breed-catalog { grid-template-columns: 1fr; }
  .bd-two { grid-template-columns: 1fr; }
  .bd-timeline { grid-template-columns: 1fr; }
  .pet-grid { grid-template-columns: 1fr; }
  .cost-grid { grid-template-columns: 1fr; }
  .bd-budget-row .btn { width: 100%; }
  .enc-cta-inner { flex-direction: column; align-items: flex-start; }
  .enc-cta .btn { width: 100%; }
}
@media (max-width: 420px) {
  .bd-head { flex-wrap: wrap; }
  .bd-diff { margin-left: 0; }
  .bd-title { min-width: 0; flex: 1 1 100%; }
  .bd-title h2 { font-size: 1.35rem; }
  .bd-emoji { width: 52px; height: 52px; font-size: 2rem; }
  .bd-inner { padding: 18px 16px; }
  .bd-foot .btn { width: 100%; }
  .bd-tabs { gap: 2px; }
  .bd-tab { padding: 9px 10px; font-size: .82rem; }
  .bd-tabs::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: calc(100% - 4px);
    background: linear-gradient(90deg, transparent, #FFFDF9);
    pointer-events: none;
  }
}
