/**
 * SMT Product Filter — frontend (v1.4 sidebar redesign).
 */

.smtpf-widget,
.smtpf-sidebar,
.smtpf-suggest,
.smtpf-active {
	--smtpf-accent: #6E1B23;
	--smtpf-border: #EDE2D3;
	--smtpf-text: #2b2b2b;
	--smtpf-muted: #8a8a8a;
	--smtpf-bg-soft: #faf7f4;

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

/* ---------- Sidebar wrapper ---------- */

.smtpf-sidebar {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.smtpf-sidebar__footer {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 20px;
	padding-top: 8px;
}

.smtpf-sidebar__clear {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 16px;
	border: 1px solid var(--smtpf-border);
	border-radius: 6px;
	background: #fff;
	color: var(--smtpf-accent);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.smtpf-sidebar__clear:hover,
.smtpf-sidebar__clear:focus {
	background: var(--smtpf-bg-soft);
	color: var(--smtpf-accent);
	text-decoration: none;
}

/* ---------- TÌM NHANH pills ---------- */

.smtpf-quick {
	margin-bottom: 22px;
}

.smtpf-quick__title {
	margin: 0 0 12px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--smtpf-accent);
}

.smtpf-quick__list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

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

.smtpf-quick__pill {
	display: flex;
	align-items: center;
	gap: 5px;
	width: 100%;
	padding: 5px 7px;
	border: 1px solid var(--smtpf-border);
	border-radius: 8px;
	background: #fff;
	color: var(--smtpf-text);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.smtpf-quick__pill:hover,
.smtpf-quick__pill:focus {
	border-color: var(--smtpf-accent);
	color: var(--smtpf-accent);
	text-decoration: none;
}

.smtpf-quick__pill.is-active {
	border-color: var(--smtpf-accent);
	background: var(--smtpf-accent);
	color: #fff;
}

.smtpf-quick__icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	line-height: 1;
}

.smtpf-quick__svg {
	display: block;
}

.smtpf-quick__svg--vang-do { color: #8B1E2D; }
.smtpf-quick__svg--vang-trang { color: #C4A35A; }
.smtpf-quick__svg--vang-hong,
.smtpf-quick__svg--vang-ngot { color: #C96B84; }
.smtpf-quick__svg--sparkling { color: #B08D3E; }
.smtpf-quick__svg--ruou-manh { color: #5C3A21; }

.smtpf-quick__pill.is-active .smtpf-quick__svg {
	color: #fff;
}

.smtpf-quick__label {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

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

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

.smtpf-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 14px 16px;
	background: none;
	border: 0;
	border-bottom: 1px solid var(--smtpf-border);
	box-shadow: none;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.06em;
	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;
}

.smtpf-panel--sidebar .smtpf-panel__body {
	padding: 0;
}

/* ---------- 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 16px;
	cursor: pointer;
	font-weight: 400;
}

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

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

.smtpf-option__label {
	flex: 1 1 auto;
	min-width: 0;
}

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

.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ả (widget thuộc tính 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.12);
	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;
}

.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);
}

.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;
	line-height: 1;
}

.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;
	text-align: center;
}

/* ---------- 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 #c9c9c9;
	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-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 16px;
	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 16px;
	color: var(--smtpf-muted);
	font-size: 13px;
}

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

.smtpf-more,
.smtpf-clear {
	display: inline-block;
	margin: 0;
	padding: 10px 16px;
	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;
}

.smtpf-price-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	padding: 16px;
}

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

.smtpf-price-fields .smtpf-field {
	margin-bottom: 0;
}

.smtpf-field__label {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--smtpf-muted);
}

.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,
.smtpf-sidebar__apply {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin: 12px 0 0;
	padding: 12px 16px;
	border: 0;
	border-radius: 6px;
	background: var(--smtpf-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-transform: uppercase;
	cursor: pointer;
	transition: opacity 0.2s ease, filter 0.2s ease;
}

.smtpf-sidebar__apply {
	margin: 0;
}

.smtpf-submit:hover,
.smtpf-submit:focus,
.smtpf-sidebar__apply:hover,
.smtpf-sidebar__apply:focus {
	background: var(--smtpf-accent);
	color: #fff;
	filter: brightness(1.06);
	opacity: 1;
}

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

.smtpf-js .smtpf-form--ranges[data-auto-submit="1"] .smtpf-submit--fallback {
	display: none;
}

.smtpf-js .smtpf-sidebar .smtpf-form--ranges .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);
}

/* ---------- Active filter chips ---------- */

.smtpf-active {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	width: 100%;
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
}

.smtpf-active__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	flex: 0 1 auto;
	min-width: 0;
}

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

.smtpf-active__chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	border-radius: 6px;
	background: #f5f5f5;
	border: 1px solid #e6e6e6;
	color: var(--smtpf-text);
}

.smtpf-active__label {
	max-width: 240px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.smtpf-active__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: #999;
	font-size: 16px;
	line-height: 1;
	text-decoration: none;
	transition: color 0.2s ease;
}

.smtpf-active__remove:hover,
.smtpf-active__remove:focus {
	color: var(--smtpf-accent);
	background: none;
	border: 0;
	text-decoration: none;
}

.smtpf-active__clear-all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	color: var(--smtpf-accent);
	font-size: 13px;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}

.smtpf-active__clear-icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.smtpf-active__clear-all:hover,
.smtpf-active__clear-all:focus {
	color: var(--smtpf-accent);
	text-decoration: underline;
}

@media (max-width: 849px) {
	.smtpf-active__list {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
		padding-bottom: 4px;
	}

	.smtpf-active__chip {
		flex-shrink: 0;
	}
}

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

.smtpf-suggest {
	display: none;
}

.smtpf-suggest__title {
	font-weight: 600;
	color: var(--smtpf-text);
}

.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;
	}

	.smtpf-price-fields {
		grid-template-columns: 1fr;
	}
}

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

/* ---------- Sidebar mockup (v1.5) ---------- */

.smtpf-panel__icon,
.smtpf-btn-icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	line-height: 1;
	color: inherit;
}

.smtpf-line-icon {
	display: block;
	width: 18px;
	height: 18px;
}

.smtpf-sidebar {
	--smtpf-radius: 6px;
	gap: 0;
}

#shop-sidebar .widget:has(.smtpf-sidebar) > .widget-title,
#shop-sidebar .widget:has(.smtpf-sidebar) > .is-divider,
#shop-sidebar .widget:has(.smtpf-quick) > .widget-title,
#shop-sidebar .widget:has(.smtpf-quick) > .is-divider {
	display: none;
}

