/*
 * Khung theme HPT: đầu trang dính (2 tầng, gộp 1 tầng khi cuộn), mega menu,
 * ngăn kéo điện thoại, chân trang nhiều cột. Token và nền chung nằm ở
 * base.css và theme.json.
 * Điểm ngắt giống Flatsome cũ: small <= 549px, medium <= 849px (từ đây là
 * giao diện hamburger).
 * Chiều cao header: tầng 1 72px + menu 54px; dính: 1 tầng 64px; điện thoại
 * 64px. Phần tử ngoài `.hpt-site-header` giữ chiều cao cố định khi đầu trang
 * co lại nên cuộn không làm nội dung nhảy (CLS 0). Lô khác cần dính dưới
 * header: top = var(--hpt-header-stuck).
 */

/* ------------------------------------------------------------------ */

/* Đầu trang                                                          */

/* ------------------------------------------------------------------ */
.hpt-site-header {
	--hpt-header-full: calc(var(--hpt-header-top) + var(--hpt-header-nav));

	position: sticky;
	top: 0;
	z-index: 100;
	background: transparent;
	pointer-events: none;
}

.admin-bar .hpt-site-header {
	top: 32px;
}

@media (max-width: 782px) {

	.admin-bar .hpt-site-header {
		top: 46px;
	}
}

@media (min-width: 850px) {

	.hpt-site-header {
		height: var(--hpt-header-full);
	}
}

.hpt-header {
	position: relative;
	background: var(--hpt-bg);
	border-bottom: 1px solid var(--hpt-line);
	color: var(--hpt-text);
	pointer-events: auto;
}

.hpt-header__inner {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: 200px minmax(0, 1fr) auto;
	grid-template-areas:
		"logo search social"
		"nav nav nav";
	grid-template-rows: var(--hpt-header-top) var(--hpt-header-nav);
	align-items: center;
	column-gap: 24px;
	max-width: var(--hpt-container);
	margin: 0 auto;
	padding: 0 var(--hpt-gutter);
}

.hpt-logo {
	grid-area: logo;
	display: flex;
	align-items: center;
	height: 100%;
	color: var(--hpt-text);
	text-decoration: none;
}

.hpt-logo__img {
	display: block;
	width: auto;
	max-width: 180px;
	height: auto;
	max-height: 52px;
}

.hpt-logo__svg {
	height: 60px;
	max-height: none;
	max-width: none;
	overflow: visible;
}

/* M13c: logo = dấu "hp" + chữ, 2 svg cạnh nhau (ghép lại 504x151). */
.hpt-logo__mark {
	aspect-ratio: 111 / 151;
}

.hpt-logo__word {
	aspect-ratio: 393 / 151;
}

/* Ô tìm kiếm pill */
.hpt-search {
	grid-area: search;
	position: relative;
	width: 100%;
	max-width: 560px;
	margin: 0 auto;
}

.hpt-search__field {
	box-sizing: border-box;
	width: 100%;
	height: 42px;
	padding: 0 52px 0 20px;
	border: 1px solid var(--hpt-line);
	border-radius: var(--hpt-r-pill);
	background: var(--hpt-surface-2);
	color: var(--hpt-text);
	font-family: inherit;
	font-size: var(--hpt-fs-search);
	box-shadow: none;
}

.hpt-search__field:focus {
	border-color: var(--hpt-accent);
	background: var(--hpt-surface-2);
	outline: none;
}

.hpt-search__field:focus-visible {
	outline: 2px solid var(--hpt-focus);
	outline-offset: 2px;
}

.hpt-search__submit {
	position: absolute;
	top: 0;
	right: 0;
	display: grid;
	place-items: center;
	width: 48px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: var(--hpt-r-pill);
	background: transparent;
	color: var(--hpt-muted);
	cursor: pointer;
	transition: color 200ms var(--hpt-ease);
}

.hpt-search__submit:hover,
.hpt-search__submit:focus-visible {
	color: var(--hpt-accent-ink);
}

/* Mạng xã hội: nút tròn viền, vùng bấm 44px */
.hpt-social {
	grid-area: social;
	display: flex;
	gap: 8px;
}

.hpt-social__link {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	box-sizing: border-box;
	border: 1px solid var(--hpt-line);
	border-radius: 50%;
	color: var(--hpt-text);
	text-decoration: none;
	transition:
		border-color 200ms var(--hpt-ease),
		color 200ms var(--hpt-ease),
		transform 200ms var(--hpt-ease);
}

.hpt-social__link:hover,
.hpt-social__link:focus-visible {
	border-color: var(--hpt-accent);
	color: var(--hpt-accent-ink);
}

.hpt-social__link:active {
	transform: scale(0.96);
}

/* Nút menu (hamburger) và nút tìm: chỉ khi gộp tầng / điện thoại */
.hpt-menu-toggle,
.hpt-themebtn,
.hpt-searchbtn {
	display: none;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--hpt-text);
	cursor: pointer;
	transition: color 200ms var(--hpt-ease), transform 200ms var(--hpt-ease);
}

.hpt-menu-toggle {
	grid-area: toggle;
}

