/* =========================================================
   Thanh lọc Hãng — UI bắt mắt + nút cuộn ngang
   ========================================================= */
.hl-hang-filter {
	--hl-hang-blue: #f58634;
	--hl-hang-blue-deep: #f58634;
	--hl-hang-blue-soft: #eef4ff;
	--hl-hang-blue-mist: #f5f9ff;
	--hl-hang-border: #d7e3f5;
	--hl-hang-text: #2b3340;
	position: relative;
	margin: 20px 0 24px;
	z-index: 2;
}

.hl-hang-filter__panel {
	position: relative;
	background:
		radial-gradient(120% 140% at 0% 0%, rgba(30, 99, 208, 0.07) 0%, transparent 42%),
		linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
	border: 1px solid #e4edf9;
	border-radius: 14px;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.9) inset,
		0 8px 28px rgba(15, 79, 184, 0.09);
	padding: 16px 16px 48px;
	overflow: hidden;
}

.hl-hang-filter__row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.hl-hang-filter__label {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 56px;
	padding: 0 22px 0 14px;
	margin-top: 1px;
	background: linear-gradient(135deg, var(--hl-hang-blue) 0%, var(--hl-hang-blue-deep) 100%);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.6px;
	line-height: 1;
	clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
	white-space: nowrap;
	user-select: none;
	box-shadow:
		0 6px 16px rgba(15, 79, 184, 0.32),
		0 1px 0 rgba(255, 255, 255, 0.25) inset;
	text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.hl-hang-filter__label-icon {
	display: block;
	filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.12));
}

.hl-hang-filter__track {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.hl-hang-filter__viewport {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	overflow-x: auto;
	overflow-y: hidden;
	max-height: 140px;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 2px 4px 4px 0;
	mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 18px), transparent 100%);
	-webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 18px), transparent 100%);
	transition: max-height 0.35s ease;
}

