/* =========================================================
   Тубер — стили сайта (главная + внутренние страницы)
   Mobile first: base styles = макет 440px, @media (min-width: 1024px) = макет 1920px
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --c-primary: #28509c;
  --c-primary-hover: #1f4080;
  --c-accent: #ac000a;
  --c-accent-hover: #8a0008;
  --c-sky: #d0e3f1;
  --c-pale: #eff6fa;
  --c-border: #9bc4e2;
  --c-topbar: #e6e6e6;
  --c-icon-bg: #d9d9d9;
  --c-muted: #b3b3b3;
  --c-placeholder: #666;
  --c-text: #000;
  --c-white: #fff;

  --radius: 10px;

  --font-base: "Roboto", Arial, sans-serif;
  --font-condensed: "Roboto Condensed", "Roboto", Arial, sans-serif;
  --font-contact: "Droid Sans", "Noto Sans", Arial, sans-serif; /* Google's Droid Sans is Latin-only; Figma also falls back to Noto for Cyrillic */

  --gutter: 15px;
  --section-gap: 35px;
}

@media (min-width: 1024px) {
  :root {
    --gutter: 20px;
    --section-gap: 80px;
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.172; /* = Figma "auto" line height for Roboto / Droid Sans, without browser rounding */
  color: var(--c-text);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, address {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

address {
  font-style: normal;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: calc(1200px + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Components ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 12px;
  border-radius: var(--radius);
  font-size: 18px;
  text-align: center;
  color: var(--c-white);
  transition: background-color 0.2s;
}

.btn--primary {
  background: var(--c-primary);
}

.btn--primary:hover {
  background: var(--c-primary-hover);
}

.btn--accent {
  background: var(--c-accent);
}

.btn--accent:hover {
  background: var(--c-accent-hover);
}

.icon-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--c-icon-bg);
}

.logo {
  display: block;
  flex-shrink: 0;
}

.logo img {
  object-fit: cover;
}

/* A logo from the media library comes with its own size: keep the layout width */
.footer__brand .logo img {
  width: 164px;
}

/* Contact: icon + text (phones, address, hours) */
.contact {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  font-family: var(--font-contact);
  font-size: 16px;
  line-height: 1.164; /* Droid Sans own line height */
  color: var(--c-primary);
}

.contact--phone {
  align-items: center;
  gap: 8px;
}

.contact--address {
  gap: 13.3px;
}

.contact__icon {
  flex-shrink: 0;
}

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

.contact__text--bold,
.contact__hours {
  font-weight: 700;
}

.contact__note {
  margin-top: 6px;
  font-size: 14px;
}

.contact a:hover {
  text-decoration: underline;
}

/* ---------- Header ---------- */
/* Sticky: stays at the top of the screen (also the anchor for the dropdown menu and the a11y panel).
   --header-top and --header-sticky are measured in main.js. */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
}

html {
  scroll-padding-top: calc(var(--header-sticky, 67px) + 10px); /* anchors are not hidden under the header */
}

.header__top {
  background: var(--c-topbar);
}

.header__top-inner {
  display: flex;
  align-items: center;
  min-height: 67px;
}

.header__contact--desktop,
.header__max,
.header__cta {
  display: none;
}

/* «Написать в MAX»: shown when the link is set in the site settings */
.max-btn {
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--c-primary);
  border-radius: 5px;
  font-family: var(--font-condensed);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--c-primary);
}

.max-btn:hover {
  background: var(--c-white);
}

.header__a11y--mobile {
  margin-left: auto;
}

.header__burger {
  display: flex;
  align-items: center;
  height: 40px;
  margin-left: 20px;
}

/* Second row (logo, menu, search) is desktop only; on mobile the burger opens the dropdown menu */
.header__main {
  display: none;
}

.header__main-inner {
  display: flex;
}

.nav__list {
  display: flex;
}

.nav__link {
  white-space: nowrap;
}

.nav__link,
.menu__link {
  font-size: 18px;
  color: var(--c-primary);
  transition: color 0.2s;
}

.nav__link:hover,
.menu__link:hover {
  color: var(--c-accent);
}

/* «Диагностика» in the desktop menu: a dropdown (overlay) opened on hover or click */
.nav__item--dropdown {
  position: relative; /* anchor for the dropdown */
}

.nav__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav__toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.nav__toggle[aria-expanded="true"]::after {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.nav__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: -18px;
  z-index: 20;
  padding-top: 12px; /* keeps hover alive between the item and the panel */
}

.nav__item--dropdown:hover .nav__dropdown,
.nav__toggle[aria-expanded="true"] + .nav__dropdown {
  display: block;
}

