/*
 * Дополнительные стили шаблона.
 * Все правки и дополнения — только сюда.
 * template_styles.css и layout_styles.css (@media) обновляются извне, не редактировать.
 */

html {
	scroll-behavior: smooth;
}

#akcii,
#about-centr,
#contacts {
	scroll-margin-top: 120px;
}

/* /about/pravovaya_informaciya/: якоря не под фиксированной шапкой */
body.legal .legal_details,
body.legal .legal_work,
body.legal .legal_reception,
body.legal .legal_question {
	scroll-margin-top: 120px;
}

@media (max-width: 1024px) {
	.specialists_wrap.is-open .specialists_item.desk,
	.specialists_wrap.is-open .specialists_item.mob_hide {
		display: flex;
	}

	.specialists_wrap.is-open > .button.hide {
		display: none;
	}
}

/* Поиск пока без выдачи: поле и кнопка статичные */
#searchInput {
	cursor: default;
}

.header_mob_search {
	cursor: default;
}

body.popup-open {
	overflow: hidden;
	position: fixed;
	width: 100%;
	left: 0;
	right: 0;
}
/* /doctors/: в template_styles заголовок скрыт, в вёрстке — виден */
.doctors .employees h2 {
	display: block;
}

a.specialists_item_doctor {
	text-decoration: none;
	color: inherit;
}
#employeesLoadMore.is-hidden,
#programsLoadMore[hidden],
#programsLoadMore.is-hidden {
	display: none !important;
}

.programs_wrap .programs_item.is-collapsed,
.programs_wrap .programs_item.is-filter-hidden {
	display: none;
}

.container.programs_wrap {
	width: 100%;
}

/* Крестик попапа: в template_styles content: url(../img/…) → /local/templates/img/ (404) */
.popup .popup_close:hover img {
	content: url(img/close_white.png);
}

@media (max-width: 1024px) {
	.popup .popup_close img,
	.popup .popup_close:hover img {
		content: url(img/close_white.png);
	}

	/* cursor_wrap.mob_show: .mob_show включается только ≤540px, а layout — ≤1024px */
	.cursor_wrap.mob_show,
	.clinics_item .cursor_wrap.mob_show {
		display: flex;
		left: unset;
	}

	/*
	 * «Вернуться наверх»: в template_styles мобильный вид только ≤540px;
	 * кнопка вынесена из .page-scale (иначе fixed + width:100% = ширина scale, не экрана).

	body > .up_button {
		bottom: unset;
		right: 0;
		left: 0;
		top: 110px;
		width: 100%;
		font-size: 15px;
		border-radius: 0;
		padding: 12px;
		border-top: none;
		border-left: none;
		border-right: none;
	}

	body > .up_button .up_button_img {
		width: 30px;
		height: 30px;
		border: 1px solid rgba(255, 255, 255, 0.7);
		padding: 8px;
		margin-right: 10px;
	}
	 */
}

.section_bottom_divider {
	padding-bottom: 30px;
	margin-bottom: 30px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

/* /pricelist/: блок врачей (#employeesBlock) — 4 колонки направлений, как на главной */
body.price_page #employeesBlock .employees_category {
	grid-template-columns: repeat(4, 1fr);
	align-items: stretch;
}

body.price_page #employeesBlock .employees_category_item:last-child:nth-child(odd) {
	grid-column: auto;
}

/* Иконки клиник: inline SVG из PREVIEW_TEXT — те же размеры, что у <img> */
.clinics_item_left svg,
.clinics_item_left img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	flex-shrink: 0;
}

/* /doctors/: баннер терапевта — как на /doctors/{code}/ (без .doctors .therapist) */
body.doctors .container.therapist {
	background-color: rgba(227, 239, 255, 1);
	border-radius: 20px;
	gap: unset;
}

body.doctors .therapist .blue_block_left_desc {
	width: 70%;
}

@media (max-width: 1024px) {
	body.doctors .container.therapist {
		max-width: 100%;
		padding: 30px 20px 60px;
		margin-bottom: 60px;
	}

	body.doctors .therapist .blue_block_left_desc {
		width: 74%;
	}
}

@media (max-width: 540px) {
	body.doctors .container.therapist {
		max-width: 100%;
		padding: 20px 10px 35px;
		margin-bottom: 35px;
	}
}

.doctor_bio_item_desc {
	flex-direction: column;
	align-items: flex-start
}

/* /useful-materials/: «Показать еще» вместо CSS-скрытия 5+ карточек */
body.materilas .materilas_wrap .materilas_item:nth-child(n+5) {
	display: flex;
}

#materialsLoadMore.is-hidden {
	display: none !important;
}

.materilas_toogle_item {
	justify-content: center;
	align-items: center;
	text-align: center;
}

.materilas_empty {
	grid-column: 1 / -1;
	padding: 20px 0;
}

