/* =============================================
   Sparta Frontender — Header
   Figma: 432:4233 (topbar) + 432:4252 (nav) + 262:848 (dropdown)
   设计基准: 1280px
   ============================================= */

/* ── Elementor 容器覆盖：清除 widget container 自带内边距 ── */
.elementor-widget-sparta-header > .elementor-widget-container {
	padding: 0 !important;
	overflow: visible !important;
}
/* 清除 Elementor section / column 可能附加的左右 padding */
.e-con:has(.sfw-header),
.elementor-column:has(.sfw-header) {
	--padding-left: 0px !important;
	--padding-right: 0px !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* ---------- root wrapper：fixed 固定在视口顶部 ---------- */
.sfw-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 9999;
	font-family: 'Montserrat', sans-serif;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.sfw-header__topbar {
	background: #d0e4ff;
	height: 71px;
	overflow: hidden;
	transition: height 0.3s ease, opacity 0.3s ease;
}

.sfw-header--scrolled .sfw-header__topbar {
	height: 0;
	opacity: 0;
}

.sfw-header__topbar-inner {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	padding: 0 30px;
	gap: 0;
}

/* certification logos (left) */
.sfw-header__certs {
	flex-shrink: 0;
}

.sfw-header__certs img {
	height: 40px;
	width: auto;
	display: block;
}

/* spacer pushes right block to the right */
.sfw-header__topbar-spacer {
	flex: 1;
}

/* right block: phone + email + socials */
.sfw-header__topbar-right {
	display: flex;
	align-items: center;
	gap: 32px;
}

.sfw-header__contact {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 20px;
	font-weight: 600;
	color: #000000;
	text-decoration: none;
	white-space: nowrap;
	line-height: 1;
}

.sfw-header__contact:hover {
	color: #054fbd;
}

.sfw-header__contact-icon {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

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

.sfw-header__socials {
	display: flex;
	align-items: center;
	gap: 19px;
}

.sfw-header__social-link {
	display: flex;
	align-items: center;
	color: #000000;
	text-decoration: none;
	transition: color 0.2s;
}

.sfw-header__social-link:hover {
	color: #054fbd;
}

.sfw-header__social-link svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

/* ============================================================
   MAIN NAV BAR
   ============================================================ */
.sfw-header__nav {
	background: #054fbd;
	height: 78px;
	position: relative;
	z-index: 2;
}

.sfw-header__nav-inner {
	width: 100%;
	height: 100%;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	padding: 0 30px;
	gap: 0;
}

/* Logo — 左列靠左 */
.sfw-header__logo {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	text-decoration: none;
	justify-self: start;
	grid-column: 1;
}

.sfw-header .sfw-header__logo img,
.sfw-header__logo img {
	height: 26px !important;
	max-height: 26px !important;
	width: auto !important;
	max-width: 220px !important;
	display: block !important;
	object-fit: contain;
}

/* Nav list — 中间列绝对居中 */
.sfw-header__menu {
	display: flex;
	align-items: center;
	justify-self: center;
	grid-column: 2;
}

.sfw-header__nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 24px;
}

.sfw-header__nav-item {
	position: relative;
}

.sfw-header__nav-link {
	display: block;
	font-size: 18px;
	font-weight: 600;
	line-height: 30px;
	color: #ffffff;
	text-decoration: none;
	white-space: nowrap;
	padding: 24px 0;
	transition: color 0.2s, opacity 0.2s;
}

/* 失焦/常态：强制白字，压过主题可能存在的 a:focus / a:active 深色规则
   （类名+伪类特异性 0,2,0 > 主题 a:focus 的 0,1,1） */
.sfw-header__nav-link:focus,
.sfw-header__nav-link:active,
.sfw-header__nav-link:focus-visible,
.sfw-header__nav-link:visited {
	color: #ffffff;
	outline: none;
}

.sfw-header__nav-link:hover,
.sfw-header__nav-link:focus:hover,
.sfw-header__nav-item--active .sfw-header__nav-link,
.sfw-header__nav-item--dropdown-open .sfw-header__nav-link {
	color: #ffd739;
	opacity: 1;
}

/* 带下拉箭头的项 hover 时箭头同步变黄 */
.sfw-header__nav-link--has-dropdown:hover::after,
.sfw-header__nav-item--dropdown-open .sfw-header__nav-link--has-dropdown::after {
	border-top-color: #ffd739;
}

.sfw-header__nav-item--active .sfw-header__nav-link {
	font-weight: 700;
}

/* indicator arrow for items with dropdown */
.sfw-header__nav-link--has-dropdown::after {
	content: '';
	display: inline-block;
	margin-left: 5px;
	border: 4px solid transparent;
	border-top-color: currentColor;
	vertical-align: middle;
	position: relative;
	top: -1px;
	transition: transform 0.2s;
}

.sfw-header__nav-item--dropdown-open .sfw-header__nav-link--has-dropdown::after {
	transform: rotate(180deg);
}

/* Quote button — 右列靠右 */
.sfw-header__quote {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	background: #ffd739;
	border: 1px solid #ffd739;
	color: #054fbd;
	font-size: 18px;
	font-weight: 700;
	line-height: 20px;
	text-decoration: none;
	padding: 7px 23px;
	border-radius: 5px;
	white-space: nowrap;
	justify-self: end;
	grid-column: 3;
	margin-left: 0;
	transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
	-webkit-tap-highlight-color: transparent;
}

.sfw-header__quote:hover {
	background: #054fbd;
	border-color: #054fbd;
	color: #ffffff;
	transform: translateY(-1px);
}

/* 点击瞬间（active）：深蓝底 + 白字，视觉有按下感 */
.sfw-header__quote:active {
	background: #012f73;
	border-color: #012f73;
	color: #ffffff;
	transform: translateY(0);
}

/* 键盘 focus / 跳转期间保持文字可见 */
.sfw-header__quote:focus {
	outline: none;
	background: #054fbd;
	border-color: #054fbd;
	color: #ffffff;
}
.sfw-header__quote:focus-visible {
	outline: 2px solid #ffd739;
	outline-offset: 3px;
}

/* 箭头 SVG 随 hover / active / focus 一起变白 */
.sfw-header__quote:hover .sfw-header__quote-arrow svg,
.sfw-header__quote:active .sfw-header__quote-arrow svg,
.sfw-header__quote:focus .sfw-header__quote-arrow svg {
	fill: #ffffff;
}
.sfw-header__quote:hover .sfw-header__quote-arrow svg path,
.sfw-header__quote:active .sfw-header__quote-arrow svg path,
.sfw-header__quote:focus .sfw-header__quote-arrow svg path {
	stroke: #ffffff;
}

.sfw-header__quote-arrow {
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	transform: rotate(180deg);
}

.sfw-header__quote-arrow svg {
	width: 16px;
	height: 16px;
	fill: #054fbd;
}

/* ============================================================
   MEGA DROPDOWN
   ============================================================ */
.sfw-header__dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
	background: #d0e4ff;
	z-index: 1;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-8px);
	transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.sfw-header__dropdown--visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.sfw-header__dropdown-inner {
	max-width: 1600px;
	margin: 0 auto;
	padding: 48px 40px 56px;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0 32px;
}