.nav__sub {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
  padding: 16px 18px;
  border: 1px solid var(--c-sky);
  border-radius: var(--radius);
  background: var(--c-pale);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.08);
}

.nav__sub-link {
  font-size: 18px;
  white-space: nowrap;
  color: var(--c-primary);
  transition: color 0.2s;
}

.nav__sub-link:hover {
  color: var(--c-accent);
}

/* Dropdown menu: a group with its own sub-items */
.menu__heading {
  font-size: 18px;
  color: var(--c-primary);
}

.menu__sub {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 2px 16px;
}

.menu__link--sub {
  font-size: 16px;
}

/* Square menu button: three lines that turn into a cross while the menu is open */
.menu-btn__lines,
.menu-btn__lines::before,
.menu-btn__lines::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: var(--c-primary);
  transition: transform 0.2s, background-color 0.2s;
}

.menu-btn__lines::before,
.menu-btn__lines::after {
  content: "";
  transform: translateY(-6px);
}

.menu-btn__lines::after {
  transform: translateY(4px);
}

.menu-btn[aria-expanded="true"] .menu-btn__lines {
  background: transparent;
}

.menu-btn[aria-expanded="true"] .menu-btn__lines::before {
  transform: translateY(0) rotate(45deg);
}

.menu-btn[aria-expanded="true"] .menu-btn__lines::after {
  transform: translateY(-2px) rotate(-45deg);
}

/* Dropdown menu: an overlay panel, it never pushes the page down */
.menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: var(--gutter);
  width: 312px;
  max-width: calc(100vw - var(--gutter) * 2);
  padding: 30px 26px 20px;
  border: 1px solid var(--c-sky);
  border-radius: var(--radius);
  background: var(--c-pale);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.08);
}

.header.is-menu-open .menu {
  display: block;
}

/* ---------- Version for the visually impaired: panel under the header ---------- */
.a11y {
  position: absolute;
  top: calc(100% + 10px);
  right: var(--gutter);
  z-index: 1;
  width: 340px;
  max-width: calc(100vw - var(--gutter) * 2);
  padding: 20px;
  border: 1px solid var(--c-sky);
  border-radius: var(--radius);
  background: var(--c-pale);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.08);
  color: var(--c-text);
}

.a11y__title {
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 600;
}

.a11y__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.a11y__group + .a11y__group {
  margin-top: 14px;
}

.a11y__label {
  flex-basis: 100%;
  font-size: 14px;
  color: var(--c-placeholder);
}

.a11y__btn {
  min-width: 44px;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--c-primary);
  border-radius: 8px;
  background: var(--c-white);
  font-size: 15px;
  color: var(--c-primary);
}

.a11y__btn--lg {
  font-size: 19px;
}

.a11y__btn--xl {
  font-size: 23px;
}

.a11y__btn[aria-pressed="true"] {
  background: var(--c-primary);
  color: var(--c-white);
}

.a11y__reset {
  margin-top: 16px;
  font-size: 15px;
  color: var(--c-primary);
  text-decoration: underline;
}

/* The modes themselves */
html[data-a11y-size="2"] body {
  zoom: 1.2;
}

html[data-a11y-size="3"] body {
  zoom: 1.4;
}

html[data-a11y-color="mono"] {
  filter: grayscale(1) contrast(1.2);
}

html[data-a11y-color="dark"],
html[data-a11y-color="dark"] img,
html[data-a11y-color="dark"] iframe {
  filter: invert(1) hue-rotate(180deg);
}

html[data-a11y-images="off"] img:not([src$=".svg"]) {
  visibility: hidden;
}

.menu__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search {
  display: flex;
  align-items: center;
  width: 215px;
  height: 40px;
  padding: 0 9px 0 15px;
  border: 1px solid var(--c-muted);
  border-radius: var(--radius);
}

.search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
}

.search__input::placeholder {
  color: var(--c-muted);
}

