/**
 * Nệm Hòa Bình - CSS Bộ Lọc Thuộc Tính, Bộ Lọc Giá & Dòng Tiết Kiệm
 */

/* ==========================================================================
   1. BỘ LỌC SIDEBAR (WIDGET CONTAINER)
   ========================================================================== */
.nb-filter-widget {
	margin-bottom: 24px;
	padding-bottom: 20px;
	border-bottom: 1px solid #ebebeb;
	font-family: inherit;
}

.nb-filter-widget:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

/* Header & Toggle (- / +) */
.nb-filter-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	padding: 4px 0 10px;
	user-select: none;
	transition: color 0.2s ease;
}

.nb-filter-header:hover .nb-filter-title {
	color: #d32f2f;
}

.nb-filter-title {
	font-size: 16px;
	font-weight: 600;
	color: #1a1a1a;
	margin: 0;
	line-height: 1.3;
	letter-spacing: -0.2px;
}

.nb-filter-toggle {
	font-size: 18px;
	font-weight: 400;
	color: #666;
	line-height: 1;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, color 0.2s ease;
}

.nb-filter-header:hover .nb-filter-toggle {
	color: #d32f2f;
}

/* Body & Danh sách checkbox */
.nb-filter-body {
	padding-top: 4px;
	transition: max-height 0.3s ease, opacity 0.3s ease;
}

