/* Мегаменю «Що ми лікуємо» (inc/npc-menu.php) + мобільне меню. Стиль узгоджено з новими сторінками */
.npc-mm {
	--npc-green: #007a53;
	--npc-green-dark: #00653f;
	--npc-ink: #2b2b2b;
	--npc-muted: #6b6b6b;
	--npc-line: #e6e6e6;
	--npc-tint: #f4f8f6;
}
.npc-mm *, .npc-mcta * { box-sizing: border-box; }
.npc-mm__trigger { position: relative; }
.npc-mm ul { list-style: none; margin: 0; padding: 0; }
.npc-mm li::before { display: none; content: none; }
.top_mnu .npc-mm__panel li { display: block; margin: 0; padding: 0; border: 0; min-height: 0; }

/* Посилання-пункт */
.top_mnu .npc-mm .npc-mm__link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 14px;
	color: var(--npc-ink);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	text-align: left;
	text-decoration: none;
	transition: background .15s ease, color .15s ease;
}
.top_mnu .npc-mm .npc-mm__link:hover,
.top_mnu .npc-mm .npc-mm__link:focus-visible,
.top_mnu .npc-mm .npc-mm__link.is-current { background: var(--npc-tint); color: var(--npc-green); }
.npc-mm__icon {
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--npc-tint);
	color: var(--npc-green);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease, color .15s ease;
}
.npc-mm__link:hover .npc-mm__icon,
.npc-mm__link:focus-visible .npc-mm__icon,
.npc-mm__link.is-current .npc-mm__icon { background: var(--npc-green); color: #fff; }
.npc-mm__label { flex: 1 1 auto; min-width: 0; }
.npc-mm__arrow {
	flex: 0 0 auto;
	display: inline-flex;
	color: var(--npc-green);
	opacity: 0;
	transform: translate(-4px, 4px);
	transition: opacity .15s ease, transform .15s ease;
}
.npc-mm__link:hover .npc-mm__arrow,
.npc-mm__link:focus-visible .npc-mm__arrow { opacity: 1; transform: none; }

.npc-mm__gtitle {
	margin: 0 0 8px;
	padding: 0 12px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-align: left;
	color: var(--npc-muted);
}

/* Кнопки (спільні для мегаменю і мобільного блоку) */
.top_mnu .npc-mm .npc-mm__btn,
.npc-mcta .npc-mm__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 48px;
	padding: 12px 18px;
	border-radius: 999px;
	background: var(--npc-green, #007a53);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background .2s ease;
}
.top_mnu .npc-mm .npc-mm__btn:hover,
.npc-mcta .npc-mm__btn:hover { background: #00653f; color: #fff; text-decoration: none; }
.top_mnu .npc-mm .npc-mm__phone,
.npc-mcta .npc-mm__phone {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	padding: 10px 18px;
	border: 1px solid #dcdcdc;
	border-radius: 999px;
	background: #fff;
	color: #2b2b2b;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}
.top_mnu .npc-mm .npc-mm__phone:hover,
.npc-mcta .npc-mm__phone:hover { border-color: #007a53; color: #007a53; text-decoration: none; }
.npc-mm__phone svg { color: #007a53; }

/* ================= Десктоп ================= */
@media (min-width: 992px) {
	.top_mnu > li.npc-mm { position: static; }
	.npc-mm__panel {
		position: absolute;
		z-index: 100;
		top: 100%;
		right: 0;
		width: 120%; /* на всю ширину рядка шапки: колонка меню — 10/12 рядка */
		display: grid;
		grid-template-columns: minmax(0, 1fr) 290px;
		gap: 28px;
		padding: 28px;
		background: #fff;
		border: 1px solid var(--npc-line);
		border-radius: 24px;
		box-shadow: 0 24px 60px rgba(0, 0, 0, .14);
		text-align: left;
		opacity: 0;
		visibility: hidden;
		transform: translateY(8px);
		transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
	}
	.npc-mm.is-open .npc-mm__panel {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: opacity .18s ease, transform .18s ease, visibility 0s;
	}
	/* «Місток», щоб меню не закривалось, поки курсор іде від пункту до панелі */
	.npc-mm.is-open .npc-mm__panel::before {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		top: -28px;
		height: 28px;
	}
	.npc-mm__groups {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 8px 20px;
		align-content: start;
	}
	.npc-mm__list { display: grid; gap: 2px; }
	.npc-mm__aside {
		display: flex;
		flex-direction: column;
		align-self: start;
		gap: 10px;
		padding: 22px;
		background: var(--npc-tint);
		border-radius: 18px;
		text-align: left;
	}
	.npc-mm__aside-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--npc-ink); }
	.npc-mm__aside-text { margin: 0 0 6px; font-size: 14px; font-weight: 400; line-height: 1.55; color: var(--npc-muted); }
	.top_mnu .npc-mm .npc-mm__all {
		margin-top: 4px;
		padding-top: 6px;
		font-size: 14px;
		font-weight: 600;
		color: var(--npc-green);
		text-align: center;
	}
	.npc-mcta { display: none; }
}
@media (min-width: 992px) and (max-width: 1199px) {
	.npc-mm__panel { grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; padding: 22px; }
	.npc-mm__groups { gap: 8px 12px; }
	.top_mnu .npc-mm .npc-mm__link { font-size: 14px; padding: 8px 10px; gap: 10px; }
	.npc-mm__icon { flex-basis: 34px; width: 34px; height: 34px; }
}

/* Кнопка «Назад» і посилання «Перейти до розділу» — лише в мобільному меню */
.npc-drill-back, .npc-drill-all { display: none; }

/* ================= Мобільний / планшет: багаторівневе меню ================= */
@keyframes npcDrillIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes npcDrillBack { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }

@media (max-width: 991px) {
	.mnu_phone {
		height: calc(100vh - 60px) !important;
		height: calc(100dvh - 60px) !important;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
		background: #fff !important;
		padding-bottom: 24px;
	}

	/* Пошук нагорі */
	.mnu_phone .search_mnu {
		position: relative;
		margin: 0;
		padding: 16px 20px 8px;
		text-align: left;
	}
	.mnu_phone .search_mnu > img { position: absolute; left: 36px; top: 31px; width: 18px; height: 18px; opacity: .55; z-index: 1; }
	.mnu_phone .search_mnu form { display: block; width: 100%; margin: 0; }
	.mnu_phone .search_mnu input[type="text"],
	.mnu_phone .search_mnu input[type="search"] {
		width: 100%;
		height: 48px;
		margin: 0;
		padding: 0 16px 0 46px;
		background: #f4f4f4;
		border: 1px solid transparent;
		border-radius: 999px;
		font-family: 'Open Sans', sans-serif;
		font-size: 16px;
		color: #2b2b2b;
		outline: none;
		text-align: left;
	}
	.mnu_phone .search_mnu input:focus { background: #fff; border-color: #007a53; box-shadow: 0 0 0 3px rgba(0, 122, 83,.15); }
	.mnu_phone .phones { display: none !important; }

	/* Крок 1: список розділів */
	.mnu_phone .top_mnu {
		margin: 0;
		padding: 4px 0 0;
		background: #fff;
		text-align: left;
	}
	.mnu_phone .top_mnu li { background: transparent !important; }
	.mnu_phone .top_mnu > li {
		display: block;
		margin: 0;
		padding: 0;
		border: 0 !important;
		border-bottom: 1px solid #ececec !important;
		text-align: left;
	}
	.mnu_phone .top_mnu > li > a {
		position: relative;
		display: flex;
		align-items: center;
		min-height: 56px;
		padding: 14px 52px 14px 20px;
		font-size: 17px;
		font-weight: 600;
		line-height: 1.35;
		text-align: left;
		color: #2b2b2b;
	}
	/* Шеврон: для розділів із підпунктами — «вправо» (перехід на наступний крок) */
	.mnu_phone .top_mnu > li > a::before { display: none !important; }
	.mnu_phone .top_mnu > li.npc-drill-parent > a:not(.npc-drill-all)::after {
		content: "";
		position: absolute;
		right: 22px;
		top: 50%;
		width: 9px;
		height: 9px;
		margin-top: -5px;
		border-right: 2px solid #007a53;
		border-top: 2px solid #007a53;
		transform: rotate(45deg);
	}
	.mnu_phone .top_mnu .sub-menu,
	.mnu_phone .npc-mm__panel { display: none !important; }

	/* Крок 2: відкритий розділ на весь екран меню */
	.mnu_phone.npc-drill .search_mnu { display: none; }
	.mnu_phone.npc-drill .top_mnu > li:not(.is-open) { display: none; }
	.mnu_phone.npc-drill .top_mnu > li.is-open {
		border-bottom: 0 !important;
		animation: npcDrillIn .22s ease;
	}
	.mnu_phone:not(.npc-drill) .top_mnu { animation: npcDrillBack .2s ease; }
	.mnu_phone.npc-drill .npc-drill-back {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		margin: 12px 0 0 12px;
		padding: 8px 10px;
		border: 0;
		border-radius: 10px;
		background: none;
		font-family: 'Open Sans', sans-serif;
		font-size: 15px;
		font-weight: 600;
		color: #007a53;
		cursor: pointer;
	}
	.mnu_phone.npc-drill .npc-drill-back span { font-size: 22px; line-height: 1; margin-top: -2px; }
	.mnu_phone.npc-drill .top_mnu > li.is-open > a:not(.npc-drill-all) {
		min-height: 0;
		padding: 4px 20px 2px;
		font-size: 24px;
		font-weight: 700;
		color: #2b2b2b;
	}
	.mnu_phone.npc-drill .top_mnu > li.is-open > a::after { display: none; }
	.mnu_phone .top_mnu > li > a.npc-drill-all { display: none; }
	.mnu_phone.npc-drill .top_mnu > li.is-open > a.npc-drill-all {
		display: inline-block;
		min-height: 0;
		padding: 0;
		margin: 0 20px 12px;
		font-size: 14px;
		font-weight: 600;
		color: #007a53;
	}

	/* Пункти «Що ми лікуємо» */
	.mnu_phone.npc-drill .npc-mm.is-open .npc-mm__panel { display: block !important; padding: 0 12px 8px; }
	.npc-mm__group + .npc-mm__group { margin-top: 14px; }
	.npc-mm__gtitle { margin: 6px 0 4px; }
	.top_mnu .npc-mm .npc-mm__link { padding: 10px 8px; font-size: 16px; }
	.npc-mm__arrow { display: none; }
	.npc-mm__aside { display: none; }

	/* Пункти звичайних підменю («Інформація для пацієнтів») */
	.mnu_phone.npc-drill .top_mnu > li.is-open > .sub-menu {
		display: block !important;
		position: static;
		opacity: 1;
		visibility: visible;
		margin: 0;
		padding: 0 0 8px;
		background: none;
		box-shadow: none;
	}
	.mnu_phone.npc-drill .sub-menu > li { margin: 0 !important; padding: 0; border-bottom: 1px solid #ececec; }
	.mnu_phone.npc-drill .sub-menu > li > a {
		position: relative;
		display: block;
		padding: 15px 44px 15px 20px;
		font-size: 16px;
		font-weight: 600;
		line-height: 1.4;
		color: #2b2b2b;
		text-align: left;
	}
	.mnu_phone.npc-drill .sub-menu > li > a::after {
		content: "";
		position: absolute;
		right: 22px;
		top: 50%;
		width: 8px;
		height: 8px;
		margin-top: -4px;
		border-right: 2px solid #b5b5b5;
		border-top: 2px solid #b5b5b5;
		transform: rotate(45deg);
	}

	/* Блок запису і телефону */
	.npc-mcta {
		display: grid;
		gap: 10px;
		padding: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mnu_phone .top_mnu, .mnu_phone .top_mnu > li { animation: none !important; }
}

/* ================= Мобільна смуга «Відгуки / Записатися» під шапкою ================= */
.npc-ti-short { display: none; }
.npc-abar { display: none; }

@media (max-width: 991px) {
	.header .top_info {
		display: flex !important;
		gap: 8px;
		margin: 60px 0 0 !important; /* під фіксованою зеленою смугою з логотипом (60px) */
		padding: 10px 15px;
		background: #fff;
		border-bottom: 1px solid #ececec;
	}
	.header .top_info::before,
	.header .top_info::after { display: none; }
	.header .top_info > li:nth-of-type(3),
	.header .top_info > li:nth-of-type(4) {
		display: block !important;
		flex: 1 1 0;
		width: auto !important;
		min-width: 0;
		height: auto;
		margin: 0 !important;
		padding: 0 !important;
		border: 0 !important;
		background: none !important;
		float: none !important;
	}
	.header .top_info > li:nth-of-type(4) { order: -1; } /* «Записатися» першою */
	.header .top_info > li:nth-of-type(3) > a,
	.header .top_info > li:nth-of-type(4) > a {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		height: 44px;
		padding: 0 12px;
		border-radius: 999px;
		font-family: 'Open Sans', sans-serif;
		font-size: 15px;
		font-weight: 600;
		line-height: 1;
		text-decoration: none;
		white-space: nowrap;
	}
	.header .top_info > li:nth-of-type(4) > a { background: #007a53; color: #fff; }
	.header .top_info > li:nth-of-type(4) > a:active { background: #00653f; }
	.header .top_info > li:nth-of-type(3) > a { background: #fff; border: 1px solid #dcdcdc; color: #2b2b2b; }
	.header .top_info > li:nth-of-type(3) > a span,
	.header .top_info > li:nth-of-type(4) > a span { color: inherit !important; font-size: inherit; display: none; }
	.header .top_info > li > a .npc-ti-short { display: inline !important; }
	.header .top_info > li:nth-of-type(3) img,
	.header .top_info > li:nth-of-type(4) img {
		position: static !important;
		width: 18px !important;
		height: 18px !important;
		margin: 0 !important;
		transform: none !important;
		object-fit: contain;
	}
	.header .top_info > li:nth-of-type(4) img { filter: brightness(0) invert(1); }

	/* Нижня панель швидких дій */
	.npc-abar {
		position: fixed;
		z-index: 1000;
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		gap: 8px;
		padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
		background: rgba(255, 255, 255, .97);
		border-top: 1px solid #e3e3e3;
		box-shadow: 0 -6px 20px rgba(0, 0, 0, .08);
		transform: translateY(110%);
		transition: transform .25s ease;
	}
	.npc-abar.is-visible { transform: none; }
	body.npc-abar-on { padding-bottom: 76px; }
	.npc-abar a {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		height: 48px;
		border-radius: 999px;
		font-family: 'Open Sans', sans-serif;
		font-size: 15px;
		font-weight: 600;
		line-height: 1.1;
		text-decoration: none;
		text-align: center;
	}
	.npc-abar__call { flex: 0 0 auto; padding: 0 18px; border: 1px solid #dcdcdc; background: #fff; color: #2b2b2b; }
	.npc-abar__call svg { color: #007a53; }
	.npc-abar__book { flex: 1 1 auto; min-width: 0; padding: 0 14px; background: #007a53; color: #fff; }
	.npc-abar a:hover, .npc-abar a:focus { text-decoration: none; }
	.npc-abar__book:hover, .npc-abar__book:focus { color: #fff; }
	.npc-abar__call:hover, .npc-abar__call:focus { color: #2b2b2b; }
}
@media (max-width: 359px) {
	.npc-abar__call span { display: none; } /* на дуже вузьких екранах — лише іконка */
}
@media (prefers-reduced-motion: reduce) {
	.npc-abar { transition: none; }
}

/* ================= Десктоп: випадаюче підменю («Інформація для пацієнтів» тощо) ================= */
.npc-sub-all { display: none; }
@media (min-width: 992px) {
	.top_mnu > li.menu-item-has-children { position: relative; }
	.top_mnu > li.menu-item-has-children > .sub-menu {
		left: 50% !important;
		top: 100% !important;
		width: 320px !important;
		margin: 0;
		padding: 10px !important;
		list-style: none;
		background: #fff;
		border: 1px solid #e6e6e6;
		border-radius: 18px;
		box-shadow: 0 20px 48px rgba(0, 0, 0, .14) !important;
		text-align: left;
		transform: translate(-50%, 8px);
		transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
	}
	.top_mnu > li.menu-item-has-children:hover > .sub-menu,
	.top_mnu > li.menu-item-has-children:focus-within > .sub-menu {
		opacity: 1;
		visibility: visible;
		z-index: 100;
		transform: translate(-50%, 0);
		transition: opacity .18s ease, transform .18s ease, visibility 0s;
	}
	/* «Місток», щоб підменю не закривалось, поки курсор іде до нього */
	.top_mnu > li.menu-item-has-children > .sub-menu::before {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		top: -22px;
		height: 22px;
	}
	.top_mnu > li.menu-item-has-children > .sub-menu > li {
		display: block;
		margin: 0 !important;
		padding: 0;
		border: 0;
		min-height: 0;
	}
	.top_mnu > li.menu-item-has-children > .sub-menu > li > a {
		position: relative;
		display: block;
		width: 100%;
		padding: 11px 40px 11px 14px;
		border-radius: 12px;
		font-size: 15px;
		font-weight: 600;
		line-height: 1.4;
		color: #2b2b2b;
		text-align: left;
		text-decoration: none;
		transition: background .15s ease, color .15s ease;
	}
	.top_mnu > li.menu-item-has-children > .sub-menu > li > a::after {
		content: "";
		position: absolute;
		right: 16px;
		top: 50%;
		width: 7px;
		height: 7px;
		margin-top: -4px;
		border-right: 2px solid #007a53;
		border-top: 2px solid #007a53;
		transform: rotate(45deg);
		opacity: 0;
		transition: opacity .15s ease, right .15s ease;
	}
	.top_mnu > li.menu-item-has-children > .sub-menu > li > a:hover,
	.top_mnu > li.menu-item-has-children > .sub-menu > li > a:focus-visible,
	.top_mnu > li.menu-item-has-children > .sub-menu > li.current-menu-item > a {
		background: #f4f8f6;
		color: #007a53;
	}
	.top_mnu > li.menu-item-has-children > .sub-menu > li > a:hover::after,
	.top_mnu > li.menu-item-has-children > .sub-menu > li > a:focus-visible::after { opacity: 1; right: 13px; }
	/* Посилання на сторінку розділу внизу підменю */
	.top_mnu .sub-menu > li.npc-sub-all {
		display: block;
		margin-top: 6px !important;
		padding-top: 6px;
		border-top: 1px solid #ececec;
	}
	.top_mnu .sub-menu > li.npc-sub-all > a { color: #007a53 !important; font-size: 14px !important; }
	.top_mnu .sub-menu > li.npc-sub-all > a::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.top_mnu > li.menu-item-has-children > .sub-menu { transition: none; }
}