.search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search__btn {
  display: flex;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  /* Figma: contact groups are top-aligned at 20px, the button sits at 15px */
  .header__top-inner {
    align-items: flex-start;
    gap: 24px;
    padding-block: 15px 13px;
  }

  .header__contact {
    margin-top: 5px;
  }

  .header__contact--desktop {
    display: flex;
  }

  .header__max {
    display: inline-flex;
    margin-top: 3px;
  }

  .header__cta {
    display: inline-flex;
    width: 215px;
    height: 50px;
    margin-left: auto;
  }

  .header__a11y--mobile,
  .header__burger {
    display: none;
  }

  .header__main {
    display: block;
    background: var(--c-white);
  }

  /* Desktop: the grey contacts row scrolls away, the logo + menu row stays */
  .header {
    top: calc(-1 * var(--header-top, 78px));
  }

  .header__main-inner {
    align-items: center;
    padding: 12px var(--gutter);
  }

  .menu-btn {
    margin-right: 20px;
  }

  /* Larger logo at the client's request; a bit smaller on narrow desktops so the menu still fits */
  .header__logo img {
    width: clamp(138px, 13vw, 195px);
  }

  .header__main .header__a11y,
  .header__search {
    margin-left: 13px;
  }

  .header__nav {
    margin-left: auto;
  }

  /* Narrow desktops (1024–1239px): smaller menu text and search so the row fits */
  .nav__list {
    gap: 12px;
  }

  .nav__link {
    font-size: 15px;
  }

  .header__search {
    width: 150px;
  }

  /* The dropdown opens under the menu button, at the left edge of the content */
  .menu {
    top: 100%;
    right: auto;
    left: max(var(--gutter), calc((100% - 1200px) / 2));
  }

  /* …and the panel for the visually impaired at the right edge of the content */
  .a11y {
    top: 100%;
    right: max(var(--gutter), calc((100% - 1200px) / 2));
  }
}

@media (min-width: 1240px) {
  /* Group starts as in the layout (463 / 718 / 1006px); a longer text just widens its column */
  .header__top-inner {
    display: grid;
    grid-template-columns: minmax(235px, max-content) minmax(268px, max-content) 1fr auto;
    column-gap: 20px;
    padding-left: calc(var(--gutter) + 103px);
  }

  /* With «Написать в MAX» the button takes the left indent, at the content edge like the menu button below */
  .header__top-inner:has(.header__max) {
    grid-template-columns: auto minmax(235px, max-content) minmax(268px, max-content) 1fr auto;
    padding-left: var(--gutter);
  }

  .nav__list {
    gap: 16px;
  }

  .nav__link {
    font-size: 18px;
  }

  .header__search {
    width: 200px;
  }
}

/* ---------- Hero ---------- */
.hero {
  --swiper-pagination-color: var(--c-primary);
  --swiper-pagination-bullet-inactive-color: var(--c-primary);
  --swiper-pagination-bullet-inactive-opacity: 0.3;
  --swiper-pagination-bullet-size: 10px;
  --swiper-pagination-bullet-horizontal-gap: 5px;
  background: var(--c-sky);
}

/* All slides take the height of the tallest one, so the page does not jump while they change */
.hero__slide {
  display: flex;
  height: auto;
}

/* Mobile: the text goes above the picture, so it never covers the photo, whatever image is uploaded */
.hero__inner {
  display: flex;
  flex-direction: column;
}

.hero__content {
  padding-block: 24px 20px;
}

.hero__title {
  font-size: min(35px, 10.5vw); /* one long word: shrink a little on 320px screens instead of overflowing */
  font-weight: 700;
  color: var(--c-accent);
}

.hero__subtitle {
  margin-top: 4px;
  font-size: 20px;
}

.hero__text {
  margin-top: 17px;
  font-size: 14px;
  line-height: 21px;
}

.hero__btn {
  width: 183px;
  min-height: 45px;
  margin-top: 10px;
  font-size: 16px;
}

.hero__image {
  width: calc(100% + var(--gutter) * 2);
  max-width: none;
  margin: auto calc(var(--gutter) * -1) 0; /* pinned to the bottom when a neighbour slide has more text */
  aspect-ratio: 857 / 530;
  object-fit: cover;
}

.hero__pagination {
  display: flex;
  justify-content: center;
  padding-block: 12px;
}

@media (min-width: 1024px) {
  /* Text and image share one grid cell, so the text sits next to the picture without positioning */
  .hero__inner {
    display: grid;
    min-height: 531px;
  }

  .hero__content,
  .hero__image {
    grid-area: 1 / 1;
  }

  .hero__content {
    z-index: 1;
    align-self: start;
    padding-block: 97px 40px;
  }

  .hero__title {
    font-size: 55px;
  }

  .hero__subtitle {
    margin-top: 18px;
    font-size: 35px;
  }

  .hero__text {
    margin-top: 64px;
    margin-left: 5px; /* as in the layout */
    font-size: 18px;
    line-height: inherit;
  }

  .hero__btn {
    width: 269px;
    min-height: 50px;
    margin-top: 14px;
    font-size: 20px;
  }

  .hero__image {
    justify-self: end;
    align-self: start;
    width: 71.42%;
    max-width: 857px;
    margin: 0;
    /* The title runs over the left edge of the photo: fade that edge into the background so any photo stays readable */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 30%);
    mask-image: linear-gradient(to right, transparent, #000 30%);
  }
}

/* ---------- Section ---------- */
.section {
  margin-top: var(--section-gap);
}

.section__title {
  margin-bottom: 16px;
  font-size: 22px;
  font-weight: 600;
}

