/**
 * Styles for woo-sil7en/product-filters — editorial faceted sidebar.
 *
 * Quiet, collapsible facet groups (native <details>): a display-face summary
 * with a rotating chevron, checkbox-style toggle rows with right-aligned muted
 * counts, an active state in the brand accent, and a compact price range form.
 * Sticky on desktop. All values are design tokens; reduced-motion safe.
 *
 * @package woo-sil7en-blocks-commerce
 * @since   0.1.0
 */

.woo-sil7en-product-filters {
	font-size: var(--wp--preset--font-size--sm, 0.9375rem);
	color: var(--wp--preset--color--contrast, #1a1714);
}

@media (min-width: 782px) {
	.woo-sil7en-product-filters {
		position: sticky;
		top: var(--wp--custom--spacing--m, 1.5rem);
	}
}

/* ---- Mobile drawer toggle (shown by view.js < 782px; panel collapses) ---- */
.woo-sil7en-product-filters__toggle {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	inline-size: 100%;
	padding: 0.75rem 1rem;
	font-family: var(--wp--preset--font-family--display, "Lora", Georgia, serif);
	font-size: var(--wp--preset--font-size--sm, 0.9375rem);
	font-weight: 500;
	color: var(--wp--preset--color--contrast, #1a1714);
	background: var(--wp--preset--color--surface, #f6f5f3);
	border: 1px solid var(--wp--preset--color--border, #e6e3de);
	border-radius: var(--wp--custom--radius--sm, 0.1875rem);
	cursor: pointer;
}

.woo-sil7en-product-filters__toggle[hidden] {
	display: none;
}

.woo-sil7en-product-filters__toggle .woo-sil7en-product-filters__chevron {
	margin-inline-start: auto;
	color: var(--wp--preset--color--muted, #6f6b64);
	transition: transform var(--wp--custom--motion--duration--base, 250ms) var(--wp--custom--motion--ease--soft, ease);
}

.woo-sil7en-product-filters.is-open .woo-sil7en-product-filters__toggle .woo-sil7en-product-filters__chevron {
	transform: rotate(180deg);
}

.woo-sil7en-product-filters__toggle-badge {
	min-inline-size: 1.3rem;
	padding-inline: 0.4rem;
	border-radius: var(--wp--custom--radius--pill, 999px);
	background: var(--wp--preset--color--primary, #531099);
	color: var(--wp--preset--color--primary-ink, #fff);
	font-size: var(--wp--preset--font-size--xs, 0.75rem);
	line-height: 1.3rem;
	text-align: center;
}

@media (max-width: 781px) {
	.woo-sil7en-product-filters[data-wsf-enhanced] .woo-sil7en-product-filters__panel {
		display: none;
		margin-block-start: var(--wp--custom--spacing--s, 0.85rem);
	}
	.woo-sil7en-product-filters[data-wsf-enhanced].is-open .woo-sil7en-product-filters__panel {
		display: block;
	}
}

@media (min-width: 782px) {
	.woo-sil7en-product-filters__toggle {
		display: none;
	}
}

/* ---- Header ---- */
.woo-sil7en-product-filters__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding-block-end: var(--wp--custom--spacing--s, 0.75rem);
	margin-block-end: var(--wp--custom--spacing--xs, 0.5rem);
	border-block-end: 1px solid var(--wp--preset--color--border, #e6e3de);
}

.woo-sil7en-product-filters__title {
	font-family: var(--wp--preset--font-family--display, "Lora", Georgia, serif);
	font-size: var(--wp--preset--font-size--md, 1.125rem);
	font-weight: 500;
	letter-spacing: -0.01em;
	margin: 0;
}

.woo-sil7en-product-filters__clear {
	font-size: var(--wp--preset--font-size--xs, 0.8125rem);
	color: var(--wp--preset--color--primary, #531099);
	text-decoration: none;
}

.woo-sil7en-product-filters__clear:hover {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* ---- Group (collapsible) ---- */
.woo-sil7en-product-filters__group {
	border-block-end: 1px solid var(--wp--preset--color--border, #e6e3de);
}

.woo-sil7en-product-filters__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding-block: var(--wp--custom--spacing--s, 0.85rem);
	cursor: pointer;
	list-style: none;
	font-family: var(--wp--preset--font-family--display, "Lora", Georgia, serif);
	font-size: var(--wp--preset--font-size--sm, 0.9375rem);
	font-weight: 500;
	letter-spacing: -0.005em;
	-webkit-tap-highlight-color: transparent;
}

.woo-sil7en-product-filters__summary::-webkit-details-marker {
	display: none;
}

.woo-sil7en-product-filters__summary:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #531099);
	outline-offset: 3px;
	border-radius: 2px;
}

.woo-sil7en-product-filters__chevron {
	flex: none;
	color: var(--wp--preset--color--muted, #6f6b64);
	transition: transform var(--wp--custom--motion--duration--base, 250ms) var(--wp--custom--motion--ease--soft, ease);
}

.woo-sil7en-product-filters__group[open] .woo-sil7en-product-filters__chevron {
	transform: rotate(180deg);
}

/* ---- Option list ---- */
.woo-sil7en-product-filters__list {
	list-style: none;
	margin: 0;
	padding: 0 0 var(--wp--custom--spacing--s, 0.85rem);
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	max-height: 17rem;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.woo-sil7en-product-filters__option {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.3rem 0.4rem;
	border-radius: var(--wp--custom--radius--sm, 0.1875rem);
	text-decoration: none;
	color: var(--wp--preset--color--muted, #6f6b64);
	line-height: 1.3;
	transition: background-color var(--wp--custom--motion--duration--fast, 150ms) ease, color var(--wp--custom--motion--duration--fast, 150ms) ease;
}

.woo-sil7en-product-filters__option:hover {
	background: var(--wp--preset--color--surface, #f6f5f3);
	color: var(--wp--preset--color--contrast, #1a1714);
}

.woo-sil7en-product-filters__option:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #531099);
	outline-offset: 1px;
}

/* Checkbox indicator */
.woo-sil7en-product-filters__check {
	flex: none;
	inline-size: 1rem;
	block-size: 1rem;
	border: 1.5px solid var(--wp--preset--color--border, #d8d4cd);
	border-radius: var(--wp--custom--radius--sm, 0.1875rem);
	background: var(--wp--preset--color--base, #fff);
	transition: border-color var(--wp--custom--motion--duration--fast, 150ms) ease, background-color var(--wp--custom--motion--duration--fast, 150ms) ease;
}

.woo-sil7en-product-filters__option.is-active .woo-sil7en-product-filters__check {
	border-color: var(--wp--preset--color--primary, #531099);
	background: var(--wp--preset--color--primary, #531099) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E") center / 0.7rem no-repeat;
}

.woo-sil7en-product-filters__option.is-active {
	color: var(--wp--preset--color--contrast, #1a1714);
	font-weight: 500;
}

.woo-sil7en-product-filters__name {
	flex: 1 1 auto;
	min-width: 0;
}

.woo-sil7en-product-filters__count {
	flex: none;
	font-size: var(--wp--preset--font-size--xs, 0.75rem);
	color: var(--wp--preset--color--muted, #9a958c);
	font-variant-numeric: tabular-nums;
}

/* Materia rows have no checkbox (they are navigation), so align the name. */
.woo-sil7en-product-filters__option.is-materia {
	font-weight: 500;
	color: var(--wp--preset--color--contrast, #1a1714);
}

.woo-sil7en-product-filters__option.is-materia.is-active {
	color: var(--wp--preset--color--primary, #531099);
}

/* ---- Price form ---- */
.woo-sil7en-product-filters__price {
	padding-block: 0.25rem var(--wp--custom--spacing--s, 0.85rem);
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.woo-sil7en-product-filters__price-fields {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.woo-sil7en-product-filters__price-fields input {
	inline-size: 100%;
	min-width: 0;
	padding: 0.4rem 0.55rem;
	border: 1px solid var(--wp--preset--color--border, #e6e3de);
	border-radius: var(--wp--custom--radius--sm, 0.1875rem);
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
	background: var(--wp--preset--color--base, #fff);
	color: inherit;
}

.woo-sil7en-product-filters__price-fields input:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #531099);
	outline-offset: 1px;
	border-color: transparent;
}

.woo-sil7en-product-filters__price-sep {
	color: var(--wp--preset--color--muted, #9a958c);
}

.woo-sil7en-product-filters__price-apply {
	align-self: flex-start;
	padding: 0.4rem 1rem;
	font-size: var(--wp--preset--font-size--xs, 0.8125rem);
	font-weight: 500;
	color: var(--wp--preset--color--contrast, #1a1714);
	background: transparent;
	border: 1px solid var(--wp--preset--color--border, #e6e3de);
	border-radius: var(--wp--custom--radius--pill, 999px);
	cursor: pointer;
	transition: border-color var(--wp--custom--motion--duration--fast, 150ms) ease, color var(--wp--custom--motion--duration--fast, 150ms) ease;
}

.woo-sil7en-product-filters__price-apply:hover,
.woo-sil7en-product-filters__price-apply:focus-visible {
	border-color: var(--wp--preset--color--primary, #531099);
	color: var(--wp--preset--color--primary, #531099);
}

@media (prefers-reduced-motion: reduce) {
	.woo-sil7en-product-filters__chevron,
	.woo-sil7en-product-filters__option,
	.woo-sil7en-product-filters__check {
		transition: none;
	}
}
