/*
 * Shared responsive layer for the dentistry site (S2).
 * Keeps the existing product language and mirrors the first S1 adaptation
 * without coupling the two Bitrix sites.
 */

:root {
  --mdx-dent-ink: #0e3449;
  --mdx-dent-muted: #607985;
  --mdx-dent-teal: #007c8e;
  --mdx-dent-teal-dark: #086575;
  --mdx-dent-mint: #eaf5f3;
  --mdx-dent-paper: #fbfcfb;
  --mdx-dent-line: #dbe8e8;
  --mdx-dent-warm: #ef7f1a;
  --mdx-dent-shadow: 0 18px 46px rgba(14, 52, 73, 0.1);
}

.body--responsive {
  min-width: 0;
}

.body--responsive.mdx-menu-open {
  overflow: hidden;
}

.main-container {
  min-width: 0 !important;
}

.mdx-skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1100;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--mdx-dent-ink);
  color: #fff;
  font-weight: 500;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.mdx-skip-link:focus {
  transform: translateY(0);
}

.body--responsive :focus-visible {
  outline: 3px solid rgba(239, 127, 26, 0.8);
  outline-offset: 3px;
}

/* Header and navigation */

.header--responsive {
  position: sticky;
  top: 0;
  z-index: 999;
  width: 100%;
}

.header--responsive + .main {
  margin-top: 0 !important;
}

.header--responsive .header-top {
  position: static;
  z-index: auto;
  padding: 0.6rem 0;
}

.header--responsive .header-top__inner,
.header--responsive .header-top__wrapper {
  min-width: 0;
}

.header--responsive .header-top__wrapper {
  gap: clamp(1rem, 3vw, 3rem);
}

.header--responsive .header-bottom {
  margin-top: 0;
  padding: 1rem 0;
}

.header--responsive .header-bottom__inner,
.header--responsive .header__toolbar {
  min-width: 0;
}

.header--responsive .header__toolbar {
  flex: 0 1 auto;
  margin-left: auto;
}

.header--responsive .header__nav-list {
  max-width: 38rem;
  gap: clamp(0.75rem, 2vw, 1.75rem);
}

.header--responsive .mob-menu__burger,
.header--responsive .mob-menu__close {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--mdx-dent-line);
  border-radius: 50%;
  background: #fff;
}

.header--responsive .mob-menu__burger {
  justify-content: space-between;
  padding: 0.72rem 0.58rem;
}

.header--responsive .mob-menu__burger span {
  width: 1.45rem;
  background: var(--mdx-dent-ink);
}

.header--responsive .mob-menu__burger span:first-child {
  width: 1.45rem;
}

.header--responsive .mob-menu__close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  z-index: 2;
}

.header--responsive .mob-menu__close span,
.header--responsive .mob-menu__close span::after {
  position: absolute;
  width: 1.2rem;
  height: 2px;
  border-radius: 2px;
  background: var(--mdx-dent-ink);
  transform: rotate(45deg);
}

.header--responsive .mob-menu__close span::after {
  content: "";
  transform: rotate(90deg);
}

@media only screen and (max-width: 1199.9px) {
  .header--responsive .header-top__inner {
    gap: 1rem;
  }

  .header--responsive .mob-menu__content {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 1001;
    width: min(24rem, 100vw);
    max-width: 100vw;
    height: 100dvh;
    min-height: 0;
    padding: 4.75rem 1.25rem 2rem;
    overflow-y: auto;
    border-left: 1px solid var(--mdx-dent-line);
    border-radius: 0;
    box-shadow: -18px 0 55px rgba(14, 52, 73, 0.18);
    visibility: hidden;
    pointer-events: none;
    transform: translateX(105%);
    transition: transform 0.28s ease, visibility 0.28s ease;
  }

  .header--responsive .mob-menu__content.active {
    right: 0;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }

  .header--responsive .mob-menu__list {
    display: grid;
    gap: 0.35rem;
    margin-top: 1.25rem;
  }

  .header--responsive .mob-menu__link {
    min-height: 3rem;
    padding: 0.8rem 0.9rem;
    border-radius: 0.8rem;
  }
}

@media only screen and (max-width: 767.9px) {
  .header--responsive {
    position: sticky;
  }

  .header--responsive .header-top {
    padding: 0.55rem 0;
  }

  .header--responsive .header-top__wrapper {
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
  }

  .header--responsive .header-bottom {
    margin-top: 0;
    padding: 0.65rem 0;
  }

  .header--responsive .header-bottom__inner {
    gap: 0.65rem;
  }

  .header--responsive .logo {
    width: clamp(7rem, 31vw, 9.25rem);
  }

  .header--responsive .header__toolbar > .button--wide {
    min-width: 0;
    max-width: 100%;
    min-height: 2.55rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.72rem;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
  }

  .header--responsive .tel--header {
    font-size: clamp(0.9rem, 4.4vw, 1.05rem);
    white-space: nowrap;
  }
}

