/* ─────────────────────────────────────────────────────────────
   База: сброс + типографика
   ───────────────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 27px;
  font-weight: 400;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }
img, svg, video { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* Контейнер повторяет сетку текущего сайта: 90% ширины, по центру */
.container {
  width: var(--container);
  margin-inline: auto;
}

/* Доступность: видимый фокус только с клавиатуры */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.visually-hidden:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  width: auto;
  height: auto;
  padding: 10px 16px;
  clip: auto;
  clip-path: none;
  color: var(--white);
  background: var(--ink);
  border-radius: var(--radius-btn);
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────
   Окно об оферте — показывается один раз при первом заходе.
   Лежит в base.css, потому что разметка есть на каждой странице.
   ───────────────────────────────────────────────────────────── */
.offer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.offer[hidden] { display: none; }
.offer.is-open { opacity: 1; }

.offer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 20, 28, 0.62);
}

.offer__dialog {
  position: relative;
  width: min(460px, 100%);
  padding: 40px 40px 42px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(var(--ink-rgb), 0.24);
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.34s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.offer.is-open .offer__dialog { transform: none; }

/* Бирюзовое пятно в углу — тот же приём, что на текущем сайте */
.offer__shape {
  position: absolute;
  top: -70px;
  right: -70px;
  width: 190px;
  height: 190px;
  background: rgba(var(--brand-rgb), 0.12);
  border-radius: 50%;
}

.offer__eyebrow {
  position: relative;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--brand);
}
.offer__title {
  position: relative;
  margin-top: 10px;
  font-family: var(--font-body);
  font-size: 30px;
  line-height: 38px;
  font-weight: 700;
  color: var(--ink);
}
.offer__text {
  position: relative;
  margin-top: 12px;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 25px;
  font-weight: 400;
  color: var(--muted);
}
.offer__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding: 14px 26px;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 24px;
  font-weight: 600;
  color: var(--white);
  background: var(--brand);
  border-radius: var(--radius-pill);
  transition: background 0.25s;
}
.offer__link svg { width: 15px; height: 15px; flex: none; }
.offer__link:hover { background: var(--brand-deep); }

.offer__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}
.offer__close svg { width: 12px; height: 12px; }
.offer__close:hover { color: var(--ink); background: var(--line); }

@media (max-width: 767px) {
  .offer__dialog { padding: 32px 24px 34px; }
  .offer__title { font-size: 25px; line-height: 33px; }
  .offer__link { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .offer, .offer__dialog { transition: none; }
}

/* ─────────────────────────────────────────────────────────────
   Онлайн запись: фрейм MedElement во весь экран.
   Разметка есть на каждой странице, поэтому стили здесь.
   ───────────────────────────────────────────────────────────── */
.appt {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.appt[hidden] { display: none; }
.appt.is-open { opacity: 1; }

.appt__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 20, 28, 0.72);
}
.appt__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  height: min(760px, calc(100vh - 48px));
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(var(--ink-rgb), 0.28);
  transform: translateY(16px) scale(0.99);
  transition: transform 0.34s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.appt.is-open .appt__panel { transform: none; }

.appt__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.appt__label {
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--brand);
}
.appt__title {
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 30px;
  font-weight: 700;
  color: var(--ink);
}
.appt__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  color: var(--muted);
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}
.appt__close svg { width: 13px; height: 13px; }
.appt__close:hover { color: var(--ink); background: var(--line); }

.appt__frame {
  flex: 1;
  width: 100%;
  border: 0;
}
.appt__fallback {
  padding: 12px 24px 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.appt__fallback a { color: var(--brand); text-decoration: underline; }

@media (max-width: 767px) {
  .appt { padding: 0; }
  .appt__panel {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }
  .appt__head { padding: 16px 18px; }
  .appt__title { font-size: 19px; line-height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .appt, .appt__panel { transition: none; }
}


/* ─────────────────────────────────────────────────────────────
   Телефон: зоны нажатия. Пальцем в строку текста высотой 19px
   попасть трудно, поэтому ссылки-списки и «подробнее» получают
   вертикальный отступ — визуально почти не меняется, а промахов нет.
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .fcol__list a,
  .footer__socials a,
  .doc__toc a {
    display: flex;
    align-items: center;
    min-height: 40px;
  }
  .fcol__list li + li { margin-top: 0; }

  .acrumbs a,
  .hero__phone,
  .ccall__phone,
  .nmore,
  .dmore,
  .services__link,
  .promo__link,
  .news__more,
  .svc-card__more {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .appt__label { font-size: 13px; }

  .contact__value a,
  .footer a.btn-liquid { padding: 8px 0; }
}

/* Карточка врача и новости кликается целиком: заголовок-ссылка
   растягивает невидимую накладку на всю карточку. */
.dcard,
.ncard { position: relative; }
.dcard__name a::after,
.ncard__title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Карточка врача и новости нажимается целиком: заголовок-ссылка
   растягивает невидимую накладку на всю карточку. */
.dcard,
.ncard { position: relative; }
.dcard__name a::after,
.ncard__title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
