/* Базовый слой поверх Bootstrap Reboot + стили секций.
   Макет десктопный (фрейм 1440, контейнер 1200); поведение на других
   разрешениях додумано, в Figma его нет. */

/* Паттерн поверх серых плоскостей: файл уже подготовлен с прозрачностью 5%,
   поэтому его достаточно положить фоновым изображением над цветом. */
:root {
  --pattern: url(../assets/images/background-pattern-soft.png);
  --pattern-size: 300px;
}

/* Карточки каруселей намеренно выходят за правый край контейнера,
   поэтому лишнюю горизонтальную прокрутку страницы гасим. На мобильных
   overflow-x у body не спасает — прокрутку перехватывает html. */
/* clip, а не hidden: hidden делает элемент контейнером прокрутки и ломает
   position: sticky у фильтра услуг. Второе объявление — для старых браузеров */
html {
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  font-family: var(--font-primary);
  color: var(--color-text);
  background-color: #fff;
}

h1, h2, h3, h4, p, ul, figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* видно только скринридерам */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

button {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* Контейнер макета: содержимое 1200 в центре, по бокам поля.
   Bootstrap на xl даёт 1140; берём 1200 плюс собственные отступы контейнера,
   чтобы контент вставал ровно в макетные 120px от края фрейма 1440. */
@media (min-width: 1200px) {
  .container {
    max-width: calc(1200px + var(--bs-gutter-x));
  }
}

/* Кнопка-таблетка, встречается в шапке и секциях */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: var(--radius-pill);
  background-color: var(--color-primary);
  color: #fff;
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button:hover {
  background-color: color-mix(in srgb, var(--color-primary) 85%, #000);
}

/* в баннерах и карточках та же кнопка идёт кеглем помельче */
.button--sm {
  font-size: 14px;
}

.button--outline {
  background-color: #fff;
  border: 1px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
  color: var(--color-text);
}

.button--outline:hover,
.button--ghost:hover {
  border-color: var(--color-primary);
  background-color: color-mix(in srgb, var(--color-primary) 8%, #fff);
  color: var(--color-primary);
}

.button--ghost {
  background-color: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-text);
}

/* иконка в цветном кружке: сам кружок красится темой, глиф белый */
.icon-circle {
  display: inline-flex;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--color-primary);
}

.icon-circle::before {
  content: '';
  width: 100%;
  height: 100%;
  background-color: #fff;
}

.icon-circle--search::before {
  -webkit-mask: url(../assets/icons/search.svg) no-repeat center / contain;
  mask: url(../assets/icons/search.svg) no-repeat center / contain;
}

/* ================================================================
   Header — общий для всех страниц (Figma 4:11 / 4:1178)
   ================================================================ */

/* шапка выше парящего декора детского баннера */
.header {
  position: relative;
  z-index: 50;
  background-color: #fff;
}

.header__top {
  background: linear-gradient(90deg, #fafafa 0%, rgba(250, 250, 250, 0) 50%, #fafafa 100%);
}

.header__top-inner,
.header__main-inner,
.header__nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header__top-inner {
  padding-block: 16px;
}

.header__section-link,
.header__a11y {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.header__section-link {
  gap: 12px;
}

.header__a11y {
  gap: 10px;
}

.header__section-dot {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--color-other-section);
}

.header__main-inner {
  padding-block: 32px;
}

/* ширину считаем от высоты: у взрослого и детского логотипов разные пропорции,
   а атрибут width в разметке при изменении высоты сплющивал картинку */
.header__logo img {
  width: auto;
  height: 48px;
}

.header__contacts {
  display: flex;
  align-items: center;
  gap: 48px;
}

.header__address {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.header__address-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

/* иконки, перекрашиваемые под тему, подключаем маской */
.header__pin {
  width: 14px;
  height: 18px;
  background-color: var(--color-primary);
  -webkit-mask: url(../assets/icons/pin.svg) no-repeat center / contain;
  mask: url(../assets/icons/pin.svg) no-repeat center / contain;
}

.header__worktime {
  display: flex;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.header__worktime span:first-child {
  color: rgba(43, 43, 43, 0.75);
}

.header__worktime span:last-child {
  color: rgba(43, 43, 43, 0.25);
}

.header__phone {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
}

.header__phone span {
  color: var(--color-primary);
}

/* разделитель: горизонтальный градиент, к краям сходит на нет.
   В макете линия нулевой высоты на границе блоков — поэтому не занимает место в потоке. */
.header__divider {
  height: 1px;
  margin-bottom: -1px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.05) 50%, rgba(0, 0, 0, 0) 100%);
}

/* Вертикальные отступы строки навигации живут на самих пунктах, а не на
   контейнере: тогда пункт меню достаёт до низа шапки и курсор попадает
   на выпадающую панель, не выходя из зоны наведения. */
.header__nav-inner {
  padding-block: 0;
}

.header__nav-inner > * {
  align-self: stretch;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 48px;
}

.nav-main__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 24px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

/* Наведение на пункт: цвет подхватывает тему, снизу подчёркивание растёт
   от центра. Толщина линии не влияет на поток, поэтому строка не дёргается. */
.nav-main__link {
  position: relative;
  transition: color 0.15s ease;
}

.nav-main__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  height: 2px;
  border-radius: 2px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.nav-main__item:hover > .nav-main__link,
.nav-main__item:focus-within > .nav-main__link {
  color: var(--color-primary);
}

.nav-main__item:hover > .nav-main__link::after,
.nav-main__item:focus-within > .nav-main__link::after {
  transform: scaleX(1);
}

.nav-main__link--accent {
  color: var(--color-primary);
}

.nav-main__burger {
  width: 16px;
  height: 9px;
  background-color: var(--color-primary);
  -webkit-mask: url(../assets/icons/burger.svg) no-repeat center / contain;
  mask: url(../assets/icons/burger.svg) no-repeat center / contain;
}

/* Выпадающие меню. Обе панели привязаны к своему пункту и начинаются
   вплотную под шапкой — без зазора, в котором терялся курсор. */
.header__nav-row {
  position: relative;
}

.nav-main__item {
  position: relative;
  display: flex;
}

.nav-main__chevron {
  transition: transform 0.2s ease;
}

.nav-main__item:hover .nav-main__chevron,
.nav-main__item:focus-within .nav-main__chevron {
  transform: rotate(180deg);
}

.submenu,
.mega {
  position: absolute;
  z-index: 20;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.nav-main__item:hover > .submenu,
.nav-main__item:focus-within > .submenu,
.nav-main__item:hover > .mega,
.nav-main__item:focus-within > .mega {
  visibility: visible;
  opacity: 1;
}

.submenu {
  top: 100%;
  left: -24px;
  min-width: 220px;
  padding: 16px 0;
  border-radius: var(--radius-card-sm);
  background-color: #fff;
  box-shadow: 0 12px 32px rgba(43, 43, 43, 0.12);
}

.submenu a {
  display: block;
  padding: 10px 24px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.submenu a:hover {
  color: var(--color-primary);
  background-color: var(--color-surface);
}

/* Мега-меню: слева разделы, справа услуги наведённого раздела.
   Панель прижата к левому краю своего пункта и не растягивается на всю страницу. */
.mega {
  top: 100%;
  left: -24px;
  width: 780px;
  max-width: calc(100vw - 48px);
  padding: 24px;
  border-radius: var(--radius-card);
  background-color: #fff;
  box-shadow: 0 12px 32px rgba(43, 43, 43, 0.12);
}

.mega__inner {
  display: flex;
  gap: 24px;
}

.mega__sections {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  width: 260px;
  padding-right: 24px;
  border-right: 1px solid var(--color-border);
}

.mega__section {
  display: block;
  padding: 10px 16px;
  border-radius: var(--radius-card-sm);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.mega__section--active,
.mega__section:hover {
  color: var(--color-primary);
  background-color: var(--color-surface);
}

.mega__panels {
  flex: 1;
  min-width: 0;
}

/* одна колонка: названия услуг длинные и в две колонки рвутся на строки */
.mega__items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mega__items a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-radius: var(--radius-card-sm);
  transition: background-color 0.15s ease;
}

.mega__items a:hover {
  background-color: var(--color-surface);
}

.mega__item-title {
  font-size: 15px;
  line-height: 1.4;
}

.mega__items a:hover .mega__item-title {
  color: var(--color-primary);
}

.mega__item-price {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.header__socials {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header__rating {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

/* Кнопка выдвижного меню — только на узких экранах */
.header__toggler {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}

.header__toggler-icon {
  width: 24px;
  height: 14px;
  background-color: var(--color-primary);
  -webkit-mask: url(../assets/icons/burger.svg) no-repeat center / contain;
  mask: url(../assets/icons/burger.svg) no-repeat center / contain;
}

.site-menu {
  --bs-offcanvas-width: 320px;
}

.site-menu__list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
  font-size: 18px;
  font-weight: 600;
}

/* строка пункта: ссылка ведёт на раздел, кнопка справа раскрывает вложенное */
.site-menu__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-menu__toggle {
  position: relative;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin-right: -8px;
  background: none;
}

.site-menu__toggle::before,
.site-menu__toggle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background-color: var(--color-primary);
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease;
}

.site-menu__toggle::before {
  width: 14px;
  height: 2px;
}

.site-menu__toggle::after {
  width: 2px;
  height: 14px;
}

/* у раскрытого пункта плюс превращается в минус */
.site-menu__item--open .site-menu__toggle::after {
  opacity: 0;
}

.site-menu__sub {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-left: 16px;
  border-left: 1px solid var(--color-border);
  font-size: 15px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.site-menu__sub[hidden] {
  display: none;
}

.site-menu__phone {
  display: block;
  margin-bottom: 12px;
  font-size: 22px;
  font-weight: 800;
  color: var(--color-primary);
}

.site-menu__address,
.site-menu__worktime {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.site-menu__worktime {
  margin-bottom: 24px;
}

@media (max-width: 1199.98px) {
  .nav-main {
    gap: 28px;
  }

  .nav-main__link {
    font-size: 16px;
  }

  .header__contacts {
    gap: 24px;
  }
}

@media (max-width: 991.98px) {
  .header__contacts,
  .header__nav-inner,
  .header__divider {
    display: none;
  }

  .header__toggler {
    display: flex;
  }

  .header__main-inner {
    padding-block: 20px;
  }
}

@media (max-width: 575.98px) {
  .header__a11y span,
  .header__a11y {
    font-size: 11px;
  }

  .header__logo img {
    height: 36px;
  }
}

/* ================================================================
   Banner — взрослая главная (Figma 4:1245)
   ================================================================ */

.banner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 512px;
  /* полоса с фотографией начинается на 32px ниже верха секции */
  padding-block: 32px 0;
}

.banner__media {
  position: absolute;
  inset: 32px 0 0;
  overflow: hidden;
  background-color: #d9d9d9;
}

/* в макете снимок отзеркален по горизонтали */
.banner__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.banner__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
}

.banner .container {
  position: relative;
  z-index: 1;
}

.banner__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  max-width: 584px;
  padding-block: 64px;
  color: #fff;
}

.banner__title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.2;
}

.banner__text {
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 991.98px) {
  .banner {
    min-height: 420px;
  }

  .banner__title {
    font-size: 36px;
  }
}

@media (max-width: 575.98px) {
  .banner {
    min-height: 360px;
  }

  .banner__title {
    font-size: 28px;
  }

  .banner__media::after {
    background: rgba(0, 0, 0, 0.5);
  }
}

/* ================================================================
   Banner — детская главная (Figma 4:81)
   Волна — растровая подложка, вокруг неё парит декор с параллаксом.
   ================================================================ */

/* overflow не режем: декор намеренно выходит за границы секции
   и парит поверх следующих блоков. Боковой вылет гасит overflow-x у body. */
.banner-kids {
  position: relative;
  display: flex;
  align-items: center;
  /* Волна тянется по ширине экрана и растёт в высоту вместе с ней
     (пропорция картинки 2880:1280 плюс отступ сверху 64px). Секция должна
     быть не ниже неё, иначе волна наезжает на блок услуг. До 1440 работает
     макетное значение 768. */
  min-height: max(768px, calc(100vw / 2.25 + 64px));
}

/* в макете картинка отражена по вертикали */
.banner-kids__wave {
  position: absolute;
  top: 64px;
  left: 50%;
  /* Тянем на всю ширину экрана: при фиксированных 1440px на широких
     мониторах по краям оставались пустые поля. Ниже 1440 ширину держим —
     волна уезжает за края, как в макете, а не сжимается. */
  width: 100%;
  min-width: 1440px;
  max-width: none;
  height: auto;
  aspect-ratio: 2880 / 1280;
  transform: translateX(-50%) scaleY(-1);
  object-fit: cover;
}

.banner-kids .container {
  position: relative;
  z-index: 2;
}

.banner-kids__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  max-width: 650px;
  color: #fff;
}

.banner-kids__title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.4;
}

.banner-kids__text {
  font-size: 14px;
  line-height: 1.6;
}

/* Декор баннера. Координаты из макета отсчитываются от центра фрейма 1440,
   поэтому на широких экранах группы остаются на своих местах относительно волны. */
/* Декор лежит поверх всех секций страницы, но ниже шапки и её выпадающих
   панелей, а значит и ниже будущих модалок Bootstrap (z-index от 1045). */
.decor {
  position: absolute;
  z-index: 40;
  pointer-events: none;
  /* сдвиг по вертикали задаёт js/main.js при скролле */
  will-change: transform;
}

/* Декор страницы услуги. Позиции в процентах от контейнера, поэтому
   группы держатся своих секций на любой ширине. */
.service-why__inner,
.steps .container,
.prices .container {
  position: relative;
}

.decor--cloud-why      { left: 90.9%; top: -48px;  width: 157px; }
.decor--cloud-what     { left: -64px; bottom: -45px; width: 170px; }
.decor--spark          { left: 48.5%; top: -32px;  width: 94px; }
.decor--stars-steps    { left: 97%;   top: 174px;  width: 125px; }
/* сердце сидит внутри венчика из лучиков — координаты обоих из одной группы макета */
.decor--sparkle-price  { left: 35.8%; top: -61px;  width: 145px; }
.decor--heart-price    { left: 41.8%; top: -5px;   width: 81px; }

@media (max-width: 991.98px) {
  /* на узких экранах декор мешает контенту */
  .decor--cloud-why,
  .decor--cloud-what,
  .decor--spark,
  .decor--stars-steps,
  .decor--heart-price,
  .decor--sparkle-price {
    display: none;
  }
}

.decor--cloud-tl { left: calc(50% - 788px); top: -17px;  width: 188px; }
.decor--cloud-tr { left: calc(50% + 541px); top: 44px;   width: 157px; }
.decor--cloud-br { left: calc(50% + 430px); top: 586px;  width: 170px; }
.decor--sun      { left: calc(50% - 118px); top: 582px;  width: 96px; }
.decor--stars    { left: calc(50% - 662px); top: 645px;  width: 125px; }
.decor--tooth-l  { left: calc(50% - 505px); top: 171px;  width: 73px; }
.decor--tooth-b  { left: calc(50% - 354px); top: 662px;  width: 94px; }
.decor--birds    { left: calc(50% + 67px);  top: 26px;   width: 58px; }
.decor--heart-t  { left: calc(50% - 248px); top: 44px;   width: 153px; }
.decor--heart-b  { left: calc(50% + 186px); top: 644px;  width: 71px; }

@media (max-width: 991.98px) {
  .banner-kids {
    min-height: 560px;
  }

  .banner-kids__title {
    font-size: 36px;
  }

  .banner-kids__wave {
    top: 40px;
    height: 480px;
  }

  /* мелкий декор в центре мешает тексту — оставляем только края */
  .decor--heart-t,
  .decor--tooth-b,
  .decor--sun,
  .decor--birds {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .banner-kids {
    min-height: 460px;
  }

  .banner-kids__title {
    font-size: 28px;
  }

  .decor {
    display: none;
  }
}

/* ================================================================
   Services — табы разделов и карусель услуг (Figma 4:1252 / 4:171)
   ================================================================ */

.services {
  padding-top: 64px;
}

.services__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.services__title {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 651px;
}

.services__title h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
}

.services__subtitle {
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.services__links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.services__search {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.services__all {
  font-size: 16px;
  line-height: 1.4;
  color: var(--color-text-muted);
  text-decoration: underline;
}

.services__body {
  display: flex;
  align-items: flex-start;
  gap: 33px;
}

.services__aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  width: 275px;
  min-height: 328px;
}

.services__tabs {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: right;
}

.services__tab {
  width: 100%;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-align: inherit;
  transition: color 0.15s ease;
}

.services__tab:hover {
  color: var(--color-primary);
}

.services__tab--active {
  color: var(--color-primary);
}

.services__divider {
  height: 1px;
  margin-block: 24px;
  background-color: var(--color-border);
}

/* панели занимают остаток ширины контейнера; карточки, которые не поместились,
   прячутся за его правой границей и доступны прокруткой слайдера */
.services__panels {
  flex: 1;
  min-width: 0;
}

.services__slider .swiper-slide {
  height: auto;
}

/* На ПК услуги выводятся списком друг за другом, а не каруселью: место есть,
   и прятать половину раздела за краем экрана незачем. Скрипт на этой ширине
   слайдер не поднимает (data-slider-until), разметка остаётся swiper'овской,
   поэтому раскладку задаём здесь. */
@media (min-width: 1200px) {
  .services__slider {
    clip-path: none;
  }

  .services__slider .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }

  .services__slider .swiper-slide {
    width: auto;
  }
}

.service-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-card);
  background-color: var(--color-surface);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* карточка приподнимается, картинка чуть наезжает, заголовок красится темой */
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(43, 43, 43, 0.1);
}