.services .section__title {
  margin-bottom: 8px;
}

.doctors .section__title {
  margin-bottom: 17px;
}

.rating .section__title {
  margin-bottom: 10px;
}

@media (min-width: 1024px) {
  .section__title,
  .services .section__title,
  .doctors .section__title {
    margin-bottom: 30px;
    font-size: 35px;
  }

  .rating .section__title {
    margin-bottom: 42px;
  }
}

/* ---------- Services: accordion on mobile, tabs on desktop ---------- */
.services__tabs {
  display: grid;
  gap: 8px;
}

.services__tab {
  width: 100%;
  min-height: 40px;
  padding-inline: 12px;
  border-radius: var(--radius);
  background: var(--c-primary);
  font-size: 16px;
  color: var(--c-white);
  transition: background-color 0.2s;
}

.services__tab:hover {
  background: var(--c-primary-hover);
}

.services__panel {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--c-pale);
}

.services__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 18px;
}

.services__list a:hover {
  color: var(--c-primary);
}

.services__subtitle {
  margin-block: 24px 10px;
  font-size: 18px;
  font-weight: 700;
}

@media (min-width: 1024px) {
  /* Tabs in one row, a third of the width each; the open panel sits under its own tab */
  .services__tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .services__tab {
    grid-row: 1;
    font-size: 18px;
  }

  .services__panel {
    grid-row: 2;
    padding: 30px 40px;
  }

  .services__panel:nth-of-type(2) {
    grid-column: 2;
  }

  .services__panel:nth-of-type(3) {
    grid-column: 3;
  }
}

/* ---------- Doctors (Swiper, slidesPerView: "auto" — widths come from CSS) ---------- */
.doctors__hint {
  position: absolute; /* decorative swipe hint over the slider, mobile only */
  top: 7px;
  right: 9px;
  z-index: 2;
  pointer-events: none;
}

.doctor-card {
  display: flex;
  flex-direction: column;
  width: 196px;
  height: auto;
}

.doctor-card__photo {
  width: 100%;
  height: auto;
  aspect-ratio: 196 / 262;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-pale);
  object-fit: cover;
}

.doctor-card__name {
  margin-top: 20px;
  font-size: 18px;
  font-weight: 700;
  color: var(--c-primary);
}

.doctor-card__name span {
  display: block;
}

.doctor-card__position {
  margin-top: 8.8px;
  font-size: 14px;
}

.doctor-card__facts {
  display: flex;
  flex-direction: column;
  gap: 8.6px;
  margin-top: 7.6px;
  font-size: 14px;
}

.doctor-card__price {
  margin-block: 11.6px 20.3px;
  font-size: 16px;
  color: var(--c-accent);
}

.doctor-card__btn {
  width: 100%;
  min-height: 40px;
  margin-top: auto;
  font-size: 16px;
}

/* A card without a price (e.g. a diagnostics doctor): keep the same gap above the button */
.doctor-card > :nth-last-child(2):not(.doctor-card__price) {
  margin-bottom: 20px;
}

/* Nothing to swipe (all cards fit): hide the swipe hint */
.doctors__slider.is-locked .doctors__hint {
  display: none;
}

@media (min-width: 1024px) {
  .doctors__hint {
    display: none;
  }

  .doctor-card {
    width: calc((100% - 4 * 21.25px) / 5);
  }

  .doctor-card__photo {
    aspect-ratio: 223 / 300;
  }

  .doctor-card__name {
    margin-top: 19px;
    font-size: 20px;
  }

  .doctor-card__position {
    margin-top: 4px;
    font-size: 18px;
  }

  .doctor-card__facts {
    gap: 4px;
    margin-top: 21px;
    font-size: 18px;
  }

  .doctor-card__price {
    margin-block: 17px 20px;
    font-size: 18px;
  }

  .doctor-card__btn {
    font-size: 18px;
  }
}

/* ---------- Appointment ---------- */
.appointment__box {
  margin-inline: calc(var(--gutter) * -1);
  padding: 30px var(--gutter) 22px;
  background: var(--c-sky) url("../img/pattern-bg.jpg") center / cover no-repeat;
}

.appointment__title {
  font-size: 22px;
  font-weight: 400;
  color: var(--c-accent);
}

.appointment__text {
  margin-top: 9.2px;
  font-size: 16px;
  color: var(--c-primary);
}

.appointment__text--wide {
  margin-top: 13.25px;
}

.appointment__form {
  margin-top: 20.5px;
  padding: 17.5px 11px 17.3px 9px;
  border-radius: var(--radius);
  background: var(--c-white);
}

