/* ==========================================================================
 * HBC Site Header — 网站页眉小部件
 *
 * 桌面:左 LOGO + 右菜单 + 社交图标(深色背景全宽,内容限宽 1600px 居中)
 * 手机:左 LOGO + 右社交图标 + 汉堡按钮 → 点击展开全屏白色抽屉
 * ========================================================================== */

/* ----- 全宽外层(背景层) ------------------------------------------------ */
.hbc-site-header {
	background-color: #1F1F1F;
	padding: 18px 48px;
	box-sizing: border-box;
	width: 100%;
	position: relative;
	transition: padding 0.25s ease, background-color 0.25s ease;
}

/* ===== 滚动缩小状态:LOGO/标语/字体压缩,padding 由 Elementor 控件接管 ===== */
.hbc-site-header.is-shrunk .hbc-site-header__tagline {
	display: none;
}

.hbc-site-header.is-shrunk .hbc-site-header__logo-text,
.hbc-site-header.is-shrunk .hbc-site-header__logo-image,
.hbc-site-header.is-shrunk .hbc-site-header__menu-link,
.hbc-site-header.is-shrunk .hbc-site-header__social-link {
	transition: font-size 0.25s ease, width 0.25s ease;
}

.hbc-site-header.is-shrunk .hbc-site-header__menu-link {
	font-size: 13px;
}

.hbc-site-header.is-shrunk .hbc-site-header__social-link {
	font-size: 16px;
}

/* 收缩态再次确认垂直居中(标语隐藏后 brand 由 column 变成只有 LOGO 一行) */
.hbc-site-header.is-shrunk .hbc-site-header__brand {
	justify-content: center;
}

/* 滚回顶部复原瞬间:JS 临时加此类,禁止所有过渡,
 * 防止 padding 从小→大动画期间撑大 header 遮挡下方内容 */
.hbc-site-header.is-no-transition,
.hbc-site-header.is-no-transition * {
	transition: none !important;
}

.hbc-site-header * {
	box-sizing: border-box;
}

/* ----- 内层(限宽居中,flex 主轴) -------------------------------------- */
.hbc-site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 24px 32px;
	width: 100%;
	max-width: 1600px;
	margin: 0 auto;
}

/* ----- 左侧:品牌(LOGO + 标语) -------------------------------------- */
.hbc-site-header__brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	line-height: 1;
}

.hbc-site-header__logo-link {
	display: inline-block;
	color: inherit;
	text-decoration: none;
}

.hbc-site-header__logo-text {
	display: inline-block;
	color: #EE6B2D;
	font-size: 36px;
	font-weight: 800;
	letter-spacing: 0.02em;
	line-height: 1;
	text-transform: uppercase;
}

.hbc-site-header__logo-image {
	display: block;
	max-width: 100%;
	height: auto;
}

.hbc-site-header__tagline {
	margin-top: 6px;
	color: #A8A8A8;
	font-size: 11px;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-transform: none;
}

/* ----- 右侧:菜单 + 社交 + 汉堡 ---------------------------------------- */
.hbc-site-header__right {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 28px;
}

/* ----- 桌面横向导航 ----------------------------------------------------- */
.hbc-site-header__nav {
	display: block;
}

.hbc-site-header__menu {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 28px;
}

.hbc-site-header__menu-item {
	margin: 0;
	padding: 0;
	position: relative; /* 让子菜单可基于此项绝对定位 */
}

.hbc-site-header__menu-link {
	display: inline-block;
	color: #FFFFFF;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: color 0.2s ease;
}

.hbc-site-header__menu-link:hover,
.hbc-site-header__menu-link:focus,
.hbc-site-header__menu-link.is-active {
	color: #EE6B2D;
}

/* ----- 桌面下拉子菜单(悬停展开)------------------------------------- */
.hbc-site-header__submenu {
	position: absolute;
	top: 100%;
	left: 0;
	margin: 0;
	padding: 18px 22px;
	list-style: none;
	min-width: 200px;
	background-color: #EE6B2D;
	display: flex;
	flex-direction: column;
	gap: 14px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
	z-index: 50;
	pointer-events: none;
}

/* 悬停或键盘聚焦父项时展开 */
.hbc-site-header__menu-item--has-children:hover > .hbc-site-header__submenu,
.hbc-site-header__menu-item--has-children:focus-within > .hbc-site-header__submenu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.hbc-site-header__submenu-item {
	margin: 0;
	padding: 0;
	list-style: none;
	position: relative; /* 让更深层 submenu 可基于此项绝对定位(flyout) */
}