.service-card:hover .service-card__title {
  color: var(--color-primary);
}

.service-card__picture {
  height: 160px;
  overflow: hidden;
}

.service-card__picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.service-card:hover .service-card__picture img {
  transform: scale(1.05);
}

.service-card__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  font-size: 14px;
  line-height: 1.4;
}

.service-card__title {
  font-size: 14px;
  font-weight: 600;
}

.service-card__text {
  color: var(--color-text-muted);
}

.service-card__price {
  margin-top: auto;
  font-weight: 700;
}

/* Детская главная: заголовок по центру, а поиск и ссылка «Все услуги»
   уезжают из шапки секции в левую колонку под список разделов. */
.services--kids {
  padding-top: 0;
}

.services--kids .services__head {
  justify-content: center;
}

.services--kids .services__title {
  align-items: center;
  max-width: none;
  text-align: center;
}

.services--kids .services__title h2 {
  font-size: 32px;
}

/* в детской теме иконка стоит перед текстом */
.services--kids .services__search {
  flex-direction: row-reverse;
}

@media (max-width: 991.98px) {
  /* разделы превращаются в горизонтальную ленту над карточками */
  .services__body {
    flex-direction: column;
    gap: 24px;
  }

  .services__aside {
    width: 100%;
    min-height: 0;
  }

  .services__tabs {
    flex-direction: row;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
    text-align: left;
  }

  .services__tab {
    width: auto;
    white-space: nowrap;
  }

  .services__divider {
    display: none;
  }

  .services--kids .services__links {
    align-items: flex-start;
  }

  .services__panels {
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  .services__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .services__links {
    align-items: flex-start;
  }
}

/* ================================================================
   Sales — баннер рассрочки и блок расчёта (Figma 4:1301 / 4:216)
   ================================================================ */

.sales {
  display: flex;
  align-items: stretch;
  gap: 32px;
  padding-block: 64px;
}

.sale {
  /* от этого значения отсчитывается и метка «Акция» — так её отступы
     всегда совпадают с внутренними отступами карточки */
  --sale-padding: 32px;

  position: relative;
  flex: 0 1 707px;
  min-height: 282px;
  padding: var(--sale-padding);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.sale__media {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.sale__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sale__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  max-width: 429px;
  color: #fff;
}

.sale__title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
}

.sale__text {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}

.sale__text b {
  font-weight: 700;
}

/* ярлык «Акция» наезжает на верхнюю границу карточки */
.sale__label {
  position: absolute;
  top: -19px;
  right: 63px;
  padding: 8px 24px;
  border-radius: var(--radius-pill);
  background-color: var(--color-primary);
  font-size: 14px;
  line-height: 1.4;
  color: #fff;
}

/* На узком десктопе карточка вытягивается по высоте, и под текстом остаётся
   пустое место — убираем метку с внешнего края внутрь, над заголовком.
   Рядом с кнопкой она смотрелась второй кнопкой того же цвета. */
@media (max-width: 1199.98px) {
  .sale__label {
    top: var(--sale-padding);
    right: auto;
    left: var(--sale-padding);
    background-color: rgba(255, 255, 255, 0.18);
  }

  /* освобождаем место под метку */
  .sale__content {
    padding-top: 48px;
  }
}

.calc {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  flex: 0 1 461px;
  min-height: 282px;
  padding: 32px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-align: right;
}

.calc__title {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.calc__text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.calc__text a {
  color: var(--color-text);
  font-weight: 700;
  text-decoration: underline;
}

.calc__bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.calc__alert {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.calc__phone {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
}

.calc__phone span {
  color: var(--color-primary);
}

/* декоративный пунктир, пересекающий карточку под небольшим углом.
   Стоит в потоке между текстом и телефоном: при переносе строк он
   раньше наезжал на текст, потому что был привязан к центру карточки. */
.calc__hr {
  position: relative;
  left: -33px;
  width: 531px;
  max-width: calc(100% + 66px);
  height: 16px;
  flex-shrink: 0;
  transform: rotate(3deg);
  background: url(../assets/icons/dashed-line.svg) no-repeat center / contain;
}

@media (max-width: 991.98px) {
  .sales {
    flex-direction: column;
  }

  .sale,
  .calc {
    flex: 1 1 auto;
  }
}

@media (max-width: 575.98px) {
  .sale {
    --sale-padding: 24px;
  }

  .calc {
    padding: 24px;
  }

  .calc {
    text-align: left;
  }

  .calc__bottom {
    align-items: flex-start;
  }

  .calc__alert {
    gap: 12px;
    font-size: 14px;
  }
}

/* ================================================================
   About — о клинике с галереей (Figma 4:1325 / 4:240)
   ================================================================ */

.about {
  padding-block: 64px;
  background: linear-gradient(90deg, #fff 0%, var(--color-bg) 100%);
}

.about__inner {
  display: flex;
  align-items: center;
  gap: 32px;
}

.about__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  flex: 1 1 584px;
  min-width: 0;
}

.about__advs {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.about__advs-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-primary);
}

.about__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(43, 43, 43, 0.75);
}

.about__buttons {
  display: flex;
  gap: 10px;
}

.about__play {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--color-primary);
}