@media only screen and (max-width: 575.9px) {
  .header--responsive .header-top__wrapper > .button {
    display: none;
  }

  .header--responsive .header-top__inner {
    justify-content: space-between;
  }

  .header--responsive .header-top__wrapper {
    min-width: 0;
  }
}

/* Shared page foundations */

.main,
.main .container,
.main .columns,
.main [class*="columns__col"],
.main .card,
.main .article,
.main .editor,
.main .editor * {
  min-width: 0;
}

.main img,
.main svg,
.main video,
.main canvas,
.main iframe {
  max-width: 100%;
}

.main .title,
.main .card__title,
.main .editor,
.main .editor *,
.main .breadcrumbs__link,
.main .breadcrumbs__curr-page {
  overflow-wrap: anywhere;
}

.main .editor img,
.main .editor video,
.main .editor iframe {
  height: auto;
}

.main .editor iframe,
.main .editor video {
  display: block;
  width: 100%;
}

.main .editor table,
.main--section-search table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.main .breadcrumbs {
  min-width: 0;
  white-space: normal;
}

.main .breadcrumbs__curr-page {
  flex: 0 1 auto;
}

.main .title,
.main .title--page,
.main .title--page-intro,
.main .services__title,
.main .intro-slider__content-wrapper {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}

.main .button {
  min-height: 2.75rem;
}

.main .modal,
.fancybox__content {
  max-width: calc(100vw - 2rem) !important;
}

.main .section--static + .section .editor,
.main--section-policy .editor,
.main--section-management .editor {
  max-width: 72rem;
}

/* Home hero and cards */

.main--section-home {
  overflow: hidden;
}

.main--index .mdx-home-hero .intro-slider,
.main--index .mdx-home-hero .intro-slider__slide {
  height: clamp(20rem, 28vw, 25rem);
  min-height: 20rem;
  max-height: none;
}