.hpt-themebtn {
	grid-area: theme;
}

.hpt-searchbtn {
	grid-area: searchbtn;
}

.hpt-menu-toggle:hover,
.hpt-themebtn:hover,
.hpt-searchbtn:hover,
.hpt-searchbtn[aria-expanded="true"] {
	color: var(--hpt-accent-ink);
}

.hpt-menu-toggle:active,
.hpt-themebtn:active,
.hpt-searchbtn:active {
	transform: scale(0.96);
}

/*
 * Menu ngang (tầng dưới): thoáng, không dấu ngăn; đường kẻ 1px tràn hết bề
 * ngang giữa 2 tầng. `.hpt-nav` và các `li` KHÔNG định vị, để bảng mega bám
 * theo `.hpt-header` và tràn hết bề ngang màn hình.
 */
.hpt-nav {
	grid-area: nav;
	min-width: 0;
}

.hpt-nav::before {
	content: "";
	position: absolute;
	top: var(--hpt-header-top);
	left: 50%;
	width: 100vw;
	height: 1px;
	margin-left: -50vw;
	background: var(--hpt-line);
}

.hpt-nav__list {
	--hpt-nav-pad: clamp(5px, 2.4vw - 16px, 20px);

	display: flex;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: stretch;
	height: var(--hpt-header-nav);
	margin: 0;
	padding: 0;
	list-style: none;
}

.hpt-nav__list > li {
	display: flex;
	align-items: stretch;
	margin: 0;
}

.hpt-nav__list > li > a,
.hpt-nav__toggle {
	position: relative;
	display: flex;
	align-items: center;
	color: var(--hpt-muted);
	transition: color 180ms var(--hpt-ease);
}

.hpt-nav__list > li > a {
	padding: 0 var(--hpt-nav-pad);
	font-family: var(--hpt-font-nav);
	font-size: clamp(10.5px, 0.5vw + 6.5px, var(--hpt-fs-nav));
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
}

.hpt-nav__list > li > a::after,
.hpt-nav__toggle::after {
	content: "";
	position: absolute;
	left: var(--hpt-nav-pad);
	right: var(--hpt-nav-pad);
	bottom: 10px;
	height: 2px;
	border-radius: 2px;
	background: var(--hpt-accent);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 180ms var(--hpt-ease);
}

/* Mục có mega: liên kết + nút mũi tên liền nhau, gạch chân chạy suốt cả hai */
.hpt-nav__list > li.hpt-has-mega > a {
	padding-right: 3px;
}

.hpt-nav__list > li.hpt-has-mega > a::after {
	right: 0;
}

.hpt-nav__toggle {
	min-width: 18px;
	padding: 0 var(--hpt-nav-pad) 0 2px;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.hpt-nav__toggle::after {
	left: 0;
}

.hpt-nav__list > li > a:hover,
.hpt-nav__list > li:hover > a,
.hpt-nav__list > li:hover > .hpt-nav__toggle,
.hpt-nav__list > li:focus-within > a,
.hpt-nav__list > li:focus-within > .hpt-nav__toggle,
.hpt-nav__list > li.is-mega-active > a,
.hpt-nav__list > li.is-mega-active > .hpt-nav__toggle,
.hpt-nav__list > li.current-menu-item > a,
.hpt-nav__list > li.current-menu-ancestor > a {
	color: var(--hpt-text);
}

.hpt-nav__list > li > a:hover::after,
.hpt-nav__list > li:hover > a::after,
.hpt-nav__list > li:hover > .hpt-nav__toggle::after,
.hpt-nav__list > li:focus-within > a::after,
.hpt-nav__list > li:focus-within > .hpt-nav__toggle::after,
.hpt-nav__list > li.is-mega-active > a::after,
.hpt-nav__list > li.is-mega-active > .hpt-nav__toggle::after,
.hpt-nav__list > li.current-menu-item > a::after,
.hpt-nav__list > li.current-menu-ancestor > a::after {
	transform: scaleX(1);
}

.hpt-nav__toggle:focus-visible,
.hpt-nav__list > li > a:focus-visible {
	outline: 2px solid var(--hpt-focus);
	outline-offset: -4px;
	border-radius: 6px;
}

.hpt-nav__toggle .hpt-icon--chevron-down {
	flex: none;
	opacity: 0.6;
	transition: transform 180ms var(--hpt-ease);
}

.hpt-nav__list > li.is-mega-active .hpt-icon--chevron-down {
	transform: rotate(180deg);
}

/*
 * Mega menu kiểu flyout toàn bề ngang (cảm hứng cách trình bày của menu xổ
 * trên các site công nghệ lớn): tấm kính tối ngay dưới thanh menu, nội dung
 * căn theo container, cột chữ lớn bên trái, icon 3D xem trước bên phải.
 * Mở/đóng bằng JS (header.js): lớp `is-open` trên bảng, `is-mega-open` trên
 * header. Mở chậm hơn đóng; chỉ animate clip-path + opacity + transform
 * (không đụng height). Bảng `display:none` tới lần chạm đầu tiên để ảnh
 * icon (loading=lazy) không bị nạp lúc mở trang.
 */
.hpt-mega__panel {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 5;
	box-sizing: border-box;
	padding: clamp(20px, 3vw, 36px) 0 clamp(24px, 3.4vw, 44px);
	border-bottom: 1px solid var(--hpt-line);
	background: var(--hpt-bg);
	box-shadow: var(--hpt-shadow-pop);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	clip-path: inset(0 0 100% 0);
	transform: translateY(-6px);
	transition:
		clip-path 160ms cubic-bezier(0.4, 0, 1, 1),
		opacity 120ms linear,
		transform 160ms cubic-bezier(0.4, 0, 1, 1),
		visibility 0s linear 160ms;
}

.hpt-mega__panel:not(.is-primed) {
	display: none;
}

@supports (backdrop-filter: blur(1px)) {

	.hpt-mega__panel {
		background: color-mix(in srgb, var(--hpt-bg) 92%, transparent);
		backdrop-filter: blur(20px) saturate(1.2);
	}
}

@media (prefers-reduced-transparency: reduce) {

	.hpt-mega__panel {
		background: var(--hpt-bg);
		backdrop-filter: none;
	}
}

.hpt-mega__panel.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	clip-path: inset(0 0 -48px 0);
	transform: none;
	transition:
		clip-path 340ms cubic-bezier(0.16, 1, 0.3, 1),
		opacity 200ms linear,
		transform 340ms cubic-bezier(0.16, 1, 0.3, 1),
		visibility 0s;
}