.about__play::before {
  content: '';
  width: 14px;
  height: 16px;
  background-color: #fff;
  -webkit-mask: url(../assets/icons/play.svg) no-repeat center / contain;
  mask: url(../assets/icons/play.svg) no-repeat center / contain;
}

.about__gallery {
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex: 1 1 584px;
  min-width: 0;
}

.about__row,
.about__list {
  display: flex;
  gap: 32px;
}

/* фотографии открываются в галерее, поэтому каждая обёрнута в ссылку */
.about__row > a,
.about__list > a {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 276 / 183;
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: opacity 0.15s ease;
}

.about__row > a {
  border-radius: var(--radius-card);
}

.about__list > a {
  border-radius: var(--radius-card-sm);
}

.about__row > a:hover,
.about__list > a:hover {
  opacity: 0.85;
}

.about__row img,
.about__list img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 991.98px) {
  .about__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .about__row,
  .about__list {
    gap: 16px;
  }
}

@media (max-width: 575.98px) {
  .about__advs {
    flex-wrap: wrap;
    gap: 12px;
  }

  .about__body {
    font-size: 14px;
  }
}

/* ================================================================
   Reviews — виджет отзывов Яндекс.Карт (Figma 4:1347 / 4:262)
   ================================================================ */

.reviews {
  padding-block: 64px;
}

.reviews .container {
  display: flex;
  justify-content: center;
}

.reviews__widget {
  width: 708px;
  max-width: 100%;
  height: 746px;
  border: none;
  border-radius: var(--radius-card);
  overflow: hidden;
}

/* ================================================================
   Team — коллектив (Figma 4:1349 / 4:264)
   ================================================================ */

.team {
  /* верхний отступ нужен всегда: перед коллективом может стоять
     и секция с фоном, и отзывы. Нижнего нет — у секции без подложки
     расстояние задаёт верхний отступ следующей, а когда коллектив
     закрывает страницу, отбивку даёт .page-content > :last-child */
  padding-block: 48px 0;
}

.team__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.team__head h2 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.4;
}

.team__right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.team__lead {
  max-width: 392px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text-muted);
  text-align: right;
}

.team__slider .swiper-slide {
  height: auto;
}

/* Карусели: ширину слайда Swiper считает от контейнера, поэтому долистанная
   до конца линейка встаёт ровно на его правую границу. Обрезку справа снимаем,
   чтобы следующие карточки было видно за краем контейнера, как в макете;
   слева обрезка остаётся, иначе уехавшие слайды лезли бы под список разделов.
   Ширину задаём явно: без overflow: hidden слайдер внутри флекс-колонки
   растягивается по содержимому, и Swiper считает размеры от него. */
.services__slider,
.team__slider,
.reasons__slider,
.care__slider {
  width: 100%;
  min-width: 0;
  overflow: visible;
  clip-path: inset(-40px -100vw -40px 0);
}

/* Кнопки перелистывания
   --------------------
   Ставятся скриптом под каждой каруселью, поэтому стиль один на все секции.
   Под слайдером, а не поверх карточек: услуги и врачи уходят за правый край
   экрана, и прижатая к нему стрелка попала бы на обрез. */
.slider-nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

/* листать нечего — Swiper вешает swiper-button-lock, и строка кнопок убирается */
.slider-nav:has(.swiper-button-lock) {
  display: none;
}

.slider-nav__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background-color: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.slider-nav__button::before {
  content: '';
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: url(../assets/icons/chevron-down.svg) no-repeat center / contain;
  mask: url(../assets/icons/chevron-down.svg) no-repeat center / contain;
}

/* одна иконка на обе кнопки: шеврон вниз разворачивается в стрелку */
.slider-nav__button--prev::before {
  rotate: 90deg;
}

.slider-nav__button--next::before {
  rotate: -90deg;
}

.slider-nav__button:hover {
  border-color: var(--color-primary);
  background-color: var(--color-primary);
  color: #fff;
}