@media (min-width: 1024px) {
  .appointment__box {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
    margin-inline: 0;
    padding: 33px 35px 33px 37px;
  }

  .appointment__intro {
    max-width: 430px;
    margin-top: 7px;
  }

  .appointment__title {
    font-size: 35px;
    font-weight: 600;
  }

  .appointment__text {
    margin-top: 10px;
    font-size: 18px;
  }

  .appointment__text--wide {
    max-width: 413px;
    margin-top: 8px;
  }

  .appointment__form {
    flex-shrink: 0;
    width: 451px;
    margin-top: 0;
    padding: 18px 24px 13px 18px;
  }
}

/* ---------- Form ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form__input {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-white);
  font-size: 12px;
}

.form__input::placeholder {
  color: var(--c-placeholder);
}

.form__input:focus {
  border-color: var(--c-primary);
  outline: 0;
}

.form__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--font-condensed);
  font-size: 12px;
  cursor: pointer;
}

.form__consent span {
  max-width: 371px;
}

.form__consent a:hover {
  text-decoration: underline;
}

.form__submit {
  align-self: flex-start;
  min-height: 40px;
  margin-top: 6px;
  padding-inline: 40px;
  font-size: 16px;
}

.form__checkbox {
  flex-shrink: 0;
  width: 11.68px;
  height: 11.68px;
  margin: 5px 0 0;
  background: url("../icons/checkbox.svg") center / 100% 100% no-repeat;
  cursor: pointer;
  appearance: none;
}

.form__checkbox:checked {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%2328509C' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    url("../icons/checkbox.svg");
}

@media (min-width: 1024px) {
  .form__input {
    padding: 0 11px;
  }

  .form__consent {
    gap: 5px;
    margin-left: -3px;
  }

  .form__consent span {
    max-width: 391px;
  }

  .form__checkbox {
    margin-top: 2px;
  }

  .form__submit {
    font-size: 18px;
  }
}

/* ---------- Documents (Swiper) ---------- */
.documents__layout {
  display: grid;
  gap: 28px;
}

.document-card {
  width: calc((100% - 18px) / 2);
  height: auto;
  aspect-ratio: 223 / 359;
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-pale);
}

.document-card__link {
  display: block;
  height: 100%;
}

.document-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.documents__nav {
  display: flex;
  gap: 27px;
  margin-top: 28px;
}

.documents__photo {
  width: 100%;
  aspect-ratio: 410 / 334;
  border-radius: var(--radius);
  object-fit: cover;
  object-position: 54% 50%;
}

.slider-arrow {
  display: flex;
  transition: opacity 0.2s;
}

.slider-arrow--prev img {
  transform: rotate(180deg);
}

.slider-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (min-width: 1024px) {
  .documents__layout {
    grid-template-columns: minmax(0, 1fr) 471px;
    align-items: start;
    gap: 20px;
  }

  .document-card {
    width: calc((100% - 40px) / 3);
  }

  .documents__nav {
    justify-content: flex-end;
    gap: 23px;
    margin-top: 10px;
  }

  .documents__photo {
    aspect-ratio: 471 / 384;
  }
}

/* ---------- Rating ---------- */
.rating__list {
  display: grid;
  grid-template-columns: minmax(0, 200fr) minmax(0, 197fr);
  gap: 8px 15px;
  margin-inline: calc(var(--gutter) * -1);
  padding: 24px var(--gutter) 15px;
  background: var(--c-sky);
}

.rating__item {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
}

.rating__item img {
  width: 100%;
  height: 106px;
  object-fit: cover;
}

@media (min-width: 1024px) {
  /* Column widths = card + following gap from the layout (265+73, 262+62, 263) */
  .rating__list {
    grid-template-columns: minmax(0, 338fr) minmax(0, 324fr) minmax(0, 263fr);
    gap: 20px 0;
    margin-inline: 0;
    padding: 29px 145px 36px 130px;
  }

  .rating__item img {
    width: auto;
    height: 140px;
  }
}

/* ---------- About: clinic name (the page H1) and a short text for search engines ---------- */
.about__text {
  font-size: 14px;
  line-height: 1.5;
}

.about__text p + p {
  margin-top: 10px;
}