.hbc-site-header__submenu-link {
	display: block;
	color: #FFFFFF;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease, opacity 0.15s ease;
}

/* hover/active 颜色由 Elementor 控件控制;此处不再硬编码,
 * 否则会盖掉用户在「桌面下拉子菜单 → 链接」选项卡里设置的颜色 */

/* 让父项与下拉之间没有可见间隙(防 hover 断流) */
.hbc-site-header__menu-item--has-children > .hbc-site-header__menu-link {
	padding-bottom: 8px;
	margin-bottom: -8px;
}

/* ==========================================================================
 *  多级嵌套子菜单(三级及以上)— 向下缩进展开模式
 *
 *  设计:嵌套 submenu 不再 absolute 右弹,而是 static 直接占据父项下方,
 *  并向左缩进。这样:
 *    - 不受 Elementor wrapper 的 overflow / stacking 影响
 *    - 鼠标 hover 链路不会因为「flyout 间隙」断开
 *    - 任意嵌套深度都能稳定显示
 *    - 父项下方就是子项,语义和视觉都更自然
 * ========================================================================== */

/* 嵌套层 — 还原为父 ul 内的内联内容,max-height + opacity 实现展开动画 */
.hbc-site-header__submenu-item--has-children > .hbc-site-header__submenu {
	position: static;
	top: auto;
	left: auto;
	min-width: 0;
	margin: 8px 0 0 0;
	padding: 0 0 0 14px;        /* 左缩进,体现层级关系 */
	background-color: transparent;
	box-shadow: none;
	gap: 10px;
	transform: none;
	opacity: 0;
	visibility: hidden;
	max-height: 0;
	overflow: hidden;
	pointer-events: none;
	transition:
		opacity    var(--hbc-nested-submenu-duration, 300ms) ease,
		max-height var(--hbc-nested-submenu-duration, 300ms) ease,
		visibility var(--hbc-nested-submenu-duration, 300ms),
		margin     var(--hbc-nested-submenu-duration, 300ms) ease;
	z-index: auto;
}

/* 悬停 / 焦点在嵌套父项时展开 */
.hbc-site-header__submenu-item--has-children:hover > .hbc-site-header__submenu,
.hbc-site-header__submenu-item--has-children:focus-within > .hbc-site-header__submenu {
	opacity: 1;
	visibility: visible;
	max-height: 800px;          /* 取一个足够大的上限以容纳实际项数 */
	pointer-events: auto;
}

/* 嵌套层的链接稍小、稍淡,体现次级感 */
.hbc-site-header__submenu-item--has-children > .hbc-site-header__submenu .hbc-site-header__submenu-link {
	font-size: 14px;
	opacity: 0.92;
}

