/* ==========================================================================
   Hello Biz Child – 页眉小部件
   - 默认透明，向下滚动后变为黑色
   - 左右菜单 + 中央 Logo + 右侧电话
   ========================================================================== */

.hbc-header {
	--hbc-header-bg: rgba(0, 0, 0, 0);
	--hbc-header-bg-scrolled: #000000;
	--hbc-header-color: #ffffff;
	--hbc-header-color-scrolled: #ffffff;
	--hbc-header-hover: #e5b94d;
	--hbc-header-hover-scrolled: #e5b94d;
	--hbc-logo-filter: brightness(0) invert(1);
	--hbc-logo-filter-scrolled: brightness(0) invert(1);

	/* 始终固定在视口顶部 */
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 9999;
	background-color: var(--hbc-header-bg);
	color: var(--hbc-header-color);
	transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.hbc-header.is-scrolled {
	background-color: var(--hbc-header-bg-scrolled);
	color: var(--hbc-header-color-scrolled);
}

/* 内容容器 ------------------------------------------------------------ */
.hbc-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	max-width: 100%;
	margin: 0 auto;
}

.hbc-header__nav {
	flex: 1 1 0;
	display: flex;
	align-items: center;
}

.hbc-header__nav--left {
	justify-content: flex-end;
}

.hbc-header__nav--right {
	justify-content: flex-start;
	gap: 24px;
}

/* Logo --------------------------------------------------------------- */
.hbc-header__logo {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 5px 24px;
	line-height: 0;
}

.hbc-header__logo img {
	display: block;
	max-width: 100%;
	width: auto;
	height: 60px;
	object-fit: contain;
	/* 默认透明背景下，深色 Logo 通过滤镜反白 */
	filter: var(--hbc-logo-filter);
	transition: filter 0.3s ease;
}

.hbc-header.is-scrolled .hbc-header__logo img {
	filter: var(--hbc-logo-filter-scrolled);
}

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

.hbc-header__menu-item {
	margin: 0;
	padding: 0;
}

.hbc-header__menu a {
	display: inline-block;
	color: inherit;
	text-decoration: none;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	font-size: 14px;
	line-height: 1;
	padding: 8px 0;
	transition: color 0.2s ease, opacity 0.2s ease;
}

.hbc-header__menu a:hover,
.hbc-header__menu a:focus,
.hbc-header__menu-item.is-current > a {
	color: var(--hbc-header-hover);
}

.hbc-header.is-scrolled .hbc-header__menu a:hover,
.hbc-header.is-scrolled .hbc-header__menu a:focus,
.hbc-header.is-scrolled .hbc-header__menu-item.is-current > a {
	color: var(--hbc-header-hover-scrolled);
}

/* 电话 --------------------------------------------------------------- */
.hbc-header__phone {
	margin-left: auto;
	margin-right: 10px;
	color: inherit;
	text-decoration: none;
	font-weight: 700;
	white-space: nowrap;
	font-size: 14px;
	letter-spacing: 0.03em;
	padding: 8px 0;
	transition: color 0.2s ease;
}

.hbc-header__phone:hover,
.hbc-header__phone:focus {
	color: var(--hbc-header-hover);
}

.hbc-header.is-scrolled .hbc-header__phone:hover,
.hbc-header.is-scrolled .hbc-header__phone:focus {
	color: var(--hbc-header-hover-scrolled);
}

/* 移动端汉堡按钮 ----------------------------------------------------- */
.hbc-header__toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	background: transparent;
	background-color: transparent !important;
	color: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
	box-shadow: none;
}

.hbc-header__toggle:hover,
.hbc-header__toggle:focus,
.hbc-header__toggle:active,
.hbc-header__toggle[aria-expanded="true"] {
	color: #ffffff;
	outline: none;
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none;
}

.hbc-header__toggle span {
	display: block;
	width: 22px;
	height: 2px;
	margin: 0 auto;
	background-color: currentColor;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.hbc-header__toggle[aria-expanded="true"] span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.hbc-header__toggle[aria-expanded="true"] span:nth-child(2) {
	opacity: 0;
}
.hbc-header__toggle[aria-expanded="true"] span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* 移动端展开菜单 ----------------------------------------------------- */
.hbc-header__mobile {
	display: none;
	padding: 16px 24px 24px;
	background-color: var(--hbc-header-bg-scrolled);
	color: var(--hbc-header-color-scrolled);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hbc-header__mobile .hbc-header__menu {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
}

.hbc-header__mobile .hbc-header__menu a {
	display: block;
	padding: 14px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hbc-header__mobile .hbc-header__phone--mobile {
	display: inline-block;
	margin-top: 16px;
}

/* 响应式 ------------------------------------------------------------- */
@media (max-width: 1024px) {
	.hbc-header__menu a {
		font-size: 13px;
	}
	.hbc-header__menu {
		gap: 18px;
	}
	.hbc-header__nav--right {
		gap: 16px;
	}
}

@media (max-width: 880px) {
	.hbc-header__inner {
		justify-content: space-between;
	}
	.hbc-header__nav {
		display: none;
	}
	.hbc-header__logo {
		flex: 1 1 auto;
		justify-content: center;
		padding: 5px 12px;
	}
	.hbc-header__toggle {
		display: inline-flex;
	}
	.hbc-header__mobile.is-open {
		display: block;
	}
	/* 移动端始终保持深色背景，避免菜单展开时透明 */
	.hbc-header.has-mobile-open {
		background-color: var(--hbc-header-bg-scrolled);
		color: var(--hbc-header-color-scrolled);
	}
}

/* WordPress 管理员工具栏适配：top 由 JS 动态写入，CSS 不再写死 ---------- */

/* Elementor 编辑器内：禁用 fixed，防止覆盖编辑面板与控件 -------------- */
.elementor-editor-active .hbc-header {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
}