.slider-nav__button.swiper-button-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.doctor-card__photo {
  height: 320px;
  margin-bottom: 26px;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.doctor-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.doctor-card__name {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.doctor-card__exp {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.doctor-card__role {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

@media (max-width: 767.98px) {
  .team__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .team__right {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .team__lead {
    text-align: left;
  }
}

/* ================================================================
   Страница услуги — шапка с фигурной подложкой и якорным меню
   (Figma 4:371 + 4:390)
   ================================================================ */

.page-header {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 283px;
}

/* подложка обрезана волной сверху и снизу — маска лежит в assets/icons */
.page-header__media {
  position: absolute;
  inset: 3px 0 0;
  -webkit-mask: url(../assets/icons/page-header-mask.svg) no-repeat center / 100% 100%;
  mask: url(../assets/icons/page-header-mask.svg) no-repeat center / 100% 100%;
  transform: scaleY(-1);
}

.page-header__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-header__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.page-header__title {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.6;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

.breadcrumbs__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-primary);
}

.service-nav {
  padding-block: 32px;
  border-bottom: 1px solid var(--color-border);
}

.service-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.service-nav__list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s ease;
}

.service-nav__list a:hover {
  color: var(--color-primary);
}

/* иконка ссылки перед подписью: красится цветом текста, поэтому
   на ховере уходит в цвет темы вместе с ним */
.service-nav__icon {
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.service-nav__list a:hover .service-nav__icon {
  opacity: 1;
}

@media (max-width: 767.98px) {
  .page-header {
    min-height: 200px;
  }

  .page-header__title {
    font-size: 28px;
  }

  .service-nav {
    padding-block: 20px;
  }

  .service-nav__list {
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Заголовок секции с круглой иконкой — общий для страницы услуги */
.section-title {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.6;
}

.section-title em {
  font-style: normal;
  color: var(--color-primary);
}

.section-title__icon {
  display: flex;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.section-title--plain {
  display: block;
}

/* Список с галочками */
.check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 32px;
  font-weight: 600;
}

.check-list li {
  position: relative;
  padding-left: 28px;
}

.check-list li::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 0;
  width: 16px;
  height: 16px;
  background-color: var(--color-primary);
  -webkit-mask: url(../assets/icons/check.svg) no-repeat center / contain;
  mask: url(../assets/icons/check.svg) no-repeat center / contain;
}

/* ================================================================
   Страница услуги — «Почему важно лечить» (Figma 4:401)
   ================================================================ */

.service-why {
  /* фотография справа опускается ниже текста, поэтому небольшой нижний
     отступ нужен: без него следующая секция подходит к ней вплотную */
  padding-block: 48px 24px;
}

.service-why__inner {
  display: flex;
  align-items: center;
  gap: 32px;
}

.service-why__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  flex: 1 1 789px;
  min-width: 0;
}

.service-why__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 16px;
  line-height: 1.6;
}

.service-why__picture {
  flex: 0 0 379px;
  height: 461px;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.service-why__picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 991.98px) {
  .service-why__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .service-why__picture {
    flex-basis: auto;
    height: 320px;
  }
}

@media (max-width: 575.98px) {
  .section-title {
    gap: 16px;
    font-size: 24px;
  }
}

/* ================================================================
   Страница услуги — «Что такое кариес?» (Figma 4:431)
   ================================================================ */

.service-what {
  padding-block: 48px 0;
}

.service-what__card {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 32px;
  border-radius: var(--radius-card);
  background: linear-gradient(90deg, rgba(233, 236, 243, 0.25) 0%, rgba(235, 238, 245, 0.5) 100%), #fff;
}

/* иконка сидит на верхней границе карточки, по линии стыка с фото */
.service-what__icon {
  position: absolute;
  /* фото вынуто из потока и идёт в разметке позже — без z-index закрывает иконку */
  z-index: 1;
  top: -20px;
  left: 359px;
  display: flex;
  width: 40px;
  height: 40px;
}

.service-what__picture {
  position: relative;
  flex: 0 0 379px;
  min-height: 320px;
  border-radius: var(--radius-card) 0 0 var(--radius-card);
  overflow: hidden;
}

/* Высоту карточки задаёт текст: фото вынуто из потока и заполняет колонку
   целиком, обрезаясь по центру. Раньше вертикальный кадр растягивал карточку
   до своей высоты, и под текстом оставалась пустота. */
.service-what__picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.service-what__content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 24px;
  flex: 1 1 0;
  min-width: 0;
  padding: 48px;
  text-align: right;
}

.service-what__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 16px;
  line-height: 1.6;
}

.service-what__text b {
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .service-what__card {
    flex-direction: column;
    gap: 0;
  }

  .service-what__icon {
    left: 32px;
  }

  .service-what__picture {
    flex-basis: 260px;
    height: 260px;
    min-height: 0;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
  }

  .service-what__content {
    align-items: flex-start;
    padding: 32px;
    text-align: left;
  }
}

/* ================================================================
   Страница услуги — причины и «Как мы лечим» (Figma 4:442)
   Обе секции стоят на общей тонированной подложке.
   ================================================================ */

/* Подложка вынесена в отдельный слой под контентом: она начинается на
   середине карточек причин и тянется до низа блока «Как мы лечим». */
.service-block {
  position: relative;
}

/* --block-bg-top проставляет js/main.js по фактической середине карточек;
   значение по умолчанию — на случай, если скрипт не отработал */
.service-block__bg {
  position: absolute;
  z-index: -1;
  top: var(--block-bg-top, 200px);
  right: 0;
  bottom: 0;
  left: 0;
  background-color: var(--color-bg);
}

.reasons {
  padding-bottom: 64px;
}

.reasons__head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
  text-align: center;
}

.reasons__title {
  align-self: center;
}

.reasons__subtitle {
  font-size: 16px;
  line-height: 1.6;
}

.reasons__slider .swiper-slide {
  height: auto;
}

.reason-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 40px 24px 24px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-card-sm);
  background-color: #fff;
  text-align: center;
}

/* иконка сидит верхом на границе карточки */
.reason-card__icon {
  position: absolute;
  top: -17px;
  left: 50%;
  display: flex;
  width: 32px;
  height: 32px;
  transform: translateX(-50%);
}

.reason-card__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
}

.reason-card__text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.how {
  padding-bottom: 64px;
}

.how__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
}

.how__title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.4;
}

.how__list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Строка тянется от края контейнера до края экрана: белая плашка выходит
   за контейнер, а фотография обрезана волной со стороны текста. */
.how__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
  /* 68px контента + отступы = макетные 132px */
  min-height: 132px;
  padding-block: 32px;
  background-color: #fff;
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  margin-left: calc(50% - 50vw);
  padding-left: calc(50vw - 50%);
}

.how__row--reverse {
  flex-direction: row-reverse;
  border-radius: var(--radius-card) 0 0 var(--radius-card);
  margin-left: 0;
  padding-left: 0;
  margin-right: calc(50% - 50vw);
  padding-right: calc(50vw - 50%);
  text-align: right;
}

.how__number {
  flex-shrink: 0;
  font-size: 64px;
  font-weight: 600;
  line-height: 1;
  color: rgba(43, 43, 43, 0.1);
}

.how__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.how__row--reverse .how__text {
  align-items: flex-end;
}

.how__name {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.6;
}

/* фотография выведена из потока: иначе она задавала бы высоту строки,
   а в макете строка ровно 132px независимо от снимка */
/* фотография скруглена с той стороны, которой примыкает к краю строки:
   волнистая маска режет только внутренний край */
.how__picture {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 584px;
  max-width: 45%;
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  overflow: hidden;
  -webkit-mask: url(../assets/icons/how-mask-end.svg) no-repeat center / 100% 100%;
  mask: url(../assets/icons/how-mask-end.svg) no-repeat center / 100% 100%;
}

.how__row--reverse .how__picture {
  right: auto;
  left: 0;
  border-radius: var(--radius-card) 0 0 var(--radius-card);
  -webkit-mask-image: url(../assets/icons/how-mask-start.svg);
  mask-image: url(../assets/icons/how-mask-start.svg);
}

/* текст не должен заезжать под фотографию */
.how__text {
  max-width: 55%;
}

.how__picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1199.98px) {
  .how__picture {
    flex-basis: 40%;
  }
}

@media (max-width: 767.98px) {
  .reasons__head {
    margin-bottom: 32px;
  }

  .how__head {
    flex-direction: column;
    align-items: flex-start;
  }

  /* на узких экранах фотография уезжает — остаются номер и текст */
  .how__picture {
    display: none;
  }

  .how__row,
  .how__row--reverse {
    margin-inline: 0;
    padding-inline: 24px;
    border-radius: var(--radius-card);
    text-align: left;
  }

  .how__row--reverse {
    flex-direction: row;
  }

  .how__row--reverse .how__text {
    align-items: flex-start;
  }

  .how__number {
    font-size: 44px;
  }

  .how__name {
    font-size: 20px;
  }
}

/* ================================================================
   Страница услуги — этапы лечения (Figma 4:514)
   ================================================================ */

.steps {
  padding-block: 48px 0;
}

.steps__head {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

/* линия занимает всё место слева от заголовка */
.steps__line {
  flex: 1;
  height: 1px;
  background-color: var(--color-border);
}

.steps__row {
  display: flex;
  align-items: stretch;
  gap: 24px;
}

.steps__row + .steps__row {
  margin-top: 24px;
}

.step-card {
  display: flex;
  flex-direction: column;
  /* карточки в ряду тянутся до самой высокой — содержимое короткой
     держим по центру, а не прижатым к верху с пустотой снизу */
  justify-content: center;
  gap: 8px;
  flex: 0 0 379px;
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-card-sm);
}

.step-card--grow {
  flex: 1 1 0;
  min-width: 0;
}

.step-card__head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.step-card__number {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
}

.step-card__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
}

.step-card__text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* Ниже 1200 пять карточек в строке сжимаются до нечитаемых колонок,
   поэтому раскладываем их сеткой с гарантированной шириной карточки. */
@media (max-width: 1199.98px) {
  .steps__row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .step-card,
  .step-card--grow {
    flex: none;
  }

  /* у номера и заголовка разная высота — равняем их по верхнему краю */
  .step-card__head {
    align-items: flex-start;
  }

  .step-card__title {
    line-height: 1.4;
  }
}

