/* ==========================================================
   Dual Header Widget
   ========================================================== */

.dual-header-widget {
	width: 100%;
}

/* ----------------------------------------------------------
   Top Bar
   ---------------------------------------------------------- */
.dh-top-bar {
	width: 100%;
	background-color: #ffffff;
}

.dh-top-bar-inner {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 6px 20px;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

.dh-top-icons {
	display: flex;
	align-items: center;
}

.dh-icon-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #374151;
	text-decoration: none;
	transition: color 0.2s ease;
	line-height: 1;
}

.dh-icon-item i,
.dh-search-btn i {
	font-size: 14px;
	line-height: 1;
}

.dh-icon-item svg,
.dh-search-btn svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
	display: block;
}

.dh-icon-item:hover {
	color: #1a3cbe;
	text-decoration: none;
}

.dh-search-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: #374151;
	margin-left: 12px;
	transition: color 0.2s ease;
	line-height: 1;
}

.dh-search-btn:hover {
	color: #1a3cbe;
}

/* ----------------------------------------------------------
   Divider — lives directly inside .dh-top-bar (outside
   .dh-top-bar-inner), so it naturally spans full width
   regardless of the inner content max-width.
   ---------------------------------------------------------- */
.dh-divider {
	width: 100%;
	height: 1px;
	background-color: #e5e7eb;
}

/* ----------------------------------------------------------
   Main Nav
   ---------------------------------------------------------- */
.dh-main-nav {
	width: 100%;
	background-color: #ffffff;
	z-index: 999;
	position: relative;
	transition: box-shadow 0.3s ease;
}

.dh-main-nav.is-sticky {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.dh-sticky-placeholder {
	display: none;
}

.dh-sticky-placeholder.is-active {
	display: block;
}

.dh-main-nav-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

/* ----------------------------------------------------------
   Logo
   ---------------------------------------------------------- */
.dh-logo {
	flex-shrink: 0;
}

.dh-logo a {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.dh-logo img {
	width: 80px;
	height: auto;
	display: block;
}

/* ----------------------------------------------------------
   Navigation Menu
   ---------------------------------------------------------- */
.dh-nav {
	flex: 1;
	display: flex;
	justify-content: center;
}

.dh-nav-menu {
	display: flex;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.dh-nav-menu > li {
	position: relative;
	margin: -12px 20px;
	padding: 12px 0;
}

.dh-nav-menu > li > a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #374151;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	transition: color 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
	transform-origin: center center;
}

/* 只有被悬停的菜单项放大，其他项颜色和大小保持不变 */
.dh-nav-menu > li > a:hover {
	transform: scale(1.2);
	color: #1a3cbe;
}

/* 当前激活菜单项（非 hover 状态下）正常高亮 */
.dh-nav-menu > li.current-menu-item > a,
.dh-nav-menu > li.current-menu-ancestor > a {
	color: #1a3cbe;
}

/* Dropdown arrow */
.dh-nav-menu > li > a .dh-arrow {
	display: inline-flex;
	align-items: center;
	margin-left: 4px;
	opacity: 0.7;
}

.dh-nav-menu > li > a .dh-arrow svg {
	width: 14px;
	height: 14px;
	display: block;
}

/* Sub-menu */
.dh-nav-menu .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: -20px;
	transform: none;
	min-width: 220px;
	background: #ffffff;
	border-radius: 0;
	border-top: 2px solid #1a3cbe;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.10);
	list-style: none;
	margin: 0;
	padding: 0;
	z-index: 200;
}

.dh-nav-menu > li:hover > .sub-menu {
	display: block;
}

.dh-nav-menu .sub-menu li {
	border-bottom: 1px solid #e8e8e8;
}

.dh-nav-menu .sub-menu li:last-child {
	border-bottom: none;
}

.dh-nav-menu .sub-menu li a {
	display: block;
	padding: 12px 20px;
	color: #374151;
	text-decoration: none;
	font-size: 14px;
	white-space: nowrap;
	background-color: #ffffff;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.dh-nav-menu .sub-menu li:first-child > a {
	color: #1a3cbe;
}

/* Mega Menu — 全宽下拉 */
.dh-nav-menu > li.has-mega-menu {
	position: static;
}

.dh-nav-menu > li.has-mega-menu > .sub-menu {
	left: 0;
	right: 0;
	width: 100%;
	display: none;
	flex-wrap: wrap;
}

.dh-nav-menu > li.has-mega-menu:hover > .sub-menu {
	display: flex;
}

.dh-nav-menu > li.has-mega-menu > .sub-menu > li {
	flex: 1 1 180px;
	border-bottom: none;
	border-right: 1px solid #e8e8e8;
}

.dh-nav-menu > li.has-mega-menu > .sub-menu > li:last-child {
	border-right: none;
}

.dh-nav-menu .sub-menu li a:hover {
	color: #1a3cbe;
	background-color: #f5f5f5;
}

/* ----------------------------------------------------------
   CTA Button
   ---------------------------------------------------------- */
.dh-cta {
	flex-shrink: 0;
}

.dh-cta-btn {
	display: inline-block;
	padding: 12px 24px;
	background-color: #1a3cbe;
	color: #ffffff;
	text-decoration: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
	cursor: pointer;
	border: none;
}

.dh-cta-btn:hover {
	background-color: #142d9a;
	color: #ffffff;
	text-decoration: none;
}

/* ----------------------------------------------------------
   Search Overlay
   ---------------------------------------------------------- */
.dh-search-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
	z-index: 99999;
	align-items: center;
	justify-content: center;
}

