.qpf,
.qpf *,
.qpf *::before,
.qpf *::after {
	box-sizing: border-box;
}

.qpf {
	--qpf-primary: var(--theme-palette-color-1, #3281dd);
	--qpf-primary-dark: var(--theme-palette-color-2, #0a55a6);
	--qpf-ink: var(--theme-palette-color-3, #02407d);
	--qpf-text: var(--theme-palette-color-4, #192a3d);
	--qpf-border: var(--theme-palette-color-5, #e1e8ed);
	--qpf-surface: var(--theme-palette-color-6, #f2f5f7);
	--qpf-white: var(--theme-palette-color-8, #ffffff);
	width: 100%;
	margin: 0 auto;
	color: var(--qpf-text);
}

.qpf.qpf :is(h1, h2, h3, h4, h5, h6, p, ol, ul, blockquote, figure) {
	margin: 0;
}

.qpf-form {
	padding: 20px;
	border: 1px solid var(--qpf-border);
	border-radius: 14px;
	background: var(--qpf-white);
	box-shadow: 0 8px 26px rgb(2 64 125 / 6%);
}

.qpf-filter-row {
	display: grid;
	gap: 10px;
}

.qpf-filter-row + .qpf-filter-row {
	margin-top: 10px;
}

.qpf-filter-row-1 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.qpf-filter-row-2 {
	grid-template-columns: repeat(6, minmax(0, 1fr));
}

.qpf-filter {
	position: relative;
	min-width: 0;
}

.qpf-filter-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	min-height: 44px;
	padding: 10px 13px;
	border: 1px solid var(--qpf-border);
	border-radius: 9px;
	background: var(--qpf-white);
	color: var(--qpf-ink);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.qpf-filter-trigger:hover,
.qpf-filter-trigger:focus-visible,
.qpf-filter.is-open .qpf-filter-trigger {
	border-color: var(--qpf-primary);
	box-shadow: 0 0 0 3px rgb(50 129 221 / 12%);
	outline: none;
}

.qpf-filter-trigger.has-selected {
	border-color: rgb(50 129 221 / 38%);
	background: rgb(50 129 221 / 8%);
}

.qpf-filter-trigger svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentcolor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex: 0 0 auto;
	transition: transform 0.2s ease;
}

.qpf-filter.is-open .qpf-filter-trigger svg {
	transform: rotate(180deg);
}

.qpf-filter-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 19px;
	margin-left: 5px;
	padding: 1px 6px;
	border-radius: 999px;
	background: var(--qpf-primary);
	color: var(--qpf-white);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.5;
}

.qpf-filter-badge:empty {
	display: none;
}

.qpf-filter-trigger-label {
	display: inline-flex;
	align-items: center;
	min-width: 0;
}

.qpf-filter-panel {
	display: none;
	position: absolute;
	top: calc(100% + 5px);
	left: 0;
	z-index: 30;
	min-width: max(100%, 220px);
	max-height: 320px;
	padding: 8px;
	overflow: auto;
	border: 1px solid var(--qpf-border);
	border-radius: 10px;
	background: var(--qpf-white);
	box-shadow: 0 16px 38px rgb(2 64 125 / 16%);
}

.qpf-filter-row > .qpf-filter:last-child .qpf-filter-panel {
	right: 0;
	left: auto;
}

.qpf-filter.is-open .qpf-filter-panel {
	display: block;
}

.qpf-filter-row-2 .qpf-filter-panel {
	top: auto;
	bottom: calc(100% + 5px);
}

.qpf-filter-option {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 7px 8px;
	border-radius: 7px;
	color: var(--qpf-text);
	font-size: 13px;
	line-height: 1.45;
	cursor: pointer;
	transition: background 0.15s ease;
}

.qpf-filter-option:hover {
	background: var(--qpf-surface);
}

.qpf-filter-option input {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--qpf-primary);
	flex: 0 0 auto;
}

.qpf-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 14px;
}

.qpf-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 9px 20px;
	border: 1px solid transparent;
	border-radius: 9px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
	text-decoration: none !important;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.qpf-button:hover {
	transform: translateY(-1px);
}

.qpf-button-apply {
	background: var(--qpf-primary);
	color: var(--qpf-white) !important;
}

.qpf-button-apply:hover,
.qpf-button-apply:focus-visible {
	background: var(--qpf-primary-dark);
}

.qpf-button-reset {
	border-color: var(--qpf-border);
	background: transparent;
	color: var(--qpf-ink) !important;
}

.qpf-button-reset:hover,
.qpf-button-reset:focus-visible {
	border-color: var(--qpf-primary);
	background: rgb(50 129 221 / 7%);
}

.qpf-status {
	margin: 18px 0 14px !important;
	color: var(--qpf-ink);
	font-size: 14px;
	font-weight: 600;
}

.qpf-active-filters {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin-top: 18px;
}

.qpf-active-title {
	padding-top: 7px;
	color: var(--qpf-ink);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.45;
	white-space: nowrap;
}

.qpf-active-list {
	display: flex;
	gap: 7px;
	flex: 1;
	flex-wrap: wrap;
}

.qpf-active-chip {
	display: inline-flex;
	align-items: baseline;
	padding: 7px 11px;
	border: 1px solid rgb(50 129 221 / 22%);
	border-radius: 999px;
	background: rgb(50 129 221 / 8%);
	color: var(--qpf-text);
	font-size: 13px;
	line-height: 1.45;
}

.qpf-active-chip strong {
	color: var(--qpf-primary-dark);
	font-weight: 700;
}

.qpf-active-filters + .qpf-status {
	margin-top: 12px !important;
}

.qpf-product-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}

.qpf-product-card {
	display: flex;
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--qpf-border);
	border-radius: 12px;
	background: var(--qpf-white);
	box-shadow: 0 3px 12px rgb(2 64 125 / 5%);
	color: inherit !important;
	text-decoration: none !important;
	flex-direction: column;
	transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.qpf-product-card:hover,
.qpf-product-card:focus-visible {
	border-color: rgb(50 129 221 / 45%);
	box-shadow: 0 14px 32px rgb(2 64 125 / 13%);
	transform: translateY(-4px);
	outline: none;
}

.qpf-product-image {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--qpf-surface);
}

.qpf-product-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.qpf-product-card:hover .qpf-product-image img {
	transform: scale(1.035);
}

.qpf-product-body {
	display: flex;
	min-height: 132px;
	padding: 15px 16px 16px;
	flex: 1;
	flex-direction: column;
	gap: 12px;
}

.qpf-product-title {
	display: -webkit-box;
	overflow: hidden;
	color: var(--qpf-text);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.55;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.qpf-product-price {
	margin-top: auto;
	color: var(--qpf-primary-dark);
	font-size: 17px;
	font-weight: 800;
	line-height: 1.4;
}

.qpf-product-price del {
	margin-right: 5px;
	color: #7b8794;
	font-size: 13px;
	font-weight: 500;
}

.qpf-product-price ins {
	background: transparent;
	color: var(--qpf-primary-dark);
	text-decoration: none;
}

.qpf-empty {
	grid-column: 1 / -1;
	padding: 60px 20px;
	border-radius: 12px;
	background: var(--qpf-surface);
	color: #637386;
	text-align: center;
}

.qpf-pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 32px;
	flex-wrap: wrap;
}

.qpf-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var(--qpf-border);
	border-radius: 8px;
	background: var(--qpf-white);
	color: var(--qpf-ink);
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
}

