/* ==========================================================================
   PK Filters — filter bar, loading states, infinite scroll sentinel
   BEM component · v2.0
   ========================================================================== */

.pk-filters {
	--filters-font: "Neuzeit Grotesk W01", sans-serif;
	--filters-gap: 12px;
	--filters-padding-v: 14px;
	--filters-padding-h: 20px;
	--filters-border: #d0d0d0;
	--filters-text: #333;
	--filters-placeholder: #999;
	--filters-bg: #fff;
	--filters-hover-bg: #f5f5f5;
	--filters-active-bg: #333;
	--filters-active-text: #fff;
	--filters-radius: 2px;
	--filters-transition: 0.25s ease;

	display: flex;
	justify-content: center;
	gap: var(--filters-gap);
	width: 100%;
	padding-bottom: 40px;
}

/* Visually hidden but accessible labels */
.pk-filters__label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Select wrapper */
.pk-filters__group {
	position: relative;
	flex: 0 1 300px;
}

/* Select element */
.pk-filters__select {
	display: block;
	width: 100%;
	padding: var(--filters-padding-v) var(--filters-padding-h);
	padding-right: 44px;
	margin: 0;
	font-family: var(--filters-font);
	font-weight: 300;
	font-size: 14px;
	letter-spacing: 0.02em;
	color: var(--filters-text);
	background: var(--filters-bg);
	border: 1px solid var(--filters-border);
	border-radius: var(--filters-radius);
	outline: none;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition:
		color var(--filters-transition),
		background-color var(--filters-transition),
		border-color var(--filters-transition),
		box-shadow var(--filters-transition);
}

.pk-filters__select::-ms-expand {
	display: none;
}

/* Placeholder state */
.pk-filters__select--placeholder {
	color: var(--filters-placeholder);
}

/* Hover */
.pk-filters__select:hover {
	border-color: #999;
	background-color: var(--filters-hover-bg);
}

/* Focus */
.pk-filters__select:focus-visible {
	border-color: var(--filters-active-bg);
	box-shadow: 0 0 0 1px var(--filters-active-bg);
}

/* Active selection (non-placeholder) */
.pk-filters__select:not(.pk-filters__select--placeholder) {
	color: var(--filters-active-text);
	background-color: var(--filters-active-bg);
	border-color: var(--filters-active-bg);
}

.pk-filters__select:not(.pk-filters__select--placeholder):hover {
	background-color: #444;
	border-color: #444;
}

/* Chevron icon */
.pk-filters__icon {
	position: absolute;
	top: 50%;
	right: 18px;
	transform: translateY(-50%);
	pointer-events: none;
	color: #999;
	transition: color var(--filters-transition);
}

.pk-filters__group:hover .pk-filters__icon {
	color: #666;
}

.pk-filters__select:not(.pk-filters__select--placeholder) ~ .pk-filters__icon {
	color: rgba(255, 255, 255, 0.6);
}

.pk-filters__select:not(.pk-filters__select--placeholder):hover ~ .pk-filters__icon {
	color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   Loading states
   ========================================================================== */

.pk-products-grid {
	transition: opacity 0.3s ease;
}

.pk-products-grid[aria-busy="true"] {
	opacity: 0.15;
	pointer-events: none;
}

/* ==========================================================================
   Infinite scroll sentinel
   ========================================================================== */

.pk-filters__sentinel {
	width: 100%;
	height: 1px;
	text-align: center;
	overflow: hidden;
}

.pk-filters__sentinel--loading {
	height: auto;
	padding: 40px 0 60px;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
}

.pk-filters__sentinel--loading::before {
	content: "";
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 1.5px solid #d0d0d0;
	border-top-color: #333;
	border-radius: 50%;
	animation: pk-spin 0.8s linear infinite;
}

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

/* ==========================================================================
   No results
   ========================================================================== */

.pk-filters__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 0 0 100%;
	text-align: center;
	padding: 80px 20px;
	font-family: var(--filters-font, sans-serif);
	font-size: 15px;
	font-weight: 300;
	letter-spacing: 0.05em;
	color: #999;
}

.pk-filters__empty p {
	margin: 0 0 20px;
}

.pk-filters__clear {
	display: inline-block;
	padding: 10px 24px;
	font-family: var(--filters-font, sans-serif);
	font-size: 13px;
	font-weight: 300;
	letter-spacing: 0.04em;
	color: #333;
	background: none;
	border: 1px solid #ccc;
	border-radius: 2px;
	cursor: pointer;
	transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.pk-filters__clear:hover {
	color: #fff;
	background-color: #333;
	border-color: #333;
}

/* ==========================================================================
   WooCommerce no products found (server-rendered empty state)
   ========================================================================== */

.woocommerce-no-products-found {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0 20px;
	text-align: center;
}

.pk-filters__view-all {
	display: inline-block;
	margin-top: 20px;
	padding: 10px 24px;
	font-family: var(--filters-font, sans-serif);
	font-size: 13px;
	font-weight: 300;
	letter-spacing: 0.04em;
	color: #fff;
	background-color: #333;
	border: 1px solid #333;
	border-radius: 2px;
	text-decoration: none;
	transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.pk-filters__view-all:hover {
	color: #fff;
	background-color: #000;
	border-color: #000;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
	.pk-filters {
		--filters-gap: 8px;
		--filters-padding-v: 12px;
		--filters-padding-h: 14px;
		flex-wrap: wrap;
		justify-content: center;
		padding: 0 0 25px;
		box-sizing: border-box;
		max-width: 100%;
	}

	.pk-filters__group {
		flex: 1 1 calc(50% - 4px);
		max-width: calc(50% - 4px);
		min-width: 0;
	}

	.pk-filters__select {
		font-size: 13px;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.pk-filters__icon {
		right: 12px;
	}
}

@media (max-width: 480px) {
	.pk-filters__group {
		flex: 1 1 100%;
		max-width: 100%;
	}
}
