/**
 * SMT - Lọc theo khoảng giá (frontend).
 */

.smtpf-widget {
	--smtpf-accent: #9b1b30;
	--smtpf-border: #e3e3e3;
	--smtpf-text: #2b2b2b;
	--smtpf-muted: #8a8a8a;

	font-size: 14px;
	line-height: 1.5;
	color: var(--smtpf-text);
}

/* ---------- Panel ---------- */

.smtpf-panel {
	background: #fff;
	border: 1px solid var(--smtpf-border);
	margin-bottom: 20px;
}

.smtpf-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 15px 18px;
	background: none;
	border: 0;
	border-bottom: 1px solid var(--smtpf-border);
	box-shadow: none;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.04em;
	text-align: left;
	text-transform: uppercase;
	color: var(--smtpf-text);
	cursor: pointer;
}

.smtpf-panel__head:hover,
.smtpf-panel__head:focus {
	background: none;
	color: var(--smtpf-accent);
}

div.smtpf-panel__head {
	cursor: default;
}

.smtpf-panel__title {
	flex: 1 1 auto;
}

.smtpf-panel__arrow {
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	margin-top: -4px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(-135deg);
	transition: transform 0.2s ease;
}

.smtpf-panel.is-collapsed .smtpf-panel__arrow {
	margin-top: 3px;
	transform: rotate(45deg);
}

.smtpf-panel.is-collapsed .smtpf-panel__body {
	display: none;
}

/* ---------- Danh sách khoảng giá ---------- */

.smtpf-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.smtpf-list__item {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--smtpf-border);
	list-style: none;
}

.smtpf-list__item:last-child {
	border-bottom: 0;
}

.smtpf-option {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 11px 18px;
	cursor: pointer;
	font-weight: 400;
}

.smtpf-option:hover .smtpf-option__label {
	color: var(--smtpf-accent);
}

.smtpf-option__input {
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	margin: 0;
	accent-color: var(--smtpf-accent);
	cursor: pointer;
}

.smtpf-option__label {
	flex: 1 1 auto;
}

.smtpf-list__item.is-active .smtpf-option__label {
	color: var(--smtpf-accent);
	font-weight: 600;
}

.smtpf-form--ranges.is-loading {
	opacity: 0.55;
	pointer-events: none;
}

/* ---------- Nút xoá tất cả bộ lọc ---------- */

.smtpf-widget .smtpf-clearbar {
	margin: 0 0 18px;
}

.smtpf-widget .smtpf-clearbar__button {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 13px 14px;
	background: var(--smtpf-accent);
	border: 0;
	border-radius: 3px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.3;
	text-transform: uppercase;
	text-decoration: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

/* Dải sáng mảnh phía trên cho khối màu đặc bớt phẳng. */
.smtpf-widget .smtpf-clearbar__button::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 1px;
	background: rgba(255, 255, 255, 0.35);
	border-radius: 3px 3px 0 0;
}

.smtpf-widget .smtpf-clearbar__button:hover,
.smtpf-widget .smtpf-clearbar__button:focus {
	background: var(--smtpf-accent);
	color: #fff;
	text-decoration: none;
	filter: brightness(1.08);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
	transform: translateY(-1px);
}

.smtpf-widget .smtpf-clearbar__button:active {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
	transform: translateY(0);
}

.smtpf-widget .smtpf-clearbar__button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -5px;
}

.smtpf-widget .smtpf-clearbar__icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.22);
	font-size: 15px;
	font-weight: 400;
	line-height: 1;
	transition: transform 0.18s ease;
}

.smtpf-widget .smtpf-clearbar__button:hover .smtpf-clearbar__icon {
	transform: rotate(90deg);
}

.smtpf-widget .smtpf-clearbar__text {
	flex: 1 1 auto;
}

.smtpf-widget .smtpf-clearbar__count {
	flex: 0 0 auto;
	min-width: 22px;
	padding: 2px 7px;
	border-radius: 11px;
	background: #fff;
	color: var(--smtpf-accent);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0;
	text-align: center;
}

@media (prefers-reduced-motion: reduce) {
	.smtpf-widget .smtpf-clearbar__button,
	.smtpf-widget .smtpf-clearbar__icon {
		transition: none;
	}

	.smtpf-widget .smtpf-clearbar__button:hover {
		transform: none;
	}

	.smtpf-widget .smtpf-clearbar__button:hover .smtpf-clearbar__icon {
		transform: none;
	}
}

/* ---------- Lọc theo thuộc tính ---------- */

.smtpf-list--attribute .smtpf-option {
	color: inherit;
	text-decoration: none;
}

