/* Shared responsive corrections for the preserved page templates. */
.container, .cmp-menu__container { max-width: 100%; }
.header__container { gap: 24px; }
.header__logo, .header__btn-menu, .header__search { margin-right: 0; }
.header__search { flex: 1; min-width: 0; max-width: 360px; }
.header__search-input { width: 100%; min-width: 0; }
.header__nav .menu { gap: 28px; }
.header__nav .menu > .menu-item { margin-right: 0; white-space: nowrap; }
.header__logo a:focus-visible, a:focus-visible, button:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible,
[role="button"]:focus-visible { outline: 3px solid #4e59fd; outline-offset: 3px; }
.header__btn-menu, .header__btn-menu-mobile { flex-shrink: 0; min-height: 44px; }
.header__btn-menu-mobile { width: 44px; min-width: 44px; align-items: center; justify-content: center; }
.header__btn-menu-mobile img { width: 30px; }
.cmp-menu { position: fixed; top: 74px; max-height: calc(100vh - 74px); max-height: calc(100dvh - 74px); overflow-y: auto; overscroll-behavior: contain; }
.cmp-menu__container { width: 1300px; }
.cmp-menu__left { flex: 0 0 260px; }
.cmp-menu__right { flex: 1; min-width: 0; width: auto; }
.cmp-menu__categories, .cmp-menu__directions-section-list { max-height: none; overflow: visible; }
.cmp-menu__categories-item { min-height: 49px; height: auto; padding-top: 8px; padding-bottom: 8px; }
.cmp-menu__directions-item a { display: block; padding: 10px 8px; overflow-wrap: anywhere; }
body.has-open-navigation { overflow: hidden; }
.header__menu-mobile { max-height: calc(100dvh - 74px); overflow-y: auto; }
.cmp-select__list-option, .cmp-select__list-option-empty { white-space: normal; overflow-wrap: anywhere; min-height: 44px; line-height: 1.35; }
.cmp-select__list-options { max-height: min(320px, 55vh); }
.cmp-select:not([data-type="search"]):hover:not([data-opened="1"]) .cmp-select__list-options-wrap { display: none; opacity: 0; }
.footer .menu, footer .menu { flex-wrap: wrap; gap: 12px 24px; justify-content: flex-start; }
.footer__head { display: flex; flex-wrap: wrap; gap: 20px; height: auto; }
.footer__logo { max-width: 100%; }
.footer__nav { flex: 1; min-width: 0; width: auto; max-width: 100%; height: auto; }
.footer__nav .menu-footer-container, .footer__nav .menu { width: auto; max-width: 100%; }
footer .menu > .menu-item { flex: 0 1 auto; margin: 0; padding: 0; }
footer .menu a { display: inline-block; padding: 8px 0; }
.catalog-schools__hero-search { min-width: 0; max-width: 100%; }
.catalog-schools__hero-search-input { flex: 1; min-width: 0; }
.catalog-schools__hero-search-btn { flex-shrink: 0; min-height: 44px; }
.school-catalog__toolbar > * { min-width: 0; max-width: 100%; }
.school-catalog__toolbar input, .school-catalog__toolbar select { min-height: 44px; }
.catalog-card { min-width: 0; overflow-wrap: anywhere; }
.catalog-card__action { min-height: 44px; }
.school-catalog__empty { padding: 20px; border: 1px solid #e1e3ea; border-radius: 8px; }
.school-catalog__empty[hidden] { display: none; }
.rtrs-form-check { line-height: 1.5; }
.rtrs-form-check label, .rtrs-form-check a { font-size: 14px; }
.rtrs-form-check input { min-width: 18px; min-height: 18px; }
.cmp-comment__form-personal { display: flex; align-items: flex-start; gap: 10px; }
.cmp-comment__form-personal-text { font-size: 14px; line-height: 1.5; }
.cmp-comment__form-personal-checkbox { min-width: 18px; min-height: 18px; margin: 2px 0 0; }
.rtrs-review-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.rtrs-review-form textarea { min-height: 44px; font-size: 16px; }
.rtrs-review-form textarea { min-height: 120px; }
.rtrs-review-form [type="submit"] { min-height: 44px; }
.rtrs-review-form .rtrs-feedback-input { max-width: 100%; }
.single-page__block[class] .rtrs-field-add { min-height: 44px; height: auto !important; }
.rtrs-review-form .rtrs-feedback-input .rtrs-remove-btn { width: 32px; height: 32px; font-size: 24px; line-height: 30px; top: 6px; }
.rtrs-review-form .rtrs-feedback-input .rtrs-input-filed { padding-right: 42px; }

@media (max-width: 1100px) {
  .header__container { gap: 16px; height: 74px; }
  .header__logo { height: auto; min-width: 0; }
  .header__logo-img { width: 190px; min-width: 0; max-width: 100%; height: auto; }
  .header__nav { display: none; }
  .header__btn-menu-mobile { display: flex; margin-top: 0; }
  .header__menu-mobile { position: absolute; top: 74px; left: 0; width: 100%; z-index: 995; background: #fff; padding: 12px 0; display: none; }
  .header__menu-mobile[data-opened="1"] { display: block; }
  .header__menu-mobile .menu-item { display: block; font-size: 20px; padding: 0; }
  .header__menu-mobile .menu-item a { display: block; min-height: 44px; padding: 12px; }
  .header__blackout { position: fixed; inset: 0; z-index: 91; background: rgb(0 0 0 / 60%); display: none; }
  .cmp-menu__directions-item { width: 50%; }
}

/* The original mobile filter layout also fits tablets; tables retain a scroll fallback. */
@media (max-width: 1023px) {
  .d_course_table--desktop, .page-school-course .d_course_items { display: none !important; }
  .d_course_table--mobile, .page-school-course .d_course_rating--mobile { display: block !important; }
  .d_course_rating__table { max-width: 100%; overflow-x: auto; }
  .d_cat_filter2 { display: flex; flex-direction: column; }
  .d_cat_filter2--mobile { display: block; }
  .d_cat_filter2--desktop { display: none; }
  .d_cat_filter2__views { display: none; }
  .d_cat_filter2__head-top, .d_cat_filter2__head, .d_cat_filter2__content { width: 100%; }
  .d_cat_filter2__head-top { order: 1; position: relative; z-index: 91; }
  .d_cat_filter2__content { order: 2; padding-top: 0; padding-bottom: 20px; }
  .d_cat_filter2__head { order: 3; display: block; }
  .d_cat_filter2__m-head-top { display: flex; justify-content: space-between; gap: 12px; }
  .d_cat_filter2__m-head-top > * { width: calc(50% - 6px); margin: 0; min-width: 0; }
  .d_cat_filter2__head-center { display: flex; gap: 12px; margin: 0; width: 100%; }
  .d_cat_filter2__head-center .d_cat_filter2__head-select { flex: 1; min-width: 0; width: auto; margin: 0 0 16px; }
  .d_cat_filter2__but-sorting { margin-left: 0; }
  .d_cat_filter2__but-sorting .d_cat_filter2__head-select-name-value { white-space: normal; line-height: 1.3; font-size: 14px; }
  .d_cat_filter2__but-sorting .cmp-select__list-options { width: min(310px, calc(100vw - 32px)); }
  .d_cat_filter2__but-sorting .cmp-select__list-options-wrap { right: 0; left: auto; }
  .d_cat_filter2__section-attr { flex-wrap: wrap; gap: 16px; }
  .d_cat_filter2__attr-block { display: block; width: calc(50% - 8px); margin-bottom: 8px; }
  .d_cat_filter2__attr-block .d_course__select { width: 100%; margin: 0; }
  .d_cat_filter2__section-props, .d_cat_filter2__props { display: flex; flex-wrap: wrap; width: 100%; }
  .d_cat_filter2__props-item { width: 50%; }
  .d_cat_filter2__props-item-label { font-size: 14px; line-height: 1.35; }
  .d_course_table__m { display: flex; flex-wrap: wrap; margin: 0 -8px; }
  .d_course_table__m-item-wrap { width: 50%; padding: 8px; min-width: 0; }
  .d_course_table__m-item { display: flex; flex-direction: column; border-radius: 8px; padding: 16px; height: 100%; margin-bottom: 0; background: #fff; box-shadow: 0 3px 14px rgb(0 0 0 / 9%); }
  .d_course_table__m-item-image { height: 130px; background-size: contain; background-position: center; background-repeat: no-repeat; }
  .d_course_table__m-item-content { display: flex; flex-direction: column; flex: 1; padding-top: 16px; }
  .d_course_table__m-item-name { height: auto; min-height: 44px; font-size: 16px; line-height: 1.4; display: block; overflow: visible; margin-bottom: 12px; }
  .d_course_table__m-item-center { border-top: 1px solid #dadee3; border-bottom: 1px solid #dadee3; padding: 10px 0; margin-bottom: 12px; }
  .d_course_table__m-item-company { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
  .d_course_table__m-item-company-logo { width: 30px; margin: 0; }
  .d_course_table__m-item-company-name { font-size: 14px; overflow-wrap: anywhere; }
  .d_course_table__m-item-rating { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .d_course_table__m-item-rating-num { margin: 0; color: #1fc578; }
  .d_course_table__m-item-rating-review { font-size: 13px; line-height: 1.5; }
  .d_course_table__m-item-prop, .d_course_table__m-item-prop span { font-size: 14px; line-height: 1.5; }
  .d_course_table__m-item-btn { margin-top: auto; min-height: 44px; height: auto; padding: 12px 8px; width: 100%; display: flex; align-items: center; justify-content: center; font-size: 14px; text-align: center; background: #170087; color: #fff; border-radius: 5px; text-decoration: none; }
  .d_course_table__m-item-content > :last-child { margin-top: 16px; }
}

@media (max-width: 620px) {
  .footer__head { flex-direction: column; align-items: flex-start; }
  .footer__nav { width: 100%; }
  .header__container { gap: 8px; }
  .header__logo { flex: 1; }
  .header__logo-img { width: 170px; }
  .header__btn-menu { width: 96px; padding-left: 44px; padding-right: 8px; font-size: 11px; }
  .header__search { display: none; }
  .header[menu-opened="1"] .header__search { flex: 1; width: auto; min-width: 0; }
  .header[menu-opened="1"] .header__search-input { font-size: 16px; }
  .cmp-menu__container { width: 100%; padding: 0 12px; }
  .cmp-menu__left { width: 100%; }
  .cmp-menu__directions-item { width: 100%; }
  .d_cat_filter2__head-center { display: block; }
  .d_cat_filter2__head-center .d_cat_filter2__head-select { width: 100%; }
  .d_course__select:has(.d_course__select-price-value) .cmp-select__list-options-wrap { right: 0; left: auto; width: min(270px, calc(100vw - 32px)); }
  .d_course__select-price-value { min-width: 0; font-size: 16px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), textarea, select { font-size: 16px; }
  .catalog-schools__hero-search { gap: 8px; flex-wrap: wrap; }
  .catalog-schools__hero-search-input { width: 100%; flex-basis: 100%; min-height: 44px; border-radius: 5px; }
  .catalog-schools__hero-search-btn { width: 100%; justify-content: center; padding-left: 28px; border-radius: 5px; background-position: calc(50% - 65px) center; }
}

@media (max-width: 480px) {
  .d_course_table__m-item-wrap { width: 100%; }
  .page-index__courses .d_course_table__m-item-wrap { width: 280px; }
  .d_cat_filter2__attr-block { width: 100%; }
  .d_cat_filter2__props-item { width: 100%; min-height: 44px; }
  .d_cat_filter2__props-item-content { align-items: center; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
