/* Шапка и главная: тонкая техническая строка, меню каталога, карусель баннеров,
   промо-карточки и блок ближайшей записи.

   Отдельный файл намеренно: общий style.css правят параллельные сессии, а
   header-extra.css отвечает только за ссылки «Врачам/Клиникам» в зелёной шапке.
   Палитра взята из images/rasshifrovka-theme.css — единственного места, где
   цвета сайта записаны явно. */

:root {
	--vr-primary: #006F4A;   /* зелёный шапки */
	--vr-green:   #029363;   /* кнопки и ссылки */
	--vr-accent:  #FF9600;   /* оранжевый акцент */
	--vr-fg:      #333333;
	--vr-fg-soft: #6A6A6A;
	--vr-muted:   #F4F4F4;
	--vr-border:  #DCDEDD;
}

/* ------------------------------------------------------------------ *
 * 1. Тонкая техническая строка над шапкой
 * ------------------------------------------------------------------ */

.topbar {
	background: #00583B;              /* на тон темнее шапки — строка читается как служебная */
	font-size: 13px;
	line-height: 1;
}

.topbar .pagewrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 22px;
}

.topbar a {
	display: inline-flex;
	align-items: center;
	min-height: 32px;                 /* палец попадает, но строка остаётся тонкой */
	color: #BFDDD0;
	text-decoration: none;
	transition: color .2s ease;
}

.topbar a:hover,
.topbar a:focus-visible { color: #FFFFFF; }
.topbar a:focus-visible { outline: 2px solid var(--vr-accent); outline-offset: 2px; }

/* Ссылки «Врачам/Клиникам» и «Расшифровка» переехали в строку и меню —
   в зелёной шапке они только создавали тесноту (по ним и был вопрос). */
header .forowners,
header .ailab { display: none; }

/* ------------------------------------------------------------------ *
 * 2. Меню каталога под шапкой
 * ------------------------------------------------------------------ */

.mainnav {
	background: #FFFFFF;
	border-bottom: 1px solid var(--vr-border);
	position: relative;
	z-index: 5;
}

.mainnav .pagewrap {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 4px;
	overflow-x: auto;                 /* на телефоне меню прокручивается, а не ломает страницу */
	scrollbar-width: none;
}
.mainnav .pagewrap::-webkit-scrollbar { display: none; }

.mainnav a {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	padding: 0 14px;
	white-space: nowrap;
	color: var(--vr-fg);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
	border-bottom: 3px solid transparent;
	transition: color .2s ease, border-color .2s ease;
}

.mainnav a:hover { color: var(--vr-green); border-bottom-color: var(--vr-green); }
.mainnav a:focus-visible { outline: 2px solid var(--vr-green); outline-offset: -2px; }
.mainnav a[aria-current="page"] { color: var(--vr-green); border-bottom-color: var(--vr-green); }

.mainnav .nav-ai b {
	margin-left: 6px;
	padding: 2px 6px;
	border-radius: 4px;
	background: var(--vr-accent);
	color: #FFFFFF;
	font-size: 11px;
	line-height: 1.4;
}

/* ------------------------------------------------------------------ *
 * 3. Карусель баннеров
 * ------------------------------------------------------------------ */

.hero { margin: 0 0 28px; }

.hero-track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	border-radius: 16px;
}
.hero-track::-webkit-scrollbar { display: none; }

.hero-slide {
	position: relative;
	flex: 0 0 100%;
	scroll-snap-align: start;
	min-height: 260px;
	display: flex;
	align-items: center;
	border-radius: 16px;
	overflow: hidden;
	background: #F3FAF6;
	text-decoration: none;
	color: inherit;
}

/* Картинка — фоном справа; текст лежит на пустой левой половине,
   ради которой баннеры и рисовались именно такими. */
.hero-slide img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: right center;
}

.hero-text {
	position: relative;
	z-index: 1;
	max-width: 54%;
	padding: 32px 0 32px 40px;
}

.hero-text h2 {
	margin: 0 0 10px;
	font-size: 34px;
	line-height: 1.15;
	color: #0B2E22;
}

.hero-text p {
	margin: 0 0 20px;
	font-size: 17px;
	line-height: 1.45;
	color: #3C5A50;
}

.hero-cta {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 22px;
	border-radius: 8px;
	background: var(--vr-green);
	color: #FFFFFF;
	font-size: 16px;
	font-weight: 600;
	transition: background .2s ease;
}
.hero-slide:hover .hero-cta { background: var(--vr-primary); }

.hero-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 14px;
}

.hero-dots button {
	width: 32px;
	height: 20px;                    /* видимая точка мелкая, но зона нажатия крупная */
	padding: 8px 6px;
	border: 0;
	background: none;
	cursor: pointer;
	line-height: 0;
}
.hero-dots button span {
	display: block;
	width: 100%;
	height: 4px;
	border-radius: 2px;
	background: #C9D6D0;
	transition: background .2s ease;
}
.hero-dots button[aria-selected="true"] span { background: var(--vr-green); }
.hero-dots button:focus-visible { outline: 2px solid var(--vr-green); outline-offset: 2px; }

