/* ============================================
   Master ECU Header - مستقل از استایل فوتر
   Version 2.0.0
============================================ */

:root {
	--meh-navy-980: #07101d;
	--meh-navy-950: #0a1422;
	--meh-navy-900: #101c2d;
	--meh-navy-850: #142238;
	--meh-blue-500: #4f91f7;
	--meh-blue-400: #72a9ff;
	--meh-cyan-400: #83d2df;
	--meh-text: #f5f8fc;
	--meh-muted: #a7b4c5;
	--meh-line: rgba(255, 255, 255, .085);
	--meh-shadow: 0 16px 48px rgba(2, 8, 23, .23);
	--meh-container: 1320px;
}

.me-container {
	width: min(calc(100% - 48px), var(--meh-container));
	margin-inline: auto;
}

.me-skip-link {
	position: fixed;
	top: -100px;
	inset-inline-start: 18px;
	z-index: 99999;
	padding: 10px 14px;
	border-radius: 9px;
	background: #fff;
	color: var(--meh-navy-980);
	font-size: 13px;
	font-weight: 800;
	text-decoration: none;
	transition: top .2s ease;
}

.me-skip-link:focus {
	top: 16px;
}

.me-site-header {
	position: sticky;
	top: 0;
	z-index: 9999;
	width: 100%;
	color: var(--meh-text);
	font-family: inherit;
}

.me-site-header.is-scrolled {
	box-shadow: var(--meh-shadow);
}

/* نوار اطلاعات */
.me-topbar {
	border-bottom: 1px solid var(--meh-line);
	background:
		linear-gradient(90deg, rgba(79,145,247,.045), transparent 46%),
		var(--meh-navy-980);
}

.me-topbar__inner {
	min-height: 40px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
}

.me-topbar__primary,
.me-topbar__contact {
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 13px;
}

.me-topbar__item,
.me-topbar__link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--meh-muted);
	font-size: 12px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: color .2s ease;
}

.me-topbar__link:hover {
	color: #fff;
}

.me-topbar__item svg,
.me-topbar__link svg {
	width: 14px;
	height: 14px;
	flex: 0 0 14px;
	fill: var(--meh-cyan-400);
}

.me-topbar__separator {
	width: 1px;
	height: 14px;
	background: var(--meh-line);
}

.me-topbar__phone bdi {
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .15px;
}

/* نوار اصلی */
.me-navbar {
	border-bottom: 1px solid var(--meh-line);
	background:
		radial-gradient(circle at 86% -20%, rgba(79,145,247,.12), transparent 31%),
		rgba(16, 28, 45, .985);
	backdrop-filter: blur(16px);
}

.me-navbar__inner {
	min-height: 78px;
	display: grid;
	grid-template-columns: minmax(190px, auto) minmax(0, 1fr) auto;
	align-items: center;
	gap: 28px;
}

/* برند */
.me-brand {
	min-width: 190px;
}

.me-brand__link,
.me-brand__link:hover {
	display: inline-flex;
	align-items: center;
	gap: 11px;
	color: #fff;
	text-decoration: none;
}

.me-brand .custom-logo-link {
	display: inline-flex;
	align-items: center;
}

.me-brand .custom-logo {
	display: block;
	width: auto;
	max-width: 176px;
	max-height: 50px;
	object-fit: contain;
}

.me-brand__mark {
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	flex: 0 0 44px;
	border: 1px solid rgba(255,255,255,.12);
	border-radius: 12px;
	background: linear-gradient(145deg, var(--meh-blue-400), var(--meh-blue-500));
	box-shadow: 0 10px 25px rgba(79,145,247,.25);
	font-size: 21px;
	font-weight: 900;
}

