/* Shared responsive corrections load after the original page styles. */
@media (max-width: 1179px) {
  .site-content.homepage .home-consult { grid-template-columns: minmax(0, 547.5px); justify-content: center; gap: 45px; }
}

@media (max-width: 1100px) {
  html, body { max-width: 100%; overflow-x: clip; }
  body { min-width: 0; overflow-wrap: anywhere; }
  .site-content, .site-main, .kb-layout, .kb-section { min-width: 0; }

  /* Keep navigation in its drawer until the full desktop header fits. */
  .site-header__inner { width: 100%; padding-inline: clamp(20px, 4vw, 40px); gap: 16px; }
  .menu-toggle { display: block; flex-shrink: 0; order: 3; }
  .primary-navigation { position: absolute; top: 100%; left: 0; display: none; width: 100%; margin: 0; padding: 10px 20px 25px; background: #fff; box-shadow: 0 12px 18px rgb(0 0 0 / 10%); }
  .primary-navigation.is-open { display: block; }
  .primary-navigation > div > ul { display: block; }
  .primary-navigation a { padding: 8px 0; text-align: center; white-space: normal; }
  .primary-navigation .menu-item-has-children > a { justify-content: center; }
  .primary-navigation .sub-menu { position: static; width: min(100%, 500px); max-height: none; margin: 4px auto 12px; padding-inline: 20px; visibility: visible; opacity: 1; transform: none; }
  .primary-navigation li:hover > .sub-menu,
  .primary-navigation li:focus-within > .sub-menu { transform: none; }

  /* Grid and flex children must be allowed to shrink below their text width. */
  .home-reviews__grid, .operations-page__reviews .home-reviews__grid,
  .services-archive__reviews .home-reviews__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-reviews__grid article, .reviews-page__card,
  .operations-page__hero-left, .operations-page__opinion-grid > div,
  .operations-page__online-content, .home-online > div,
  .blog-page__categories > a, .operations-page__anchors > a { min-width: 0; }
  .home-reviews__grid article h3 { white-space: normal; overflow-wrap: anywhere; }
  .home-review__meta, .home-reviews__heading, .home-reviews__partners,
  .services-archive__reviews .home-reviews__partners { flex-wrap: wrap; height: auto; }
  .home-reviews__partners, .services-archive__reviews .home-reviews__partners { gap: 20px; max-width: 100%; justify-content: center; }
  .home-price > span, .prices-page__row > span { min-width: 0; }
  .home-price > strong, .prices-page__row > strong { flex-shrink: 0; }
  .home-hero__schedule p span { width: auto; min-width: 24px; flex-shrink: 0; }
  .site-footer__bottom { flex-wrap: wrap; gap: 12px; }
  .footer-copyright { flex-wrap: wrap; }

  /* Every service variant uses flexible columns and wrapping labels. */
  .operations-page .operations-page__hero { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .operations-page .operations-page__hero-left { grid-template-rows: auto auto; }
  .operations-page .operations-page__title-card h1 { white-space: normal; overflow-wrap: anywhere; }
  .operations-page__process-list strong { white-space: normal; overflow-wrap: anywhere; }
  .operations-page__anchors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .operations-page__breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; }
  .operations-page__breadcrumb > * { min-width: 0; }
  .operations-page__online-content { transform: none; }
  .home-button, .operations-page__button, .header-cta, .footer-action a { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: center; }

  /* Saved editor sizes cannot make media wider than the article column. */
  .native-blog-single .native-blog-article__body img { max-width: 100% !important; height: auto; }
  .native-blog-article__body figure, .operations-page__article figure,
  .service-page__content figure, .native-service-article__figure { max-width: 100%; }
  .native-blog-article__body iframe, .operations-page__article iframe,
  .native-blog-article__body video, .operations-page__article video { max-width: 100%; }
  .native-blog-article__body .alignwide, .native-blog-article__body .alignfull,
  .operations-page__article .alignwide, .operations-page__article .alignfull { width: 100%; max-width: 100%; margin-inline: 0; }
  .native-blog-article__body pre, .operations-page__article pre { white-space: pre-wrap; overflow-wrap: anywhere; }

  /* Tables wrap inside their column, without a second horizontal scrollbar. */
  .operations-page__article, .wp-block-table { overflow-x: visible; }
  .operations-page__article table, .native-blog-article__body table,
  .native-service-article table, .service-page__content table { width: 100% !important; max-width: 100%; table-layout: fixed; }
  .operations-page__article col, .native-blog-article__body col,
  .operations-page__article th, .operations-page__article td,
  .native-blog-article__body th, .native-blog-article__body td,
  .native-service-article th, .native-service-article td,
  .service-page__content th, .service-page__content td { width: auto !important; min-width: 0; padding: 10px 6px !important; white-space: normal !important; overflow-wrap: anywhere; }
  .native-blog-article__table-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .native-blog-article__table-row > * { min-width: 0; }
  .native-popup__grid > *, .native-lead-form, .operations-page__form { min-width: 0; }
}

@media (max-width: 900px) {
  .operations-page .operations-page__hero { display: block; min-height: 0; }
  .operations-page .operations-page__hero-left { display: block; }
  .operations-page .operations-page__title-card h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; }
}