@media (min-width: 1024px) {
  .about__text {
    max-width: 1200px;
    font-size: 18px;
  }

  .about__text p + p {
    margin-top: 14px;
  }
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 51px;
  padding-block: 20px 23px;
  background: var(--c-sky) url("../img/pattern-bg.jpg") center / cover no-repeat;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer__btn {
  display: none;
}

.footer__map {
  order: 1;
  width: 100%;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}

.footer__map img {
  width: 100%;
  height: 233px;
  object-fit: cover;
}

.footer__socials {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.footer__social {
  display: block;
  transition: opacity 0.2s;
}

.footer__social:hover {
  opacity: 0.8;
}

/* Warning required for medical services advertising */
.footer__bottom {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(40, 80, 156, 0.2);
}

.footer__disclaimer {
  font-size: 13px;
  text-align: center;
  color: var(--c-primary);
}

.footer__nav {
  order: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

.footer__menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 15px;
  font-size: 16px;
  color: var(--c-primary);
}

.footer__menu a:hover {
  color: var(--c-accent);
}

.footer__contacts {
  order: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 100%;
  margin-top: 17px;
}

.footer__contacts .contact--phone {
  margin-left: 13px;
}

.footer__contacts .contact--phone,
.footer__contacts .contact--address {
  font-size: 14px;
}

.footer__contacts .contact--phone .contact__icon {
  width: 30px;
  height: 30px;
}

.footer__contacts .contact--address .contact__icon {
  width: 25.15px;
  height: 32px;
}

.footer__contacts .contact--hours {
  flex-basis: 100%;
  justify-content: center;
  margin-top: 20px;
}

@media (min-width: 1024px) {
  .footer {
    margin-top: var(--section-gap);
    padding-block: 20px;
  }

  .footer__inner {
    display: grid;
    grid-template-columns: minmax(0, 263fr) minmax(0, 348fr) minmax(0, 252fr) minmax(0, 302fr);
    align-items: start;
    padding-right: calc(var(--gutter) + 35px);
  }

  .footer__brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 10px;
  }

  .footer__btn {
    display: inline-flex;
    width: 182px;
    min-height: 45px;
  }

  .footer__nav,
  .footer__contacts,
  .footer__map {
    order: 0;
    margin-top: 0;
  }

  .footer__nav {
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
    padding-top: 10px;
  }

  .footer__menu {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
    font-size: 18px;
  }

  .footer__menu:first-child {
    width: 142px;
  }

  .footer__contacts {
    flex-direction: column;
    flex-wrap: nowrap;
    padding-top: 13px;
  }

  .footer__contacts .contact--phone,
  .footer__contacts .contact--address {
    font-size: 16px;
  }

  .footer__contacts .contact--phone {
    margin-left: 0;
  }

  .footer__contacts .contact--phone .contact__icon {
    width: 35px;
    height: 35px;
  }

  .footer__contacts .contact--address .contact__icon {
    width: 26.7253px;
    height: 34px;
  }

  .footer__contacts .contact--address {
    margin-top: 13px;
  }

  .footer__contacts .contact--hours {
    flex-basis: auto;
    justify-content: flex-start;
    margin-top: 18px;
  }

  .footer__map img {
    height: 169px;
  }

  .footer__socials {
    margin-top: 2px;
  }

  .footer__disclaimer {
    font-size: 14px;
  }
}

/* =========================================================
   Внутренние страницы (УЗИ, Флюорография, Маммография, Контакты)
   ========================================================= */

/* ---------- Page hero: breadcrumbs, title, short list, button, photo ---------- */
.page-hero {
  background: var(--c-pale) url("../img/page-hero-bg.jpg") center / cover no-repeat;
}

.page-hero__inner {
  display: grid;
  gap: 20px;
  padding-block: 16px 30px;
}

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.breadcrumbs__item + .breadcrumbs__item::before {
  content: "/";
  margin-right: 8px;
}

.breadcrumbs a:hover {
  color: var(--c-primary);
}

.page-hero__title {
  font-size: 35px;
  font-weight: 700;
  color: var(--c-accent);
}

.page-hero__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  font-size: 16px;
}

.page-hero__list li::before {
  content: "– ";
}

.page-hero__btn {
  min-height: 45px;
  margin-top: 24px;
  padding-inline: 30px;
}

.page-hero__image {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  object-fit: cover;
}

@media (min-width: 1024px) {
  .page-hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 600px);
    grid-template-areas:
      "crumbs crumbs"
      "content image";
    column-gap: 40px;
    padding-block: 15px 30px;
  }

  .breadcrumbs {
    grid-area: crumbs;
    font-size: 16px;
  }

  .page-hero__content {
    grid-area: content;
    align-self: center;
    padding-left: 60px;
  }

  .page-hero__image {
    grid-area: image;
  }

  .page-hero__title {
    font-size: 55px;
  }

  .page-hero__list {
    gap: 10px;
    margin-top: 28px;
    font-size: 18px;
  }

  .page-hero__btn {
    min-height: 50px;
    margin-top: 40px;
    font-size: 20px;
  }
}

/* A page without a photo (Контакты): breadcrumbs and title only */
.page-hero--simple .page-hero__inner {
  grid-template-columns: none;
  grid-template-areas: none;
  gap: 16px;
  padding-block: 16px 30px;
}