/* 嵌套父项加 ▼ 下尖角箭头,hover 时旋转 180° 变 ▲ */
.hbc-site-header__submenu-item--has-children > .hbc-site-header__submenu-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.hbc-site-header__submenu-item--has-children > .hbc-site-header__submenu-link::after {
	content: '';
	display: inline-block;
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	flex-shrink: 0;
	opacity: 0.75;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.hbc-site-header__submenu-item--has-children:hover > .hbc-site-header__submenu-link::after,
.hbc-site-header__submenu-item--has-children:focus-within > .hbc-site-header__submenu-link::after {
	opacity: 1;
	transform: rotate(180deg);
}

/* 提升整个 widget 的 z-index,确保下拉能盖住下方 section */
.elementor-widget-hbc-site-header {
	position: relative;
	z-index: 100;
}

/* ----- 社交图标 -------------------------------------------------------- */
.hbc-site-header__socials {
	display: flex;
	align-items: center;
	gap: 12px;
}

.hbc-site-header__social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2em;
	height: 2em;
	color: #FFFFFF;
	font-size: 18px;
	line-height: 1;
	text-decoration: none;
	border-radius: 50%;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.hbc-site-header__social-link:hover,
.hbc-site-header__social-link:focus {
	opacity: 0.85;
	transform: translateY(-1px);
}

.hbc-site-header__social-link.is-filled {
	background-color: #FFFFFF;
	color: #1F1F1F;
}

.hbc-site-header__social-link i,
.hbc-site-header__social-link svg {
	display: inline-block;
	width: 1em;
	height: 1em;
	line-height: 1;
}

.hbc-site-header__social-link svg {
	fill: currentColor;
}

/* ==========================================================================
 *  汉堡按钮 — 默认隐藏,仅手机端显示
 * ========================================================================== */
.hbc-site-header__toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 32px;
	height: 32px;
	padding: 0;
	margin: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.hbc-site-header__toggle:focus {
	outline: 2px solid rgba(238, 107, 45, 0.6);
	outline-offset: 4px;
}

.hbc-site-header__toggle-bar {
	display: block;
	width: 100%;
	height: 3px;
	background-color: #EE6B2D;
	border-radius: 2px;
	transition: transform 0.25s ease, opacity 0.2s ease;
}

/* ==========================================================================
 *  抽屉(展开后的全屏覆盖层)— 默认隐藏
 * ========================================================================== */
.hbc-site-header__drawer {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background-color: #FFFFFF;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.hbc-site-header__drawer[hidden] {
	display: none;
}

.hbc-site-header__drawer.is-open {
	opacity: 1;
	visibility: visible;
}

/* 关闭按钮(右上角) */
.hbc-site-header__drawer-close {
	position: absolute;
	top: 16px;
	right: 18px;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
	color: #EE6B2D;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	-webkit-appearance: none;
	appearance: none;
	z-index: 2;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.hbc-site-header__drawer-close:hover,
.hbc-site-header__drawer-close:focus {
	opacity: 0.8;
	outline: none;
	transform: rotate(90deg);
}

.hbc-site-header__drawer-close-icon {
	display: block;
	width: 28px;
	height: 28px;
	pointer-events: none;
}

/* 抽屉内层(垂直居中堆放品牌 + 菜单) */
.hbc-site-header__drawer-inner {
	min-height: 100%;
	padding: 80px 24px 48px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 24px;
	text-align: center;
}

/* 抽屉内的 brand 区域 */
.hbc-site-header__drawer-inner .hbc-site-header__brand {
	align-items: center;
	text-align: center;
}

.hbc-site-header__drawer-inner .hbc-site-header__logo-text {
	font-size: 48px;
}

.hbc-site-header__drawer-inner .hbc-site-header__tagline {
	color: #A8A8A8;
	font-size: 13px;
	letter-spacing: 0.08em;
}

/* 抽屉内的菜单(垂直、居中、橙色大字) */
.hbc-site-header__nav--drawer {
	width: 100%;
}

.hbc-site-header__nav--drawer .hbc-site-header__menu {
	flex-direction: column;
	align-items: center;
	gap: 18px;
}

.hbc-site-header__nav--drawer .hbc-site-header__menu-link {
	color: #EE6B2D;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.hbc-site-header__nav--drawer .hbc-site-header__menu-link:hover,
.hbc-site-header__nav--drawer .hbc-site-header__menu-link:focus,
.hbc-site-header__nav--drawer .hbc-site-header__menu-link.is-active {
	color: #1F1F1F;
}

/* 抽屉打开时锁定 body 滚动 */
body.hbc-site-header-drawer-open {
	overflow: hidden;
}

/* ==========================================================================
 *  响应式
 * ========================================================================== */

/* 平板:稍微紧凑一点的桌面布局 */
@media (max-width: 1024px) {
	.hbc-site-header {
		padding: 16px 24px;
	}
	.hbc-site-header__menu {
		gap: 20px;
	}
	.hbc-site-header__right {
		gap: 20px;
	}
}

/* 手机:启用汉堡 + 抽屉模式 */
@media (max-width: 767px) {
	.hbc-site-header {
		padding: 14px 20px;
	}

	/* 桌面菜单隐藏 */
	.hbc-site-header__inner > .hbc-site-header__right .hbc-site-header__nav:not(.hbc-site-header__nav--drawer) {
		display: none;
	}

	/* 汉堡按钮显示 */
	.hbc-site-header__toggle {
		display: inline-flex;
	}

	/* 主布局保持单行:LOGO 在左,社交 + 汉堡在右 */
	.hbc-site-header__inner {
		flex-wrap: nowrap;
	}
	.hbc-site-header__right {
		gap: 14px;
	}

	/* LOGO 文字略小 */
	.hbc-site-header__logo-text {
		font-size: 32px;
	}
	.hbc-site-header__tagline {
		font-size: 10px;
	}
}

/* 极窄屏:再缩一点 */
@media (max-width: 380px) {
	.hbc-site-header__right {
		gap: 10px;
	}
	.hbc-site-header__socials {
		gap: 8px;
	}
}