.smtpf-option__box {
	flex: 0 0 auto;
	position: relative;
	width: 15px;
	height: 15px;
	border: 1px solid #b9b9b9;
	border-radius: 2px;
	background: #fff;
}

.smtpf-list__item.is-active .smtpf-option__box {
	border-color: var(--smtpf-accent);
	background: var(--smtpf-accent);
}

.smtpf-list__item.is-active .smtpf-option__box::after {
	content: "";
	position: absolute;
	top: 1px;
	left: 4px;
	width: 4px;
	height: 8px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg);
}

.smtpf-option__count {
	flex: 0 0 auto;
	color: var(--smtpf-muted);
	font-size: 13px;
}

.smtpf-list__item.is-hidden {
	display: none;
}

.smtpf-list--attribute.is-expanded .smtpf-list__item.is-hidden {
	display: block;
}

.smtpf-list__item.is-filtered-out,
.smtpf-panel--attribute.is-searching .smtpf-list--attribute.is-expanded .smtpf-list__item.is-filtered-out {
	display: none;
}

.smtpf-panel--attribute.is-searching .smtpf-list__item.is-hidden:not(.is-filtered-out) {
	display: block;
}

.smtpf-panel--attribute.is-searching .smtpf-more {
	display: none;
}

.smtpf-search {
	padding: 10px 18px;
	border-bottom: 1px solid var(--smtpf-border);
}

.smtpf-search__input {
	width: 100%;
	height: 36px;
	padding: 8px 12px;
	border: 1px solid var(--smtpf-border);
	border-radius: 2px;
	background: #fff;
	font-size: 13px;
	color: var(--smtpf-text);
	box-shadow: none;
}

.smtpf-search__input:focus {
	border-color: var(--smtpf-accent);
	outline: none;
}

.smtpf-search__empty {
	margin: 0;
	padding: 12px 18px;
	color: var(--smtpf-muted);
	font-size: 13px;
}

.smtpf-search__empty[hidden] {
	display: none;
}

.smtpf-more,
.smtpf-clear {
	display: inline-block;
	margin: 0;
	padding: 10px 18px;
	background: none;
	border: 0;
	border-top: 1px solid var(--smtpf-border);
	width: 100%;
	color: var(--smtpf-accent);
	font-size: 13px;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.smtpf-more:hover,
.smtpf-clear:hover {
	background: none;
	text-decoration: underline;
}

/* ---------- Ô nhập giá ---------- */

.smtpf-form--price {
	padding: 16px 18px;
}

.smtpf-field {
	margin-bottom: 10px;
}

.smtpf-input {
	width: 100%;
	height: 40px;
	padding: 8px 12px;
	border: 1px solid var(--smtpf-border);
	border-radius: 2px;
	background: #fff;
	font-size: 14px;
	color: var(--smtpf-text);
	box-shadow: none;
}

.smtpf-input:focus {
	border-color: var(--smtpf-accent);
	outline: none;
}

.smtpf-submit {
	display: block;
	width: 100%;
	margin: 12px 0 0;
	padding: 11px 16px;
	border: 0;
	border-radius: 2px;
	background: var(--smtpf-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-transform: uppercase;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.smtpf-submit:hover,
.smtpf-submit:focus {
	background: var(--smtpf-accent);
	color: #fff;
	opacity: 0.88;
}

.smtpf-submit--fallback {
	margin: 0;
	border-radius: 0;
}

/* Có JavaScript thì không cần nút "Lọc" cho danh sách checkbox. */
.smtpf-js .smtpf-form--ranges[data-auto-submit="1"] .smtpf-submit--fallback {
	display: none;
}

.smtpf-current-price {
	margin: 12px 0 0;
	font-size: 13px;
	color: var(--smtpf-muted);
}

.smtpf-current-price__value {
	color: var(--smtpf-text);
}

/* ---------- Dãy nhãn gợi ý ---------- */

.smtpf-suggest {
	--smtpf-accent: #9b1b30;

	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.5;
}

.smtpf-suggest__title {
	font-weight: 600;
	color: #2b2b2b;
}

.smtpf-suggest__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.smtpf-suggest__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.smtpf-suggest__link {
	color: var(--smtpf-accent);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease;
}

.smtpf-suggest__link:hover,
.smtpf-suggest__link:focus {
	color: var(--smtpf-accent);
	border-bottom-color: currentColor;
}

.smtpf-suggest__item.is-active .smtpf-suggest__link {
	font-weight: 700;
	border-bottom-color: currentColor;
}

@media (max-width: 480px) {
	.smtpf-suggest {
		gap: 4px 12px;
	}
}
