/**
 * Header Styles strictly matching Original 8087 Site (НАЕКС)
 * Pure White Technical Industrial Theme - High DPI, Search Panel, Mobile Accordion Drawer
 */

/* ==========================================================================
   1. ROOT VARIABLES & GLOBAL CONTAINER
   ========================================================================== */
:root {
	--hdr-bg: rgba(255, 255, 255, 0.98);
	--hdr-bg-scrolled: #ffffff;
	--hdr-text: #0f172a;
	--hdr-text-muted: #475569;
	--hdr-accent: #ffb703;
	--hdr-accent-hover: #f5a600;
	--hdr-accent-subtle: rgba(255, 183, 3, 0.12);
	--hdr-accent-border: rgba(255, 183, 3, 0.45);
	--hdr-border: rgba(15, 23, 42, 0.08);
	--hdr-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
	--hdr-shadow-scrolled: 0 8px 25px rgba(15, 23, 42, 0.08);
	--hdr-radius: 6px;
	--hdr-radius-sm: 4px;
	--hdr-height: 76px;
	--hdr-height-scrolled: 64px;
	--hdr-height-mobile: 62px;
	--hdr-transition: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Full-Width Edge-to-Edge Resets (Removing 1200px theme constraint on screen) */
html, body {
	margin: 0 !important;
	padding: 0 !important;
	width: 100% !important;
	max-width: 100vw !important;
	overflow-x: hidden !important;
}

.site#page,
#page,
.grid-container#page {
	max-width: 100% !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

.site-content,
#content.site-content,
#page .site-content,
.separate-containers .site-content,
.one-container .site-content {
	max-width: 100% !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	display: block;
}

#primary,
.content-area,
.site-main,
.samodvizhec-frontpage {
	max-width: 100% !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

.inside-article {
	padding: 0 !important;
}

.g-container {
	width: 100% !important;
	max-width: 1240px !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 20px !important;
	padding-right: 20px !important;
	box-sizing: border-box !important;
}

@media (max-width: 767px) {
	.g-container {
		padding-left: 16px !important;
		padding-right: 16px !important;
	}
}

/* ==========================================================================
   2. MAIN STICKY HEADER (100% Fixed & Sticky on All Devices)
   ========================================================================== */
.samodvizhec-main-header {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	width: 100% !important;
	background: var(--hdr-bg);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	border-bottom: 1px solid var(--hdr-border);
	box-shadow: var(--hdr-shadow);
	z-index: 99999 !important;
	transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.samodvizhec-main-header.is-scrolled {
	background: var(--hdr-bg-scrolled);
	box-shadow: var(--hdr-shadow-scrolled);
	border-bottom-color: rgba(222, 190, 31, 0.25);
}

.samodvizhec-header-spacer {
	display: block !important;
	width: 100% !important;
	height: var(--hdr-height) !important;
}

.samodvizhec-header-inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: var(--hdr-height);
	transition: height 0.3s var(--hdr-transition);
}

.samodvizhec-main-header.is-scrolled .samodvizhec-header-inner {
	height: var(--hdr-height-scrolled);
}

@media (max-width: 1023px) {
	.samodvizhec-header-inner,
	.samodvizhec-main-header.is-scrolled .samodvizhec-header-inner {
		height: var(--hdr-height-mobile);
	}
	.samodvizhec-header-spacer {
		height: var(--hdr-height-mobile) !important;
	}
}

/* ==========================================================================
   3. BRAND LOGO (НАЕКС)
   ========================================================================== */
.samodvizhec-header-brand {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.samodvizhec-logo-wrap {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	transition: transform 0.2s ease;
}

.samodvizhec-logo-wrap:hover {
	transform: translateY(-1px);
}

.samodvizhec-logo-img {
	height: 46px;
	width: auto;
	max-width: 180px;
	object-fit: contain;
	display: block;
	transition: height 0.3s ease;
}

.samodvizhec-main-header.is-scrolled .samodvizhec-logo-img {
	height: 40px;
}

@media (max-width: 767px) {
	.samodvizhec-logo-img,
	.samodvizhec-main-header.is-scrolled .samodvizhec-logo-img {
		height: 36px;
		max-width: 140px;
	}
}

/* ==========================================================================
   4. DESKTOP NAVIGATION (8087 ORIGINAL)
   ========================================================================== */
.samodvizhec-desktop-nav {
	display: none;
}

@media (min-width: 1024px) {
	.samodvizhec-desktop-nav {
		display: block;
	}
}

.samodvizhec-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 6px;
}

.samodvizhec-nav-list > li {
	position: relative;
}

.samodvizhec-nav-list > li > a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	color: #1e293b;
	text-decoration: none;
	font-size: 0.92rem;
	font-weight: 600;
	border-radius: var(--hdr-radius-sm);
	transition: all 0.2s ease;
	position: relative;
	line-height: 1.4;
}

.samodvizhec-nav-list > li > a:hover,
.samodvizhec-nav-list > li.current-menu-item > a,
.samodvizhec-nav-list > li.current_page_item > a {
	color: var(--hdr-accent);
	background: var(--hdr-accent-subtle);
}

.samodvizhec-nav-list > li > a::after {
	content: '';
	position: absolute;
	bottom: 2px;
	left: 12px;
	right: 12px;
	height: 2px;
	background: var(--hdr-accent);
	border-radius: 1px;
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 0.25s var(--hdr-transition);
}

.samodvizhec-nav-list > li > a:hover::after,
.samodvizhec-nav-list > li.current-menu-item > a::after,
.samodvizhec-nav-list > li.current_page_item > a::after {
	transform: scaleX(1);
}

/* Chevron indicator for menu items with children (О нас) */
.samodvizhec-nav-list > li.menu-item-has-children > a::before {
	content: '';
	display: inline-block;
	order: 2;
	width: 6px;
	height: 6px;
	border-right: 1.8px solid currentColor;
	border-bottom: 1.8px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	transition: transform 0.2s ease;
	margin-left: 2px;
}

.samodvizhec-nav-list > li.menu-item-has-children:hover > a::before {
	transform: rotate(-135deg) translateY(-2px);
}

/* Dropdown Card (Submenu) */
.samodvizhec-nav-list .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 290px;
	background: #ffffff;
	border: 1px solid var(--hdr-border);
	border-top: 2.5px solid var(--hdr-accent);
	border-radius: var(--hdr-radius-sm);
	padding: 8px;
	box-shadow: 0 14px 35px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(0,0,0,0.04);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.22s ease, transform 0.22s var(--hdr-transition), visibility 0.22s ease;
	z-index: 100;
	list-style: none;
	margin: 0;
	pointer-events: none;
}