.page-hero--simple .breadcrumbs,
.page-hero--simple .page-hero__content {
  grid-area: auto;
  padding-left: 0;
}

/* ---------- In-page navigation: Услуги | Врачи | Цены ---------- */
.page-nav {
  border-block: 1px solid var(--c-primary);
  background: var(--c-white);
}

.page-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 44px;
  padding-block: 6px;
}

.page-nav__list li + li::before {
  content: "|";
  margin-inline: 16px;
  font-weight: 700;
  color: var(--c-primary);
}

.page-nav__link {
  font-family: var(--font-condensed);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--c-primary);
  transition: color 0.2s;
}

.page-nav__link:hover {
  color: var(--c-accent);
}

@media (min-width: 1024px) {
  .page-nav__list {
    padding-left: 60px;
  }

  .page-nav__list li + li::before {
    margin-inline: 30px;
  }

  .page-nav__link {
    font-size: 20px;
  }
}

/* ---------- Service search + list of service types ---------- */
.service-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding-inline: 16px 8px;
  border: 1px solid var(--c-muted);
  border-radius: var(--radius);
  background: var(--c-white);
}

.service-search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
}

.service-search__input::placeholder {
  color: var(--c-placeholder);
}

.service-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.service-search__clear {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--c-placeholder);
}

.service-search__clear:hover {
  color: var(--c-accent);
}

.service-search:focus-within {
  border-color: var(--c-primary);
}

.service-types {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.service-types__btn {
  font-family: var(--font-condensed);
  font-size: 20px;
  text-align: left;
  color: var(--c-primary);
  transition: color 0.2s;
}

.service-types__btn:hover,
.service-types__btn[aria-pressed="true"] {
  color: var(--c-accent);
}

.service-types__btn[aria-pressed="true"] {
  text-decoration: underline;
}

@media (min-width: 1024px) {
  .service-types {
    gap: 16px;
    margin-top: 28px;
    padding-left: 20px;
  }

  .service-types__btn {
    font-size: 24px;
  }
}

/* ---------- Prices: a tab per doctor or cabinet, a table in each ---------- */
.price-tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.price-tabs__tab {
  min-height: 44px;
  padding-inline: 18px;
  border: 1px solid var(--c-primary);
  border-radius: var(--radius);
  font-family: var(--font-condensed);
  font-size: 16px;
  color: var(--c-primary);
  transition: background-color 0.2s, color 0.2s;
}

.price-tabs__tab[aria-selected="true"] {
  background: var(--c-primary);
  color: var(--c-white);
}

.price-tabs__tab:not([aria-selected="true"]):hover {
  background: var(--c-pale);
}

.price-tabs__panel {
  margin-top: 16px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--c-pale);
}

.price-table__wrap {
  overflow-x: auto;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.price-table th,
.price-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--c-sky);
  text-align: left;
  vertical-align: top;
}

.price-table th {
  font-weight: 700;
  background: var(--c-sky);
}

.price-table td:not(:first-child),
.price-table th:not(:first-child) {
  white-space: nowrap;
}

.price-table tbody tr:hover {
  background: var(--c-white);
}

.price-tabs__empty {
  padding: 16px 10px;
  color: var(--c-placeholder);
}

@media (min-width: 1024px) {
  .price-tabs__tab {
    min-height: 46px;
    padding-inline: 24px;
    font-size: 20px;
  }

  .price-tabs__panel {
    margin-top: 20px;
    padding: 20px;
  }

  .price-table {
    font-size: 16px;
  }

  .price-table th,
  .price-table td {
    padding: 10px 14px;
  }
}

/* ---------- Doctor card without a photo yet ---------- */
.doctor-card__photo--empty {
  object-fit: contain;
}

/* ---------- Contacts ---------- */
.contacts__layout {
  display: grid;
  gap: 24px;
}

.contacts__info {
  display: grid;
  gap: 20px;
}

.contacts__cards {
  display: grid;
  gap: 12px;
}

.contacts__card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--c-pale);
}

.contacts__icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.contacts__label {
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 700;
}

.contacts__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 16px;
}

.contacts__text a {
  color: var(--c-primary);
}

.contacts__text a:hover {
  text-decoration: underline;
}

.contacts__note {
  margin-top: 6px;
  font-size: 14px;
  color: var(--c-placeholder);
}

.contacts__btn {
  justify-self: start;
  min-height: 45px;
  padding-inline: 30px;
}

.contacts__map {
  width: 100%;
  height: 320px;
  border: 0;
  border-radius: var(--radius);
  background: var(--c-pale);
}

.route__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 16px;
  line-height: 1.5;
}

