/*
  ═══════════════════════════════════════════════════
  DOCTOR_DETAIL.CSS — Стили страницы врача
  Только специфика этой страницы:
  layout, отступы, позиционирование, компоненты.

  Размеры шрифтов     → var(--text-*)     из base.css
  Цвета               → var(--sage-*)     из base.css
  Прозрачные цвета    → var(--sage-20)    из base.css
  Метки-капители      → .label-caps       из base.css
  Большие числа       → .stat-number      из base.css
  ═══════════════════════════════════════════════════
*/


/* ══════════════════════════════════════════
   1. ШАПКА ВРАЧА (фото + hero)
══════════════════════════════════════════ */
.doc-top {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 78vh;
}

/* — Левая колонка (фото) — */
.doc-photo {
  background: var(--ivory);
  border-right: var(--border-sage);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: 2.4rem;
}

.doc-avatar {
  width: 230px;
  height: 275px;
  border-radius: 20px;
  object-fit: cover;
  object-position: top;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 1px var(--sage-20);
}

.doc-avatar-fallback {
  width: 230px;
  height: 275px;
  border-radius: 20px;
  background: var(--sage-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: var(--text-7xl);
  color: var(--sage-dk);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 1px var(--sage-20);
}

/* Кнопка записи */
.doc-btn {
  display: block;
  width: 100%;
  background: var(--sage-dk);
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  font-size: var(--text-md);
  font-weight: 600;
  padding: .9rem 2rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s;
}
.doc-btn:hover       { opacity: .88; }
.doc-btn--disabled   { opacity: .45; cursor: default; }

/* Контакты */
.doc-contacts-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
/*  width: 100%; */
}

.doc-contact {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-contact-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}

.doc-contact-v {
  font-size: var(--text-lg);
  color: var(--text);
}

/* — Правая колонка (hero) — */
.doc-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4.5rem 2rem;
  gap: 1.6rem;
}

/*
  .doc-role — роль/специализация врача.
  Отдельный класс т.к. цвет --sage, а не --muted
  (в отличие от .label-caps из base.css).
*/
.doc-role {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sage);
}

.doc-name {
  font-family: var(--serif);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: 1.05;
  color: var(--text);
}

.doc-fraza {
  font-family: var(--serif);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--muted);
  line-height: 1.65;
  border-left: 2px solid var(--sage-lt);
  padding-left: 1.4rem;
}

/* Теги специализаций */
.doc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.doc-tag {
  background: var(--sage-10);
  color: var(--sage-dk);
  border: .5px solid var(--sage-dk-18);
  border-radius: var(--radius-pill);
  font-size: var(--text-base);
  font-weight: 500;
  padding: 7px 18px;
}

/* Блок статистики в шапке */
.doc-stats {
  display: flex;
  gap: 0.5rem;
  margin-top: .4rem;
}

