/* =====================================================================
   NCU: шапка во всю ширину + переключатель языков
   Подключается после style.css (см. functions.php → ncu_header_assets)
   ===================================================================== */

:root {
	--ncu-header-gutter: clamp(16px, 3vw, 31px);
}

/* ---------- Переключатель языков ---------- */
.ncu-lang-widget {
	flex: 0 0 auto;
}

.ncu-lang-switcher {
	color: var(--ncu-lang-color, inherit);
	font-family: 'Montserrat', sans-serif;
	white-space: nowrap;
}

.ncu-lang-switcher.is-front {
	color: #ffffff;
}

.ncu-lang-switcher ul {
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ncu-lang-switcher li {
	display: flex;
	align-items: center;
	float: none;
	margin: 0;
	padding: 0;
	line-height: 1;
	list-style: none;
}

/* вертикальный разделитель между языками */
.ncu-lang-switcher li + li::before {
	content: "";
	display: block;
	width: 1px;
	height: 1.25em;
	margin: 0 0.9em;
	background: currentColor;
	opacity: 0.5;
}

.ncu-lang-switcher a {
	display: block;
	padding: 4px 0 3px;
	color: inherit;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: opacity .2s ease, border-color .2s ease;
	color: #ffffff;
}

.ncu-lang-switcher a:hover,
.ncu-lang-switcher a:focus {
	color: inherit;
	border-bottom-color: currentColor;
}

.ncu-lang-switcher .is-current a {
	border-bottom-color: currentColor;
	cursor: default;
}

/* ---------- Шапка во всю ширину (планшет и десктоп) ---------- */
@media screen and (min-width: 768px) {
	#header-text-nav-container > .inner-wrap,
	#header-text-nav-container .bottom-menu > .inner-wrap {
		width: 100%;
		max-width: 1280px;
		margin-left: auto;
		margin-right: auto;
		padding-left: var(--ncu-header-gutter);
		padding-right: var(--ncu-header-gutter);
		box-sizing: border-box;
	}

	/* то же для flex-меню: clearfix-«хвост» сдвигал последний пункт влево */
	.bottom-menu .menu-primary-container > ul::before,
	.bottom-menu .menu-primary-container > ul::after {
		display: none;
	}

	#header-text-nav-wrap {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: clamp(24px, 3vw, 64px);
		padding-bottom: 8px;
		border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	}

	.spacious-header-display-four .bottom-menu {
		padding-top: 4px;
	}

	/* clearfix-псевдоэлементы во flex-контейнерах становятся лишними
	   flex-элементами и «съедают» место справа */
	#header-text-nav-wrap::before,
	#header-text-nav-wrap::after,
	#header-right-sidebar::before,
	#header-right-sidebar::after {
		display: none;
	}

	#header-left-section {
		display: flex;
		flex: 0 0 auto;
		float: none;
		margin: 0;
	}

	#header-right-section {
		flex: 1 1 auto;
		float: none;
		width: auto;
		min-width: 0;
	}

	#header-right-sidebar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 24px;
		width: 100%;
		min-width: 0;
	}

	#header-right-section #header-right-sidebar .widget {
		margin: 0;
		padding: 0;
	}

	#header-right-section .headercta {
		min-width: 0;
		max-width: none;
	}
}

/* Планшеты и узкие ноутбуки: чтобы всё поместилось,
   у кнопки WhatsApp остаётся только иконка */
@media screen and (min-width: 768px) and (max-width: 1279px) {
	#header-right-sidebar {
		gap: 16px;
	}

	#header-right-section .head-phones {
		min-width: 0;
	}

	#header-right-section .head-phones a {
		font-size: 16px;
		white-space: nowrap;
	}

	#header-right-section .headercta a {
		font-size: 0;
	}

	#header-right-section .headercta img {
		display: block;
		width: 36px;
		height: 36px;
		max-width: none;
		margin: 0;
	}

	.ncu-lang-switcher li + li::before {
		margin: 0 0.7em;
	}
}

/* Планшеты: виджеты шапки переносятся на вторую строку */
@media screen and (min-width: 768px) and (max-width: 980px) {
	#header-text-nav-wrap {
		gap: 16px;
	}

	#header-right-sidebar {
		flex-wrap: wrap;
		justify-content: flex-end;
		column-gap: 20px;
		row-gap: 6px;
	}

	#header-right-section .head-phones a {
		font-size: 14px;
	}
}

/* ---------- Мобильная шапка ---------- */
@media screen and (max-width: 767px) {
	#header-text-nav-container {
		position: relative;
	}

	/* переключатель — в правом нижнем углу шапки, под иконкой меню */
	.better-responsive-menu #header-text-nav-wrap #header-right-section .widget.ncu-lang-widget {
		display: block;
		position: absolute;
		right: 12px;
		bottom: 4px;
		margin: 0;
		padding: 0;
	}

	.ncu-lang-switcher a {
		font-size: 13px;
		padding: 2px 0 1px;
	}

	.ncu-lang-switcher li + li::before {
		margin: 0 0.6em;
	}
}