.samodvizhec-nav-list .sub-menu::before {
	content: '';
	position: absolute;
	top: -12px;
	left: 0;
	right: 0;
	height: 12px;
}

.samodvizhec-nav-list li:hover > .sub-menu,
.samodvizhec-nav-list li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.samodvizhec-nav-list .sub-menu li a {
	display: block;
	padding: 9px 12px;
	color: #334155;
	font-size: 0.88rem;
	font-weight: 500;
	text-decoration: none;
	border-radius: var(--hdr-radius-sm);
	transition: all 0.18s ease;
}

.samodvizhec-nav-list .sub-menu li a:hover {
	background: var(--hdr-accent-subtle);
	color: var(--hdr-accent);
	padding-left: 16px;
	font-weight: 600;
}

/* ==========================================================================
   5. HEADER ACTIONS (SEARCH & HAMBURGER)
   ========================================================================== */
.samodvizhec-header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

/* Search Button */
.samodvizhec-search-toggle {
	width: 42px;
	height: 42px;
	border-radius: var(--hdr-radius);
	background: #ffffff;
	border: 1px solid var(--hdr-border);
	color: #334155;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	padding: 0;
}

.samodvizhec-search-toggle:hover {
	border-color: var(--hdr-accent);
	color: var(--hdr-accent);
	background: var(--hdr-accent-subtle);
	transform: translateY(-1px);
}

.search-svg-icon {
	width: 18px;
	height: 18px;
}

/* Search Dropdown Panel */
.samodvizhec-search-panel {
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
	background: #ffffff;
	border-bottom: 1px solid var(--hdr-border);
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
	padding: 16px 0;
	z-index: 999;
	display: none;
	opacity: 0;
	transform: translateY(-10px);
	transition: opacity 0.25s ease, transform 0.25s var(--hdr-transition);
}

.samodvizhec-search-panel.is-open {
	display: block;
	opacity: 1;
	transform: translateY(0);
}

.samodvizhec-search-form {
	display: flex;
	align-items: center;
	gap: 10px;
	position: relative;
	max-width: 700px;
	margin: 0 auto;
}

