/* =========================================================
   Цены — прейскурант услуг клиники
   Дела сердечные / Клиника доктора Сонина
   (исполнение и палитра — как на странице «Анализы»)
   ========================================================= */

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

/* ── PDF viewer overlay ──────────────────────────────────── */
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(31, 25, 66, 0.55);
  backdrop-filter: blur(3px);
}
.pdf-modal.is-open { display: flex; }
.pdf-modal-box {
  width: min(1000px, 100%);
  height: min(92vh, 100%);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
}
.pdf-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.pdf-modal-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.pdf-modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pdf-modal-download {
  display: inline-flex;
  align-items: center;
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 14px;
  font-weight: 600;
  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);
}
.pdf-modal-download:hover { background: var(--violet); color: #fff; }
.pdf-modal-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: #F1F1F4;
  color: var(--text-muted);
  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);
}
.pdf-modal-close:hover { background: var(--violet); color: #fff; }
.pdf-modal-body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #EDEDF1;
}
.pdf-modal-pages {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 22px 16px;
}
.pdf-page {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  box-shadow: 0 6px 22px rgba(48, 30, 110, 0.14);
  background: #fff;
}
.pdf-modal-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
}

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

/* ── Left category nav ───────────────────────────────────── */
.cat-nav {
  position: static;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.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;
  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;
  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 (acts as filter or as a link) */
.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 auto;
  width: 16px;
  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); }

/* diagnostics: 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 auto;
  width: 15px;
  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); }

/* PDF download plate (deep violet) */
.cat-pdf {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 18px 22px;
  border-radius: var(--r-lg);
  background: var(--violet-deep);
  color: #fff;
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: background 0.2s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.cat-pdf::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.18) 50%, transparent 100%);
  transition: left 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}
.cat-pdf:hover { background: #2C2168; }
.cat-pdf:hover::before { left: 100%; }
.cat-pdf > * { position: relative; z-index: 1; }
.cat-pdf svg { flex: 0 0 auto; }

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

.tseny-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F6F7F9;
  border-radius: 999px;
  padding: 6px 8px 6px 24px;
  margin-bottom: 30px;
}
.tseny-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: var(--text);
  padding: 14px 0;
}
.tseny-search input::placeholder { color: var(--text-light); }
.tseny-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);
}
.tseny-search-btn:hover { color: var(--violet); }

/* result group heading */
.tseny-group {
  margin-bottom: 38px;
  scroll-margin-top: 24px;
}
.tseny-group-title {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 18px;
}
.tseny-group-title--nested {
  font-size: clamp(18px, 1.8vw, 24px);
  margin-top: 26px;
}
.tseny-group--level-3,
.tseny-group--level-4 {
  margin-bottom: 24px;
}

.tseny-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tseny-cards + .tseny-cards {
  margin-top: 14px;
}

/* service card */
.svc-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, auto) auto;
  align-items: center;
  column-gap: 28px;
  row-gap: 12px;
  background: #F6F7F9;
  border-radius: var(--r-xl);
  padding: 24px 28px;
  transition: box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.svc-card:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.svc-name {
  grid-column: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text);
  text-wrap: pretty;
}
.svc-doctor { color: var(--violet); white-space: nowrap; }
.svc-doctor--link { text-decoration: none; cursor: pointer; transition: color 0.15s ease; }
.svc-doctor--link:hover { color: var(--violet-hover); text-decoration: underline; text-underline-offset: 2px; }

.svc-price {
  grid-column: 2;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  justify-self: end;
}

.svc-cta {
  grid-column: 3;
  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 30px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.svc-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;
}
.svc-cta > span { position: relative; z-index: 1; }
.svc-cta:hover { background: var(--violet); color: #fff; }
.svc-cta:hover::before { left: 100%; }
.svc-cta:active { transform: scale(0.97); }

/* empty + search summary */
.tseny-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 17px;
}
.tseny-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);
}
.tseny-summary strong { font-weight: 600; }
.tseny-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;
}
.tseny-clear:hover { background: var(--violet-hover); transform: scale(1.08); }

/* hover/interaction transitions (matches the reference «Анализы» plates) */
.svc-card {
  transition: box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .tseny-layout { grid-template-columns: 1fr; gap: 28px; }
  .cat-nav { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 620px) {
  .svc-card {
    grid-template-columns: 1fr auto;
    column-gap: 16px;
    padding: 16px 18px;
  }
  .svc-name { grid-column: 1 / -1; font-size: 15.5px; }
  .svc-doctor { white-space: normal; }      /* длинные специальности переносятся, не вылезают за край */
  .svc-price { grid-column: 1; justify-self: start; font-size: 18px; }
  .svc-cta { grid-column: 2; justify-self: end; padding: 12px 22px; }
  .tseny-group-title { font-size: 22px; }
}
