/* ============================================
   Header Component - Lebedev Industrial Style
   ============================================ */

/* Base Header Styles */
.site-header-lebedev {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 1000;
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(15px);
	-webkit-backdrop-filter: blur(15px);
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
	height: 70px;
	min-height: 70px;
	display: flex;
	align-items: center; /* центрируем содержимое по вертикали */
	box-shadow: none;
	margin: 0;
	padding: 0;
}

/* Шапка всегда фиксирована на всех страницах */
.home-page .site-header-lebedev,
body:not(.home-page) .site-header-lebedev {
	position: fixed;
}

.header-wrapper {
	/* Внутренняя обёртка высотой в шапку.
	   На внутренних страницах задаёт высоту header,
	   на главной внешний отступ решается через padding у body и margin у hero. */
	height: 70px;
	width: 100%;
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
}

/* Вспомогательная обёртка внутри header, выравниваем по всей ширине и по вертикали */
.header-inner {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Переопределяем стили .container для шапки */
.container.header-container,
.header-container {
	/* Единая сетка для всех страниц: центрируем и ограничиваем ширину */
	height: 100% !important;
	max-width: 1200px !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 20px !important;
	display: flex !important;
	align-items: center !important; /* Центрируем по вертикали */
	/* Все элементы по центру */
	justify-content: center !important;
	gap: 32px !important;
	flex-wrap: nowrap !important;
	box-sizing: border-box !important;
}

/* Logo */
.header-logo {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	height: 100%;
	order: 1;
}

.header-logo img {
	height: 55px;
	width: auto;
	display: block;
	object-fit: contain;
}

/* Navigation */
.header-nav {
	display: flex;
	align-items: center;
	gap: 32px;
	flex-shrink: 0;
	justify-content: center;
	order: 2;
}

/* Navigation Links */
.nav-link {
	position: relative;
	font-family: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
	font-weight: 600;
	font-size: 14px;
	line-height: 1; /* чтобы не было лишнего места снизу */
	color: #1a1a1a;
	text-decoration: none;
	padding: 8px 0;
	transition: color 0.2s ease;
	white-space: nowrap;
}

.nav-link::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0;
	height: 2px;
	background-color: #1F4078;
	transition: width 0.3s ease;
}

.nav-link:hover {
	color: #1a1a1a;
	opacity: 0.7;
}

.nav-link:hover::after {
	width: 100%;
}

/* Dropdown */
.nav-dropdown {
	position: relative;
}

.nav-link-dropdown {
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	background: none;
	border: none;
	padding: 8px 0;
	font-family: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
	font-weight: 600;
	font-size: 14px;
	line-height: 1;
	color: #1a1a1a;
	transition: color 0.2s ease;
}

.nav-link-dropdown::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0;
	height: 2px;
	background-color: #1F4078;
	transition: width 0.3s ease;
}

.nav-link-dropdown:hover {
	color: #1a1a1a;
	opacity: 0.7;
}

.nav-link-dropdown:hover::after {
	width: 100%;
}

.nav-chevron {
	transition: transform 0.3s ease;
	flex-shrink: 0;
	pointer-events: all;
}

.nav-dropdown:hover .nav-chevron {
	transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
	position: absolute;
	top: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%);
	width: 240px;
	background: #ffffff;
	border-radius: 12px;
	padding: 8px 0;
	opacity: 0;
	visibility: hidden;
	transform: translateX(-50%) translateY(-8px);
	transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

@media (min-width: 1024px) {
	.dropdown-menu {
		box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
	}
}