/*
 * Đang chuyển giữa các mục cha khi bảng đã mở: đổi nội dung ngay, không
 * đóng rồi mở lại
 */
.hpt-header.is-mega-switching .hpt-mega__panel,
.hpt-header.is-mega-switching .hpt-mega__item {
	transition-duration: 0s;
	transition-delay: 0s;
}

.hpt-mega__inner {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 40%);
	align-items: center;
	gap: clamp(24px, 4vw, 64px);
	max-width: var(--hpt-container);
	margin: 0 auto;
	padding: 0 var(--hpt-gutter);
}

.hpt-mega__panel.is-few .hpt-mega__inner {
	grid-template-columns: minmax(0, 1fr) minmax(280px, 46%);
}

/* M9c: chữ mục co giãn theo khổ; bảng <= 4 mục lớn hơn một bậc */
.hpt-mega__panel.is-few .hpt-mega__item a {
	font-size: clamp(17px, 0.7vw + 9px, 22px);
}

.hpt-mega__panel.is-few .hpt-mega__preview {
	max-width: 580px;
}

.hpt-mega__pv:focus-visible {
	outline: 2px solid var(--hpt-focus);
	outline-offset: 4px;
	border-radius: 6px;
}

.hpt-mega__grid {
	display: grid;
	grid-template-rows: repeat(var(--hpt-mega-rows, 4), auto);
	grid-auto-flow: column;
	grid-auto-columns: max-content;
	justify-content: start;
	column-gap: clamp(32px, 5vw, 72px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.hpt-mega__item {
	margin: 0;
	opacity: 0;
	filter: blur(6px);
	transform: translateY(8px);
	transition:
		opacity 120ms linear,
		transform 120ms linear;
}

.hpt-mega__panel.is-open .hpt-mega__item {
	opacity: 1;
	filter: none;
	transform: none;
	transition:
		opacity 520ms var(--hpt-ease) calc(90ms + var(--i, 0) * 30ms),
		filter 520ms var(--hpt-ease) calc(90ms + var(--i, 0) * 30ms),
		transform 520ms var(--hpt-ease) calc(90ms + var(--i, 0) * 30ms);
}

.hpt-mega__item a {
	display: flex;
	align-items: center;
	gap: 8px;
	width: max-content;
	padding: 8px 0;
	color: var(--hpt-muted);
	font-size: clamp(15px, 0.5vw + 9px, 19px);
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
	white-space: nowrap;
	transition: color 220ms var(--hpt-ease);
}

.hpt-mega__lbl {
	position: relative;
	display: block;
}

/* Gạch chân vàng quét từ trái sang cho mục đang chọn */
.hpt-mega__lbl::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: -3px;
	left: 0;
	height: 2px;
	border-radius: 2px;
	background: var(--hpt-accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 480ms var(--hpt-ease);
}

.hpt-mega__item .hpt-icon {
	flex: none;
	color: var(--hpt-accent-ink);
	opacity: 0;
	transform: translateX(-10px);
	transition:
		opacity 260ms var(--hpt-ease),
		transform 420ms var(--hpt-ease);
}

.hpt-mega__item a.is-current,
.hpt-mega__item a:hover,
.hpt-mega__item a:focus-visible {
	color: var(--hpt-text);
}

.hpt-mega__item a.is-current .hpt-mega__lbl::after,
.hpt-mega__item a:hover .hpt-mega__lbl::after,
.hpt-mega__item a:focus-visible .hpt-mega__lbl::after {
	transform: scaleX(1);
}

.hpt-mega__item a.is-current .hpt-icon,
.hpt-mega__item a:hover .hpt-icon,
.hpt-mega__item a:focus-visible .hpt-icon {
	opacity: 1;
	transform: none;
}

.hpt-mega__item a:focus-visible {
	outline: 2px solid var(--hpt-focus);
	outline-offset: 4px;
	border-radius: 6px;
}

/* Thẻ xem trước: banner danh mục đang chọn, quầng sáng cùng màu ảnh */
.hpt-mega__preview {
	position: relative;
	display: grid;
	justify-self: end;
	width: 100%;
	max-width: 540px;
	opacity: 0;
	transform: translateX(28px) scale(0.96);
	transition: opacity 120ms linear;
}

.hpt-mega__panel.is-open .hpt-mega__preview {
	opacity: 1;
	transform: none;
	transition:
		opacity 600ms var(--hpt-ease) 120ms,
		transform 800ms var(--hpt-ease) 120ms;
}

.hpt-mega__pv {
	position: relative;
	grid-area: 1 / 1;
	display: block;
	min-width: 0;
	color: inherit;
	text-decoration: none;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 380ms var(--hpt-ease),
		visibility 0s linear 380ms;
}

.hpt-mega__pv.is-active {
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

.hpt-mega__glow {
	position: absolute;
	inset: -14% -16% 0 -16%;
	z-index: -1;
	opacity: 0;
	-webkit-mask-image: radial-gradient(closest-side, #000 35%, #0000);
	mask-image: radial-gradient(closest-side, #000 35%, #0000);
	transition: opacity 600ms var(--hpt-ease);
}

.hpt-mega__pv.is-active .hpt-mega__glow {
	opacity: 0.95;
}

/* WP lõi gắn `contain-intrinsic-size: 3000px 1500px` cho img sizes="auto" (ảnh lazy) → thẻ xem trước phình 3000px. */
.hpt-mega__panel .hpt-mega__pv img {
	contain-intrinsic-size: none;
}

.hpt-mega__glow img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: blur(36px) saturate(1.7);
}

.hpt-mega__card {
	display: block;
	overflow: hidden;
	border: 1px solid var(--hpt-line);
	border-radius: var(--hpt-r-card);
	background: var(--hpt-surface);
	box-shadow: var(--hpt-shadow-big);
	transition: border-color 260ms var(--hpt-ease);
}

.hpt-mega__pv:hover .hpt-mega__card {
	border-color: var(--hpt-edge-hover);
}

.hpt-mega__shot {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--hpt-surface-2);
}

.hpt-mega__shot img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1.06);
	transition: transform 900ms var(--hpt-ease);
}

.hpt-mega__pv.is-active .hpt-mega__shot img {
	transform: none;
}

.hpt-mega__pv:hover .hpt-mega__shot img {
	transform: scale(1.03);
}

.hpt-mega__pv.is-icon .hpt-mega__shot picture {
	display: grid;
	height: 100%;
	place-items: center;
}

.hpt-mega__pv.is-icon .hpt-mega__shot img {
	width: auto;
	height: 70%;
	object-fit: contain;
}

.hpt-mega__meta {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px 14px 20px;
}

.hpt-mega__name {
	flex: 1;
	min-width: 0;
	color: var(--hpt-text);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

.hpt-mega__count {
	color: var(--hpt-muted);
	font-size: 13px;
	white-space: nowrap;
}

.hpt-mega__go {
	display: grid;
	flex: none;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: var(--hpt-r-pill);
	background: var(--hpt-accent);
	color: var(--hpt-on-accent);
	transition: transform 360ms var(--hpt-ease);
}

.hpt-mega__pv:hover .hpt-mega__go {
	transform: translateX(3px);
}

/* Ánh sáng: dải sáng chạy 1 lần ở viền dưới khi mở, vệt sáng theo chuột */
.hpt-mega__panel::before {
	content: "";
	position: absolute;
	bottom: -1px;
	left: 0;
	z-index: 2;
	width: 22%;
	height: 2px;
	background: linear-gradient(90deg, #0000, var(--hpt-accent), var(--hpt-heat), #0000);
	opacity: 0;
	pointer-events: none;
}

.hpt-mega__panel.is-open::before {
	animation: hpt-mega-sweep 1200ms var(--hpt-ease) 160ms 1 both;
}

@keyframes hpt-mega-sweep {

	0% {
		opacity: 0;
		transform: translateX(-100%);
	}

	15% {
		opacity: 1;
	}

	100% {
		opacity: 0;
		transform: translateX(480%);
	}
}

.hpt-mega__spot {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 0;
	width: 560px;
	height: 560px;
	margin: -280px 0 0 -280px;
	border-radius: 50%;
	background: radial-gradient(circle, var(--hpt-spot), transparent 62%);
	opacity: 0;
	pointer-events: none;
	transition: opacity 500ms linear;
	will-change: transform;
}

.hpt-mega__panel.has-spot .hpt-mega__spot {
	opacity: 1;
}

.hpt-header.is-mega-switching .hpt-mega__preview,
.hpt-header.is-mega-switching .hpt-mega__panel::before {
	transition-duration: 0s;
	transition-delay: 0s;
	animation: none;
}

/* Lớp mờ tối phủ phần trang bên dưới khi bảng mở (tạo bằng JS) */
.hpt-mega-scrim {
	position: fixed;
	inset: 0;
	z-index: 99;
	background: var(--hpt-scrim);
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 160ms linear,
		visibility 0s linear 160ms;
}

@supports (backdrop-filter: blur(1px)) {

	.hpt-mega-scrim {
		backdrop-filter: blur(4px);
	}
}

.hpt-mega-scrim.is-on {
	opacity: 1;
	visibility: visible;
	transition: opacity 300ms linear;
}

@media (prefers-reduced-motion: reduce) {

	.hpt-mega__panel,
	.hpt-mega__panel.is-open,
	.hpt-mega-scrim,
	.hpt-mega-scrim.is-on {
		transition: none;
	}

	.hpt-mega__panel,
	.hpt-mega__panel.is-open {
		transform: none;
		clip-path: none;
	}

	.hpt-mega__panel::before,
	.hpt-mega__spot {
		display: none;
	}

	.hpt-mega__item,
	.hpt-mega__panel.is-open .hpt-mega__item,
	.hpt-mega__preview,
	.hpt-mega__panel.is-open .hpt-mega__preview {
		opacity: 1;
		filter: none;
		transform: none;
		transition: none;
	}

	.hpt-mega__item a,
	.hpt-mega__item a.is-current,
	.hpt-mega__item a:hover,
	.hpt-mega__item a:focus-visible {
		transform: none;
		transition: none;
	}

	.hpt-mega__pv {
		transition: opacity 120ms linear;
	}

	.hpt-mega__shot img,
	.hpt-mega__pv.is-active .hpt-mega__shot img,
	.hpt-mega__pv:hover .hpt-mega__shot img {
		transform: none;
		transition: none;
	}
}

/* Ô icon dùng trong ngăn kéo điện thoại */
.hpt-mega__thumb {
	flex: none;
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: var(--hpt-r-img);
	background: var(--hpt-surface-2);
}

.hpt-mega__icon {
	display: block;
	width: 48px;
	height: 48px;
	object-fit: contain;
}

/* ------------------------------------------------------------------ */

/* Gộp 1 tầng khi cuộn (>= 850px): logo nhỏ + menu + nút tìm           */

/* ------------------------------------------------------------------ */
@media (min-width: 850px) {

	.hpt-header.is-stuck .hpt-header__inner {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "nav searchbtn";
		grid-template-rows: var(--hpt-header-stuck);
		column-gap: 16px;
	}

	.hpt-header.is-stuck .hpt-logo,
	.hpt-header.is-stuck .hpt-search,
	.hpt-header.is-stuck .hpt-social {
		display: none;
	}

	.hpt-header.is-stuck .hpt-logo__word {
		display: none;
	}

	.hpt-header.is-stuck .hpt-searchbtn {
		display: grid;
		animation: hpt-fade-in 180ms var(--hpt-ease);
	}

	.hpt-header.is-stuck .hpt-nav__list {
		height: var(--hpt-header-stuck);
	}

	.hpt-header.is-stuck .hpt-nav::before {
		display: none;
	}

	.hpt-header.is-stuck .hpt-nav__list {
		--hpt-nav-pad: clamp(6px, 0.9vw, 10px);
	}

	.hpt-header.is-stuck .hpt-nav__list > li > a::after,
	.hpt-header.is-stuck .hpt-nav__toggle::after {
		bottom: 14px;
	}
}

@media (min-width: 1160px) {

	.hpt-header.is-stuck .hpt-header__inner {
		grid-template-columns: auto minmax(0, 1fr) auto;
		grid-template-areas: "logo nav searchbtn";
	}

	.hpt-header.is-stuck .hpt-logo {
		display: flex;
		animation: hpt-fade-in 180ms var(--hpt-ease);
	}

	.hpt-header.is-stuck .hpt-logo__img {
		max-height: 34px;
	}

	/* M13c: khi dính chỉ còn dấu "hp" (38 > 46px), bỏ hẳn chữ. */
	.hpt-header.is-stuck .hpt-logo__svg {
		height: 46px;
		max-height: none;
	}
}

/* M13c: 1160-1299px thu khoảng đệm menu để vừa dấu "hp" (cỡ chữ giữ). */
@media (min-width: 1160px) and (max-width: 1299px) {

	.hpt-header.is-stuck .hpt-nav__list {
		--hpt-nav-pad: 7px;
	}
}

/*
 * M13c: hết dính (JS thêm .is-unstuck ~1s): dấu "hp" phóng từ 46px
 * về 60px, chữ lộ dần trái sang phải sau 120ms. Chỉ transform,
 * opacity, clip-path; lần tải đầu không có class nên không chạy.
 */
@media (min-width: 850px) and (prefers-reduced-motion: no-preference) {

	.hpt-header.is-unstuck .hpt-logo__mark {
		transform-origin: 0 50%;
		animation: hpt-mark-grow 380ms var(--hpt-ease) backwards;
	}

	.hpt-header.is-unstuck .hpt-logo__word {
		animation: hpt-word-reveal 450ms var(--hpt-ease) 120ms backwards;
	}
}

@keyframes hpt-mark-grow {

	from {
		transform: scale(0.767);
	}
}

@keyframes hpt-word-reveal {

	from {
		opacity: 0;
		clip-path: inset(-10% 100% -10% -2%);
	}

	to {
		opacity: 1;
		clip-path: inset(-10% -10% -10% -2%);
	}
}

@keyframes hpt-fade-in {

	from {
		opacity: 0;
	}
}

/* Ô tìm dạng bảng thả xuống (khi gộp tầng hoặc trên điện thoại) */
.hpt-header.is-search-open .hpt-search {
	position: absolute;
	top: 100%;
	left: 50%;
	z-index: 6;
	display: block;
	box-sizing: border-box;
	width: min(640px, calc(100% - 2 * var(--hpt-gutter)));
	margin: 8px 0 0;
	padding: 10px;
	border: 1px solid var(--hpt-line);
	border-radius: var(--hpt-r-card);
	background: var(--hpt-surface);
	box-shadow: var(--hpt-shadow);
	transform: translateX(-50%);
	animation: hpt-pop-in 180ms var(--hpt-ease);
}

.hpt-header.is-search-open .hpt-search__submit {
	top: 10px;
	right: 10px;
}

@keyframes hpt-pop-in {

	from {
		opacity: 0;
		transform: translate(-50%, 8px);
	}
}

/* ------------------------------------------------------------------ */

/* <= 849px: hamburger trái, logo giữa, nút tìm phải                  */

/* ------------------------------------------------------------------ */
@media (max-width: 849px) {

	.hpt-site-header {
		height: auto;
	}

	.hpt-header__inner {

		/* Q28 A: hamburger + nút sáng/tối (48px) trái, nút tìm phải;
		   cột phải thêm 48px đối xứng để logo vẫn ở giữa. */
		grid-template-columns: 48px 48px minmax(0, 1fr) 48px 48px;
		grid-template-areas: "toggle theme logo searchbtn searchbtn";
		grid-template-rows: var(--hpt-header-mobile);
		column-gap: 0;
		padding: 0 8px;
	}

	.hpt-menu-toggle,
	.hpt-themebtn,
	.hpt-searchbtn {
		display: grid;
	}

	.hpt-searchbtn {
		justify-self: end;
	}

	.hpt-logo {
		justify-content: center;
	}

	.hpt-logo__img {
		max-height: 40px;
	}

	.hpt-logo__svg {
		height: 46px;
		max-height: none;
	}

	.hpt-header__inner > .hpt-search,
	.hpt-header__inner > .hpt-social,
	.hpt-nav {
		display: none;
	}

	.hpt-header.is-search-open .hpt-header__inner > .hpt-search {
		display: block;
	}
}

/* < 380px: không đủ chỗ cho cột đối xứng (logo ~154px): bỏ cột thừa, logo
   lệch 24px sang phải thay vì đè nút. */
@media (max-width: 379px) {

	.hpt-header__inner {
		grid-template-columns: 48px 48px minmax(0, 1fr) 48px;
		grid-template-areas: "toggle theme logo searchbtn";
	}
}

/* ------------------------------------------------------------------ */

/* Ngăn kéo (nằm ở wp_footer, ngoài header có z-index)                */

/* ------------------------------------------------------------------ */
.hpt-overlay {
	position: fixed;
	inset: 0;
	z-index: 999;
	background: var(--hpt-scrim-drawer);
	opacity: 0;
	transition: opacity 220ms var(--hpt-ease);
}

.hpt-overlay:not([hidden]) {
	opacity: 1;
}

.hpt-drawer {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: 1000;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: min(360px, 88vw);
	border-right: 1px solid var(--hpt-line);
	background: var(--hpt-surface);
	color: var(--hpt-text);
	overflow: hidden;
	visibility: hidden;
	transform: translateX(-100%);
	transition: transform 220ms var(--hpt-ease), visibility 0s linear 220ms;
}

.hpt-drawer.is-open {
	visibility: visible;
	transform: none;
	transition-delay: 0s;
	box-shadow: var(--hpt-shadow-drawer);
}

html.hpt-drawer-open {
	overflow: hidden;
}

.hpt-drawer__head {
	display: flex;
	flex: none;
	justify-content: flex-end;
	padding: 8px 8px 0;
}

.hpt-drawer__close {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--hpt-text);
	cursor: pointer;
}

.hpt-drawer__close:hover {
	color: var(--hpt-accent-ink);
}

.hpt-drawer__scroll {
	position: relative;
	flex: 1 1 auto;
	padding: 4px 20px 28px;
	overflow-x: hidden;
	overflow-y: auto;
}

.hpt-drawer .hpt-search {
	max-width: none;
	margin: 0 0 12px;
}

.hpt-drawer__menu,
.hpt-drawer__sub {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hpt-drawer__menu > li {
	display: flex;
	align-items: center;
	margin: 0;
	border-bottom: 1px solid var(--hpt-line);
}

.hpt-drawer__menu a {
	display: flex;
	align-items: center;
	min-height: 52px;
	color: var(--hpt-text);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
}

.hpt-drawer__menu > li > a {
	flex: 1;
}

.hpt-drawer__menu a:hover {
	color: var(--hpt-accent-ink);
}

.hpt-drawer__menu li.current-menu-item > a {
	box-shadow: -12px 0 0 -10px var(--hpt-accent);
	color: var(--hpt-accent-ink);
}

.hpt-drawer__next {
	flex: none;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	margin-right: -12px;
	border: 0;
	background: transparent;
	color: var(--hpt-muted);
	cursor: pointer;
}

/* Cấp 2: tấm phủ trượt từ phải vào (220ms), nút quay lại ở đầu */
.hpt-drawer__sub {
	position: absolute;
	inset: 0;
	z-index: 2;
	padding: 4px 20px 28px;
	background: var(--hpt-surface);
	overflow-y: auto;
	visibility: hidden;
	transform: translateX(100%);
	transition: transform 220ms var(--hpt-ease), visibility 0s linear 220ms;
}

.hpt-drawer__menu > li.is-open > .hpt-drawer__sub {
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}

.hpt-drawer__sub > li {
	margin: 0;
	border-bottom: 1px solid var(--hpt-line);
}

.hpt-drawer__sub .menu-item a {
	gap: 12px;
	padding: 6px 0;
}

.hpt-drawer__sub .hpt-mega__thumb {
	width: 48px;
	height: 48px;
}

.hpt-drawer__sub .hpt-mega__icon {
	width: 40px;
	height: 40px;
}

.hpt-drawer__back {
	display: flex;
	align-items: center;
	gap: 6px;
	width: 100%;
	min-height: 52px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--hpt-accent-ink);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-align: left;
	text-transform: uppercase;
	cursor: pointer;
}

.hpt-drawer .hpt-social {
	margin-top: 24px;
}

/* ------------------------------------------------------------------ */

/* Chân trang nhiều cột                                               */

/* ------------------------------------------------------------------ */
.hpt-site-footer {
	position: relative;
	background: var(--hpt-surface);
	border-top: 1px solid var(--hpt-line);
}

/* Vệt sáng vàng rất nhẹ trên viền trên, không thêm phần tử */
.hpt-site-footer::before {
	content: "";
	position: absolute;
	top: -1px;
	left: 0;
	right: 0;
	height: 1px;
	--hpt-glow: rgb(255 214 0 / 40%);

	background: linear-gradient(90deg, transparent, var(--hpt-glow), transparent);
	pointer-events: none;
}

.hpt-footer {
	background: var(--hpt-surface);
	color: var(--hpt-text);
}

/*
 * Hàng trên: thương hiệu | địa chỉ + email | kinh doanh + bảo hành.
 * Menu chiếm cả hàng dưới.
 */
.hpt-footer__grid {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: minmax(200px, 0.9fr) 1.5fr 1.3fr;
	gap: 36px clamp(32px, 5vw, 72px);
	max-width: var(--hpt-container);
	margin: 0 auto;
	padding: clamp(40px, 5vw, 64px) var(--hpt-gutter) clamp(24px, 3vw, 32px);
}

.hpt-footer__col {
	min-width: 0;
}

.hpt-footer__brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 20px;
}

.hpt-logo--footer {
	height: auto;
}

.hpt-logo--footer .hpt-logo__img {
	max-width: 200px;
	max-height: 64px;
}

.hpt-logo--footer .hpt-logo__svg {
	height: 72px;
	max-height: none;
	max-width: none;
}

/* Nhãn: 13px / 600 / muted, icon vàng (giữ nguyên hoa/thường của chữ gốc) */
.hpt-footer__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 10px;
	color: var(--hpt-muted);
	font-family: var(--hpt-font-display);
	font-size: var(--hpt-fs-nav);
	font-weight: 600;
	letter-spacing: 0.03em;
	line-height: 1.4;
}