@media (min-width: 1024px) {
  .contacts__layout {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
    gap: 40px;
  }

  .contacts__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .contacts__card {
    padding: 24px;
  }

  .contacts__btn {
    margin-top: 6px;
  }

  .contacts__map {
    height: 460px;
  }

  .route__text {
    font-size: 18px;
  }
}

/* ---------- Simple page intro text ---------- */
.page-hero__lead {
  max-width: 900px;
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.5;
}

.page-hero__lead a {
  color: var(--c-primary);
  text-decoration: underline;
}

@media (min-width: 1024px) {
  .page-hero__lead {
    font-size: 18px;
  }
}

/* ---------- Long texts (legal pages, info for patients) ---------- */
.prose {
  max-width: 960px;
  font-size: 16px;
  line-height: 1.6;
}

.prose > * + * {
  margin-top: 12px;
}

.prose h2 {
  margin-top: 28px;
  font-size: 20px;
  font-weight: 600;
}

.prose h3 {
  margin-top: 24px;
  font-size: 18px;
  font-weight: 600;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose ul {
  list-style: disc;
}

.prose li + li {
  margin-top: 6px;
}

.prose a {
  color: var(--c-primary);
  text-decoration: underline;
}

.prose a:hover {
  color: var(--c-accent);
}

@media (min-width: 1024px) {
  .prose {
    font-size: 18px;
  }

  .prose h2 {
    font-size: 24px;
  }

  .prose h3 {
    font-size: 20px;
  }
}

/* Name / value pairs: requisites, opening hours, supervising bodies */
.info-list {
  display: grid;
  gap: 4px 24px;
}

.info-list dt {
  font-weight: 700;
}

.info-list dd {
  margin: 0 0 10px;
}

@media (min-width: 1024px) {
  .info-list {
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  }

  .info-list dd {
    margin-bottom: 6px;
  }
}

/* A section waiting for the clinic's data — must not stay on the live site */
.notice {
  padding: 12px 16px;
  border-left: 4px solid var(--c-accent);
  border-radius: var(--radius);
  background: #fff4e5;
  font-size: 15px;
}

/* Files to download: licence, contract sample */
.prose .files {
  display: grid;
  gap: 10px;
  max-width: 640px;
  padding: 0;
  list-style: none;
}

.prose .files li + li {
  margin-top: 0;
}

.prose .file {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-white);
  color: var(--c-text);
  text-decoration: none;
  line-height: 1.3;
}

.prose .file:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.file__type {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--c-pale);
  color: var(--c-primary);
  font-size: 13px;
  font-weight: 700;
}

.file__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.file__name {
  overflow-wrap: anywhere;
}

.file__meta {
  color: var(--c-placeholder);
  font-size: 14px;
}

.info-block + .info-block {
  margin-top: 40px;
}

/* In-page navigation as a list of sections (long pages) */
.page-nav--list .page-nav__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px 24px;
  padding-block: 14px;
}

.page-nav--list .page-nav__list li + li::before {
  content: none;
}

.page-nav--list .page-nav__link {
  font-family: var(--font-base);
  font-size: 16px;
  font-weight: 400;
  text-transform: none;
}

/* ---------- Prices page ---------- */
.prices__note {
  margin-top: 12px;
  font-size: 14px;
  color: var(--c-placeholder);
}

.prices__empty-all {
  margin-top: 16px;
  font-size: 16px;
}

.prices__empty-all a {
  color: var(--c-primary);
}

/* ---------- Doctors page: all cards in a grid ---------- */
.doctors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 24px 16px;
}

.doctors-grid .doctor-card {
  width: auto;
  scroll-margin-top: 20px;
}

@media (min-width: 1024px) {
  .doctors-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 40px 22px;
  }
}

/* ---------- About: advantages ---------- */
.features {
  display: grid;
  gap: 12px;
}

.features__item {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--c-pale);
  font-size: 16px;
  line-height: 1.5;
}

.features__title {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 600;
  color: var(--c-primary);
}

@media (min-width: 1024px) {
  .features {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }

  .features__item {
    padding: 28px 24px;
  }
}

/* ---------- About: photo gallery (Swiper) ---------- */
.gallery__item {
  width: 85%;
  overflow: hidden;
  border-radius: var(--radius);
}

.gallery__item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.gallery__nav {
  display: flex;
  gap: 27px;
  margin-top: 20px;
}

@media (min-width: 1024px) {
  .gallery__item {
    width: calc((100% - 40px) / 3);
  }

  .gallery__nav {
    justify-content: flex-end;
    gap: 23px;
  }
}

/* ---------- Booking form: hidden trap field for bots, sending status ---------- */
.form__trap {
  display: none;
}

.form__status {
  margin-top: 10px;
  font-size: 14px;
}

.form__status--ok {
  color: #1d7a3a;
}

.form__status--error {
  color: var(--c-accent);
}
