/* =========================================================
   Анализы — каталог лабораторных исследований
   Дела сердечные
   ========================================================= */

.analizy-section {
  padding: 18px 0 90px;
}

.analizy-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* ── Left category nav ───────────────────────────────────── */
.cat-nav {
  position: sticky;
  top: var(--cat-top, 212px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* when expanded taller than the viewport, stop pinning so every plate stays reachable */
.cat-nav.is-tall {
  position: static;
}

.cat-group {
  background: var(--violet-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.cat-group-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  transition: color 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.cat-group-head:hover,
.cat-group-head.is-active { color: var(--violet); }

.cat-chevron {
  flex: 0 0 auto;
  display: block;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  color: var(--violet);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.cat-group.is-open > .cat-group-head .cat-chevron { transform: rotate(180deg); }

.cat-group-body {
  display: none;
  padding: 0 12px 12px;
  flex-direction: column;
  gap: 6px;
}
.cat-group.is-open > .cat-group-body { display: flex; }

/* leaf — single category (matches price navigation) */
.cat-leaf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  font-size: 15px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  background: #fff;
  border: none;
  text-align: left;
  font-family: inherit;
  width: 100%;
  text-decoration: none;
  transition: background 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              color 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.cat-leaf:hover { color: var(--violet); background: #fff; box-shadow: var(--shadow-card); }
.cat-leaf.is-active {
  color: var(--violet);
  background: var(--violet-soft);
  font-weight: 600;
}
.cat-leaf .leaf-arrow {
  flex: 0 0 16px;
  display: block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  color: var(--violet);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.cat-leaf.is-link .leaf-arrow,
.cat-leaf:hover .leaf-arrow { opacity: 1; transform: translateX(0); }

/* section heading + indented sub-leaf */
.cat-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
}
.cat-subhead .leaf-arrow {
  flex: 0 0 15px;
  display: block;
  width: 15px;
  height: 15px;
  min-width: 15px;
  min-height: 15px;
  max-width: 15px;
  max-height: 15px;
  color: var(--violet);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.cat-subhead.is-link:hover,
.cat-subhead.is-active { color: var(--violet); }
.cat-subhead.is-link:hover .leaf-arrow { opacity: 1; transform: translateX(0); }
.cat-leaf--sub {
  padding-left: 28px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted, #6b6b74);
}
.cat-leaf--sub:hover { color: var(--violet); }

/* ── Right column ────────────────────────────────────────── */
.analizy-main { min-width: 0; }

.analizy-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F6F7F9;
  border-radius: 999px;
  padding: 6px 8px 6px 22px;
  margin-bottom: 24px;
}
.analizy-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: var(--text);
  padding: 12px 0;
}
.analizy-search input::placeholder { color: var(--text-light); }
.analizy-search-btn {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.analizy-search-btn:hover { color: var(--violet); }

/* term filter */
.analizy-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 34px;
}
.analizy-filter-label {
  font-size: 15px;
  color: var(--text-muted);
  margin-right: 6px;
}
.filter-pill {
  border: none;
  background: var(--violet-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              color 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.filter-pill:hover { background: #E5DCFB; }
.filter-pill.is-active {
  background: var(--violet);
  color: #fff;
}

/* result group heading */
.analizy-group {
  margin-bottom: 40px;
  scroll-margin-top: 24px;
}
.analizy-group-title {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 18px;
}

.analizy-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* analysis card */
.an-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  column-gap: 24px;
  row-gap: 14px;
  background: #F6F7F9;
  border-radius: var(--r-xl);
  padding: 24px 26px;
  transition: box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.an-card:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}
.an-card--section {
  display: block;
  cursor: pointer;
}
.an-card-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  column-gap: 24px;
  row-gap: 14px;
  list-style: none;
}
.an-card-summary::-webkit-details-marker { display: none; }
.an-card-summary .an-name { margin-bottom: 0; }
.an-card-summary .an-cta--toggle::after { content: ''; }
.an-card--section[open] .an-card-summary .an-cta--toggle { background: var(--violet); color: #fff; }
.an-card--section[open] .an-card-summary .an-cta--toggle { font-size: 0; }
.an-card--section[open] .an-card-summary .an-cta--toggle::after { content: 'Скрыть'; font-size: 15px; }
.an-section-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 12, 50, 0.08);
}
.an-card--nested {
  background: #fff;
  border: 1px solid rgba(15, 12, 50, 0.06);
  padding: 20px 22px;
}

.an-card-body { grid-column: 1; min-width: 0; }
.an-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 12px;
}
.an-name a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.an-name a:hover { color: var(--violet); }
.an-term {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--violet);
  margin-bottom: 12px;
}
.an-term svg { color: var(--violet); }
.an-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
  max-width: 64ch;
}
.an-code { color: var(--text-light); font-weight: 600; }

.an-price {
  grid-column: 2;
  align-self: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}
.an-cta {
  grid-column: 3;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: none;
  background: #fff;
  color: var(--violet);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 34px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease,
              color 0.2s ease;
}
/* unified shine sweep (matches site .btn) */
.an-cta::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
  transition: left 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}
.an-cta:hover {
  background: var(--violet);
  color: #fff;
}
.an-cta:hover::before { left: 100%; }
.an-cta:active { transform: scale(0.97); }

.analizy-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 17px;
}

/* search result summary bar */
.analizy-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 24px;
  padding: 13px 14px 13px 20px;
  background: var(--violet-soft);
  border-radius: var(--r-md);
  font-size: 15px;
  color: var(--text);
}
.analizy-summary strong { font-weight: 600; }
.analizy-clear {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--violet);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.analizy-clear:hover { background: var(--violet-hover); transform: scale(1.08); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .analizy-layout { grid-template-columns: 1fr; gap: 28px; }
  .cat-nav { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 620px) {
  .an-card {
    grid-template-columns: 1fr auto;
    column-gap: 16px;
  }
  .an-card-summary {
    grid-template-columns: 1fr auto;
    column-gap: 16px;
  }
  .an-card-summary .an-card-body { grid-column: 1 / -1; }
  .an-card-summary .an-price { grid-column: 1; }
  .an-card-summary .an-cta { grid-column: 2; justify-self: end; }
  .an-card-body { grid-column: 1 / -1; }
  .an-price { grid-column: 1; }
  .an-cta { grid-column: 2; justify-self: end; }
  .analizy-group-title { font-size: 22px; }
}

/* Тёмный читаемый текст вместо светло-серого (категории, описания, коды) */
.an-desc,
.an-code { color: #273036; }
