/* =========================================================
   Библиотека заболеваний — справочник
   Клиника доктора Сонина
   ========================================================= */

/* центрированные хлебные крошки на этой странице */
.page-head .breadcrumbs { justify-content: center; }

/* ── Фиолетовая полоса поиска ─────────────────────────────── */
.bib-searchband {
  /* same gradient + vertical rhythm as the «Врачи» filter band */
  background: linear-gradient(120deg, #6F62C4 0%, #8678D4 45%, #9D8FDE 100%);
  padding: 51px 0;          /* 51 + control 64 + 51 ≈ band height of «Врачи» */
  margin-top: 18px;
}
.bib-searchband-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;            /* same control height as the «Врачи» band */
  background: #F5F5F7;
  border-radius: 16px;
  padding: 0 8px 0 24px;
  box-shadow: 0 14px 34px rgba(40, 26, 96, 0.20);
  transition: box-shadow 0.25s ease, background 0.25s ease;
}
.bib-searchband-inner:focus-within {
  background: #fff;
  box-shadow: 0 14px 34px rgba(40, 26, 96, 0.28);
}
.bib-searchband-inner input {
  flex: 1;
  align-self: stretch;
  border: none;
  background: transparent;
  outline: none;
  font-size: 17px;
  color: var(--text);
  padding: 0;
}
.bib-searchband-inner input::placeholder { color: var(--text-light); }
.bib-search-btn {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.bib-search-btn:hover { color: var(--violet); }
/* clear (×) mode — round soft-violet plate, appears while typing */
.bib-search-btn .ic-clear { display: none; }
.bib-search-btn.is-clear {
  width: 40px;
  height: 40px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--violet-soft);
  color: var(--violet);
}
.bib-search-btn.is-clear:hover { background: #E3D9FB; }
.bib-search-btn.is-clear .ic-search { display: none; }
.bib-search-btn.is-clear .ic-clear { display: block; }

/* ── Панель: алфавит + фильтр ─────────────────────────────── */
.bib-controls {
  padding: 40px 0 0;
  background: #F6F7F9;
}
.bib-controls-grid {
  display: grid;
  /* same 3-column track as the cards below, so edges line up */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.bib-alpha  { grid-column: span 2; }   /* alphabet card = width of 2 disease cards */
.bib-filter { grid-column: span 1; }   /* filter card = width of 1 disease card */

.bib-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-card);
  padding: 30px 32px;
}

/* alphabet card header */
.bib-alpha-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.bib-alpha-head h2 {
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 10px;
}
.bib-alpha-head p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
  max-width: 52ch;
}
.bib-found {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  white-space: nowrap;
}

/* alphabet pills */
.bib-alphabet {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.bib-letter {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out),
              border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.bib-letter:hover:not(:disabled):not(.is-active) {
  background: var(--violet-soft);
  border-color: transparent;
  color: var(--violet);
}
.bib-letter.is-active {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
}
.bib-letter:disabled {
  color: var(--text-light);
  opacity: 0.45;
  cursor: not-allowed;
}
.bib-letter--all { width: auto; padding: 0 20px; border-radius: 999px; }

/* filter card */
.bib-filter h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
}

/* ── Кастомный выпадающий список (стиль со страницы «Врачи») ── */
.dfilter-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #F5F5F7;
  border-radius: 16px;
  height: 64px;
  transition: box-shadow 0.25s ease, background 0.25s ease;
}
.dfilter-select-wrap.open { background: #fff; box-shadow: 0 14px 34px rgba(40, 26, 96, 0.18); }
.dfilter-native { display: none; }
.dfilter-trigger {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px 0 22px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  outline: none;
}
.dfilter-trigger-text {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dfilter-chevron {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease;
}
.dfilter-select-wrap.open .dfilter-chevron { transform: rotate(180deg); color: var(--violet); }
.dfilter-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 46px rgba(40, 26, 96, 0.22);
  z-index: 60;
  opacity: 0;
  transform: translateY(-8px) scale(0.985);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.dfilter-select-wrap.open .dfilter-dropdown {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.dfilter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.dfilter-option .dfilter-option-label { flex: 1 1 auto; }
.dfilter-option .dfilter-check { flex: 0 0 auto; opacity: 0; transition: opacity 0.15s ease; }
.dfilter-option:hover { background: var(--violet-soft); color: var(--violet); }
.dfilter-option.selected { background: var(--violet); color: #fff; }
.dfilter-option.selected .dfilter-check { opacity: 1; }

.bib-filter-note {
  font-size: 13px;
  color: var(--text-light);
  margin: 14px 0 0;
}

/* ── Сетка карточек ───────────────────────────────────────── */
.bib-results {
  padding: 32px 0 70px;
  background: #F6F7F9;
}
.bib-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.disease-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  padding: 28px 30px 26px;
  text-decoration: none;
  color: inherit;
  will-change: transform;
  transition: box-shadow 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.disease-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-6px) scale(1.01);
}
.disease-tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.disease-name {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 10px;
  text-wrap: balance;
}
.disease-alt {
  font-size: 15.5px;
  color: var(--text-muted);
  margin: 0 0 18px;
}
.disease-desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 24px;
}
.disease-more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0;
  align-self: flex-start;
  font-size: 14px;
  font-weight: 600;
  color: var(--violet);
  text-decoration: none;
  transition: gap 0.4s var(--ease-out), color 0.2s var(--ease-out);
}
/* arrow hidden by default, revealed on card hover (up-right style from service cards) */
.disease-more svg {
  width: 0;
  height: 16px;
  opacity: 0;
  transform: translateX(-4px) rotate(0deg);
  transition: width 0.4s var(--ease-out), opacity 0.3s var(--ease-out),
              transform 0.4s var(--ease-out);
}
.disease-card:hover .disease-more { gap: 8px; }
.disease-card:hover .disease-more svg {
  width: 16px;
  opacity: 1;
  transform: translateX(0) rotate(0deg);
}
.disease-more:hover { color: var(--violet-hover); }
.disease-more:hover svg { transform: translateX(2px) rotate(-8deg); }

.bib-empty {
  grid-column: 1 / -1;
  padding: 70px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 17px;
}

/* ── Пагинация ────────────────────────────────────────────── */
.bib-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 46px;
}
.bib-page {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out),
              border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.bib-page:hover:not(:disabled):not(.is-active) {
  border-color: var(--violet);
  color: var(--violet);
}
.bib-page.is-active {
  border-color: var(--violet);
  border-width: 1.5px;
  color: var(--violet);
  cursor: default;
}
.bib-page--arrow { color: var(--violet); }
.bib-page:disabled { opacity: 0.4; cursor: not-allowed; color: var(--text-light); }
.bib-page svg { width: 20px; height: 20px; }

/* ── Адаптив ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .bib-controls-grid { grid-template-columns: 1fr; }
  .bib-alpha, .bib-filter { grid-column: auto; }
  .bib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .bib-grid { grid-template-columns: 1fr; }
  .bib-panel { padding: 24px 20px; }
  .bib-alpha-head { flex-direction: column; }
  .bib-letter { width: 38px; height: 38px; font-size: 14px; }
  .bib-letter--all { width: auto; padding: 0 16px; }
  .bib-page { width: 48px; height: 48px; }
  .bib-searchband-inner { padding-left: 18px; }
  .bib-searchband-inner input { font-size: 15px; }
}
