/* =========================================================================
 * X3SALES DV Header — element vhm_thm_header
 * Header: logo (trái) + menu ngang cuộn mượt tới section + nút hamburger (mobile);
 * kèm nút nổi Zalo/Gọi (fixed) nhấp nháy. Dựng flexbox (responsive, tự xuống hàng)
 * thay cho absolute px của bản gốc. Màu đổ qua --thm-header-*. Scope dưới
 * .thm-header / .thm-fab.
 * ========================================================================= */

.thm-header,
.thm-header *,
.thm-fab,
.thm-fab * {
	box-sizing: border-box;
}

/* -------- Header -------- */
.thm-header {
	position: sticky;
	top: 0;
	z-index: 100;
	width: 100%;
	background-color: #ffffff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Khi đăng nhập: nằm dưới thanh admin bar của WordPress. */
.admin-bar .thm-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .thm-header {
		top: 46px;
	}
}

.thm-header__inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	max-width: 1200px;
	min-height: 80px;
	margin: 0 auto;
	padding: 8px 15px;
}

/* -------- Logo -------- */
.thm-header__logo {
	flex: 0 0 auto;
	display: block;
	line-height: 0;
}

.thm-header__logo img {
	display: block;
	width: auto;
	height: 60px;
	max-width: 100%;
}

/* Mặc định (desktop): hiện logo PC, ẩn logo mobile.
   Dùng img.class để thắng điểm đặc hiệu của ".thm-header__logo img". */
.thm-header__logo img.thm-header__logo-pc {
	display: block;
}

.thm-header__logo img.thm-header__logo-mobile {
	display: none;
}

/* -------- Menu -------- */
.thm-nav__menu {
	flex: 1 1 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 12px 26px;
}

.thm-nav__item {
	font-size: 14px;
	font-weight: bold;
	line-height: 1.6;
	color: var(--thm-header-nav, #010101);
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
	transition: color 150ms linear;
}

.thm-nav__item:hover,
.thm-nav__item.is-active {
	color: var(--thm-header-active, #264b9c);
}

/* -------- Nút hamburger (chỉ hiện ở mobile) -------- */
.thm-nav__toggle {
	flex: 0 0 auto;
	display: none;
	width: 44px;
	height: 44px;
	cursor: pointer;
}

.thm-nav__toggle svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: var(--thm-header-toggle, #264b9c);
}

/* -------- Nút nổi Zalo / Gọi -------- */
.thm-fab {
	position: fixed;
	left: 8px;
	bottom: 20px;
	width: 64px;
	z-index: 90000050;
}

.thm-fab__zalo {
	display: block;
	width: 52px;
	height: 52px;
	margin: 0 auto 12px;
	border-radius: 50%;
	overflow: hidden;
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.thm-fab__call {
	position: relative;
	display: block;
	width: 64px;
	height: 64px;
	margin: 0 auto;
}

.thm-fab__call-ring {
	position: absolute;
	inset: 0;
	border: 1px solid rgb(249, 187, 0);
	border-radius: 50%;
	background-color: transparent;
	animation: thmFabPulse 1s linear 1s infinite;
}

.thm-fab__call-circle {
	position: absolute;
	inset: 6px;
}

.thm-fab__call-circle svg {
	display: block;
	width: 100%;
	height: 100%;
}

.thm-fab__call-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 48%;
	height: 48%;
	transform: translate(-50%, -50%);
	transform-origin: center center;
	animation: thmFabSwing 1s ease 0s infinite;
}

.thm-fab__call-icon svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: #ffffff;
}

@keyframes thmFabPulse {
	0%   { transform: scale(1); opacity: 1; }
	50%  { transform: scale(1.3); opacity: 0; }
	100% { transform: scale(1); opacity: 0; }
}

@keyframes thmFabSwing {
	0%   { transform: translate(-50%, -50%) rotate(0); }
	20%  { transform: translate(-50%, -50%) rotate(15deg); }
	40%  { transform: translate(-50%, -50%) rotate(-10deg); }
	60%  { transform: translate(-50%, -50%) rotate(5deg); }
	80%  { transform: translate(-50%, -50%) rotate(-5deg); }
	100% { transform: translate(-50%, -50%) rotate(0); }
}

/* -------- Mobile (< 768px): menu gập thành dropdown -------- */
@media (max-width: 767px) {
	.thm-header__inner {
		min-height: 64px;
		justify-content: space-between;
	}

	.thm-header__logo img {
		height: 50px;
	}

	/* Mobile: đổi sang logo mobile, ẩn logo PC. */
	.thm-header__logo img.thm-header__logo-pc {
		display: none;
	}

	.thm-header__logo img.thm-header__logo-mobile {
		display: block;
	}

	.thm-nav__toggle {
		display: block;
	}

	.thm-nav__menu {
		position: absolute;
		top: 100%;
		left: 0;
		width: 100%;
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: stretch;
		justify-content: flex-start;
		gap: 0;
		padding: 8px 0;
		background-color: #ffffff;
		box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
		display: none;
		z-index: 100;
	}

	.thm-nav__menu.is-open {
		display: flex;
	}

	.thm-nav__item {
		display: block;
		padding: 10px 16px;
	}
}

/* -------------------------------------------------------------------------
 * Chế độ UX Builder ("chip viền builder"): các mục menu hiện thành chip CÓ VIỀN
 * để dễ nhìn/kéo-thả/sửa. Nút hamburger luôn hiện trong builder để minh hoạ.
 * Frontend giữ thanh menu thật.
 * ---------------------------------------------------------------------- */
.thm-header--builder .thm-nav__toggle {
	display: block;
}

.thm-header__builder-items {
	flex: 1 1 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.thm-header__builder-note {
	flex: 1 1 100%;
	margin: 0 0 4px;
	color: #555;
	font-size: 13px;
	font-style: italic;
}

.thm-header__b-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border: 1px dashed rgba(0, 0, 0, 0.35);
	border-radius: 8px;
	background: rgba(184, 127, 14, 0.06);
	color: #111;
	font-size: 13px;
	line-height: 1.3;
}

.thm-header__b-item.is-active {
	border-color: var(--thm-header-active, #264b9c);
	background: rgba(184, 127, 14, 0.14);
}

.thm-header__b-tag {
	padding: 2px 7px;
	border-radius: 999px;
	background: var(--fs-color-primary, #264b9c);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
}

.thm-header__b-text {
	font-weight: 700;
}

.thm-header__b-meta {
	color: #777;
	font-size: 12px;
}