@media (max-width: 575.98px) {
  .steps__row {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   Страница услуги — профилактика и уход (Figma 4:554)
   ================================================================ */

.care {
  /* у секции свой фон, поэтому нижний отступ оставляем */
  padding-block: 48px;
  background: linear-gradient(90deg, rgba(235, 238, 245, 0.5) 0%, rgba(233, 236, 243, 0.25) 100%);
}

/* на подложке карточки услуг белые, а не серые как в общей секции */
.care .service-card {
  background-color: #fff;
}

.care__inner {
  display: flex;
  gap: 32px;
}

.care__content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1 1 584px;
  min-width: 0;
  font-size: 16px;
  line-height: 1.6;
}

/* в этой секции заголовок мельче, чем в остальных на странице */
.section-title--sm {
  font-size: 24px;
}

.care__content .check-list {
  gap: 8px;
  margin-top: -16px;
}

.care__note {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: auto;
  padding: 24px;
  border-radius: var(--radius-card-sm);
  background-color: #fff;
  box-shadow: 0 4px 24px rgba(43, 43, 43, 0.06);
}

.care__note img {
  flex-shrink: 0;
}

.care__services {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1 1 584px;
  min-width: 0;
}

.care__all {
  align-self: flex-end;
}

.care__slider .swiper-slide {
  height: auto;
}

@media (max-width: 991.98px) {
  .care__inner {
    flex-direction: column;
  }
}

/* ================================================================
   Страница услуги — цены (Figma 4:604)
   ================================================================ */

.prices {
  padding-block: 48px 0;
}

.prices__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.prices__title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.4;
}

.prices__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prices__note {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.price-line {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 24px 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card-sm);
}

.price-line__title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  line-height: 1.6;
}

.price-line__price {
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

.price-line__action {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--color-primary);
  text-decoration: underline;
  transition: opacity 0.15s ease;
}

.price-line__action:hover {
  opacity: 0.7;
}

@media (max-width: 767.98px) {
  .prices__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .price-line {
    flex-wrap: wrap;
    gap: 12px 24px;
    padding: 20px 24px;
  }

  .price-line__title {
    flex-basis: 100%;
  }
}

/* ================================================================
   Разводящая услуг. В макете Figma этой страницы нет.
   ================================================================ */

.catalogue {
  padding-block: 48px 0;
}

.catalogue__inner {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.catalogue__aside {
  position: sticky;
  top: 24px;
  flex: 0 0 276px;
  transition: opacity 0.2s ease;
}

/* во время поиска разделы ни на что не влияют — показываем это прозрачностью */
.catalogue--searching .catalogue__aside {
  opacity: 0.4;
  pointer-events: none;
}

.catalogue__aside-title {
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.catalogue__sections {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.catalogue__section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-card-sm);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.catalogue__section:hover,
.catalogue__section--active {
  color: var(--color-primary);
  background-color: var(--color-surface);
}

.catalogue__count {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.catalogue__content {
  flex: 1;
  min-width: 0;
}

.catalogue__search {
  position: relative;
  margin-bottom: 24px;
}

.catalogue__search-icon {
  position: absolute;
  top: 50%;
  left: 24px;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  background-color: var(--color-primary);
  -webkit-mask: url(../assets/icons/search.svg) no-repeat center / contain;
  mask: url(../assets/icons/search.svg) no-repeat center / contain;
}

.catalogue__search-input {
  width: 100%;
  padding: 18px 56px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background-color: #fff;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.catalogue__search-input::placeholder {
  color: var(--color-text-muted);
}

.catalogue__search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

/* у поля type=search свой крестик — прячем, чтобы не дублировал наш */
.catalogue__search-input::-webkit-search-cancel-button {
  display: none;
}

.catalogue__search-reset {
  position: absolute;
  top: 50%;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--color-surface);
  font-size: 20px;
  line-height: 1;
  color: var(--color-text-muted);
  transform: translateY(-50%);
  transition: color 0.15s ease;
}

.catalogue__search-reset:hover {
  color: var(--color-text);
}

.catalogue__status {
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.catalogue__groups {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* группа, целиком отфильтрованная поиском, из потока убирается */
.catalogue__group[hidden] {
  display: none;
}

.catalogue__group-title {
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  scroll-margin-top: 24px;
}

.catalogue__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.catalogue__list .service-card[hidden] {
  display: none;
}

.service-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.catalogue__empty {
  padding: 48px 24px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-card);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-muted);
  text-align: center;
}

.catalogue__empty a {
  color: var(--color-primary);
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 1199.98px) {
  .catalogue__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .catalogue__inner {
    flex-direction: column;
  }

  /* разделы превращаются в горизонтальную ленту над поиском */
  .catalogue__aside {
    position: static;
    flex-basis: auto;
    width: 100%;
  }

  .catalogue__sections {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .catalogue__section {
    white-space: nowrap;
    background-color: var(--color-surface);
  }

  .catalogue__content {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .catalogue__list {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .catalogue__search-input {
    padding: 14px 48px;
    font-size: 15px;
  }
}

/* ================================================================
   Страница раздела услуг. В макете Figma её нет.
   ================================================================ */

.section-intro {
  padding-block: 48px 0;
}

.section-intro__inner {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.section-intro__text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 0;
  min-width: 0;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(43, 43, 43, 0.75);
}

.section-intro__lead {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text);
}

.section-intro__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  flex: 0 0 379px;
  padding: 32px;
  border-radius: var(--radius-card);
  background-color: var(--color-bg);
}

.section-intro__aside-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

/* в карточке список идёт без дополнительного отступа слева */
.section-intro__benefits {
  padding-left: 0;
  font-size: 15px;
  line-height: 1.5;
}

.section-services {
  padding-block: 48px 0;
}

.section-services__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.section-services__title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.4;
}

.catalogue__group-title a {
  transition: color 0.15s ease;
}

.catalogue__group-title a:hover {
  color: var(--color-primary);
}

@media (max-width: 991.98px) {
  .section-intro__inner {
    flex-direction: column;
  }

  .section-intro__aside {
    flex-basis: auto;
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  .section-services__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-services__title {
    font-size: 24px;
  }

  .section-intro__lead {
    font-size: 18px;
  }
}

/* ================================================================
   Footer — общий для всех страниц. В макете Figma его нет.
   ================================================================ */

.footer {
  padding-block: 64px 32px;
  background-color: var(--color-footer-bg);
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  line-height: 1.6;
}

.footer__top {
  display: flex;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  flex: 1 1 340px;
  min-width: 0;
}

/* логотипы нарисованы под светлый фон — на тёмном выводим их белыми */
.footer__logo img {
  width: auto;
  height: 48px;
  filter: brightness(0) invert(1);
}

.footer__contacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  font-style: normal;
}

.footer__address {
  color: #fff;
}

.footer__phone {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.4;
  color: #fff;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.footer__phone:hover {
  color: var(--color-primary-light);
}

.footer__socials {
  display: flex;
  gap: 16px;
}

.footer__socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.08);
  transition: background-color 0.15s ease;
}

.footer__socials a:hover {
  background-color: rgba(255, 255, 255, 0.16);
}

/* фирменные цвета иконок на тёмном фоне пестрят — приводим к белому */
.footer__socials img {
  filter: brightness(0) invert(1);
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.footer__socials a:hover img {
  opacity: 1;
}

.footer__copyright {
  margin-top: auto;
  font-size: 13px;
}

.footer__col {
  flex: 1 1 200px;
  min-width: 0;
}

.footer__title {
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__list a {
  transition: color 0.15s ease;
}

.footer__list a:hover {
  color: #fff;
}

.footer__disclaimer {
  margin-top: 32px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 991.98px) {
  .footer__top {
    flex-wrap: wrap;
  }

  .footer__brand {
    flex-basis: 100%;
    margin-bottom: 16px;
  }
}

@media (max-width: 575.98px) {
  .footer {
    padding-top: 40px;
  }

  .footer__top {
    flex-direction: column;
    gap: 32px;
    padding-bottom: 32px;
  }

  /* в колонку расстояние задаёт gap, иначе к нему прибавляется этот отступ */
  .footer__brand {
    margin-bottom: 0;
  }
}

/* --- Служебная страница разработчика (index.php), в макете её нет --- */

.dev-index {
  max-width: 640px;
  margin: 80px auto;
  padding-inline: 16px;
  font-family: var(--font-primary);
}

.dev-index h1 {
  margin-bottom: 8px;
  font-size: 28px;
  font-weight: 800;
}

.dev-index p {
  margin-bottom: 32px;
  color: #6b6b6b;
}

.dev-index li + li {
  margin-top: 12px;
}

.dev-index a {
  font-weight: 600;
  text-decoration: underline;
}

.dev-index code {
  margin-left: 8px;
  color: #6b6b6b;
  font-family: ui-monospace, monospace;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
}

/* ================================================================
   Booking — окно записи на приём. В макете Figma его нет.
   ================================================================ */

.booking__dialog {
  max-width: 880px;
}

.booking__content {
  position: relative;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  border: none;
  border-radius: var(--radius-card);
}

/* картинку растягиваем абсолютом: у флекс-элемента без явной высоты
   height: 100% у вложенного img схлопывается в ноль */
.booking__media {
  position: relative;
  flex: 0 0 320px;
  background-color: var(--color-bg);
}

.booking__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.booking__body {
  flex: 1;
  min-width: 0;
  padding: 40px;
}

.booking__title {
  margin-bottom: 8px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
}

.booking__lead {
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.booking__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  transition: background-color 0.15s ease;
}

.booking__close::before,
.booking__close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  background-color: var(--color-text);
}

.booking__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.booking__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.booking__close:hover {
  background-color: #fff;
}

.booking__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.booking__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.booking__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.booking__input {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background-color: #fff;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.booking__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.booking__input--invalid {
  border-color: #d64545;
}

.booking__error {
  font-size: 12px;
  line-height: 1.4;
  color: #d64545;
}

.booking__error:empty {
  display: none;
}

/* ловушка для ботов: убираем из видимого потока, но оставляем в DOM */
.booking__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.booking__consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
  cursor: pointer;
}