.hpt-footer__title .hpt-icon {
	flex: none;
	color: var(--hpt-accent-ink);
}

/* Giá trị: 15px trắng; phần tiền tố (Showroom:, Hotline 01:) muted */
.hpt-footer__line {
	margin: 0 0 8px;
	color: var(--hpt-text);
	font-size: var(--hpt-fs-body);
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.hpt-footer__k {
	color: var(--hpt-muted);
}

.hpt-footer__title + .hpt-footer__line:last-child {
	margin-bottom: 0;
}

.hpt-footer__line + .hpt-footer__title {
	margin-top: 28px;
}

.hpt-footer__link {
	color: var(--hpt-text);
	font-weight: 600;
	text-decoration: none;
	transition: color 200ms var(--hpt-ease);
}

.hpt-footer__link[href^="tel:"] {
	white-space: nowrap;
}

.hpt-footer__link:hover,
.hpt-footer__link:focus-visible {
	color: var(--hpt-accent-ink);
}

/* Menu: một hàng ngang gọn dưới cùng, ngăn cách bằng viền mảnh */
.hpt-footer__menu {
	grid-column: 1 / -1;
	padding-top: 20px;
	border-top: 1px solid var(--hpt-line);
}

.hpt-footer__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0 clamp(16px, 2vw, 36px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.hpt-footer__list > li {
	margin: 0;
}

.hpt-footer__list a {
	display: flex;
	align-items: center;
	min-height: 44px;
	color: var(--hpt-muted);
	font-size: var(--hpt-fs-nav);
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	transition: color 200ms var(--hpt-ease);
}

.hpt-footer__list a:hover,
.hpt-footer__list a:focus-visible,
.hpt-footer__list li.current-menu-item > a {
	color: var(--hpt-accent-ink);
}

.hpt-footer__bar {
	box-sizing: border-box;
	max-width: var(--hpt-container);
	margin: 0 auto;
	padding: 20px var(--hpt-gutter);
	background:
		linear-gradient(var(--hpt-line), var(--hpt-line))
		center top / calc(100% - 2 * var(--hpt-gutter)) 1px no-repeat;
	color: var(--hpt-muted);
	font-family: var(--hpt-font-body);
	font-size: var(--hpt-fs-small);
	line-height: 20px;
}

.hpt-footer__copy {
	color: var(--hpt-muted);
}

.hpt-footer__copy strong {
	color: var(--hpt-text);
	font-weight: 600;
}

.hpt-totop {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 90;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid var(--hpt-line);
	border-radius: 50%;
	background: var(--hpt-surface-2);
	color: var(--hpt-text);
	cursor: pointer;
	transition:
		transform 200ms var(--hpt-ease),
		border-color 200ms var(--hpt-ease),
		color 200ms var(--hpt-ease);
}

.hpt-totop[hidden] {
	display: none;
}

.hpt-totop:hover {
	border-color: var(--hpt-accent);
	color: var(--hpt-accent-ink);
	transform: translateY(-2px);
}

@media (max-width: 1023px) {

	/* Thương hiệu một hàng riêng, hai cột thông tin bên dưới */
	.hpt-footer__grid {
		grid-template-columns: 1fr 1fr;
	}

	.hpt-footer__brand {
		grid-column: 1 / -1;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}

@media (max-width: 767px) {

	.hpt-footer__list {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 0 20px;
	}
}

@media (max-width: 549px) {

	.hpt-footer__grid {
		grid-template-columns: 1fr;
		gap: 28px;
	}

	.hpt-footer__col:nth-child(3) {
		padding-top: 28px;
		border-top: 1px solid var(--hpt-line);
	}

	.hpt-footer__bar {
		text-align: center;
	}
}

/*
 * Dưới 1100px chưa đủ chỗ cho mũi tên nhỏ: bỏ mũi tên, mega menu vẫn mở khi
 * rê chuột/focus
 */
@media (min-width: 850px) and (max-width: 1099px) {

	.hpt-nav__toggle {
		min-width: 0;
	}

	.hpt-nav__toggle .hpt-icon--chevron-down {
		width: 10px;
		height: 10px;
	}

	.hpt-nav__list > li > a {
		letter-spacing: 0.03em;
	}
}

@media (min-width: 850px) and (max-width: 879px) {

	.hpt-nav__list {
		--hpt-nav-pad: 3px;
	}
}

/*
 * ===== M15 (lô sửa bố cục QA Q5): BẮT ĐẦU khối riêng, chỉ bố cục/kích thước,
 * không đổi màu =====
 */

/* V-14: icon mạng xã hội vùng chạm 44x44. */
.hpt-social__link {
	width: 44px;
	height: 44px;
}

/* V-13: số điện thoại ở chân trang không ngắt giữa số. */
.hpt-footer__link {
	white-space: nowrap;
}

/* V-09: mục ngăn kéo cấp 1 có đệm trái, thanh mục đang chọn không dính chữ. */
.hpt-drawer__menu > li > a {
	padding-left: 14px;
}

/*
 * V-08: nút lên đầu trang tạm ẩn khi đè lên icon/liên kết chân trang
 * (header.js bật .is-dodging).
 */
.hpt-totop.is-dodging {
	opacity: 0;
	pointer-events: none;
}

/* ===== M15: KẾT THÚC ===== */

/* ------------------------------------------------------------------ */

/* Nút chuyển sáng/tối (lô M14)                                       */

/* ------------------------------------------------------------------ */
.hpt-theme-toggle {
	padding: 0;
	background: transparent;
	font: inherit;
	cursor: pointer;
}

/* Tối: hiện mặt trời (bấm để sang sáng). Sáng: hiện mặt trăng (bấm để sang tối). */
.hpt-theme-toggle .hpt-icon--moon,
:root[data-theme="light"] .hpt-theme-toggle .hpt-icon--sun {
	display: none;
}

:root[data-theme="light"] .hpt-theme-toggle .hpt-icon--moon {
	display: block;
}

/* Chuyển màu mượt 200ms khi bấm nút (class gắn ~300ms bởi header.js; không áp lúc tải trang). */
@media (prefers-reduced-motion: no-preference) {

	html.hpt-theme-anim *,
	html.hpt-theme-anim *::before,
	html.hpt-theme-anim *::after {
		transition:
			background-color 200ms linear,
			border-color 200ms linear,
			color 200ms linear,
			fill 200ms linear,
			box-shadow 200ms linear !important;
	}
}
