/* =========================================================================
   متغیرهای رنگ — برای تطبیق با رنگ برند HSB این‌ها را تغییر دهید
   ========================================================================= */
.hpf-wrapper, .hpf-results-wrapper {
	--hpf-primary: #e02020;
	--hpf-primary-dark: #b81717;
	--hpf-border: #e6e6e6;
	--hpf-text: #2b2b2b;
	--hpf-muted: #8a8a8a;
	--hpf-bg: #ffffff;
	box-sizing: border-box;
}

.hpf-wrapper *, .hpf-results-wrapper * {
	box-sizing: border-box;
}

/* =========================================================================
   پنل فیلتر (سایدبار)
   ========================================================================= */
.hpf-wrapper {
	font-family: inherit;
	color: var(--hpf-text);
	max-width: 320px;
	background: var(--hpf-bg);
	border: 1px solid var(--hpf-border);
	border-radius: 10px;
	padding: 18px 18px 22px;
}

.hpf-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.hpf-title {
	margin: 0;
	font-size: 16px;
	font-weight: 800;
	flex-grow: 1;
	text-align: center;
}

.hpf-reset-icon {
	background: none;
	border: none;
	font-size: 18px;
	color: var(--hpf-muted);
	cursor: pointer;
	line-height: 1;
	padding: 4px;
}

.hpf-reset-icon:hover { color: var(--hpf-primary); }

.hpf-funnel-icon {
	color: var(--hpf-primary);
	font-size: 16px;
}

.hpf-header-line {
	height: 2px;
	background: var(--hpf-primary);
	margin: 12px 0 6px;
	border-radius: 2px;
}

/* بخش‌های آکاردئونی */
.hpf-section {
	border-bottom: 1px solid var(--hpf-border);
	padding: 14px 0;
}

.hpf-section:last-of-type {
	border-bottom: none;
}

.hpf-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	user-select: none;
}

.hpf-section-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--hpf-text);
}

.hpf-chevron {
	font-size: 11px;
	color: var(--hpf-muted);
}

.hpf-section-body {
	margin-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* ردیف چک‌باکس (دسته‌بندی / ویژگی) */
.hpf-checkbox-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 13px;
	color: var(--hpf-text);
	cursor: pointer;
}

.hpf-checkbox-row .hpf-checkbox-label {
	flex-grow: 1;
}

.hpf-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 50%;
	background: #f2f2f2;
	color: var(--hpf-muted);
	font-size: 12px;
}

.hpf-checkbox-row input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--hpf-primary);
	cursor: pointer;
}

/* فیلدهای فیلتر خودرو */
.hpf-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 10px;
}

.hpf-field label {
	font-size: 12px;
	font-weight: 600;
	color: var(--hpf-primary);
}

.hpf-select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--hpf-border);
	border-radius: 6px;
	background: #fff;
	font-size: 13px;
	color: var(--hpf-text);
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 10px center;
	background-size: 14px;
	padding-left: 30px;
}

.hpf-select:focus {
	outline: none;
	border-color: var(--hpf-primary);
}

.hpf-select:disabled {
	background-color: #f5f5f5;
	color: #aaa;
	cursor: not-allowed;
}

.hpf-hint {
	font-size: 11px;
	color: var(--hpf-primary);
	line-height: 1.5;
}

/* دکمه اعمال فیلتر */
.hpf-apply-btn {
	width: 100%;
	margin-top: 16px;
	padding: 13px;
	background: var(--hpf-primary);
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 800;
	cursor: pointer;
	transition: background 0.15s ease;
}

.hpf-apply-btn:hover {
	background: var(--hpf-primary-dark);
}

/* =========================================================================
   ناحیه نتایج
   ========================================================================= */
.hpf-results-wrapper {
	font-family: inherit;
	color: var(--hpf-text);
}

.hpf-loading {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #666;
	margin-bottom: 16px;
}

.hpf-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid #ddd;
	border-top-color: var(--hpf-primary);
	border-radius: 50%;
	display: inline-block;
	animation: hpf-spin 0.7s linear infinite;
}

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

.hpf-products-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 18px;
}

.hpf-product-card {
	background: #fff;
	border: 1px solid var(--hpf-border);
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hpf-product-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.hpf-product-thumb {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f7f7f7;
}

.hpf-product-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hpf-product-info {
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex-grow: 1;
}

.hpf-product-title {
	font-size: 14px;
	font-weight: 700;
	margin: 0;
	line-height: 1.4;
}

.hpf-product-title a {
	color: var(--hpf-text);
	text-decoration: none;
}

.hpf-product-price {
	font-size: 15px;
	font-weight: 700;
	color: var(--hpf-primary);
}

.hpf-product-btn {
	margin-top: auto;
	text-align: center;
	padding: 9px 12px;
	background: var(--hpf-primary);
	color: #fff;
	border-radius: 7px;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
}

.hpf-product-btn:hover {
	background: var(--hpf-primary-dark);
}

.hpf-no-results {
	text-align: center;
	padding: 40px 20px;
	background: #fafafa;
	border-radius: 12px;
	font-size: 15px;
	color: #666;
}

.hpf-pagination {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 24px;
}

.hpf-page-btn {
	min-width: 36px;
	padding: 8px 10px;
	border: 1px solid var(--hpf-border);
	background: #fff;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
}

.hpf-page-btn.active {
	background: var(--hpf-primary);
	border-color: var(--hpf-primary);
	color: #fff;
}

/* =========================================================================
   ریسپانسیو
   ========================================================================= */
@media (max-width: 900px) {
	.hpf-wrapper {
		max-width: 100%;
	}
}

@media (max-width: 560px) {
	.hpf-products-grid {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
		gap: 12px;
	}
}