.doc-stat {
  flex: 1;
  background: var(--white-55);
  border: .5px solid var(--sage-22);
  border-radius: var(--radius-md);
  padding: 1.6rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.doc-stat-l {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .4rem;
}

/* Большое число (зелёный вариант) */
.doc-stat-n {
  font-family: var(--serif);
  font-size: var(--text-5xl);
  color: var(--sage-dk);
  line-height: 1;
}
.doc-stat-n span {
  font-family: var(--serif);
  font-size: var(--text-2xl);
  color: var(--sage);
}

/* Большое число (тёплый вариант) */
.doc-stat-cn {
  font-family: var(--serif);
  font-size: var(--text-5xl);
  color: var(--warm);
  line-height: 1;
}
.doc-stat-cn span {
  font-size: var(--text-2xl);
  opacity: .7;
}

/* Подпись под числом */
.doc-stat-nl {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
  margin-top: 5px;
}


/* ══════════════════════════════════════════
   2. КОНТЕНТ + СТАТИСТИКА ПРАКТИКИ
══════════════════════════════════════════ */
.block-atical {
  display: grid;
  grid-template-columns: 70% 30%;
  min-height: 80vh;
  border-top: var(--border-sage);
}

.right {
  padding: 3.5rem 4rem 3.5rem 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.art-body {
  font-size: var(--text-body);
  color: var(--text);
  line-height: 1.85;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.left-wrapper {
  display: flex;
  flex-direction: column;
  border-left: var(--border-sage);
}

.left {
  background: var(--ivory);
  display: flex;
  flex-direction: column;
  padding: 3rem 2.4rem;
  gap: 1.2rem;
}

.left-stats   { border-bottom: var(--border-sage); }

.left-articles {
  position: sticky;
  top: 0;
  max-height: 100vh;
}

.stats {
  display: flex;
  flex-direction: column;
}

.stat-item {
  padding: 1.4rem 0;
  border-bottom: .5px solid var(--sage-15);
}
.stat-item:last-child { border-bottom: none; }

.stat-num {
  font-family: var(--serif);
  font-size: var(--text-6xl);
  font-weight: 400;
  color: var(--sage-dk);
  line-height: 1;
}
.stat-num span {
  font-family: var(--serif);
  font-size: var(--text-3xl);
  color: var(--sage);
}

.stat-label {
  font-size: var(--text-body);
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.45;
}

/* Список статей */
.articles-list { list-style: none; }

.articles-list__item {
  padding: .75rem 0;
  border-bottom: .5px solid var(--sage-15);
}

.articles-list__link {
  font-size: var(--text-base);
  color: var(--sage-dk);
  text-decoration: none;
  line-height: 1.45;
  display: block;
}
.articles-list__link:hover { text-decoration: underline; }

.articles-list__category {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 3px;
}


/* ══════════════════════════════════════════
   3. ПОРТФОЛИО
══════════════════════════════════════════ */
.portfolio {
  background: var(--cream);
  padding: 3rem 3.5rem;
  border-top: var(--border-sage);
}

.pf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.8rem;
}

.pf-card {
  background: var(--ivory);
  border: .5px solid var(--sage-25);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pf-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}

.pf-photo-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}
.pf-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.pf-photo-wrap.before img {
  filter: saturate(.45) contrast(.92) brightness(.95);
}

.pf-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
}
.badge-before { background: var(--text-55);    color: var(--white-90); }
.badge-after  { background: var(--sage-dk-85); color: var(--white);    }

.pf-divider-line {
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 1.5px;
  background: var(--white-75);
  z-index: 2;
  transform: translateX(-50%);
}

.pf-card-body {
  padding: 1.2rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.pf-card-title {
  font-family: var(--serif);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}


/* ══════════════════════════════════════════
   4. FAQ
══════════════════════════════════════════ */
.faq {
  background: var(--cream);
  padding: 3.5rem;
  border-top: var(--border-sage);
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.faq-item {
  background: var(--ivory);
  border: .5px solid var(--sage-28);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .2s;
}
.faq-item.open {
  border-color: var(--sage-dk-50);
  background: var(--white);
}

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.6rem;
  cursor: pointer;
  user-select: none;
}

.faq-q-text {
  font-family: var(--serif);
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--text);
  line-height: 1.35;
  transition: color .2s;
}
.faq-item.open .faq-q-text { color: var(--sage-dk); }

.faq-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: .5px solid var(--sage-40);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s;
  position: relative;
}
.faq-item.open .faq-icon {
  background: var(--sage-dk);
  border-color: var(--sage-dk);
}

.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background: var(--sage-dk);
  border-radius: 1px;
  transition: transform .25s, background .2s;
}
.faq-icon::before { width: 11px; height: 1.5px; }
.faq-icon::after  { width: 1.5px; height: 11px; }
.faq-item.open .faq-icon::before,
.faq-item.open .faq-icon::after  { background: var(--white); }
.faq-item.open .faq-icon::after  { transform: rotate(90deg) scaleY(0); }

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}
.faq-item.open .faq-a { max-height: 500px; }