.hero-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--vr-border);
	background: rgba(255, 255, 255, .92);
	color: var(--vr-primary);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
}
.hero-arrow:hover { background: #FFFFFF; }
.hero-arrow:focus-visible { outline: 2px solid var(--vr-green); outline-offset: 2px; }
.hero-prev { left: 10px; }
.hero-next { right: 10px; }

.hero-wrap { position: relative; }

/* ------------------------------------------------------------------ *
 * 4. Три промо-карточки
 * ------------------------------------------------------------------ */

.promo-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin-bottom: 32px;
}

.promo-card {
	display: block;
	padding: 22px;
	border-radius: 14px;
	background: var(--vr-muted);
	color: var(--vr-fg);
	text-decoration: none;
	transition: transform .2s ease, box-shadow .2s ease;
}
.promo-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 111, 74, .12); }
.promo-card:focus-visible { outline: 2px solid var(--vr-green); outline-offset: 2px; }

.promo-card .promo-ico {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-bottom: 14px;
	border-radius: 10px;
	background: #FFFFFF;
	color: var(--vr-green);
}
.promo-card .promo-ico svg { width: 22px; height: 22px; }

.promo-card h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.25; }
.promo-card p  { margin: 0 0 14px; font-size: 14px; line-height: 1.45; color: var(--vr-fg-soft); }
.promo-card .promo-more { color: var(--vr-green); font-size: 14px; font-weight: 600; }

/* Первая карточка — про ИИ-расшифровку, она же главный баннер: выделяем цветом */
.promo-card.promo-ai { background: #FFF6E9; }
.promo-card.promo-ai .promo-ico { color: var(--vr-accent); }

/* ------------------------------------------------------------------ *
 * 5. Ближайшая запись к врачу
 * ------------------------------------------------------------------ */

.slots-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 14px;
}
.slots-head h2 { margin: 0; }
.slots-head .slots-all { color: var(--vr-green); font-size: 15px; }

.slots {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 32px;
}

.slot-card {
	display: flex;
	flex-direction: column;
	padding: 16px;
	border: 1px solid var(--vr-border);
	border-radius: 14px;
	background: #FFFFFF;
	color: var(--vr-fg);
	text-decoration: none;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.slot-card:hover { border-color: var(--vr-green); box-shadow: 0 6px 20px rgba(0, 111, 74, .10); }
.slot-card:focus-visible { outline: 2px solid var(--vr-green); outline-offset: 2px; }

.slot-photo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: 12px;
	border-radius: 50%;
	background: #E8F5EF;
	color: var(--vr-primary);
	font-size: 19px;
	font-weight: 600;
	letter-spacing: .5px;
}

.slot-name { font-size: 16px; font-weight: 600; line-height: 1.25; margin-bottom: 4px; }
.slot-spec { font-size: 13px; color: var(--vr-fg-soft); margin-bottom: 10px; }

.slot-when {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	min-height: 28px;
	padding: 0 10px;
	margin-bottom: 10px;
	border-radius: 6px;
	background: #E8F5EF;
	color: var(--vr-primary);
	font-size: 13px;
	font-weight: 600;
}