#shop-sidebar > .smtpf-quick {
	margin-bottom: 18px;
}

.smtpf-sidebar .smtpf-quick {
	margin-bottom: 18px;
}

.smtpf-sidebar .smtpf-panel,
.smtpf-sidebar .smtpf-widget,
.smtpf-sidebar .smtpf-widget--attributes,
.smtpf-sidebar .smtpf-attrs {
	background: transparent;
	border: 0;
	margin: 0;
	box-shadow: none;
}

.smtpf-sidebar .smtpf-panel--ranges,
.smtpf-sidebar .smtpf-panel--price {
	margin: 0 0 16px;
}

.smtpf-sidebar .smtpf-panel__head {
	padding: 6px 0 10px;
	border-bottom: 0;
	border-radius: 0;
	min-height: 0;
	height: auto;
	box-shadow: none;
	text-shadow: none;
	color: var(--smtpf-accent);
	letter-spacing: 0.07em;
}

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

.smtpf-sidebar .smtpf-panel--ranges .smtpf-panel__title,
.smtpf-sidebar .smtpf-panel--price .smtpf-panel__title {
	color: var(--smtpf-accent);
}

.smtpf-sidebar .smtpf-panel--ranges .smtpf-panel__icon {
	color: var(--smtpf-accent);
}

.smtpf-sidebar .smtpf-panel--attribute .smtpf-panel__head {
	padding: 12px 0;
	color: var(--smtpf-text);
}

.smtpf-sidebar .smtpf-panel--attribute .smtpf-panel__title {
	color: var(--smtpf-text);
	font-size: 13px;
}

.smtpf-sidebar .smtpf-panel--attribute .smtpf-panel__icon {
	color: var(--smtpf-accent);
}

.smtpf-sidebar .smtpf-panel--attribute .smtpf-panel__arrow {
	color: var(--smtpf-muted);
}

.smtpf-sidebar .smtpf-attrs {
	margin-top: 4px;
	border-top: 1px solid var(--smtpf-border);
}

.smtpf-sidebar .smtpf-panel--attribute {
	border-bottom: 1px solid var(--smtpf-border);
}

.smtpf-sidebar .smtpf-panel--sidebar .smtpf-panel__body {
	padding: 0 0 8px;
}

.smtpf-sidebar .smtpf-panel--attribute .smtpf-panel__body {
	padding: 0 0 10px;
}

.smtpf-sidebar .smtpf-list__item {
	border-bottom: 0;
}

.smtpf-sidebar .smtpf-option {
	padding: 7px 0;
	gap: 10px;
}

.smtpf-sidebar .smtpf-option__input[type="radio"] {
	appearance: none;
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	border: 1.5px solid #cfcfcf;
	border-radius: 50%;
	background: #fff;
	box-shadow: none;
	flex: 0 0 18px;
}

.smtpf-sidebar .smtpf-option__input[type="radio"]:checked {
	border-color: var(--smtpf-accent);
	background: radial-gradient(circle, var(--smtpf-accent) 0 5px, #fff 6px 100%);
}

.smtpf-sidebar .smtpf-option__label {
	font-size: 14px;
}

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

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

.smtpf-sidebar .smtpf-price-fields {
	padding: 4px 0 0;
	gap: 12px;
}

.smtpf-sidebar .smtpf-field__label {
	margin-bottom: 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: none;
	color: var(--smtpf-text);
}

.smtpf-sidebar .smtpf-input {
	height: 42px;
	border-radius: var(--smtpf-radius);
	border-color: #ddd;
}

.smtpf-sidebar .smtpf-price-apply {
	margin: 12px 0 0;
	border-radius: var(--smtpf-radius);
}

.smtpf-sidebar .smtpf-search {
	padding: 0 0 10px;
	border-bottom: 0;
}

.smtpf-sidebar .smtpf-search__input {
	border-radius: var(--smtpf-radius);
}

.smtpf-sidebar .smtpf-more,
.smtpf-sidebar .smtpf-clear {
	padding: 8px 0;
	border-top: 0;
	width: auto;
}

.smtpf-sidebar .smtpf-panel--attribute .smtpf-clear {
	display: none;
}

#shop-sidebar > .smtpf-sidebar {
	width: 100%;
	margin: 0 0 8px;
}

#shop-sidebar .smtpf-sidebar button.smtpf-panel__head {
	background: transparent;
	background-color: transparent;
}

.smtpf-sidebar__apply {
	border-radius: var(--smtpf-radius);
}

.smtpf-sidebar__clear .smtpf-btn-icon {
	color: var(--smtpf-accent);
}

.smtpf-sidebar__apply .smtpf-btn-icon {
	color: #fff;
}

@media (max-width: 849px) {
	#shop-sidebar .smtpf-quick,
	#shop-sidebar .smtpf-sidebar {
		padding-bottom: 8px;
	}
}