.nb-filter-list {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.nb-filter-item {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	transition: opacity 0.2s ease;
}

.nb-filter-item.is-empty {
	color: #8c8c8c;
}

/* Nhãn Checkbox */
.nb-filter-label {
	display: flex;
	align-items: center;
	position: relative;
	cursor: pointer;
	font-size: 14px;
	color: #2b2b2b;
	line-height: 1.4;
	margin: 0;
	user-select: none;
	transition: color 0.15s ease;
}

.nb-filter-item.is-empty .nb-filter-label {
	color: #767676;
}

.nb-filter-label:hover {
	color: #d32f2f;
}

/* Ẩn checkbox native */
.nb-filter-checkbox,
.nb-price-range-checkbox {
	position: absolute;
	opacity: 0;
	cursor: pointer;
	height: 0;
	width: 0;
	margin: 0 !important;
}

/* Custom checkbox box */
.nb-filter-box {
	position: relative;
	display: inline-block;
	width: 17px;
	height: 17px;
	min-width: 17px;
	margin-right: 10px;
	background-color: #fff;
	border: 1.5px solid #d2d2d2;
	border-radius: 3px;
	box-sizing: border-box;
	transition: all 0.2s ease;
}

.nb-filter-label:hover .nb-filter-box {
	border-color: #d32f2f;
}

/* Trạng thái được chọn (Checked) */
.nb-filter-checkbox:checked ~ .nb-filter-box,
.nb-price-range-checkbox:checked ~ .nb-filter-box {
	background-color: #d32f2f;
	border-color: #d32f2f;
}

.nb-filter-checkbox:checked ~ .nb-filter-box::after,
.nb-price-range-checkbox:checked ~ .nb-filter-box::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 2px;
	width: 4px;
	height: 8px;
	border: solid #ffffff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.nb-filter-checkbox:checked ~ .nb-filter-name,
.nb-price-range-checkbox:checked ~ .nb-filter-name {
	font-weight: 600;
	color: #d32f2f;
}

.nb-filter-name {
	margin-right: 6px;
	transition: color 0.15s ease;
}

.nb-filter-count {
	color: #8c8c8c;
	font-size: 13px;
}

.nb-filter-item.is-active .nb-filter-count {
	color: #d32f2f;
	font-weight: 600;
}

/* ==========================================================================
   2. BỘ LỌC GIÁ & Ô NHẬP KHOẢNG GIÁ TÙY Ý
   ========================================================================== */
.nb-price-custom-range {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px dashed #e5e5e5;
}

.nb-price-custom-heading {
	font-size: 13px;
	font-weight: 500;
	color: #555;
	margin-bottom: 8px;
}

.nb-price-input-row {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 10px;
}

.nb-price-input-group {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1;
	background: #fbfbfb;
	border: 1px solid #dcdcdc;
	border-radius: 4px;
	padding: 0 6px;
	height: 34px;
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nb-price-input-group:focus-within {
	border-color: #d32f2f;
	background: #fff;
	box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.1);
}

.nb-price-input-prefix {
	font-size: 11px;
	color: #888;
	margin-right: 4px;
	white-space: nowrap;
}

.nb-price-input {
	width: 100% !important;
	height: 100% !important;
	border: none !important;
	outline: none !important;
	background: transparent !important;
	padding: 0 2px !important;
	margin: 0 !important;
	font-size: 13px !important;
	color: #222 !important;
	box-shadow: none !important;
	-moz-appearance: textfield;
}

.nb-price-input::-webkit-outer-spin-button,
.nb-price-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.nb-price-input-unit {
	font-size: 12px;
	color: #666;
	margin-left: 2px;
}

.nb-price-sep {
	color: #888;
	font-size: 14px;
	font-weight: 600;
}

.nb-price-apply-btn {
	display: block;
	width: 100%;
	height: 34px;
	line-height: 34px;
	padding: 0 16px !important;
	background: #d32f2f !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 4px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	text-align: center;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.1s ease;
	margin: 0 !important;
}

.nb-price-apply-btn:hover {
	background: #b71c1c !important;
	color: #ffffff !important;
}

.nb-price-apply-btn:active {
	transform: scale(0.98);
}

/* ==========================================================================
   3. DÒNG "TIẾT KIỆM: xxxđ" Ở DANH SÁCH SẢN PHẨM (LOOP)
   ========================================================================== */
.nb-product-savings {
	font-size: 13px;
	color: #595959;
	margin-top: 4px;
	margin-bottom: 2px;
	line-height: 1.4;
	display: block;
}

.nb-product-savings .nb-savings-label {
	color: #595959;
	font-weight: 400;
}

.nb-product-savings .nb-savings-val {
	color: #1a1a1a;
	font-weight: 600;
	letter-spacing: -0.2px;
}

/* Trong thẻ card Section 4 */
.nb-product-card-savings {
	font-size: 13px;
	color: #595959;
	margin-top: 4px;
	margin-bottom: 6px;
	line-height: 1.4;
}

.nb-product-card-savings .nb-savings-val {
	color: #1a1a1a;
	font-weight: 600;
}

/* ==========================================================================
   4. DÒNG "TIẾT KIỆM: xxxđ" Ở TRANG CHI TIẾT SẢN PHẨM (SINGLE PRODUCT)
   ========================================================================== */
.nb-single-savings {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 6px;
	margin-bottom: 12px;
	padding: 4px 10px;
	background: #fff5f5;
	border: 1px dashed #d32f2f;
	border-radius: 4px;
	font-size: 13.5px;
	line-height: 1.4;
	color: #444;
	animation: nbFadeIn 0.3s ease;
}

.nb-single-savings .nb-savings-label {
	color: #555;
	font-weight: 500;
}

.nb-single-savings .nb-savings-val {
	color: #d32f2f;
	font-weight: 700;
	font-size: 15px;
}

/* Trong Quick Order Popup */
.nb-modal-savings {
	font-size: 13px;
	color: #555;
	margin-top: 3px;
	line-height: 1.3;
}

.nb-modal-savings .nb-savings-val {
	color: #d32f2f;
	font-weight: 700;
}

@keyframes nbFadeIn {
	from {
		opacity: 0;
		transform: translateY(-3px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ==========================================================================
   5. RESPONSIVE CHO SIDEBAR OFF-CANVAS TRÊN MOBILE
   ========================================================================== */
@media (max-width: 767px) {
	.nb-filter-widget {
		margin-bottom: 18px;
		padding-bottom: 16px;
	}

	.nb-filter-title {
		font-size: 15px;
	}

	.nb-filter-label {
		font-size: 13.5px;
	}

	.nb-price-input-row {
		flex-direction: row;
	}
}