.nav-link-dropdown[aria-expanded="true"] + .dropdown-menu {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

/* rotate chevron only when expanded via aria-expanded attribute */
.nav-link-dropdown[aria-expanded="true"] .nav-chevron {
	transform: rotate(180deg);
}

/* animate dropdown links when menu is opened */
.dropdown-menu .dropdown-link {
	display: block;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 260ms ease, transform 260ms ease;
}
.nav-link-dropdown[aria-expanded="true"] + .dropdown-menu .dropdown-link {
	opacity: 1;
	transform: translateY(0);
}

/* also show dropdown on hover (visual only) - chevron rotation still controlled by aria-expanded */
.nav-dropdown:hover .dropdown-menu {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.nav-dropdown:hover .dropdown-link {
	opacity: 1;
	transform: translateY(0);
}

.dropdown-link {
	display: block;
	padding: 12px 24px;
	font-family: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
	font-weight: 400;
	font-size: 14px;
	line-height: 1.4;
	color: #333333;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
	position: relative;
}

.dropdown-link:first-child {
	padding-top: 12px;
}

.dropdown-link:last-child {
	padding-bottom: 12px;
}

.dropdown-link::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 24px;
	right: 24px;
	width: 0;
	height: 2px;
	background-color: #1F4078;
	transition: width 0.3s ease;
}

.dropdown-link:hover {
	background-color: rgba(0, 0, 0, 0.02);
	color: #333333;
}

.dropdown-link:hover::after {
	width: calc(100% - 48px);
}

/* Right Side */
.header-right {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	order: 3;
}

.header-phone {
	font-family: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
	font-weight: 700;
	font-size: 16px;
	line-height: 1;
	color: #1F4078;
	text-decoration: none;
	transition: opacity 0.2s ease;
	white-space: nowrap;
}

.header-phone:hover {
	opacity: 0.8;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	background: none;
	border: none;
	padding: 8px;
	cursor: pointer;
	width: 32px;
	height: 32px;
	justify-content: center;
	align-items: center;
}

.mobile-menu-toggle span {
	display: block;
	width: 20px;
	height: 2px;
	background-color: #1a1a1a;
	transition: all 0.3s ease;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
	transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
	opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
	transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu */
.mobile-menu {
	display: none;
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: blur(10px);
	border-top: 1px solid rgba(229, 231, 235, 0.5);
}

.mobile-menu-content {
	padding: 32px 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mobile-link {
	font-family: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
	font-weight: 400;
	font-size: 16px;
	line-height: 1.5;
	color: #333333;
	text-decoration: none;
	padding: 12px 0;
	transition: color 0.2s ease;
	position: relative;
}

.mobile-link::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0;
	height: 2px;
	background-color: #1F4078;
	transition: width 0.3s ease;
}

.mobile-link:hover {
	color: #333333;
}

.mobile-link:hover::after {
	width: 100%;
}

.mobile-menu-footer {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid #e5e7eb;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.mobile-phone {
	font-family: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
	font-weight: 700;
	font-size: 20px;
	line-height: 1.2;
	color: #1F4078;
	text-decoration: none;
}

/* Плавное появление кнопок и элементов шапки при загрузке страницы */
@keyframes headerFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.site-header-lebedev .header-logo,
.site-header-lebedev .header-nav .nav-link,
.site-header-lebedev .header-nav .nav-link-dropdown,
.site-header-lebedev .header-right .header-phone,
.site-header-lebedev .mobile-menu-toggle {
	opacity: 0;
	animation: headerFadeIn 0.25s ease-out forwards;
}

.site-header-lebedev .header-logo {
	animation-delay: 0.05s;
}

.site-header-lebedev .header-nav .nav-link,
.site-header-lebedev .header-nav .nav-link-dropdown {
	animation-delay: 0.1s;
}

.site-header-lebedev .header-right .header-phone {
	animation-delay: 0.15s;
}

.site-header-lebedev .mobile-menu-toggle {
	animation-delay: 0.2s;
}

/* Responsive */
@media (max-width: 1024px) {
	.header-inner {
		padding: 0 20px;
	}

	.header-nav {
		display: none;
	}

	.header-right {
		display: none;
	}

	.mobile-menu-toggle {
		display: flex;
	}

	.mobile-menu {
		display: block;
	}

	.mobile-menu-content {
		padding: 24px 0;
	}
}

@media (min-width: 1025px) {
	.mobile-menu {
		display: none !important;
	}
}

@media (max-width: 768px) {
	.header-inner {
		padding: 0 16px;
	}

	.header-logo img {
		height: 50px;
	}

	.mobile-menu-content {
		padding: 24px 0;
	}
}