.faq-a-inner {
  padding: 1.2rem 1.6rem 1.6rem;
  border-top: .5px solid var(--sage-18);
}

.faq-a-text {
  font-size: var(--text-md);
  color: var(--muted);
  line-height: 1.8;
}
.faq-a-text strong {
  color: var(--text);
  font-weight: 500;
}


/* ══════════════════════════════════════════
   5. СЕРТИФИКАТЫ
══════════════════════════════════════════ */
.cert {
  background: var(--cream);
  padding: 3.5rem;
  border-top: var(--border-sage);
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.2rem;
}

.cert-card {
  background: var(--ivory);
  border: .5px solid var(--sage-28);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .18s, transform .15s;
}
.cert-card:hover {
  border-color: var(--sage-dk);
  transform: translateY(-2px);
}

.cert-card-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}
.cert-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cert-card-body {
  padding: .9rem 1rem 1rem;
  border-top: .5px solid var(--sage-15);
}

.cert-card-title {
  font-size: var(--text-sm);
  color: var(--text);
  line-height: 1.45;
  font-weight: 400;
}

.cert-more-wrap {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 1.8rem;
}

.cert-more-btn {
  background: transparent;
  color: var(--sage-dk);
  border: .5px solid var(--sage-dk-40);
  border-radius: var(--radius-pill);
  font-size: var(--text-md);
  font-weight: 500;
  padding: .75rem 1.8rem;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.cert-more-btn:hover { background: var(--sage-dk); color: var(--white); }

.cert-more-count {
  font-size: var(--text-base);
  color: var(--muted);
}

/* Модальное окно сертификатов */
.cert-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--text-55);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.cert-modal-overlay.open { display: flex; }

.cert-modal {
  background: var(--cream);
  border-radius: var(--radius-lg);
  border: .5px solid var(--sage-30);
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2.4rem;
}

.cert-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.8rem;
  padding-bottom: 1.2rem;
  border-bottom: var(--border-sage);
}

.cert-modal-title {
  font-family: var(--serif);
  font-size: var(--text-3xl);
  font-weight: 400;
  color: var(--text);
}

.cert-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: .5px solid var(--sage-30);
  background: transparent;
  cursor: pointer;
  font-size: var(--text-xl);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.cert-modal-close:hover { background: var(--ivory); }

.cert-modal-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.2rem;
}


/* ══════════════════════════════════════════
   6. CRM-ПАНЕЛЬ
══════════════════════════════════════════ */
.crm-overlay {
  position: fixed;
  inset: 0;
  background: var(--text-45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.crm-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.crm-panel {
  position: fixed;
  top: 0; right: 0;
  width: 70vw;
  height: 100vh;
  background: var(--cream);
  border-left: .5px solid var(--sage-25);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
  box-shadow: -8px 0 40px var(--text-12);
}
.crm-panel.open { transform: translateX(0); }

.crm-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 1.8rem;
  border-bottom: var(--border-sage);
  background: var(--ivory);
  flex-shrink: 0;
}

.crm-panel__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .3rem;
}

.crm-panel__doctor {
  font-family: var(--serif);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--text);
  line-height: 1.2;
}

.crm-panel__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: .5px solid var(--sage-30);
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.crm-panel__close:hover {
  background: var(--sage-dk);
  color: var(--white);
  border-color: var(--sage-dk);
}

.crm-panel__body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.crm-panel__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  font-size: var(--text-md);
  color: var(--muted);
  background: var(--cream);
  z-index: 2;
  transition: opacity .3s;
}
.crm-panel__loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.crm-spinner { animation: crm-spin 1s linear infinite; }
@keyframes crm-spin { to { transform: rotate(360deg); } }

.crm-panel__body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (max-width: 560px) {
  .crm-panel { width: 100vw; }
}

/* В doctor_detail.css */
.reviews {
  background: var(--cream);
  padding: 3.5rem;
  border-top: var(--border-sage);
}