.me-brand__text {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.me-brand__text strong {
	font-size: 18px;
	font-weight: 900;
	line-height: 1;
	letter-spacing: -.2px;
	white-space: nowrap;
}

.me-brand__text small {
	color: var(--meh-muted);
	font-size: 10.5px;
	font-weight: 500;
	line-height: 1.4;
	white-space: nowrap;
}

/* منو */
.me-main-nav {
	min-width: 0;
	height: 100%;
}

.me-main-nav .me-menu,
.me-main-nav > .menu,
.me-main-nav .menu {
	display: flex;
	align-items: stretch;
	justify-content: center;
	gap: 1px;
	height: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.me-main-nav .me-menu > li,
.me-main-nav > .menu > li,
.me-main-nav .menu > li {
	position: relative;
	display: flex;
	align-items: stretch;
}

.me-main-nav .me-menu > li > a,
.me-main-nav > .menu > li > a,
.me-main-nav .menu > li > a {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 78px;
	padding: 0 11px;
	color: #dbe5f0;
	font-size: 13.5px;
	font-weight: 650;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	transition: color .2s ease, background-color .2s ease;
}

.me-main-nav .me-menu > li > a::after,
.me-main-nav > .menu > li > a::after,
.me-main-nav .menu > li > a::after {
	content: "";
	position: absolute;
	inset-inline: 11px;
	bottom: 0;
	height: 2px;
	border-radius: 999px 999px 0 0;
	background: linear-gradient(90deg, var(--meh-blue-500), var(--meh-cyan-400));
	transform: scaleX(0);
	transform-origin: center;
	transition: transform .2s ease;
}

.me-main-nav .me-menu > li:hover > a,
.me-main-nav .me-menu > li.current-menu-item > a,
.me-main-nav .me-menu > li.current-menu-ancestor > a,
.me-main-nav > .menu > li:hover > a,
.me-main-nav .menu > li:hover > a,
.me-main-nav .menu > li.current-menu-item > a {
	color: #fff;
}

.me-main-nav .me-menu > li:hover > a::after,
.me-main-nav .me-menu > li.current-menu-item > a::after,
.me-main-nav .me-menu > li.current-menu-ancestor > a::after,
.me-main-nav > .menu > li:hover > a::after,
.me-main-nav .menu > li:hover > a::after,
.me-main-nav .menu > li.current-menu-item > a::after {
	transform: scaleX(1);
}

/* زیرمنو */
.me-main-nav .sub-menu {
	position: absolute;
	top: calc(100% - 8px);
	inset-inline-start: 0;
	z-index: 10000;
	width: 238px;
	margin: 0;
	padding: 10px;
	border: 1px solid var(--meh-line);
	border-radius: 14px;
	background: rgba(10, 20, 34, .99);
	box-shadow: 0 24px 55px rgba(2, 8, 23, .38);
	list-style: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

.me-main-nav li:hover > .sub-menu,
.me-main-nav li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.me-main-nav .sub-menu a {
	display: block;
	padding: 10px 12px;
	border-radius: 9px;
	color: #c7d2df;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.7;
	text-decoration: none;
	white-space: normal;
	transition: color .2s ease, background .2s ease, padding .2s ease;
}

.me-main-nav .sub-menu a:hover {
	padding-inline-start: 16px;
	background: rgba(79,145,247,.10);
	color: #fff;
}

/* اکشن */
.me-header-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
}

.me-header-cta {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 17px;
	border: 1px solid rgba(255,255,255,.13);
	border-radius: 11px;
	background: linear-gradient(145deg, var(--meh-blue-400), var(--meh-blue-500));
	box-shadow: 0 12px 28px rgba(79,145,247,.20);
	color: #fff;
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.me-header-cta:hover {
	color: #fff;
	filter: brightness(1.06);
	transform: translateY(-2px);
	box-shadow: 0 16px 34px rgba(79,145,247,.28);
}

.me-header-cta svg {
	width: 15px;
	height: 15px;
	fill: currentColor;
	transform: rotate(180deg);
}

/* دکمه موبایل: به‌صورت اجباری در دسکتاپ مخفی */
.me-site-header .me-menu-toggle {
	display: none !important;
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 0;
	margin: 0;
	padding: 0;
	border: 1px solid var(--meh-line) !important;
	border-radius: 11px;
	background: rgba(255,255,255,.045) !important;
	box-shadow: none !important;
	appearance: none;
	cursor: pointer;
}

.me-menu-toggle span {
	display: block;
	width: 20px;
	height: 2px;
	margin: 2.5px auto;
	border-radius: 999px;
	background: #fff;
	transition: transform .2s ease, opacity .2s ease;
}

.me-menu-toggle.is-active span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.me-menu-toggle.is-active span:nth-child(2) {
	opacity: 0;
}

.me-menu-toggle.is-active span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* لپ‌تاپ */
@media (max-width: 1240px) {
	.me-container {
		width: min(calc(100% - 34px), var(--meh-container));
	}

	.me-navbar__inner {
		grid-template-columns: minmax(175px, auto) minmax(0, 1fr) auto;
		gap: 18px;
	}

	.me-brand {
		min-width: 175px;
	}

	.me-main-nav .me-menu > li > a,
	.me-main-nav > .menu > li > a,
	.me-main-nav .menu > li > a {
		padding-inline: 8px;
		font-size: 12.75px;
	}

	.me-header-cta {
		padding-inline: 14px;
		font-size: 12.5px;
	}
}

@media (max-width: 1080px) {
	.me-topbar__desktop-only {
		display: none;
	}

	.me-navbar__inner {
		grid-template-columns: minmax(160px, auto) minmax(0, 1fr) auto;
	}

	.me-brand {
		min-width: 160px;
	}

	.me-brand__text small {
		display: none;
	}

	.me-main-nav .me-menu > li > a,
	.me-main-nav > .menu > li > a,
	.me-main-nav .menu > li > a {
		padding-inline: 6px;
		font-size: 12.25px;
	}
}

/* موبایل و تبلت */
@media (max-width: 980px) {
	body.me-menu-open {
		overflow: hidden;
	}

	.me-topbar {
		display: none;
	}

	.me-container {
		width: min(calc(100% - 28px), var(--meh-container));
	}

	.me-navbar__inner {
		min-height: 70px;
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 14px;
	}

	.me-brand {
		min-width: 0;
	}

	.me-brand .custom-logo {
		max-width: 145px;
		max-height: 42px;
	}

	.me-brand__mark {
		width: 40px;
		height: 40px;
		flex-basis: 40px;
		font-size: 19px;
	}

	.me-brand__text strong {
		font-size: 16px;
	}

	.me-brand__text small {
		display: block;
		font-size: 9.5px;
	}

	.me-main-nav {
		position: fixed;
		top: 70px;
		inset-inline: 0;
		z-index: 9998;
		height: calc(100dvh - 70px);
		padding: 18px 18px 34px;
		overflow-y: auto;
		background:
			radial-gradient(circle at 20% 5%, rgba(79,145,247,.13), transparent 35%),
			var(--meh-navy-980);
		opacity: 0;
		visibility: hidden;
		transform: translateY(-8px);
		transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
	}

	.me-main-nav.is-open {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	.me-main-nav .me-menu,
	.me-main-nav > .menu,
	.me-main-nav .menu {
		display: block;
		height: auto;
	}

	.me-main-nav .me-menu > li,
	.me-main-nav > .menu > li,
	.me-main-nav .menu > li {
		display: block;
		border-bottom: 1px solid var(--meh-line);
	}

	.me-main-nav .me-menu > li > a,
	.me-main-nav > .menu > li > a,
	.me-main-nav .menu > li > a {
		min-height: auto;
		justify-content: flex-start;
		padding: 14px 4px;
		font-size: 14.5px;
		font-weight: 750;
		line-height: 1.7;
		text-align: right;
		white-space: normal;
	}

	.me-main-nav .me-menu > li > a::after,
	.me-main-nav > .menu > li > a::after,
	.me-main-nav .menu > li > a::after {
		display: none;
	}

	.me-main-nav .sub-menu {
		position: static;
		width: 100%;
		padding: 0 10px 10px;
		border: 0;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.me-main-nav .sub-menu a {
		padding: 8px 11px;
		color: var(--meh-muted);
		font-size: 13px;
	}

	.me-header-actions {
		gap: 8px;
	}

	.me-header-cta {
		min-height: 40px;
		padding-inline: 12px;
		font-size: 11.5px;
		border-radius: 10px;
	}

	.me-header-cta svg {
		display: none;
	}

	.me-site-header .me-menu-toggle {
		display: flex !important;
	}
}

@media (max-width: 520px) {
	.me-container {
		width: min(calc(100% - 22px), var(--meh-container));
	}

	.me-navbar__inner {
		min-height: 66px;
	}

	.me-main-nav {
		top: 66px;
		height: calc(100dvh - 66px);
	}

	.me-brand__text small {
		display: none;
	}

	.me-header-cta {
		padding-inline: 10px;
	}

	.me-menu-toggle {
		width: 40px !important;
		height: 40px !important;
	}
}

@media (max-width: 390px) {
	.me-header-cta {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.me-site-header *,
	.me-site-header *::before,
	.me-site-header *::after {
		transition: none !important;
		animation: none !important;
	}
}