#materialsBlock.is-materials-loading {
	opacity: 0.65;
	pointer-events: none;
}

/* Imported publication wrappers are text content, not site layout containers. */
.materilas_page_cont_top_text .container {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.materilas_page_cont_top_text .news-container > * + * {
    margin-top: 1em;
}

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

.materilas_page_cont_top_text h2 {
	display: block;
	font-weight: 500;
	margin: 16px 0 0;
}

.materilas_page_cont_top_text h3,
.materilas_page_cont_top_text h4 {
	font-weight: 500;
	margin: 0;
}

.materilas_page_cont_top_text p,
.materilas_page_cont_top_text ul,
.materilas_page_cont_top_text ol {
	margin: 0;
}

.materilas_page_cont_top_text ul,
.materilas_page_cont_top_text ol {
	flex-direction: column;
	align-items: flex-start;
	padding-left: 1.2em;
	gap: 8px;
}

.materilas_page_cont_top_text li {
	display: list-item;
	list-style: disc;
}

.materilas_page_cont_top_text ol li {
	list-style: decimal;
}

.materilas_page_cont_top_img img {
	width: 100%;
	height: 100%;
}

/* Service breadcrumb labels may wrap on narrow screens, including imported nobr. */
@media (max-width: 1024px) {
    .top_banner_slide_left .breadcrumbs_top a {
        display: block;
        min-width: 0;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .top_banner_slide_left .breadcrumbs_top a nobr {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

/* Детальные страницы: один h1 (селекторы в layout привязаны к h2) */
.container.blue_block.breadcrumbs > h1 {
	font-size: 40px;
	width: 60%;
	margin: 0;
	font-weight: inherit;
}

@media (max-width: 1024px) {
	.container.blue_block.breadcrumbs > h1 {
		font-size: 36px;
		width: 100%;
	}
}

@media (max-width: 540px) {
	.container.blue_block.breadcrumbs > h1 {
		font-size: 24px;
	}
}

.doctor_wrap_about h1 {
	font-size: 32px;
	width: 100%;
	padding-bottom: 10px;
	margin: 0 0 20px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.3);
	font-weight: inherit;
}

.materilas_page_cont_top h1 {
	width: 100%;
	margin: 0;
	font-size: 24px;
	font-weight: inherit;
}

/* Banner H1 uses the same class typography and breakpoints as the other slides. */

/*
.materilas_page_cont_top_text ul {
	flex-direction: column;
	padding-left: 0;
}
.materilas_page_cont_top_text ul li {
	margin-bottom: 10px;
}*/

font.tablebodytext {
	display: none;
}
/* Editorial introduction: keep ordinary links inline with the text. */
.container.seo-about-intro a{display:inline;width:auto;padding:0;border:0;background:none;text-decoration:underline}
.container.seo-about-intro p{margin:16px 0}

/* /reviews/: на телефоне вместо сетки вкладок показываем выпадающий список */
@media (max-width: 540px) {
	.review_page .employees_category { display: none; }
	.review_page .employees_category_wrap.mob_show { display: flex; }
}


/* /pricelist/: вкладки разделов прайса */
#priceList .questions_wrap[hidden] {
	display: none;
}


/* Страницы направлений: текст из инфоблока */
.direction-content {
	display: block;
	margin-top: 32px;
	margin-bottom: 32px;
}
.direction-content h2,
.seo-direction-content h2 {
	margin: 32px 0 16px;
}
.direction-content h3,
.seo-direction-content h3 {
	margin: 24px 0 12px;
}
.direction-content p,
.seo-direction-content p {
	margin: 0 0 16px;
}
.direction-content ul,
.direction-content ol,
.seo-direction-content ol {
	display: block;
	padding-left: 24px;
	margin: 0 0 20px;
}
.direction-content ul {
	list-style: disc;
}
.direction-content ol,
.seo-direction-content ol {
	list-style: decimal;
}
.direction-content li,
.seo-direction-content ol li {
	display: list-item;
	margin: 8px 0;
}
.direction-content a {
	text-decoration: underline;
}
.direction-content img,
.seo-direction-content img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 16px 0;
	border-radius: 12px;
}
.direction-content table,
.seo-direction-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 20px;
}
.direction-content td,
.direction-content th,
.seo-direction-content td,
.seo-direction-content th {
	border: 1px solid rgba(0, 0, 0, 0.15);
	padding: 8px;
}
.direction-content blockquote,
.seo-direction-content blockquote {
	margin: 0 0 16px;
	padding-left: 16px;
	border-left: 3px solid rgba(0, 0, 0, 0.2);
}


@media (max-width: 1024px) {
	.clinics .clinics_desc.seo-direction-content {
		box-sizing: border-box;
		padding-left: 20px;
		padding-right: 20px;
	}
}


.direction-content img,
.seo-direction-content img {
	max-width: min(100%, 640px);
}