.booking__consent input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--color-primary);
}

.booking__consent .booking__error {
  grid-column: 2;
}

.booking__consent a {
  color: var(--color-primary);
  text-decoration: underline;
}

.booking__submit {
  align-self: flex-start;
  min-width: 180px;
}

.booking__submit[disabled] {
  opacity: 0.6;
  cursor: default;
}

.booking__note {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(43, 43, 43, 0.4);
}

.booking__done {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.booking__done-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.booking__done-icon::before {
  content: '';
  width: 24px;
  height: 24px;
  background-color: var(--color-primary);
  -webkit-mask: url(../assets/icons/check.svg) no-repeat center / contain;
  mask: url(../assets/icons/check.svg) no-repeat center / contain;
}

.booking__done-text {
  font-size: 16px;
  line-height: 1.6;
}

@media (max-width: 767.98px) {
  /* на телефоне картинка занимала бы весь экран — оставляем только форму */
  .booking__media {
    display: none;
  }

  .booking__body {
    padding: 32px 24px;
  }

  .booking__title {
    font-size: 22px;
  }

  .booking__submit {
    align-self: stretch;
  }
}

/* цена в первой секции страницы услуги */
.service-why__price {
  margin-top: 8px;
  font-size: 18px;
}

.service-why__price b {
  font-weight: 700;
  color: var(--color-primary);
}

/* ================================================================
   Внутренние страницы: текстовые блоки, списки карточек, статьи.
   В макете Figma их нет.
   ================================================================ */

.text-block {
  padding-block: 48px 0;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(43, 43, 43, 0.75);
}

.text-block__lead {
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text);
}

.text-block p {
  margin-bottom: 12px;
}

.text-block h2 {
  margin-top: 32px;
  margin-bottom: 12px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text);
}

.text-block ul {
  margin-bottom: 12px;
  padding-left: 20px;
  list-style: disc;
}

.text-block li {
  margin-bottom: 4px;
}

.text-block strong {
  color: var(--color-text);
}

.cards-list {
  padding-block: 48px 0;
}

.cards-list__empty {
  padding: 48px 24px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-card);
  color: var(--color-text-muted);
  text-align: center;
}

.service-card__date {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* прайс по разделам */
.prices__group + .prices__group {
  margin-top: 48px;
}

.prices__title a {
  transition: color 0.15s ease;
}

.prices__title a:hover {
  color: var(--color-primary);
}

.price-line__title a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* коллектив сеткой вместо карусели */
.team--grid {
  padding-block: 48px 0;
}

/* страница новости или акции */
.article {
  padding-block: 48px 0;
}

.article__inner {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.article__picture {
  flex: 0 0 480px;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.article__picture img {
  width: 100%;
  height: auto;
  display: block;
}

.article__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
  min-width: 0;
  font-size: 16px;
  line-height: 1.6;
}

.article__date {
  font-size: 14px;
  color: var(--color-text-muted);
}

.article__until {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background-color: var(--color-bg);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
}

.article__lead {
  font-size: 18px;
  font-weight: 600;
}

.article__text p + p {
  margin-top: 12px;
}

@media (max-width: 991.98px) {
  .article__inner {
    flex-direction: column;
  }

  .article__picture {
    flex-basis: auto;
    width: 100%;
  }
}

/* контакты в три колонки */
.contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.contacts__col {
  flex: 1 1 260px;
}

.contacts__title {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.contacts__phone {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-primary);
}

.text-block a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ================================================================
   FAQ — общий блок вопросов на страницах услуг. В макете его нет.
   ================================================================ */

.faq {
  padding-block: 48px 0;
}

.faq__head {
  margin-bottom: 32px;
}

.faq__lead {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.faq__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq__item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card-sm);
  background-color: #fff;
  transition: border-color 0.15s ease;
}

.faq__item--open {
  border-color: color-mix(in srgb, var(--color-primary) 35%, transparent);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 20px 24px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
}

.faq__marker {
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.faq__marker::before,
.faq__marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background-color: var(--color-primary);
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease;
}

.faq__marker::before {
  width: 14px;
  height: 2px;
}

.faq__marker::after {
  width: 2px;
  height: 14px;
}

/* у раскрытого вопроса плюс превращается в минус */
.faq__item--open .faq__marker::after {
  opacity: 0;
}

.faq__answer {
  padding: 0 24px 20px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(43, 43, 43, 0.75);
}

.faq__answer p + p {
  margin-top: 12px;
}

/* карта на странице контактов */
.map {
  padding-block: 48px 0;
}

.map__frame {
  width: 100%;
  height: 420px;
  border: none;
  border-radius: var(--radius-card);
}

.footer__email {
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.15s ease;
}

.footer__email:hover {
  color: #fff;
}

.contacts__legal {
  margin-top: 12px;
  font-size: 14px;
  color: var(--color-text-muted);
}

@media (max-width: 767.98px) {
  .faq__question {
    padding: 16px 20px;
    font-size: 16px;
  }

  .faq__answer {
    padding: 0 20px 16px;
  }

  .map__frame {
    height: 320px;
  }
}

/* ================================================================
   Страница врача. В макете Figma её нет.
   ================================================================ */

.doctor {
  padding-block: 48px 64px;
}

.doctor__inner {
  display: flex;
  align-items: flex-start;
  gap: 48px;
}

.doctor__photo {
  flex: 0 0 380px;
  border-radius: var(--radius-card);
  overflow: hidden;
  background-color: var(--color-surface);
}

.doctor__photo img {
  width: 100%;
  height: auto;
  display: block;
}

.doctor__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
  min-width: 0;
  font-size: 16px;
  line-height: 1.6;
}

.doctor__role {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
}

.doctor__exp {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background-color: var(--color-bg);
  font-size: 14px;
  font-weight: 600;
}

.doctor__lead {
  font-size: 18px;
  font-weight: 600;
}

.doctor__text p + p {
  margin-top: 12px;
}

.doctor__block {
  width: 100%;
}

.doctor__block-title {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 700;
}

.doctor__education {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: rgba(43, 43, 43, 0.75);
}

.doctor__education li {
  position: relative;
  padding-left: 20px;
}

.doctor__education li::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-primary);
}

/* карточка врача целиком кликабельна */
.doctor-card__link {
  display: block;
  height: 100%;
}

.doctor-card {
  transition: transform 0.15s ease;
}

.doctor-card:hover {
  transform: translateY(-4px);
}

.doctor-card:hover .doctor-card__name {
  color: var(--color-primary);
}

@media (max-width: 991.98px) {
  .doctor__inner {
    flex-direction: column;
    gap: 24px;
  }

  .doctor__photo {
    flex-basis: auto;
    width: 100%;
    max-width: 380px;
  }
}

/* ================================================================
   Уведомление о cookie и юридические документы.
   ================================================================ */

.cookie-notice {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  padding-block: 20px;
  background-color: #fff;
  box-shadow: 0 -8px 32px rgba(43, 43, 43, 0.14);
}

.cookie-notice[hidden] {
  display: none;
}

.cookie-notice__inner {
  display: flex;
  align-items: center;
  gap: 32px;
}