.samodvizhec-search-input {
	width: 100%;
	padding: 12px 48px 12px 18px;
	font-size: 1rem;
	font-family: inherit;
	color: #0f172a;
	background: #f8fafc;
	border: 1.5px solid #cbd5e1;
	border-radius: var(--hdr-radius);
	transition: all 0.2s ease;
	box-sizing: border-box;
}

.samodvizhec-search-input:focus {
	outline: none;
	background: #ffffff;
	border-color: var(--hdr-accent);
	box-shadow: 0 0 0 3px rgba(222, 190, 31, 0.18);
}

.samodvizhec-search-submit {
	position: absolute;
	right: 48px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: none;
	color: #64748b;
	cursor: pointer;
	padding: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease;
}

.samodvizhec-search-submit:hover {
	color: var(--hdr-accent);
}

.samodvizhec-search-submit svg {
	width: 20px;
	height: 20px;
}

.samodvizhec-search-close {
	background: rgba(15, 23, 42, 0.05);
	border: 1px solid var(--hdr-border);
	width: 38px;
	height: 38px;
	border-radius: var(--hdr-radius-sm);
	color: #64748b;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.samodvizhec-search-close:hover {
	background: var(--hdr-accent);
	color: #ffffff;
	border-color: var(--hdr-accent);
}

.samodvizhec-search-close svg {
	width: 18px;
	height: 18px;
}

/* ==========================================================================
   6. HAMBURGER BUTTON
   ========================================================================== */
.samodvizhec-hamburger-btn {
	width: 42px;
	height: 42px;
	padding: 0;
	background: #ffffff;
	border: 1.5px solid var(--hdr-accent-border);
	border-radius: var(--hdr-radius);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
	transition: all 0.25s ease;
	z-index: 1002;
}

.samodvizhec-hamburger-btn:hover {
	border-color: var(--hdr-accent);
	background: var(--hdr-accent-subtle);
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(222, 190, 31, 0.25);
}

@media (min-width: 1024px) {
	.samodvizhec-hamburger-btn {
		display: none;
	}
}

.hamburger-box {
	width: 20px;
	height: 14px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	position: relative;
}

.hamburger-line {
	width: 100%;
	height: 2.2px;
	background: var(--hdr-accent);
	border-radius: 2px;
	transition: transform 0.28s var(--hdr-transition), opacity 0.2s ease;
	transform-origin: center;
}

.samodvizhec-hamburger-btn.is-active .hamburger-line.line-1 {
	transform: translateY(6px) rotate(45deg);
}

.samodvizhec-hamburger-btn.is-active .hamburger-line.line-2 {
	opacity: 0;
	transform: scaleX(0);
}

.samodvizhec-hamburger-btn.is-active .hamburger-line.line-3 {
	transform: translateY(-6px) rotate(-45deg);
}

/* ==========================================================================
   7. MOBILE DRAWER (ORIGINAL 8087 MENU + ACCORDION)
   ========================================================================== */
.samodvizhec-mobile-drawer {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	max-width: 100%;
	z-index: 2000;
	display: none;
	overflow: hidden;
}

.samodvizhec-mobile-drawer.is-open {
	display: block;
}

.samodvizhec-drawer-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.45);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	animation: drawerFadeIn 0.25s ease forwards;
}

@keyframes drawerFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

.samodvizhec-drawer-panel {
	position: fixed;
	top: 0;
	right: 0;
	width: 320px;
	max-width: 86vw;
	height: 100%;
	background: #ffffff;
	border-left: 1.5px solid var(--hdr-accent-border);
	box-shadow: -10px 0 35px rgba(15, 23, 42, 0.18);
	display: flex;
	flex-direction: column;
	animation: drawerSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
	z-index: 2001;
	box-sizing: border-box;
}

@keyframes drawerSlideIn {
	from { transform: translateX(100%); }
	to { transform: translateX(0); }
}

.samodvizhec-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--hdr-border);
	background: #ffffff;
	flex-shrink: 0;
}

.samodvizhec-drawer-logo img {
	height: 32px;
	width: auto;
	display: block;
}

.samodvizhec-drawer-close {
	background: rgba(15, 23, 42, 0.04);
	border: 1px solid var(--hdr-border);
	color: #0f172a;
	width: 36px;
	height: 36px;
	border-radius: var(--hdr-radius-sm);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	padding: 0;
}

.samodvizhec-drawer-close svg {
	width: 18px;
	height: 18px;
}

.samodvizhec-drawer-close:hover {
	background: var(--hdr-accent);
	color: #ffffff;
	border-color: var(--hdr-accent);
}