/* ══════════════════════════════════════════
   АДАПТИВ
══════════════════════════════════════════ */

/* Мобильный заголовок — скрыт на десктопе */
.doc-mobile-header {
  display: none;
}


/* — Планшет (до 1024px) — */
@media (max-width: 1024px) {

  .doc-top {
    grid-template-columns: 240px 1fr;
  }

  .doc-hero {
    padding: 3rem;
  }

  .doc-name {
    font-size: var(--text-2xl);
  }

  .pf-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cert-grid,
  .cert-modal-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .doc-btn{
  padding: 0.6rem 0rem;
  }

  .doc-contact {
  gap: 0;
  }
/*
  .doc-contact-icon{
  display: none;
  }
*/
  .doc-contact-v{
  font-size: var(--text-base);
  }

  .doc-photo{
  padding: 1rem;
  }


}


/* — Планшет маленький (до 768px) — */
@media (max-width: 768px) {

  .doc-top {
    display: flex;
    flex-direction: column;
    min-height: auto;
  }

  .doc-mobile-header {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: 100%;
    padding-bottom: .8rem;
    border-bottom: .5px solid var(--sage-15);
    text-align: center;
    order: 0;
  }

  .doc-photo {
    order: 1;
    border-right: none;
    border-bottom: none;
    padding: 1.6rem;
    align-items: center;
    gap: 1rem;
  }

  .doc-avatar,
  .doc-avatar-fallback {
    width: 150px;
    height: 180px;
  }

  .doc-btn {
    width: 100%;
    max-width: 240px;
  }

  .doc-contacts-group {
    align-items: center;
  }

  .doc-hero {
    display: flex;
    flex-direction: column;
    order: 2;
    padding: 1.2rem 1.6rem 1.6rem;
    gap: 1rem;
    border-top: var(--border-sage);
    justify-content: flex-start;
  }

  .doc-hero > .doc-role,
  .doc-hero > .doc-name,
  .doc-hero > .doc-fraza {
    display: none;
  }

  .doc-tags {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Статистика — две колонки */
  .doc-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .8rem;
    margin-top: 0;
  }

  .doc-stat {
    width: 100%;
    padding: 1.1rem 1rem;
    gap: 1rem;
  }

  .doc-stat svg {
    width: 44px;
    height: 44px;
  }

  .doc-stat-n,
  .doc-stat-cn {
    font-size: var(--text-4xl);
  }

  .doc-stat-n span,
  .doc-stat-cn span {
    font-size: var(--text-xl);
  }

  .block-atical {
    grid-template-columns: 1fr;
  }

  .left-wrapper {
    border-left: none;
    border-top: var(--border-sage);
    flex-direction: column;
  }

  .left-stats {
    border-bottom: var(--border-sage);
    border-right: none;
  }

  .left-articles {
    position: static;
    max-height: none;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }

  .cert-grid,
  .cert-modal-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .crm-panel {
    width: 100vw;
  }
}


/* — Телефон (до 483px) — */
@media (max-width: 483px) {

  .doc-stats {
    grid-template-columns: 1fr;
  }

  .doc-stat {
    padding: 1rem;
    gap: .8rem;
  }
}


/* — Телефон маленький (до 480px) — */
@media (max-width: 480px) {

  .doc-photo {
    flex-direction: column;
    align-items: center;
  }

  .doc-contacts-group {
    align-items: center;
  }

  .doc-tags {
    justify-content: center;
  }

  .doc-stat {
    flex-direction: column;
    text-align: center;
    gap: .6rem;
  }

  .right {
    padding: 1.8rem 1.2rem;
  }

  .left {
    padding: 1.8rem 1.2rem;
  }

  .portfolio,
  .faq,
  .cert {
    padding: 2rem 1.2rem;
  }

  .pf-grid {
    grid-template-columns: 1fr;
  }

  .cert-grid,
  .cert-modal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}