.cookie-notice__text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.cookie-notice__title {
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.cookie-notice__text a {
  color: var(--color-primary);
  text-decoration: underline;
}

.cookie-notice__accept {
  flex-shrink: 0;
  min-width: 140px;
}

/* страницы юридических документов */
.doc {
  padding-block: 48px 0;
}

/* первый заголовок документа не добавляет свой верхний отступ к отступу секции */
.doc__body > h2:first-child {
  margin-top: 0;
}

.doc__body {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(43, 43, 43, 0.85);
}

.doc__body h2 {
  margin-top: 32px;
  margin-bottom: 12px;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
}

.doc__body h3 {
  margin-top: 24px;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.doc__body p {
  margin-bottom: 12px;
}

.doc__body ul,
.doc__body ol {
  margin-bottom: 12px;
  padding-left: 24px;
  list-style: disc;
}

.doc__body ol {
  list-style: decimal;
}

.doc__body li {
  margin-bottom: 6px;
}

.doc__body a {
  color: var(--color-primary);
  text-decoration: underline;
  word-break: break-word;
}

.doc__body table {
  width: 100%;
  margin-bottom: 16px;
  border-collapse: collapse;
}

.doc__body td,
.doc__body th {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  vertical-align: top;
}

@media (max-width: 767.98px) {
  .cookie-notice__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .cookie-notice {
    padding-block: 16px;
  }
}

/* пока соседний сайт не запущен, пункт остаётся на месте, но не кликается */
.header__section-link--empty {
  cursor: default;
}

/* ================================================================
   Паттерн на серых плоскостях.
   Идёт последним блоком, чтобы дополнять уже описанные фоны,
   а не переписывать их в каждой секции.
   ================================================================ */

/* сплошные тонированные плоскости */
.service-block__bg,
.section-intro__aside,
.service-card,
.step-card,
.reason-card,
.faq__item,
.doctor__exp,
.article__until,
.booking__media,
.site-menu {
  background-image: var(--pattern);
  background-repeat: repeat;
  background-size: var(--pattern-size) auto;
}

/* здесь фон — градиент, поэтому паттерн кладём вторым слоем поверх него */
.about {
  background-image: var(--pattern), linear-gradient(90deg, #fff 0%, var(--color-bg) 100%);
  background-repeat: repeat, no-repeat;
  background-size: var(--pattern-size) auto, cover;
}

.care {
  background-image: var(--pattern), linear-gradient(90deg, rgba(235, 238, 245, 0.5) 0%, rgba(233, 236, 243, 0.25) 100%);
  background-repeat: repeat, no-repeat;
  background-size: var(--pattern-size) auto, cover;
}

/* ================================================================
   Прайс-лист: разделы-аккордеоны и поиск.
   ================================================================ */

.prices--catalogue {
  padding-block: 48px 0;
}

.prices__search {
  margin-bottom: 24px;
}

.prices__groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* на странице прайса разделы стоят вплотную: отступ задаёт gap списка,
   отбивка в 48px нужна только озаглавленным группам на детальной услуге */
.prices--catalogue .prices__group + .prices__group {
  margin-top: 0;
}

.prices__group[hidden] {
  display: none;
}

/* у кнопки свой display, поэтому атрибут hidden сам по себе её не скрывает */
.prices__toggle[hidden] {
  display: none;
}

.prices__toggle {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card-sm);
  background-color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  transition: border-color 0.15s ease;
}

.prices__toggle:hover {
  border-color: color-mix(in srgb, var(--color-primary) 40%, transparent);
}

.prices__group--open .prices__toggle {
  border-color: color-mix(in srgb, var(--color-primary) 40%, transparent);
  border-radius: var(--radius-card-sm) var(--radius-card-sm) 0 0;
}

.prices__toggle-name {
  flex: 1;
  min-width: 0;
}

.prices__toggle-count {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.prices__toggle-marker {
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.prices__toggle-marker::before,
.prices__toggle-marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background-color: var(--color-primary);
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease;
}

.prices__toggle-marker::before {
  width: 14px;
  height: 2px;
}

.prices__toggle-marker::after {
  width: 2px;
  height: 14px;
}

/* у раскрытого раздела плюс превращается в минус */
.prices__group--open .prices__toggle-marker::after {
  opacity: 0;
}

.prices__group .prices__list {
  gap: 0;
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-card-sm) var(--radius-card-sm);
}

.prices__group .price-line {
  border: none;
  border-radius: 0;
}

.prices__group .price-line + .price-line {
  border-top: 1px solid var(--color-border);
}

.prices__group .price-line[hidden] {
  display: none;
}

/* во время поиска разделов не видно: каждая услуга становится отдельной
   карточкой, как в блоке цен на детальной странице услуги */
.prices--searching .prices__groups {
  gap: 8px;
}

.prices--searching .prices__group .prices__list {
  gap: 8px;
  border: none;
  border-radius: 0;
}

.prices--searching .prices__group .price-line,
.prices--searching .prices__group .price-line + .price-line {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card-sm);
}

.prices__total {
  margin-top: 24px;
  font-size: 14px;
  color: var(--color-text-muted);
}

@media (max-width: 767.98px) {
  .prices__toggle {
    padding: 16px 20px;
    font-size: 16px;
  }
}

/* ================================================================
   Документы клиники: раскрывающиеся группы со сканами и файлами.
   ================================================================ */

.documents {
  padding-block: 48px 0;
}

.documents__title {
  margin-bottom: 24px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.4;
}

.documents__groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.documents__toggle {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card-sm);
  background-color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  transition: border-color 0.15s ease;
}

.documents__toggle:hover {
  border-color: color-mix(in srgb, var(--color-primary) 40%, transparent);
}

.documents__group--open .documents__toggle {
  border-color: color-mix(in srgb, var(--color-primary) 40%, transparent);
  border-radius: var(--radius-card-sm) var(--radius-card-sm) 0 0;
}

.documents__toggle-name {
  flex: 1;
  min-width: 0;
}

.documents__toggle-count {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.documents__toggle-marker {
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.documents__toggle-marker::before,
.documents__toggle-marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background-color: var(--color-primary);
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease;
}

.documents__toggle-marker::before {
  width: 14px;
  height: 2px;
}

.documents__toggle-marker::after {
  width: 2px;
  height: 14px;
}

.documents__group--open .documents__toggle-marker::after {
  opacity: 0;
}

.documents__body {
  padding: 24px;
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-card-sm) var(--radius-card-sm);
}

.documents__tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.documents__tile {
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card-sm);
  background-color: #fff;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

.documents__tile:hover {
  border-color: color-mix(in srgb, var(--color-primary) 40%, transparent);
  opacity: 0.9;
}

.documents__tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.documents__files {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 16px;
  line-height: 1.5;
}

.documents__files li {
  position: relative;
  padding-left: 28px;
}

/* иконка документа перед названием файла */
.documents__files li::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 0;
  width: 16px;
  height: 18px;
  background-color: var(--color-primary);
  -webkit-mask: url(../assets/icons/icon-note.svg) no-repeat center / contain;
  mask: url(../assets/icons/icon-note.svg) no-repeat center / contain;
}

.documents__files a {
  color: var(--color-text);
  transition: color 0.15s ease;
}

.documents__files a:hover {
  color: var(--color-primary);
}

/* когда есть и сканы, и файлы, отбиваем список от плиток */
.documents__tiles + .documents__files {
  margin-top: 24px;
}

@media (max-width: 767.98px) {
  .documents__title {
    font-size: 24px;
  }

  .documents__toggle {
    padding: 16px 20px;
    font-size: 16px;
  }

  .documents__body {
    padding: 16px;
  }
}

/* ================================================================
   Страница «О стоматологии»: текст с фотографиями и карточками.
   В макете Figma этой страницы нет.
   ================================================================ */

.about-page {
  padding-block: 48px 0;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(43, 43, 43, 0.75);
}

.about-page h2 {
  margin-bottom: 12px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
}

.about-page p {
  margin-bottom: 12px;
}

.about-page__lead {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text);
}

.about-page__intro {
  display: flex;
  align-items: center;
  gap: 48px;
}

.about-page__intro-text {
  flex: 1 1 0;
  min-width: 0;
}

.about-page__intro-media {
  flex: 1 1 0;
  min-width: 0;
}

.about-page__intro-media img,
.about-page__split-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-card);
}

/* два коротких факта под лидом — цифра и подпись */
.about-page__facts {
  display: flex;
  gap: 32px;
  margin-top: 24px;
}

.about-page__facts li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 0;
  padding-left: 16px;
  border-left: 3px solid var(--color-primary);
}

.about-page__fact-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

.about-page__fact-label {
  font-size: 14px;
  line-height: 1.4;
}

.about-page__mission {
  display: flex;
  gap: 24px;
  margin-top: 48px;
  padding: 32px;
  border-radius: var(--radius-card);
  background-color: var(--color-surface);
  background-image: var(--pattern);
  background-repeat: repeat;
  background-size: var(--pattern-size) auto;
}

/* иконки набора уже нарисованы в круге, дополнительной подложки не нужно */
.about-page__mission-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
}

.about-page__mission-text {
  min-width: 0;
}

.about-page__accent {
  margin-bottom: 0;
  font-weight: 700;
  color: var(--color-text);
}

/* список с галочками вместо маркеров */
.about-page__checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.about-page__checklist li {
  position: relative;
  padding-left: 28px;
}

/* галочка нарисована рамкой: отдельной иконки-галочки в наборе нет */
.about-page__checklist li::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 2px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
  transform: rotate(-45deg);
}

.about-page__split {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-top: 48px;
}

.about-page__split--reverse {
  flex-direction: row-reverse;
}

.about-page__split-media,
.about-page__split-text {
  flex: 1 1 0;
  min-width: 0;
}

.about-page__split-text p:last-child {
  margin-bottom: 0;
}

.about-page__section-title {
  margin-top: 48px;
  text-align: center;
}

.about-page__reasons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.about-reason {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background-color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.about-reason:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(43, 43, 43, 0.1);
}

.about-reason img {
  width: 56px;
  height: 56px;
}

.about-reason h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
}

.about-reason p {
  margin-bottom: 0;
  font-size: 15px;
}

.about-page__note {
  margin-top: 24px;
  text-align: center;
}

.about-page__quote {
  position: relative;
  margin-top: 48px;
  margin-bottom: 0;
  /* слева оставлено место под кавычку, иначе она наезжает на текст */
  padding: 40px 40px 40px 104px;
  border-radius: var(--radius-card);
  background-color: var(--color-surface);
  background-image: var(--pattern);
  background-repeat: repeat;
  background-size: var(--pattern-size) auto;
}

