/* Shop filter bar (blocksy-child) - Dawn / heliosupply style */

.bc-facets {
	--bc-f-text: var(--theme-text-color, #3a4f66);
	--bc-f-strong: var(--theme-headings-color, var(--theme-text-color, #192a3d));
	--bc-f-border: var(--theme-border-color, rgba(18, 18, 18, 0.15));
	--bc-f-bg: var(--theme-palette-color-8, #ffffff);
	--bc-f-accent: var(--theme-link-hover-color, var(--theme-palette-color-1, #2872fa));
	position: relative;
	z-index: 20;
	margin-bottom: 30px;
	color: var(--bc-f-text);
	font-size: 15px;
}

/* The filter bar replaces the default sorting / result count */
.bc-has-facets .woo-listing-top:empty {
	display: none;
}

.bc-facets__form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 32px;
	margin: 0;
}

.bc-facets__filters,
.bc-facets__end {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 28px;
}

.bc-facets__heading,
.bc-facets__sort-label {
	margin: 0;
	white-space: nowrap;
}

/* ---- Dropdown ----------------------------------------------------------- */

.bc-facets__disclosure {
	position: relative;
}

.bc-facets__summary {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 0;
	list-style: none;
	cursor: pointer;
	user-select: none;
	color: var(--bc-f-text);
	transition: color 0.2s;
}

.bc-facets__summary::-webkit-details-marker {
	display: none;
}

.bc-facets__summary:hover,
.bc-facets__disclosure[open] > .bc-facets__summary {
	color: var(--bc-f-strong);
}

.bc-facets__summary:hover > span:first-child {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.bc-facets__summary:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.bc-facets__badge {
	font-size: 0.9em;
}

.bc-facets__caret {
	width: 10px;
	height: 6px;
	flex: 0 0 auto;
	transition: transform 0.2s;
}

.bc-facets__disclosure[open] .bc-facets__caret {
	transform: rotate(180deg);
}

.bc-facets__display {
	position: absolute;
	top: calc(100% + 4px);
	left: -12px;
	z-index: 30;
	width: 350px;
	max-width: calc(100vw - 40px);
	max-height: 55vh;
	overflow-y: auto;
	border: 1px solid var(--bc-f-border);
	background: var(--bc-f-bg);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
	animation: bc-facets-in 0.2s ease;
}

@keyframes bc-facets-in {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: none; }
}

.bc-facets__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 20px;
	border-bottom: 1px solid var(--bc-f-border);
	font-size: 14px;
}

.bc-facets__selected .woocommerce-Price-amount {
	font-weight: inherit;
}

.bc-facets__reset {
	color: var(--bc-f-strong);
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
}

.bc-facets__reset:hover {
	text-decoration-thickness: 2px;
}

/* ---- Checkbox list ------------------------------------------------------ */

.bc-facets__fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.bc-facets__list {
	margin: 0;
	padding: 12px 20px 16px;
	list-style: none;
}

.bc-facets__list li {
	margin: 0;
}

.bc-facets__label {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 7px 0;
	cursor: pointer;
	line-height: 1.4;
}

.bc-facets__label input {
	position: absolute;
	opacity: 0;
	width: 16px;
	height: 16px;
	margin: 0;
}

.bc-facets__check {
	position: relative;
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	border: 1px solid currentColor;
	background: transparent;
}

.bc-facets__label input:checked + .bc-facets__check::after {
	content: "";
	position: absolute;
	left: 4px;
	top: 1px;
	width: 5px;
	height: 9px;
	border: solid currentColor;
	border-width: 0 1.5px 1.5px 0;
	transform: rotate(45deg);
}

.bc-facets__label input:focus-visible + .bc-facets__check {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.bc-facets__label:hover .bc-facets__text {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.bc-facets__label.is-disabled {
	opacity: 0.45;
	cursor: default;
}

.bc-facets__label.is-disabled .bc-facets__text {
	text-decoration: line-through;
}

.bc-facets__num {
	opacity: 0.8;
}

/* ---- Price -------------------------------------------------------------- */

.bc-facets__price {
	display: flex;
	gap: 20px;
	padding: 20px;
}

.bc-facets__price-field {
	display: flex;
	flex: 1 1 0;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.bc-facets__field {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

.bc-facets .bc-facets__field input {
	width: 100%;
	height: 46px;
	padding: 18px 14px 4px;
	border: 1px solid var(--bc-f-border);
	border-radius: 0;
	background: transparent;
	color: var(--bc-f-strong);
	font-size: 15px;
	box-shadow: none;
}

.bc-facets .bc-facets__field input:focus {
	border-color: var(--bc-f-strong);
	outline: none;
	box-shadow: 0 0 0 1px var(--bc-f-strong);
}

.bc-facets__field-label {
	position: absolute;
	top: 50%;
	left: 15px;
	transform: translateY(-50%);
	color: var(--bc-f-text);
	pointer-events: none;
	transition: top 0.15s ease, font-size 0.15s ease;
}

.bc-facets__field input:focus + .bc-facets__field-label,
.bc-facets__field input:not(:placeholder-shown) + .bc-facets__field-label {
	top: 13px;
	font-size: 11px;
	letter-spacing: 0.02em;
}

/* ---- Sort + count ------------------------------------------------------- */

.bc-facets__sort {
	display: flex;
	align-items: center;
	gap: 14px;
}

.bc-facets__select {
	position: relative;
}

.bc-facets .bc-facets__select select {
	min-width: 150px;
	height: auto;
	padding: 6px 32px 6px 8px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--bc-f-text);
	font-size: inherit;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
}

.bc-facets .bc-facets__select select:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.bc-facets__select .bc-facets__caret {
	position: absolute;
	top: 50%;
	right: 8px;
	transform: translateY(-50%);
	pointer-events: none;
}

.bc-facets__count {
	margin: 0;
	opacity: 0.8;
	white-space: nowrap;
}

/* ---- Active filters ----------------------------------------------------- */

.bc-facets__active {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 16px;
}

.bc-facets__pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	border: 1px solid var(--bc-f-border);
	border-radius: 999px;
	color: var(--bc-f-strong);
	font-size: 14px;
	line-height: 1.3;
	text-decoration: none;
	transition: border-color 0.2s;
}

.bc-facets__pill:hover {
	border-color: var(--bc-f-strong);
	color: var(--bc-f-strong);
}

.bc-facets__pill svg {
	width: 11px;
	height: 11px;
}

.bc-facets__remove-all {
	margin-left: 4px;
	color: var(--bc-f-strong);
	font-size: 14px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---- Loading ------------------------------------------------------------ */

.bc-facets-loading ul.products,
.bc-facets-loading .woocommerce-info,
.bc-facets-loading .ct-pagination,
.bc-facets-loading .woocommerce-pagination {
	opacity: 0.4;
	pointer-events: none;
	transition: opacity 0.2s;
}

.bc-facets-loading .bc-facets__count {
	visibility: hidden;
}

/* ---- Mobile drawer ------------------------------------------------------ */

/*
 * Desktop: the bar / drawer chrome does not exist, the filter bar is inline.
 * Mobile: "Filter and sort" bar + a drawer sliding in from the left, like
 * heliosupply.com (Dawn).
 */
.bc-facets__bar,
.bc-facets__drawer-head,
.bc-facets__drawer-foot,
.bc-facets__back-bar,
.bc-facets__overlay,
.bc-facets__arrow {
	display: none;
}

body.bc-facets-locked {
	overflow: hidden;
}

@media (max-width: 749px) {
	/*
	 * No stacking context here: the drawer is fixed and has to paint above the
	 * (sticky) header, which is outside .bc-facets.
	 */
	.bc-facets {
		position: static;
		z-index: auto;
		margin-bottom: 24px;
	}

	/* ---- The bar that opens the drawer ---- */

	.bc-facets.is-js .bc-facets__bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		padding: 14px 0;
		border-top: 1px solid var(--bc-f-border);
		border-bottom: 1px solid var(--bc-f-border);
	}

	.bc-facets .bc-facets__toggle {
		display: inline-flex;
		align-items: center;
		gap: 10px;
		min-height: 0;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: none;
		box-shadow: none;
		color: var(--bc-f-accent);
		font: inherit;
		letter-spacing: normal;
		text-transform: none;
		cursor: pointer;
	}

	.bc-facets .bc-facets__toggle:hover span {
		text-decoration: underline;
		text-underline-offset: 3px;
	}

	.bc-facets__toggle-icon {
		flex: 0 0 auto;
		width: 20px;
		height: 20px;
	}

	.bc-facets__bar-count {
		opacity: 0.8;
		white-space: nowrap;
	}

	/* ---- Drawer ---- */

	.bc-facets.is-js .bc-facets__overlay {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 99989;
		background: rgba(0, 0, 0, 0.4);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.25s ease, visibility 0s linear 0.25s;
	}

	.bc-facets.is-open .bc-facets__overlay {
		opacity: 1;
		visibility: visible;
		transition: opacity 0.25s ease;
	}

	.bc-facets.is-js .bc-facets__panel {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		z-index: 99990;
		display: flex;
		flex-direction: column;
		width: min(355px, calc(100% - 45px));
		background: var(--bc-f-bg);
		box-shadow: 0 0 24px rgba(0, 0, 0, 0.12);
		transform: translateX(-100%);
		visibility: hidden;
		transition: transform 0.25s ease, visibility 0s linear 0.25s;
	}

	body.admin-bar .bc-facets.is-js .bc-facets__panel,
	body.admin-bar .bc-facets.is-js .bc-facets__overlay {
		top: 46px;
	}

	.bc-facets.is-open .bc-facets__panel {
		transform: none;
		visibility: visible;
		transition: transform 0.25s ease;
	}

	/* Re-opened right after an AJAX reload: no slide-in replay. */
	.bc-facets.is-instant .bc-facets__panel,
	.bc-facets.is-instant .bc-facets__overlay {
		transition: none;
	}

	.bc-facets.is-instant .bc-facets__display {
		animation: none;
	}

	.bc-facets.is-js .bc-facets__drawer-head {
		position: relative;
		flex: 0 0 auto;
		display: block;
		padding: 16px 52px;
		border-bottom: 1px solid var(--bc-f-border);
		text-align: center;
	}

	.bc-facets__drawer-title {
		display: block;
		color: var(--bc-f-strong);
		font-weight: 600;
	}

	.bc-facets__drawer-count {
		display: block;
		margin-top: 2px;
		font-size: 14px;
		opacity: 0.8;
	}

	.bc-facets .bc-facets__close {
		position: absolute;
		top: 50%;
		right: 10px;
		transform: translateY(-50%);
		display: flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		min-height: 0;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: none;
		box-shadow: none;
		color: var(--bc-f-strong);
		cursor: pointer;
	}

	.bc-facets__close svg {
		width: 20px;
		height: 20px;
	}

	/* ---- Drawer body ---- */

	.bc-facets.is-js .bc-facets__form {
		position: static;
		flex: 1 1 auto;
		display: block;
		gap: 0;
		padding-bottom: 92px;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.bc-facets__filters {
		display: block;
		gap: 0;
	}

	.bc-facets__heading,
	.bc-facets__count {
		display: none;
	}

	.bc-facets__disclosure {
		position: static;
	}

	.bc-facets__summary {
		gap: 12px;
		padding: 18px 20px;
		color: var(--bc-f-strong);
	}

	.bc-facets__summary > span:first-child {
		flex: 1 1 auto;
	}

	.bc-facets__summary:hover > span:first-child {
		text-decoration: none;
	}

	.bc-facets__summary .bc-facets__caret {
		display: none;
	}

	.bc-facets__summary .bc-facets__arrow {
		display: block;
		width: 16px;
		height: 16px;
	}

	/* ---- Sub-panel (one facet), slides over the drawer ---- */

	.bc-facets.is-js .bc-facets__display {
		position: absolute;
		inset: 0;
		z-index: 2;
		width: auto;
		max-width: none;
		max-height: none;
		padding-bottom: 92px;
		border: 0;
		box-shadow: none;
		animation: bc-facets-slide-in 0.25s ease;
	}

	@keyframes bc-facets-slide-in {
		from { transform: translateX(100%); }
		to { transform: none; }
	}

	.bc-facets.is-js .bc-facets__back-bar {
		display: block;
		padding: 6px 12px;
		border-bottom: 1px solid var(--bc-f-border);
	}

	.bc-facets .bc-facets__back {
		display: inline-flex;
		align-items: center;
		gap: 12px;
		min-height: 0;
		padding: 12px 8px;
		border: 0;
		border-radius: 0;
		background: none;
		box-shadow: none;
		color: var(--bc-f-strong);
		font: inherit;
		font-weight: 600;
		letter-spacing: normal;
		text-transform: none;
		cursor: pointer;
	}

	.bc-facets__back svg {
		flex: 0 0 auto;
		width: 16px;
		height: 16px;
	}

	.bc-facets__price {
		gap: 12px;
	}

	/* ---- Sort ---- */

	.bc-facets__end {
		display: block;
		padding: 4px 20px 20px;
	}

	.bc-facets__sort {
		justify-content: space-between;
		gap: 12px;
	}

	.bc-facets__sort-label {
		color: var(--bc-f-strong);
	}

	/* ---- Drawer footer ---- */

	.bc-facets.is-js .bc-facets__drawer-foot {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 3;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		padding: 16px 20px;
		border-top: 1px solid var(--bc-f-border);
		background: var(--bc-f-bg);
	}

	.bc-facets__foot-clear {
		margin: 0;
		font-size: 15px;
	}

	.bc-facets .bc-facets__apply {
		flex: 0 0 auto;
		min-width: 150px;
		min-height: 0;
		padding: 15px 24px;
		border: 0;
		border-radius: 0;
		background: var(--bc-f-strong);
		box-shadow: none;
		color: var(--bc-f-bg);
		font: inherit;
		line-height: 1.2;
		text-align: center;
		cursor: pointer;
	}

	.bc-facets .bc-facets__apply:hover {
		opacity: 0.9;
	}

	/* ---- Active filter pills stay under the bar ---- */

	.bc-facets__active {
		margin-top: 14px;
	}
}