/* Keep material card actions aligned within each grid row or slider track. */
.materilas_wrap > .materilas_item {
    display: flex;
    flex-direction: column;
}

.materilas_wrap > .materilas_item > :not(.button) {
    flex-shrink: 0;
}

.materilas_wrap > .materilas_item > .button {
    margin-top: auto;
    flex-shrink: 0;
}

/* Карточки материалов: высота кнопки «Подробнее» не должна применяться к ссылке на фото */
.materilas_item .materilas_item_pic a {
	display: block;
	height: 100%;
}

/* Экскурсия на главной: видео заполняет блок целиком */
@media (min-width: 1025px) {
	.excursion_wrap_left {
		padding-bottom: 30px;
	}
	.excursion_wrap_right,
	.contact_right {
		position: relative;
	}
	.excursion_wrap_right > iframe.excursion_wrap_right_video,
	.contact_right > iframe.contact_right_map {
		position: absolute;
		inset: 0;
		display: block;
		box-sizing: border-box;
		width: 100%;
		height: 100%;
		max-width: none;
		max-height: none;
		border: 0;
		transform: none;
	}
}

/* Вторая колонка списка без заголовка: на телефоне и планшете пустую строку не показываем */
@media (max-width: 1024px) {
	.clinik_directions_item_title.is-empty {
		display: none;
	}
}

/* Статьи: таблицы и выделенные врезки из текста инфоблока */
.materilas_page_cont_top_text table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	margin: 8px 0;
	font-size: 18px;
}

.materilas_page_cont_top_text th,
.materilas_page_cont_top_text td {
	border: 1px solid rgba(0, 0, 0, 0.15);
	padding: 10px;
	text-align: left;
	vertical-align: top;
	overflow-wrap: anywhere;
}

.materilas_page_cont_top_text th {
	font-weight: 500;
	background-color: rgba(227, 239, 255, 1);
}

.materilas_page_cont_top_text blockquote {
	margin: 8px 0;
	padding: 15px 20px;
	border-left: 3px solid rgba(60, 142, 254, 1);
	background-color: rgba(227, 239, 255, 1);
	border-radius: 5px;
}

@media (max-width: 540px) {
	.materilas_page_cont_top_text table {
		font-size: 13px;
	}

	.materilas_page_cont_top_text th,
	.materilas_page_cont_top_text td {
		padding: 6px;
	}
}

/* Телефоны и почта внутри текста */
.contact-link,
.materilas_page_cont_top_text a[href^="tel:"],
.materilas_page_cont_top_text a[href^="mailto:"] {
	display: inline;
	color: inherit;
	text-decoration: underline;
}

.questions_item_answer_wrap_desc:has(> .contact-link),
.legal_details_item:has(> .contact-link),
.legal_infomation_title:has(> .contact-link),
.legal_infomation_desc_desc:has(> .contact-link) {
	display: block;
}

/* Иконки с неверным относительным путём в стилях вёрстки */
.feedback .contact_left_info_desc_img img,
.review_send .contact_left_info_desc_img img {
	content: url(img/phone_white.svg);
}

/* Блок терапевта: фото вертикальные, в круге показываем лицо крупно, как в макете */
.therapist .blue_block_right_img {
	background-color: #fff;
}

.therapist .blue_block_right_img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

/* Блок терапевта на телефоне: круги целиком, без обрезки по краям контейнера */
@media (max-width: 540px) {
	.therapist .blue_block_right {
		width: 100%;
		margin: 0;
		overflow: visible;
	}
}

/* Телефон: круги заходят друг на друга на четверть, как на планшете в макете, лица не перекрываются */
@media (max-width: 540px) {
	.therapist .blue_block_right {
		--doctor-card-width: 142px;
		justify-content: flex-start;
	}
}

/* Mobile back-to-top bar: equal space above and below its contents. */
@media (max-width: 540px) {
    body > .up_button {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        column-gap: 10px;
        height: auto;
        min-height: 0;
        box-sizing: border-box;
        padding-top: 12px;
        padding-bottom: 12px;
        align-items: center;
        justify-content: center;
        border-top: 1px solid #fff;
        border-bottom: 1px solid #fff;
    }
    body > .up_button .up_button_img {
        margin: 0;
        flex: 0 0 30px;
    }
    body > .up_button .up_button_text {
        flex: 0 1 auto;
        width: auto;
        min-width: 0;
        margin: 0;
        line-height: 1.2;
        white-space: nowrap;
    }
}

/* Главная: расстояние между двумя кнопками списка врачей. */
#employeesBlock .employees_show_more_wrap {
    margin-bottom: 20px;
}
/* Скрываем вынесенные медиаблоки при открытой модальной форме. */
body.popup-open > iframe.clinic-media-frame {
    visibility: hidden !important;
    pointer-events: none !important;
}