@media (max-width: 767px) {
  /* The hero's margins and width must add up to the viewport width. */
  .site-content.homepage .home-hero { width: calc(100% - 40px); max-width: none; margin-inline: 20px; display: block; }
  .home-hero__intro { width: 100%; height: auto; }
  .home-hero__headline { position: relative; display: block; height: auto; }
  .home-hero__headline p { min-width: 0; width: 100%; font-size: clamp(28px, 9vw, 44px); line-height: 1.15; }
  .home-hero__headline img { position: absolute; top: 12px; right: 0; width: clamp(48px, 16vw, 80px); max-width: 100%; margin: 0; }
  .home-hero__quick { height: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-hero__quick a { min-width: 0; height: auto; min-height: 72px; flex-direction: column; gap: 4px; padding: 8px 5px; white-space: normal; }
  .home-hero__quick a span { font-size: clamp(12px, 3.4vw, 14px); line-height: 1.25; overflow-wrap: normal; }
  .home-hero__quick a b { display: none; }
  .home-hero__quick .home-hero__all { height: auto; min-height: 72px; }
  .home-hero__media { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-hero__doctor { width: 100%; max-width: 100%; }
  .home-hero__clinic { min-width: 0; height: auto; min-height: 53px; }
  .home-hero__clinic strong { white-space: normal; }
  .home-consult__art { overflow: hidden; }
  .home-consult__left, .home-consult__steps { min-width: 0; max-width: 100%; }
  .home-consult__badge--rating, .home-consult__badge--male,
  .home-consult__badge--female { left: auto; right: 8px; }
  .home-location__card { transform: none; flex-wrap: wrap; }
  .home-location__card > span { flex: 1; min-width: 0; }

  .home-reviews__grid, .operations-page__reviews .home-reviews__grid,
  .services-archive__reviews .home-reviews__grid { grid-template-columns: minmax(0, 1fr); }
  .home-reviews__grid article { height: auto; }
  .services-archive__reviews { width: 100%; padding-inline: 0; }
  .services-archive__reviews .home-reviews__partners { width: 100%; }
  .operations-page__anchors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-page .operations-page__title-card h1 { font-size: clamp(28px, 7.4vw, 38px); line-height: 1.15; }
  .operations-page__map-card { width: min(300px, calc(100% - 16px)); padding-inline: 16px; }
  .operations-page__map-card > span:not(.operations-page__map-hours) { width: auto; min-width: 0; flex: 1; }
  .operations-page__map-hours { left: 16px; }
  .native-service-article__figures { flex-wrap: wrap; }
  .native-service-article__restricted { flex: 0 1 100%; max-width: 372px; }
  .native-blog-single .native-blog-article__body figure { width: auto !important; margin-inline: 0; }
  .native-blog-single .native-blog-article__body .wp-block-column,
  .operations-page__article .wp-block-column { min-width: 0; max-width: 100%; }
  .operations-page__article .wp-block-columns { flex-direction: column; }
  .native-popup__media { width: 100%; max-width: 100%; }
  .native-popup__form-panel, .native-popup__result-panel { padding-inline: 20px; }
  .native-lead-form input, .operations-page__form input { min-width: 0; max-width: 100%; }
}

@media (max-width: 400px) {
  .home-hero__doctor { height: 640px; min-height: 640px; }
  .home-hero__rating { left: 16px; width: 100px; }
  .home-hero__online { top: 200px; right: 16px; width: 132px; min-height: 0; padding: 8px; font-size: 12px; line-height: 14px; }
  .home-hero__schedule + .home-hero__online { top: 200px; }
  .home-hero__schedule { left: 16px; right: 16px; width: auto; }
}