.samodvizhec-drawer-body {
	padding: 18px 20px 24px;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

/* Mobile Search in Drawer */
.drawer-search-wrap {
	margin-bottom: 16px;
}

.drawer-search-form {
	position: relative;
	display: flex;
	align-items: center;
}

.drawer-search-input {
	width: 100%;
	padding: 10px 40px 10px 14px;
	font-size: 0.95rem;
	font-family: inherit;
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: var(--hdr-radius-sm);
	box-sizing: border-box;
}

.drawer-search-input:focus {
	outline: none;
	background: #ffffff;
	border-color: var(--hdr-accent);
}

.drawer-search-submit {
	position: absolute;
	right: 8px;
	background: transparent;
	border: none;
	color: #64748b;
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.drawer-search-submit svg {
	width: 18px;
	height: 18px;
}

/* Mobile Nav List */
.samodvizhec-mobile-nav-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.samodvizhec-mobile-nav-list > li {
	border-bottom: 1px solid rgba(15, 23, 42, 0.06);
	position: relative;
}

.samodvizhec-mobile-nav-list > li > a {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 10px 0;
	color: #1e293b;
	font-size: 1.02rem;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.18s ease;
}

.samodvizhec-mobile-nav-list > li > a:hover,
.samodvizhec-mobile-nav-list > li.current-menu-item > a {
	color: var(--hdr-accent);
}

/* Mobile Accordion for "О нас" / Submenu */
.samodvizhec-mobile-nav-list li.menu-item-has-children {
	display: flex;
	flex-direction: column;
}

.samodvizhec-mobile-nav-list li.menu-item-has-children > .mobile-menu-item-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}

.samodvizhec-mobile-nav-list li.menu-item-has-children > .mobile-menu-item-row > a {
	flex-grow: 1;
	min-height: 48px;
	display: flex;
	align-items: center;
	padding: 10px 0;
	color: #1e293b;
	font-size: 1.02rem;
	font-weight: 600;
	text-decoration: none;
}

.samodvizhec-submenu-toggle {
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	padding: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	color: #64748b;
	cursor: pointer;
	border-radius: var(--hdr-radius-sm);
	transition: background 0.2s ease, color 0.2s ease;
	margin-left: 6px;
	flex-shrink: 0;
	box-sizing: border-box;
}

.samodvizhec-submenu-toggle:hover {
	background: var(--hdr-accent-subtle);
	color: var(--hdr-accent);
}

.samodvizhec-submenu-toggle svg {
	width: 20px !important;
	height: 20px !important;
	min-width: 20px !important;
	min-height: 20px !important;
	display: block;
	transition: transform 0.25s var(--hdr-transition);
}

.samodvizhec-mobile-nav-list li.menu-item-has-children.is-expanded > .mobile-menu-item-row .samodvizhec-submenu-toggle svg {
	transform: rotate(180deg);
}

/* Submenu in Drawer */
.samodvizhec-mobile-nav-list .sub-menu {
	list-style: none;
	padding: 0 0 8px 12px;
	margin: 0;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-height 0.35s var(--hdr-transition), opacity 0.25s ease;
	border-left: 2px solid rgba(222, 190, 31, 0.35);
}

.samodvizhec-mobile-nav-list li.menu-item-has-children.is-expanded > .sub-menu {
	max-height: 600px;
	opacity: 1;
}

.samodvizhec-mobile-nav-list .sub-menu li a {
	display: block;
	padding: 8px 0 8px 8px;
	min-height: 40px;
	color: #475569;
	font-size: 0.94rem;
	font-weight: 500;
	text-decoration: none;
	transition: color 0.18s ease, transform 0.18s ease;
}

.samodvizhec-mobile-nav-list .sub-menu li a:hover {
	color: var(--hdr-accent);
	transform: translateX(3px);
}

/* ==========================================================================
   8. REDUCED MOTION PREFERENCES
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.samodvizhec-main-header,
	.samodvizhec-header-inner,
	.samodvizhec-nav-list .sub-menu,
	.samodvizhec-mobile-drawer,
	.samodvizhec-drawer-panel,
	.samodvizhec-drawer-backdrop,
	.samodvizhec-search-panel,
	.hamburger-line,
	.samodvizhec-submenu-toggle svg,
	.samodvizhec-mobile-nav-list .sub-menu {
		transition: none !important;
		animation: none !important;
	}
}