.hl-hang-filter.has-scroll-left .hl-hang-filter__viewport {
	mask-image: linear-gradient(90deg, transparent 0%, #000 18px, #000 calc(100% - 18px), transparent 100%);
	-webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

.hl-hang-filter__viewport::-webkit-scrollbar {
	display: none;
}

.hl-hang-filter.is-expanded .hl-hang-filter__viewport {
	max-height: 480px;
	overflow-x: hidden;
	overflow-y: auto;
	mask-image: none;
	-webkit-mask-image: none;
	scrollbar-width: thin;
	scrollbar-color: #aec7ef transparent;
}

.hl-hang-filter.is-expanded .hl-hang-filter__viewport::-webkit-scrollbar {
	display: block;
	width: 5px;
}

.hl-hang-filter.is-expanded .hl-hang-filter__viewport::-webkit-scrollbar-thumb {
	background: #aec7ef;
	border-radius: 10px;
}

.hl-hang-filter__tags {
	display: flex;
	flex-flow: column wrap;
	align-content: flex-start;
	gap: 10px;
	height: 126px;
	width: max-content;
	max-width: none;
	padding-right: 10px;
}

.hl-hang-filter.is-expanded .hl-hang-filter__tags {
	flex-flow: row wrap;
	height: auto;
	width: 100%;
	padding-right: 0;
}

a.hl-hang-filter__tag,
.hl-hang-filter__tag {
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 58px;
	min-height: 58px;
	margin: 0;
	border: 1px solid var(--hl-hang-border);
	background: #fff;
	color: var(--hl-hang-text);
	border-radius: 10px;
	padding: 0 16px 0 6px;
	font-size: 13px;
	line-height: 1;
	font-weight: 550;
	font-family: inherit;
	letter-spacing: 0;
	text-transform: none;
	text-shadow: none;
	vertical-align: middle;
	cursor: pointer;
	transition:
		border-color 0.2s ease,
		color 0.2s ease,
		background 0.2s ease,
		box-shadow 0.2s ease,
		transform 0.15s ease;
	white-space: nowrap;
	text-decoration: none !important;
	box-shadow: 0 1px 2px rgba(20, 40, 80, 0.04);
}

.hl-hang-filter .hl-hang-filter__logo {
	flex: 0 0 54px;
	width: 54px;
	height: 54px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	box-sizing: border-box;
}

.hl-hang-filter .hl-hang-filter__logo img {
	width: 54px !important;
	height: 54px !important;
	max-width: 54px !important;
	max-height: 54px !important;
	object-fit: contain;
	display: block;
}

.hl-hang-filter__tag:not(.has-logo) {
	padding-left: 16px;
}

a.hl-hang-filter__tag:hover,
.hl-hang-filter__tag:hover {
	border-color: #8fb4ef;
	color: var(--hl-hang-blue-deep);
	background: var(--hl-hang-blue-soft);
	box-shadow: 0 6px 14px rgba(30, 99, 208, 0.14);
	transform: translateY(-1px);
	text-decoration: none !important;
}

a.hl-hang-filter__tag.is-active,
.hl-hang-filter__tag.is-active {
	border-color: transparent;
	border: 1px solid var(--hl-hang-blue);
	color: #000 !important;
}

/* Nút cuộn ngang */
.hl-hang-filter__nav {
	flex: 0 0 auto;
	width: 36px;
	height: 56px;
	margin-top: 1px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #b9d0f5;
	border-radius: 8px;
	background: linear-gradient(180deg, #ffffff 0%, #eaf2ff 100%);
	color: var(--hl-hang-blue);
	cursor: pointer;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.9) inset,
		0 4px 12px rgba(30, 99, 208, 0.12);
	transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.hl-hang-filter__nav:hover {
	background: linear-gradient(135deg, var(--hl-hang-blue) 0%, var(--hl-hang-blue-deep) 100%);
	border-color: var(--hl-hang-blue-deep);
	color: #fff;
	box-shadow: 0 8px 16px rgba(15, 79, 184, 0.28);
	transform: translateY(-1px);
}

.hl-hang-filter__nav:active {
	transform: translateY(0) scale(0.96);
}

.hl-hang-filter__nav[hidden] {
	display: none !important;
}

.hl-hang-filter__nav:disabled,
.hl-hang-filter.is-expanded .hl-hang-filter__nav {
	opacity: 0.35;
	pointer-events: none;
	box-shadow: none;
}

.hl-hang-filter__view-all {
	position: absolute;
	right: 16px;
	bottom: 11px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 34px;
	padding: 0 14px;
	border: 1px solid #b6cff4;
	border-radius: 8px;
	background: linear-gradient(180deg, #ffffff 0%, #eaf2ff 100%);
	color: var(--hl-hang-blue-deep);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.4px;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(30, 99, 208, 0.1);
	transition: all 0.2s ease;
}

.hl-hang-filter__view-all:hover,
.hl-hang-filter.is-expanded .hl-hang-filter__view-all {
	background: linear-gradient(135deg, var(--hl-hang-blue) 0%, var(--hl-hang-blue-deep) 100%);
	border-color: var(--hl-hang-blue-deep);
	color: #fff;
	box-shadow: 0 8px 18px rgba(15, 79, 184, 0.28);
}

.hl-hang-filter__loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: rgba(255, 255, 255, 0.88);
	border-radius: 14px;
	color: var(--hl-hang-blue);
	font-size: 13px;
	font-weight: 600;
	z-index: 5;
	backdrop-filter: blur(2px);
}

.hl-hang-filter__loading[hidden] {
	display: none !important;
}

.hl-hang-filter__spinner {
	width: 34px;
	height: 34px;
	border: 3px solid #d6e4f8;
	border-top-color: var(--hl-hang-blue);
	border-radius: 50%;
	animation: hl-hang-spin 0.7s linear infinite;
}

@keyframes hl-hang-spin {
	to { transform: rotate(360deg); }
}

.hl-hang-filter__empty {
	padding: 28px 16px;
	text-align: center;
	background: #fff;
	border: 1px dashed var(--hl-hang-border);
	border-radius: 8px;
	color: #666;
}

.hl-hang-products-wrap {
	position: relative;
	min-height: 60px;
}

.hl-hang-products-wrap.is-hang-loading {
	pointer-events: none;
}

.hl-hang-products-wrap.is-hang-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.65);
	z-index: 20;
}

.hl-hang-products-wrap.is-hang-loading::before {
	content: "";
	position: absolute;
	top: 80px;
	left: 50%;
	width: 40px;
	height: 40px;
	margin-left: -20px;
	border: 3px solid #d6e4f8;
	border-top-color: var(--hl-hang-blue);
	border-radius: 50%;
	animation: hl-hang-spin 0.7s linear infinite;
	z-index: 21;
}

@media (max-width: 767px) {
	.hl-hang-filter__panel {
		padding: 12px 12px 48px;
	}

	.hl-hang-filter__label {
		font-size: 12px;
		height: 48px;
		padding: 0 18px 0 10px;
	}

	a.hl-hang-filter__tag,
	.hl-hang-filter__tag {
		font-size: 12px;
		height: 50px;
		min-height: 50px;
		padding: 0 12px 0 4px;
		gap: 8px;
	}

	.hl-hang-filter__tag:not(.has-logo) {
		padding-left: 12px;
	}

	.hl-hang-filter .hl-hang-filter__logo {
		flex: 0 0 44px;
		width: 44px;
		height: 44px;
		border: 0;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
	}

	.hl-hang-filter .hl-hang-filter__logo img {
		width: 44px !important;
		height: 44px !important;
		max-width: 44px !important;
		max-height: 44px !important;
	}

	.hl-hang-filter__viewport {
		max-height: 120px;
	}

	.hl-hang-filter__tags {
		height: 110px;
	}

	.hl-hang-filter__nav {
		width: 34px;
		height: 48px;
	}

	.hl-hang-filter__nav--prev {
		display: none !important;
	}
}