.qpf-pagination .page-numbers.current {
	border-color: var(--qpf-primary);
	background: var(--qpf-primary);
	color: var(--qpf-white);
}

.qpf-pagination a.page-numbers:hover,
.qpf-pagination a.page-numbers:focus-visible {
	border-color: var(--qpf-primary);
	color: var(--qpf-primary-dark);
}

.qpf-notice {
	padding: 14px 16px;
	border-left: 4px solid #d63638;
	background: #fff4f4;
}

@media (max-width: 1199px) {
	.qpf-filter-row-2 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.qpf-product-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.qpf-form {
		padding: 14px;
	}

	.qpf-filter-row-1,
	.qpf-filter-row-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.qpf-filter-panel {
		min-width: 100%;
		max-width: calc(100vw - 28px);
	}

	.qpf-actions {
		justify-content: stretch;
	}

	.qpf-button {
		flex: 1;
	}

	.qpf-active-filters {
		align-items: stretch;
		flex-direction: column;
		gap: 6px;
	}

	.qpf-active-title {
		padding-top: 0;
	}

	.qpf-product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.qpf-product-body {
		min-height: 118px;
		padding: 12px;
	}

	.qpf-product-title {
		font-size: 14px;
	}

	.qpf-product-price {
		font-size: 15px;
	}
}

@media (max-width: 479px) {
	.qpf-filter-row-1,
	.qpf-filter-row-2,
	.qpf-product-grid {
		grid-template-columns: 1fr;
	}
}