.dh-search-overlay.is-active {
	display: flex;
}

.dh-search-overlay-inner {
	position: relative;
	width: 100%;
	max-width: 640px;
	padding: 0 20px;
}

.dh-search-overlay form {
	display: flex;
	align-items: center;
	background: #ffffff;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.dh-search-overlay input[type="search"] {
	flex: 1;
	padding: 16px 20px;
	font-size: 18px;
	border: none;
	outline: none;
	background: transparent;
	-webkit-appearance: none;
	appearance: none;
}

.dh-search-overlay button[type="submit"] {
	padding: 16px 20px;
	background: none;
	border: none;
	cursor: pointer;
	color: #374151;
	font-size: 18px;
	display: inline-flex;
	align-items: center;
}

.dh-search-overlay-close {
	position: absolute;
	top: -48px;
	right: 20px;
	background: none;
	border: none;
	color: #ffffff;
	font-size: 36px;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	display: flex;
	align-items: center;
}

/* ==========================================================
   Mobile — breakpoint ≤ 768 px
   ========================================================== */

/* 隐藏桌面端两层，显示移动端头部 */
@media (max-width: 768px) {
	.dh-top-bar,
	.dh-main-nav,
	.dh-sticky-placeholder {
		display: none !important;
	}

	/* --------------------------------------------------
	   Mobile Header Bar
	   -------------------------------------------------- */
	.dh-mobile-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 10px 16px;
		background-color: #ffffff;
		position: relative;
		z-index: 100;
	}

	/* Hamburger button */
	.dh-hamburger {
		display: flex;
		flex-direction: column;
		justify-content: center;
		gap: 5px;
		background: none;
		border: none;
		cursor: pointer;
		padding: 4px;
		width: 32px;
		flex-shrink: 0;
	}

	.dh-hamburger span {
		display: block;
		width: 22px;
		height: 2px;
		background-color: #374151;
		border-radius: 2px;
		transition: transform 0.25s ease, opacity 0.25s ease;
		transform-origin: center;
	}

	/* Hamburger → X when open */
	.dh-hamburger.is-active span:nth-child(1) {
		transform: translateY(7px) rotate(45deg);
	}
	.dh-hamburger.is-active span:nth-child(2) {
		opacity: 0;
		transform: scaleX(0);
	}
	.dh-hamburger.is-active span:nth-child(3) {
		transform: translateY(-7px) rotate(-45deg);
	}

	/* Mobile Logo — centred */
	.dh-mobile-logo {
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
	}

	.dh-mobile-logo img {
		height: 40px;
		width: auto;
		display: block;
	}

	/* Mobile CTA */
	.dh-mobile-cta {
		flex-shrink: 0;
	}

	.dh-mobile-cta .dh-cta-btn {
		font-size: 13px;
		padding: 8px 14px;
	}

	/* --------------------------------------------------
	   Mobile Overlay
	   -------------------------------------------------- */
	.dh-mobile-overlay {
		display: none;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.5);
		z-index: 998;
	}

	.dh-mobile-overlay.is-active {
		display: block;
	}

	/* --------------------------------------------------
	   Mobile Sidebar
	   -------------------------------------------------- */
	.dh-mobile-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		width: 70%;
		max-width: 360px;
		height: 100%;
		background-color: #ffffff;
		z-index: 999;
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform 0.3s ease;
		display: flex;
		flex-direction: column;
	}

	.dh-mobile-sidebar.is-open {
		transform: translateX(0);
	}

	/* Sidebar top image */
	.dh-sidebar-top-image {
		width: 100%;
		flex-shrink: 0;
		margin-top: 30px;
	}

	.dh-sidebar-top-image img {
		display: block;
		max-width: 100%;
		height: auto;
		margin: 0 auto;
	}

	/* --------------------------------------------------
	   Sidebar Menu
	   -------------------------------------------------- */
	.dh-sidebar-nav {
		flex: 1;
	}

	.dh-sidebar-menu {
		list-style: none;
		margin: 0;
		padding: 0;
	}

	/* Top-level item row */
	.dh-sidebar-menu > li {
		border-bottom: 1px solid #e5e7eb;
		position: relative;
	}

	/* Item row — flex to place link + toggle side by side */
	.dh-sidebar-menu > li > a,
	.dh-sidebar-menu > li > .dh-accordion-toggle {
		display: flex;
		align-items: center;
	}

	.dh-sidebar-menu > li > a {
		flex: 1;
		padding: 16px 20px;
		color: #374151;
		text-decoration: none;
		font-size: 15px;
		font-weight: 500;
		transition: color 0.2s ease;
	}

	.dh-sidebar-menu > li > a:hover {
		color: #1a3cbe;
	}

	/* Accordion toggle button */
	.dh-accordion-toggle {
		flex-shrink: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 48px;
		height: 52px;
		background: none;
		border: none;
		cursor: pointer;
		color: #6b7280;
		transition: transform 0.25s ease, color 0.2s ease;
		padding: 0;
	}

	.dh-accordion-toggle svg {
		display: block;
		transition: transform 0.25s ease;
	}

	.dh-accordion-toggle.is-open svg {
		transform: rotate(180deg);
	}

	/* Sub-menu — hidden by default, accordion */
	.dh-sidebar-menu .sub-menu {
		list-style: none;
		margin: 0;
		padding: 0;
		display: none;
		background-color: #f3f4f6;
	}

	.dh-sidebar-menu .sub-menu.is-open {
		display: block;
	}

	.dh-sidebar-menu .sub-menu li {
		border-top: 1px solid rgba(0, 0, 0, 0.06);
	}

	.dh-sidebar-menu .sub-menu li a {
		display: block;
		padding: 12px 24px;
		color: #374151;
		text-decoration: none;
		font-size: 14px;
		transition: color 0.2s ease, background-color 0.2s ease;
	}

	.dh-sidebar-menu .sub-menu li a:hover {
		color: #1a3cbe;
		background-color: rgba(0, 0, 0, 0.04);
	}
}