/* column */
.sfw-header__mega-col-title {
	font-size: 20px;
	font-weight: 700;
	line-height: 30px;
	color: #054fbd;
	margin: 0 0 20px;
}

.sfw-header__mega-col-divider {
	width: 93px;
	height: 2px;
	background: #054fbd;
	margin-bottom: 20px;
	display: none; /* shown only on first col per design */
}

.sfw-header__mega-col:first-child .sfw-header__mega-col-divider {
	display: block;
}

.sfw-header__mega-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sfw-header__mega-list li {
	line-height: 30px;
}

.sfw-header__mega-list a {
	font-size: 16px;
	font-weight: 400;
	line-height: 30px;
	color: #054fbd;
	text-decoration: none;
	transition: opacity 0.2s;
}

.sfw-header__mega-list a:hover {
	opacity: 0.7;
	text-decoration: underline;
}

/* ============================================================
   MOBILE HAMBURGER
   ============================================================ */
.sfw-header__hamburger {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	width: 36px;
	height: 36px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	justify-self: end;
	grid-column: 3;
}

.sfw-header__hamburger span {
	display: block;
	width: 24px;
	height: 2px;
	background: #ffffff;
	border-radius: 2px;
	transition: transform 0.3s, opacity 0.3s;
}

.sfw-header__hamburger.is-open span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.sfw-header__hamburger.is-open span:nth-child(2) {
	opacity: 0;
}

.sfw-header__hamburger.is-open span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* mobile nav drawer */
.sfw-header__mobile-nav {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
	background: #054fbd;
	padding: 24px 20px 32px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	z-index: 10;
}

.sfw-header__mobile-nav.is-open {
	display: block;
}

.sfw-header__mobile-nav-list {
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
}

.sfw-header__mobile-nav-list li {
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sfw-header__mobile-nav-list a {
	display: block;
	padding: 12px 0;
	font-size: 16px;
	font-weight: 600;
	color: #ffffff;
	text-decoration: none;
}

.sfw-header__mobile-quote {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #ffd739;
	color: #054fbd;
	font-size: 16px;
	font-weight: 700;
	padding: 10px 20px;
	border-radius: 5px;
	text-decoration: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* 内容统一全宽 + 40px 边距；导航左/中/右三列分布 */

/* tablet 768–1279px */
@media (max-width: 1279px) {
	.sfw-header__contact {
		font-size: 15px;
	}

	.sfw-header__nav-list {
		gap: 16px;
	}

	.sfw-header__nav-link {
		font-size: 15px;
	}

	.sfw-header__quote {
		font-size: 15px;
		padding: 7px 16px;
	}

	.sfw-header__dropdown-inner {
		grid-template-columns: repeat(2, 1fr);
		gap: 32px;
	}
}

/* mobile ≤767px */
@media (max-width: 767px) {
	.sfw-header__topbar {
		height: 56px;
	}

	.sfw-header__topbar-inner {
		padding: 0 8px;
	}

	.sfw-header__topbar-right {
		gap: 16px;
	}

	.sfw-header__contact--email {
		display: none;
	}

	.sfw-header__contact {
		font-size: 13px;
	}

	.sfw-header__contact-text {
		display: none;
	}

	.sfw-header__nav-inner {
		display: flex;
		justify-content: space-between;
		padding: 0 8px;
	}

	.sfw-header__menu {
		display: none;
	}

	.sfw-header__quote {
		display: none;
	}

	.sfw-header__hamburger {
		display: flex;
	}

	.sfw-header__dropdown {
		display: none;
	}
}