.main--index .mdx-home-hero .intro-slider__surface,
.main--index .mdx-home-hero .intro-slider__picture {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.main--index .mdx-home-hero .intro-slider__picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.main--index .mdx-home-hero .intro-slider__content {
  top: clamp(2rem, 4vw, 3.9rem);
  left: clamp(1.5rem, 5vw, 4.4rem);
  z-index: 2;
  max-width: min(44%, 31rem);
}

.main--index .mdx-home-hero .slider__controls--inner,
.main--index .mdx-home-hero .slider__pagination {
  z-index: 3;
}

.main--index .mdx-home-hero .slider__button,
.main--index .slider .slider__button {
  min-width: 2.75rem;
  min-height: 2.75rem;
}

@media only screen and (max-width: 991.9px) {
  .main--index .mdx-home-hero .intro-slider,
  .main--index .mdx-home-hero .intro-slider__slide {
    height: clamp(21rem, 48vw, 26rem);
  }
}

@media only screen and (max-width: 767.9px) {
  .main--index .mdx-home-hero .container--no-padding {
    padding-inline: 0;
  }

  .main--index .mdx-home-hero .intro-slider,
  .main--index .mdx-home-hero .intro-slider__slide {
    height: clamp(26rem, 130vw, 38rem);
    min-height: 26rem;
    max-height: none;
  }

  .main--index .mdx-home-hero .intro-slider {
    border-inline: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .main--index .mdx-home-hero .intro-slider__content {
    top: 1.5rem;
    right: 1.25rem;
    left: 1.25rem;
    max-width: none;
  }

  .main--index .services__article,
  .main--index .article-feature,
  .main--index .card,
  .main--section-doctors .card,
  .main--section-management .card {
    height: auto;
  }
}

/* Inner-page hero: copy first, real image retained beneath it on small screens. */

.main .page-intro {
  width: min(calc(100% - 1.875rem), 73.125rem);
  margin-inline: auto;
}

.main .page-intro__content,
.main .page-intro__picture,
.main .page-intro__picture img {
  min-width: 0;
  max-width: 100%;
}

.main .page-intro__bottom,
.main .page-intro__bottom a {
  max-width: 100%;
}

@media only screen and (max-width: 767.9px) {
  .main .breadcrumbs {
    align-items: flex-start;
    row-gap: 0.45rem;
    font-size: 0.8125rem;
    line-height: 1.35;
  }

  .main .page-intro,
  .main .page-intro--min,
  .main .page-intro--big,
  .main .page-intro--no-header,
  .main .page-intro__content,
  .main .page-intro--min .page-intro__content,
  .main .page-intro--big .page-intro__content,
  .main .page-intro--no-header__content {
    height: auto !important;
    min-height: 0;
  }

  .main .page-intro {
    width: calc(100% - 1.5rem);
    border-radius: 1rem;
  }

  .main .page-intro .columns {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .main .page-intro__content,
  .main .page-intro--no-header__content {
    padding: 1.25rem 0 0.75rem;
  }

  .main .page-intro__picture,
  .main .page-intro__picture--decor-round,
  .main .page-intro__picture--full,
  .main .page-intro__picture--no-header,
  .main .page-intro--min__picture {
    position: relative !important;
    inset: auto !important;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: clamp(13rem, 65vw, 22rem);
    margin: 0 auto;
    overflow: hidden;
    transform: none;
  }

  .main .page-intro__picture::after,
  .main .page-intro__picture--shadow::before {
    content: none;
  }

  .main .page-intro__picture img,
  .main .page-intro__picture--decor-round img,
  .main .page-intro__picture--full img,
  .main .page-intro__picture--no-header img,
  .main .page-intro--min__picture img {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0 auto;
    object-fit: contain;
    object-position: center bottom;
    transform: none;
  }

  .main .page-intro__bottom,
  .main .page-intro__bottom a {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Image promos */

.main--index .service-promo,
.main--section-promotion .promo {
  overflow: hidden;
}

.main--index .service-promo__info,
.main--section-promotion .promo__info {
  position: relative;
  z-index: 2;
  min-width: 0;
}

@media only screen and (max-width: 767.9px) {
  .main--index .service-promo,
  .main--section-promotion .promo {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }

  .main--index .service-promo__info,
  .main--section-promotion .promo__info {
    order: 1;
    width: 100%;
    max-width: none;
    padding: 1.5rem;
  }

  .main--index .service-promo__text,
  .main--section-promotion .promo__text {
    margin-bottom: 1.5rem;
  }

  .main--index .service-promo__picture,
  .main--section-promotion .promo__picture {
    position: relative;
    inset: auto;
    order: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    max-width: none;
    height: clamp(13.5rem, 68vw, 22rem);
    max-height: none;
    aspect-ratio: auto;
    overflow: hidden;
  }

  .main--index .service-promo__picture::before {
    top: 8%;
    right: 50%;
    width: min(120vw, 34rem);
    height: min(120vw, 34rem);
    transform: translateX(50%);
  }

  .main--index .service-promo__picture img,
  .main--section-promotion .promo__picture img {
    position: relative;
    inset: auto;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center bottom;
  }

  .main--section-promotion .promo__footer,
  .main--section-promotion .promo__footer .button {
    width: 100%;
  }
}

/* Prices, services, works and search */

.main--section-prices .article-faq__header,
.main--section-prices .article-faq__link,
.main--section-services .services-list__link,
.main--section-search .card-search {
  min-width: 0;
}

.main--section-prices .article-faq__link {
  gap: 0.75rem;
}

.main--section-prices .article-faq__link span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.main--section-prices .article-faq__link span:last-child {
  flex: 0 0 auto;
  text-align: right;
}

.main--section-works .compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.main--section-works .compare img {
  display: block;
  width: 100%;
  height: auto;
}

@media only screen and (max-width: 767.9px) {
  .main--section-prices .article-faq__header {
    padding: 1rem;
  }

  .main--section-prices .article-faq__title,
  .main--section-prices .article-faq__head,
  .main--section-prices .article-faq__link {
    font-size: 1rem;
    line-height: 1.4;
  }

  .main--section-prices .article-faq__link span {
    padding: 0.85rem 0.15rem;
  }

  .main--section-search .card-search__header,
  .main--section-search .card-search__content-wrapper {
    min-width: 0;
  }

  .main--section-search .search-page__wrapper {
    gap: 0.75rem;
  }
}

@media only screen and (max-width: 479.9px) {
  .main--section-works .compare {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Footer */

.footer--responsive a {
  overflow-wrap: anywhere;
}

@media only screen and (max-width: 767.9px) {
  .footer--responsive {
    padding: 2.5rem 0 2rem;
  }

  .footer--responsive .footer__menu-list {
    gap: 1.75rem;
  }

  .footer--responsive .footer__menu-list > .footer__menu-item {
    width: 100%;
    margin: 0;
  }

  .footer--responsive .footer__bottom,
  .footer--responsive .footer__bottom .flex {
    align-items: flex-start;
    max-width: 100%;
  }
}

@media only screen and (max-width: 374.9px) {
  .container {
    padding-inline: 1rem;
  }

  .main .title--page,
  .main .title--page-intro {
    font-size: clamp(1.65rem, 9vw, 1.875rem);
    line-height: 1.15;
  }

  .main .button {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header--responsive *,
  .mdx-skip-link {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