/* 桌面端隐藏手机端专用元素 */
@media (min-width: 769px) {
	.dh-mobile-header,
	.dh-mobile-sidebar,
	.dh-mobile-overlay {
		display: none !important;
	}
}

/* ----------------------------------------------------------
   Transparent Header Mode
   ---------------------------------------------------------- */

/* 占位符隐藏，整个 widget 固定在顶部 */
.dh-mode-transparent .dh-sticky-placeholder {
	display: none !important;
}

.dh-mode-transparent {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 999;
}

/* WordPress admin bar 高度补偿（管理员前端预览时） */
body.admin-bar .dh-mode-transparent {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .dh-mode-transparent {
		top: 46px;
	}
}

/* Elementor 外壳容器不占高度（:has() 现代浏览器支持） */
.elementor-widget-dual-header:has(.dh-mode-transparent),
.elementor-widget-dual-header:has(.dh-mode-transparent) > .elementor-widget-container {
	height: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	overflow: visible !important;
}

/* 顶部栏透明（不再隐藏） */
.dh-mode-transparent .dh-top-bar {
	background-color: transparent !important;
	transition: background-color 0.35s ease;
}

/* 透明时 top-bar 图标与搜索按钮变白，确保在深色背景图上可见 */
.dh-mode-transparent:not(.is-scrolled) .dh-icon-item,
.dh-mode-transparent:not(.is-scrolled) .dh-search-btn {
	color: #ffffff;
}

.dh-mode-transparent:not(.is-scrolled) .dh-divider {
	background-color: rgba(255, 255, 255, 0.25);
}

/* main-nav 在透明模式下不再自身 fixed（widget 已经 fixed） */
.dh-main-nav.dh-transparent {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	background-color: transparent !important;
	box-shadow: none;
	transition: background-color 0.35s ease, box-shadow 0.35s ease;
	z-index: auto;
}

.dh-main-nav.dh-transparent .dh-nav-menu > li > a {
	color: #ffffff;
	transition: color 0.25s ease, transform 0.25s ease;
}

.dh-main-nav.dh-transparent .dh-cta-btn {
	color: #ffffff;
}

/* 滚动后：隐藏 top-bar，只保留 main-nav 吸顶 */
.dh-mode-transparent.is-scrolled .dh-top-bar {
	display: none !important;
}

/* 滚动后：main-nav 切换实色 + 阴影 */
.dh-main-nav.dh-transparent.is-scrolled {
	background-color: #ffffff !important;
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.dh-main-nav.dh-transparent.is-scrolled .dh-nav-menu > li > a {
	color: #374151;
}

.dh-main-nav.dh-transparent.is-scrolled .dh-cta-btn {
	color: #ffffff;
}