/* крупная кавычка в углу цитаты */
.about-page__quote::before {
  content: '«';
  position: absolute;
  top: 24px;
  left: 32px;
  font-size: 80px;
  line-height: 1;
  color: color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.about-page__quote p {
  position: relative;
  font-size: 18px;
  line-height: 1.5;
}

.about-page__quote-author {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 24px;
}

.about-page__quote-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.about-page__quote-role {
  font-size: 14px;
}

@media (max-width: 991.98px) {
  .about-page__intro,
  .about-page__split {
    flex-direction: column;
    gap: 24px;
  }

  .about-page__split--reverse {
    flex-direction: column;
  }

  .about-page__reasons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .about-page h2 {
    font-size: 22px;
  }

  .about-page__facts {
    flex-direction: column;
    gap: 16px;
  }

  .about-page__mission,
  .about-page__quote {
    padding: 24px;
  }

  /* на узком экране места под кавычку нет */
  .about-page__quote::before {
    display: none;
  }

  .about-page__mission {
    flex-direction: column;
  }
}

/* ================================================================
   ДМС: карусель страховых компаний и шаги обращения.
   В макете Figma этой страницы нет.
   ================================================================ */

.insurers {
  padding-block: 48px 0;
}

.insurers__title {
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
}

/* карусель обрезает содержимое, из-за чего у приподнятой карточки срезались
   тень и рамка: обрезаем только по бокам, сверху и снизу оставляем запас */
.insurers__slider {
  overflow: visible;
  /* по бокам запас меньше промежутка между слайдами, поэтому соседняя
     карточка в него не попадает — только её тень */
  clip-path: inset(-40px -24px);
}

/* карточки выравниваются по самой высокой без процентной высоты: в quirks
   mode (плашка пробной лицензии до <!DOCTYPE>) height: 100% разрешался
   не от слайда, а от экрана, и логотипы растягивались во весь первый экран */
.insurers__slider .swiper-slide {
  display: flex;
  height: auto;
}

.insurer-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background-color: #fff;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.insurer-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--color-primary) 40%, transparent);
  box-shadow: 0 12px 32px rgba(43, 43, 43, 0.1);
}

/* логотипы разной пропорции: выравниваем по общей высоте площадки */
.insurer-card img {
  width: 100%;
  height: 64px;
  object-fit: contain;
}

.insurer-card__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.dms-steps {
  padding-block: 48px 0;
}

.dms-steps__title {
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
}

.dms-steps__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.dms-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px 24px;
  border-radius: var(--radius-card);
  background-color: var(--color-surface);
  background-image: var(--pattern);
  background-repeat: repeat;
  background-size: var(--pattern-size) auto;
}

.dms-step__number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.dms-step__text {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(43, 43, 43, 0.75);
}

@media (max-width: 767.98px) {
  .dms-steps__list {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   Вертикальный ритм внутренних страниц. Отступ между секциями задаёт
   верхний padding, нижний нужен только последней секции — иначе
   соседние отступы складываются и разрыв выходит вдвое больше.
   ================================================================ */

.page-content > :last-child {
  padding-bottom: 64px;
}

/* последний абзац или список внутри секции не должен добавлять свой
   нижний margin к отступу между секциями */
.text-block > :last-child,
.about-page > .container > :last-child,
.dms-steps__list,
.prices__total {
  margin-bottom: 0;
}

/* ================================================================
   Мобильный ритм. На узком экране отступы макета (48–64px между
   секциями) читаются как пустые экраны, поэтому уменьшаем их разом.
   ================================================================ */

@media (max-width: 767.98px) {
  .banner,
  .services,
  .about,
  .reviews,
  .steps,
  .care,
  .sales,
  .service-why,
  .section-intro,
  .section-services,
  .faq,
  .map,
  .catalogue,
  .cards-list,
  .article,
  .doc,
  .text-block,
  .about-page,
  .documents,
  .insurers,
  .dms-steps,
  .prices,
  .service-what,
  .team--grid,
  .team {
    padding-top: 32px;
  }

  /* нижний отступ оставляем только секциям с фоном — у остальных
     расстояние задаёт верхний отступ следующей секции */
  .about,
  .care,
  .sales {
    padding-bottom: 32px;
  }

  .reviews,
  .steps,
  .prices,
  .service-what,
  .faq {
    padding-bottom: 0;
  }

  /* под фотографией услуги оставляем небольшой просвет */
  .service-why {
    padding-bottom: 16px;
  }

  .page-content > :last-child {
    padding-bottom: 40px;
  }

  /* внутренние отбивки секций тоже сжимаем */
  .about-page__mission,
  .about-page__split,
  .about-page__section-title,
  .about-page__quote {
    margin-top: 32px;
  }

  .prices__group + .prices__group {
    margin-top: 24px;
  }

  .steps__row + .steps__row {
    margin-top: 16px;
  }
}

/* ================================================================
   Колонки на узких экранах. Когда flex-контейнер разворачивается
   в столбец, его flex-basis начинает работать как высота: колонка
   в 584px превращалась в 584px пустоты под контентом. Сбрасываем
   basis везде, где раскладка меняет направление.
   ================================================================ */

@media (max-width: 991.98px) {
  .services__body > *,
  .sales > *,
  .about__inner > *,
  .service-why__inner > *,
  .service-what__card > *,
  .care__inner > *,
  .catalogue__inner > *,
  .section-intro__inner > *,
  .article__inner > * {
    flex-basis: auto;
  }
}

@media (max-width: 767.98px) {
  .team__head > *,
  .how__head > *,
  .prices__head > *,
  .section-services__head > * {
    flex-basis: auto;
  }
}

@media (max-width: 575.98px) {
  .footer__top > * {
    flex-basis: auto;
  }
}

/* ================================================================
   Секции с цветной подложкой. Их собственный padding лежит уже внутри
   фона, поэтому внешний просвет задаём отдельно — иначе подложка
   упирается в предыдущий блок.
   ================================================================ */

.about,
.care {
  margin-top: 48px;
}

/* на главной перед блоком «О клинике» идёт секция с собственным нижним
   отступом — второй просвет там лишний */
.sales + .about {
  margin-top: 0;
}

@media (max-width: 767.98px) {
  .about,
  .care {
    margin-top: 32px;
  }
}

/* Плашка Битрикса об истёкшей пробной версии
   ------------------------------------------
   Ядро печатает её в самое начало вывода, до <!DOCTYPE>, поэтому парсер
   кладёт <font class="tablebodytext"> первым элементом в <body>. Прячем,
   чтобы она не ломала первый экран на локальной машине. Само состояние
   лицензии это не меняет — уйдёт после ввода боевого ключа. */
body > font.tablebodytext:first-child {
  display: none;
}

/* Высота каруселей
   ----------------
   Swiper задаёт .swiper-wrapper { height: 100% }. Пока сайт на пробной
   лицензии, ядро печатает плашку до <!DOCTYPE>, браузер уходит в quirks
   mode, и там процент от родителя с height: auto разрешается не в auto,
   а от вьюпорта — слайдер раздувался до высоты экрана, а вместе с ним
   и карточки внутри (так логотипы ДМС вырастали во весь экран). Явный auto
   даёт тот же результат, что и standards mode, и режима не касается.
   Правило общее для всех каруселей: у всех слайды с height: auto. */
.swiper .swiper-wrapper {
  height: auto;
}

/* ================================================================
   CTA — короткий блок записи, который ставится между секциями.
   Подложка берётся от темы на просвет, поэтому блок одинаково читается
   и на белом фоне, и на цветном. Отступ по общей схеме: сверху 48/32,
   снизу ноль, если блок не последний на странице.
   ================================================================ */

.cta {
  padding-block: 48px 0;
}

.cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 32px 40px;
  border-radius: var(--radius-card);
  background-color: color-mix(in srgb, var(--color-primary) 8%, #fff);
}

.cta__title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.cta__text {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.cta__button {
  flex-shrink: 0;
}

@media (max-width: 767.98px) {
  .cta {
    padding-block: 32px 0;
  }

  .cta__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
  }

  .cta__title {
    font-size: 20px;
  }

  .cta__button {
    width: 100%;
  }
}

/* Секции, которые несут собственный нижний отступ (акции — 64, отзывы — 64),
   уже дают просвет перед следующим блоком. Верхний отступ CTA поверх них
   удваивал бы разрыв — снимаем, как это уже сделано для `.sales + .about`. */
.sales + .cta,
.reviews + .cta {
  padding-top: 0;
}

/* В разделе с несколькими услугами строка прайса подписывается услугой,
   к которой относится — иначе «Консультация» из разных услуг неразличимы. */
.price-line__service {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-muted);
}

/* Акция на странице услуги
   -----------------------
   Карточка та же, что в блоке акций на главной (`.sale`), но стоит одна
   и тянется на всю ширину контейнера — флексовая база `.sale` здесь
   не работает, родитель не флекс. Отступ по общей схеме: сверху, снизу нет. */

.service-promo {
  padding-block: 48px 0;
}

.service-promo .sale {
  min-height: 240px;
}

.sale__until {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 767.98px) {
  .service-promo {
    padding-block: 32px 0;
  }
}

/* Затемнение под текстом карточки акции. Фотография приходит из админки,
   и какая она — заранее неизвестно, поэтому контраст обеспечиваем сами:
   слева, где лежит текст, плотнее, справа фото остаётся видно. */
.sale__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(17, 17, 17, 0.75) 0%,
    rgba(17, 17, 17, 0.55) 45%,
    rgba(17, 17, 17, 0.15) 100%
  );
}

/* На одиночной карточке страницы услуги текст занимает всю ширину:
   колонка в 429px рассчитана на карточку рядом с блоком расчёта. */
.service-promo .sale__content {
  max-width: none;
}

@media (max-width: 767.98px) {
  /* карточка узкая, текст идёт во всю ширину — градиент слева направо
     на нём не работает, затемняем равномерно */
  .sale__media::after {
    background: rgba(17, 17, 17, 0.6);
  }
}
