/* Мега-меню «Услуги» — выпадает из шапки, шапка остаётся кликабельной */

.header.header--mega-open {
	z-index: 200;
}

/* Старое hover-подменю не используем — только .header-mega (десктоп) */
.header__menu-item--services-mega > .header__menu-item-submenu {
	display: none;
}

.header__menu-item--services-mega.is-open > a::after,
.header__menu-item--services-mega.is-open > .js-services-mega-trigger::after {
	transform: rotate(180deg);
}

.header-mega {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 1;
}

.header.header--mega-open .header-mega {
	display: block;
}

.header.header--mega-open .header__top,
.header.header--mega-open .header__bottom {
	position: relative;
	z-index: 3;
	background: #fff;
}

.header-mega__backdrop {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	top: var(--header-mega-backdrop-top, var(--header-height, 120px));
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(26, 26, 26, 0.25);
	cursor: pointer;
	z-index: 0;
}

.header-mega__panel {
	position: relative;
	z-index: 1;
	background: #fff;
	border-top: 1px solid #e8e8e8;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

.header-mega__container {
	padding-top: 20px;
	padding-bottom: 24px;
}

.header-mega__layout {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}

.header-mega__tabs {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.header-mega__tab {
	display: block;
	width: 100%;
	text-align: left;
	border: 0;
	background: transparent;
	border-radius: 8px;
	padding: 11px 14px;
	font: inherit;
	font-size: 15px;
	line-height: 1.35;
	color: #1a1a1a;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.header-mega__tab:hover,
.header-mega__tab.is-active {
	background: #e8f6f3;
	color: #208d79;
}

.header-mega__promo {
	margin-top: 20px;
	padding: 14px;
	border-radius: 12px;
	background: #f3faf8;
}

.header-mega__promo-title {
	font-size: 14px;
	font-weight: 700;
	margin: 0 0 8px;
}

.header-mega__promo-text {
	font-size: 13px;
	line-height: 1.45;
	color: #666;
	margin: 0 0 8px;
}

.header-mega__promo-tel {
	font-size: 16px;
	font-weight: 700;
	color: #208d79;
	text-decoration: none;
}

.header-mega__content {
	position: relative;
	min-width: 0;
}

.header-mega__section {
	display: none;
}

.header-mega__section.is-active {
	display: block;
}

.header-mega__section[hidden] {
	display: none;
}

.header-mega__title {
	margin: 0 0 14px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #1a1a1a;
}

.header-mega__scroll {
	margin: 0;
}

.header-mega__scroll--on {
	max-height: 272px;
	overflow-x: hidden;
	overflow-y: scroll;
	padding-right: 8px;
	margin-bottom: 2px;
	scrollbar-width: thin;
	scrollbar-color: #208d79 #e8f6f3;
}

.header-mega__scroll--on::-webkit-scrollbar {
	width: 8px;
}

.header-mega__scroll--on::-webkit-scrollbar-track {
	background: #e8f6f3;
	border-radius: 4px;
}

.header-mega__scroll--on::-webkit-scrollbar-thumb {
	background: #208d79;
	border-radius: 4px;
}

.header-mega__links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 4px 20px;
}

.header-mega__link {
	display: block;
	padding: 6px 0;
	font-size: 14px;
	line-height: 1.4;
	color: #1a1a1a;
	text-decoration: none;
}

.header-mega__link:hover {
	color: #208d79;
}

.header-mega__more {
	display: inline-block;
	margin-top: 10px;
	padding: 4px 0 2px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	color: #208d79;
	text-decoration: none;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
}

.header-mega__empty {
	margin: 0;
	font-size: 14px;
	color: #666;
}

@media (max-width: 1071px) {
	/* На мобилке — аккордеон в зелёном drawer, не нижний sheet */
	.header-mega {
		display: none !important;
	}

	.header.header--mega-open .header-mega {
		display: none !important;
	}

	.header__dropdown .header-mega-mob-drawer,
	.header__bottom-menu .header-mega-mob-drawer {
		display: none;
		padding: 0 0 8px;
	}

	.header__dropdown .header__menu-item--services-mega.is-open > .header-mega-mob-drawer,
	.header__bottom-menu .header__menu-item--services-mega.is-open > .header-mega-mob-drawer,
	.header__dropdown .js-services-mega-trigger.active + .header-mega-mob-drawer,
	.header__bottom-menu .js-services-mega-trigger.active + .header-mega-mob-drawer {
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
		height: auto !important;
		overflow: visible !important;
		pointer-events: auto !important;
	}

	.header-mega-mob__panel[aria-hidden="true"] {
		display: none;
	}

	.header-mega-mob__section + .header-mega-mob__section {
		border-top: 1px solid rgba(255, 255, 255, 0.15);
	}

	.header-mega-mob__toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		border: 0;
		background: transparent;
		color: #fff;
		font: inherit;
		font-size: 16px;
		font-weight: 600;
		line-height: 1.35;
		text-align: left;
		padding: 12px var(--wrap-p, 15px) 12px 28px;
		cursor: pointer;
	}

	.header-mega-mob__toggle::after {
		content: "";
		width: 8px;
		height: 8px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: rotate(45deg);
		transition: transform 0.2s ease;
		flex-shrink: 0;
		margin-left: 12px;
	}

	.header-mega-mob__toggle.active::after {
		transform: rotate(-135deg);
	}

	.header-mega-mob__panel {
		padding: 0 var(--wrap-p, 15px) 12px 28px;
	}

	.header-mega-mob__heading {
		margin: 0 0 10px;
		font-size: 12px;
		font-weight: 700;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: rgba(255, 255, 255, 0.75);
	}

	.header-mega-mob__links {
		list-style: none;
		margin: 0;
		padding: 0;
		max-height: 45vh;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
		scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
	}

	.header-mega-mob__link {
		display: block;
		padding: 8px 0;
		font-size: 15px;
		line-height: 1.35;
		color: #fff;
		text-decoration: none;
		opacity: 0.95;
	}

	.header-mega-mob__link:hover {
		opacity: 1;
		text-decoration: underline;
	}

	.header-mega-mob__more {
		display: inline-block;
		margin-top: 10px;
		font-size: 14px;
		font-weight: 700;
		color: #fff;
		text-decoration: underline;
	}

	.header-mega-mob__empty {
		margin: 0;
		font-size: 14px;
		color: rgba(255, 255, 255, 0.8);
	}
}

@media (min-width: 1072px) {
	/* Мобильный аккордеон в шапке не показываем на ПК */
	.header__bottom-menu .header__menu-item--services-mega .header-mega-mob-drawer {
		display: none !important;
	}

	.header-mega__panel {
		max-height: none;
	}

	/* Одинаковая компактная высота блока ссылок (чек-апы и капельницы) */
	.header-mega__scroll {
		max-height: 272px;
		overflow-x: hidden;
		overflow-y: auto;
		padding-right: 8px;
		scrollbar-width: thin;
		scrollbar-color: #208d79 #e8f6f3;
	}

	.header-mega__scroll::-webkit-scrollbar {
		width: 8px;
	}

	.header-mega__scroll::-webkit-scrollbar-track {
		background: #e8f6f3;
		border-radius: 4px;
	}

	.header-mega__scroll::-webkit-scrollbar-thumb {
		background: #208d79;
		border-radius: 4px;
	}

	.header-mega-mob-drawer {
		display: none !important;
	}

	/* main.css: hover на .header__menu-item-submenu — не для «Услуги» */
	.header__bottom-menu .header__menu-item--services-mega:hover > .header__menu-item-submenu,
	.header__bottom-menu .header__menu-item--services-mega > .header__menu-item-submenu {
		display: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		pointer-events: none !important;
	}
}