.slot-clinic { font-size: 13px; color: var(--vr-fg-soft); margin-bottom: 12px; }
.slot-price  { margin-top: auto; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ *
 * 6. Адаптив
 * ------------------------------------------------------------------ */

@media screen and (max-width: 1023px) {
	.slots { grid-template-columns: repeat(2, 1fr); }
	.hero-text h2 { font-size: 26px; }
	.hero-text { max-width: 60%; padding-left: 24px; }
}

@media screen and (max-width: 767px) {
	.promo-cards { grid-template-columns: 1fr; }
	.hero-slide { min-height: 320px; align-items: flex-end; }

	/* На телефоне текст не помещается рядом с картинкой: кладём его вниз,
	   а картинку прижимаем вверх и накрываем градиентом ради контраста. */
	.hero-slide img { object-position: center top; height: 62%; top: 0; bottom: auto; }
	.hero-text {
		max-width: 100%;
		padding: 18px 18px 22px;
		background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #FFFFFF 22%);
		width: 100%;
	}
	.hero-text h2 { font-size: 22px; }
	.hero-text p { font-size: 15px; margin-bottom: 14px; }
	.hero-arrow { display: none; }        /* остаются свайп и точки */
	.topbar { font-size: 12px; }
	.topbar .pagewrap { gap: 0 16px; }
}

@media screen and (max-width: 479px) {
	.slots { grid-template-columns: 1fr; }
}

/* Уважаем системную настройку «меньше движения»: карусель перестаёт
   листаться сама, остаются точки и свайп. */
@media (prefers-reduced-motion: reduce) {
	.hero-track { scroll-behavior: auto; }
	.promo-card, .slot-card, .hero-cta { transition: none; }
}

/* ------------------------------------------------------------------ *
 * 7. Раскладка верха: шапка сайта — position:fixed (style.css, .14)
 *
 * Из-за этого тонкая строка и меню, стоящие в обычном потоке, оказывались
 * ПОД шапкой и были не видны. Поэтому весь верх делаем одной фиксированной
 * стопкой: строка 32 + шапка 60 + меню 48 = 140 px, а контент отодвигаем.
 * Правим только здесь: style.css трогают параллельные сессии.
 * ------------------------------------------------------------------ */

.topbar {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 32px;
	z-index: 999;                     /* выше шапки: у неё z-index 998 */
}

header { top: 32px; }

.mainnav {
	position: fixed;
	top: 92px;                        /* 32 строка + 60 шапка */
	left: 0;
	width: 100%;
	height: 48px;
	z-index: 997;
}

/* Контент начинался с margin-top:80px под 60-пиксельную шапку.
   Теперь над ним 140 px, зазор в 20 px сохраняем. */
.section.first { margin-top: 131px; }

/* Кнопка поиска партнёра висела внутри 60-пиксельной шапки и вылезала
   на меню. Переносим её в правый край строки меню — там пусто. */
header .dd-search-toggle {
	position: absolute;
	right: 0;
	top: 66px;
	margin: 0 !important;
	z-index: 998;
	min-height: 36px;
}

/* Раскрывающийся поиск партнёра тоже уезжал под шапку. */
#dd-search-head-wrap { margin-top: 140px; }

/* Текст баннера налезал на картинку: подкладываем мягкую белую подложку,
   чтобы заголовок читался при любой длине строки. */
@media screen and (min-width: 768px) {
	.hero-text {
		background: linear-gradient(90deg,
			rgba(255, 255, 255, .88) 0%,
			rgba(255, 255, 255, .80) 62%,
			rgba(255, 255, 255, 0) 100%);
		/* Слева место под стрелку — иначе она ложится на вторую строку текста. */
		padding-left: 78px;
		padding-right: 90px;
		border-radius: 16px 0 0 16px;
	}
	.hero-text p { max-width: 90%; }
}

@media screen and (max-width: 1023px) {
	.section.first { margin-top: 121px; }
	.mainnav a { font-size: 14px; padding: 0 11px; }
}

@media screen and (max-width: 767px) {
	/* На телефоне шапка перестраивается, а меню и строка остаются:
	   держим ту же стопку, только компактнее. */
	.topbar { height: 28px; }
	header { top: 28px; }
	.mainnav { top: 88px; height: 44px; }
	.mainnav a { min-height: 44px; }
	.section.first { margin-top: 119px; }
	#dd-search-head-wrap { margin-top: 132px; }
	header .dd-search-toggle { top: 62px; right: 10px; font-size: .8rem; }
}

/* ------------------------------------------------------------------ *
 * 8. Раскрывающиеся блоки (details/summary)
 *
 * Нативные details, а не свой JS: работают с клавиатуры, ищутся
 * встроенным поиском по странице и остаются в разметке для поисковиков.
 * ------------------------------------------------------------------ */

.acc { border-top: 1px solid var(--vr-border); }
.acc:first-of-type { border-top: 0; }

.acc > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 52px;
	padding: 12px 0;
	cursor: pointer;
	list-style: none;
	font-size: 19px;
	font-weight: 600;
	color: var(--vr-fg);
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary:hover { color: var(--vr-green); }
.acc > summary:focus-visible { outline: 2px solid var(--vr-green); outline-offset: 2px; }

/* Стрелка справа: своя, потому что штатный маркер выключен ради выравнивания */
.acc > summary::after {
	content: "";
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	margin-right: 4px;
	border-right: 2px solid var(--vr-green);
	border-bottom: 2px solid var(--vr-green);
	transform: rotate(45deg) translate(-2px, -2px);
	transition: transform .2s ease;
}
.acc[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }

.acc > article,
.acc > .indx_rev,
.acc > ul { padding-bottom: 18px; }

/* Внутри свёрнутого блока заголовки не должны спорить с самим заголовком блока */
.acc article h2 { font-size: 18px; margin-top: 22px; }

@media (prefers-reduced-motion: reduce) {
	.acc > summary::after { transition: none; }
}

/* ------------------------------------------------------------------ *
 * Одна левая граница у всей страницы.
 *
 * Служебная строка, шапка и меню живут в центрированном .pagewrap
 * (max-width 1200), а содержимое — в .section с отступом слева
 * (80px на десктопе, 20 на планшете, 0 на телефоне) плюс padding у .pdng.
 * Из-за этого «Врачам», «Врачи» и заголовок страницы начинались
 * в трёх разных местах.
 *
 * Повторяем отступы содержимого теми же брейкпоинтами, что в style.css:
 * 100 -> 40 -> 20 px. Справа остаётся обычное поле.
 * ------------------------------------------------------------------ */
.topbar .pagewrap,
.mainnav .pagewrap,
header .pagewrap {
	max-width: none;
	margin: 0;
	padding: 0 20px 0 100px;
	box-sizing: border-box;
}

@media screen and (max-width: 1023px) {
	.topbar .pagewrap,
	.mainnav .pagewrap,
	header .pagewrap { padding-left: 40px; }
}

@media screen and (max-width: 767px) {
	.topbar .pagewrap,
	.mainnav .pagewrap,
	header .pagewrap { padding-left: 20px; }
}
