/**
 * Front-end filter bar.
 */

.bf-filter,
.bf-filter * {
	box-sizing: border-box;
}

.bf-filter {
	--bf-primary: #d71920;
	position: relative;
	z-index: 20;
	container-type: inline-size;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 8px;
	padding: 12px;
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.35;
	color: #1d2939;
}

.bf-filter a {
	text-decoration: none;
}

.bf-pills {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.bf-group {
	position: relative;
}

.bf-pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 38px;
	padding: 0 13px;
	margin: 0;
	border: 1px solid #d9d9d9;
	border-radius: 6px;
	background: #fff;
	color: #222;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
	white-space: nowrap;
}

.bf-pill:hover,
.bf-pill:focus-visible,
.bf-group.is-open .bf-pill {
	border-color: var(--bf-primary);
	color: var(--bf-primary);
	outline: none;
}

.bf-group.is-open .bf-pill {
	box-shadow: inset 0 0 0 1px var(--bf-primary);
}

.bf-group.has-value .bf-pill {
	border-color: var(--bf-primary);
	background: #fff8f8;
	color: var(--bf-primary);
}

.bf-caret {
	flex: 0 0 auto;
	transition: transform 0.15s ease;
}

.bf-group.is-open .bf-caret {
	transform: rotate(180deg);
}

.bf-pill-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--bf-primary);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

.bf-reset {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 38px;
	padding: 0 10px;
	color: #667085;
	font-size: 13px;
}

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

/* Dropdown panels */
.bf-panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 70;
	display: none;
	min-width: 250px;
	max-width: 340px;
	max-height: 340px;
	overflow: auto;
	padding: 6px;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 8px;
	box-shadow: 0 10px 28px rgba(16, 24, 40, 0.14);
}

.bf-group.is-open .bf-panel {
	display: block;
}

.bf-opt {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 8px 9px;
	border-radius: 6px;
	color: #344054;
	font-size: 14px;
}

.bf-opt:hover {
	background: #f5f6f8;
	color: var(--bf-primary);
}

.bf-opt-all {
	font-weight: 600;
}

.bf-tick {
	position: relative;
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	border: 1.5px solid #c9ccd2;
	border-radius: 3px;
	background: #fff;
}

.bf-opt.is-selected .bf-tick {
	border-color: var(--bf-primary);
	background: var(--bf-primary);
}

.bf-opt.is-selected .bf-tick::after {
	content: "";
	position: absolute;
	left: 4px;
	top: 1px;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.bf-opt-name {
	flex: 1 1 auto;
}

.bf-opt-count {
	color: #98a2b3;
	font-size: 12px;
}

/* Selected chips */
.bf-chosen {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px dashed #e6e6e6;
}

.bf-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 9px;
	border-radius: 20px;
	background: #f2f4f7;
	color: #344054;
	font-size: 13px;
}

.bf-chip b {
	font-weight: 600;
}

.bf-chip-label {
	color: #667085;
}

.bf-chip .bf-x {
	color: #98a2b3;
	font-size: 11px;
}

.bf-chip:hover {
	background: #ffe9e9;
	color: var(--bf-primary);
}

/* Quick-choice blocks */
.bf-block {
	margin-top: 14px;
}

.bf-block-title {
	margin: 0 0 8px;
	color: #1d2939;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.bf-cards {
	display: grid;
	grid-template-columns: repeat(var(--bf-cols, 4), minmax(0, 1fr));
	gap: 10px;
}

@container (max-width: 820px) {
	.bf-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.bf-card {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid #e4e7ec;
	border-radius: 8px;
	background: #fff;
	color: #1d2939;
	min-width: 0;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.bf-card:hover {
	border-color: var(--bf-primary);
	color: #1d2939;
}

.bf-card.is-active {
	border-color: var(--bf-primary);
	background: #fff7f7;
	box-shadow: inset 0 0 0 1px var(--bf-primary);
}

.bf-card-icon {
	flex: 0 0 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 40px;
	color: #344054;
}

.bf-card-icon img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.bf-card-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.3;
}

.bf-card-text strong {
	font-size: 14px;
	font-weight: 700;
}

.bf-card-text span {
	color: #667085;
	font-size: 12px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Brands */
.bf-block--brands {
	padding: 12px;
	border: 2px solid var(--bf-primary);
	border-radius: 8px;
}

.bf-brands {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.bf-brand {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 92px;
	height: 44px;
	padding: 6px 16px;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	background: #fff;
	color: #1d2939;
	font-size: 14px;
	font-weight: 800;
	letter-spacing: 0.02em;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.bf-brand:hover {
	border-color: var(--bf-primary);
	color: var(--bf-primary);
}

.bf-brand img {
	max-width: 110px;
	max-height: 24px;
	object-fit: contain;
}

.bf-brand.is-active {
	border-color: var(--bf-primary);
	color: var(--bf-primary);
	box-shadow: inset 0 0 0 1px var(--bf-primary);
}

.bf-brand--all {
	min-width: 74px;
	font-weight: 600;
}

/* Clean layout (hide legacy sidebar / filters) */
.bf-clean-shop .category-page-row > .col.large-9 {
	flex-basis: 100%;
	max-width: 100%;
}

.bf-clean-shop .category-page-row > .large-3.col {
	display: none !important;
}

.bf-clean-shop .shop-container .woof_show_auto_form,
.bf-clean-shop .shop-container .woof_auto_show,
.bf-clean-shop .shop-container .woof_products_top_panel {
	display: none !important;
}

.bf-clean-shop .category-filter-row {
	display: none !important;
}

/* Top bar wrapper */
.bf-topbar {
	padding: 16px 0 0;
}

.bf-under-title {
	padding-top: 0;
	padding-bottom: 4px;
}

/* Sidebar widget (vertical) */
.bf-filter--vertical {
	container-type: normal;
	padding: 0;
	border: 0;
	background: transparent;
	margin: 0;
}

.bf-filter--vertical .bf-chosen {
	margin: 0 0 8px;
	padding-top: 0;
	border-top: 0;
}

.bf-filter--vertical .bf-pills {
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 6px;
}

.bf-filter--vertical .bf-group {
	width: 100%;
	min-width: 0;
}

.bf-filter--vertical .bf-pill {
	width: 100%;
	min-width: 0;
	justify-content: space-between;
	height: 40px;
	padding: 0 10px;
	font-size: 14px;
	overflow: hidden;
}

.bf-filter--vertical .bf-pill-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bf-filter--vertical .bf-panel {
	position: static;
	display: none;
	min-width: 0;
	max-width: none;
	max-height: 300px;
	margin: 4px 0 2px;
	padding: 4px;
	border: 1px solid #eee;
	border-radius: 6px;
	box-shadow: none;
}

.bf-filter--vertical .bf-group.is-open .bf-panel {
	display: block;
}

.bf-filter--vertical .bf-opt {
	padding: 7px 8px;
	font-size: 13px;
}

.bf-filter--vertical .bf-wgroup {
	margin-bottom: 14px;
}

.bf-filter--vertical .bf-group-title {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 700;
}

.bf-filter--vertical .bf-wgroup .bf-panel {
	display: block;
	position: static;
	max-height: none;
	padding: 0;
	border: 0;
}

.bf-filter--vertical .bf-block {
	margin-top: 12px;
}

.bf-filter--vertical .bf-cards {
	grid-template-columns: 1fr;
}

.bf-filter--vertical .bf-card {
	padding: 8px 10px;
}

.bf-filter--vertical .bf-block--brands {
	padding: 8px;
	border-width: 1px;
}

.bf-filter--vertical .bf-brands {
	gap: 6px;
}

.bf-filter--vertical .bf-brand {
	flex: 1 1 45%;
	min-width: 0;
	height: 38px;
	padding: 4px 8px;
	font-size: 12px;
}

.bf-filter--vertical .bf-reset {
	height: auto;
	padding: 2px 0;
}

/* Accordion groups (sidebar) */
.bf-filter--vertical .bf-acc {
	margin-bottom: 10px;
	background: #fff;
	border: 1px solid #e4e7ec;
	border-radius: 5px;
	overflow: hidden;
}

.bf-filter--vertical .bf-acc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	padding: 10px 12px;
	margin: 0;
	background: #f7f8f9;
	border: 0;
	border-bottom: 1px solid #e4e7ec;
	color: #1d2939;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	text-align: left;
	cursor: pointer;
}

.bf-filter--vertical .bf-acc-head:hover {
	color: var(--bf-primary);
}

.bf-filter--vertical .bf-acc:not(.is-open) .bf-acc-head {
	border-bottom: 0;
}

.bf-filter--vertical .bf-acc:not(.is-open) .bf-caret {
	transform: rotate(-90deg);
}

.bf-filter--vertical .bf-acc-body {
	padding: 10px 12px 11px;
}

.bf-filter--vertical .bf-acc:not(.is-open) .bf-acc-body {
	display: none;
}

.bf-filter--vertical .bf-acc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
	gap: 3px 12px;
}

.bf-filter--vertical .bf-acc-grid--1 {
	grid-template-columns: 1fr;
}

.bf-filter--vertical .bf-cb {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 5px 0;
	color: #344054;
	font-size: 13px;
	line-height: 1.3;
	text-decoration: none;
}

.bf-filter--vertical .bf-cb:hover {
	color: var(--bf-primary);
}

.bf-filter--vertical .bf-box {
	position: relative;
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	margin-top: 1px;
	background: #fff;
	border: 1px solid #c9ccd2;
	border-radius: 2px;
}

.bf-filter--vertical .bf-cb.is-selected .bf-box {
	background: var(--bf-primary);
	border-color: var(--bf-primary);
}

.bf-filter--vertical .bf-cb.is-selected .bf-box::after {
	content: "";
	position: absolute;
	left: 4px;
	top: 1px;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.bf-empty {
	color: #98a2b3;
	font-size: 13px;
}

@media (max-width: 849px) {
	.bf-topbar {
		padding-top: 10px;
	}

	.bf-filter {
		padding: 10px;
	}

	.bf-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.bf-filter:not(.bf-filter--vertical) .bf-panel {
		position: fixed;
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		max-width: none;
		max-height: 70vh;
		border-radius: 12px 12px 0 0;
	}
}

@media (max-width: 549px) {
	.bf-pill {
		height: 34px;
		padding: 0 10px;
		font-size: 13px;
	}

	.bf-block--brands {
		padding: 10px;
	}

	.bf-brand {
		min-width: 76px;
		height: 38px;
		padding: 5px 10px;
		font-size: 13px;
	}

	.bf-card {
		padding: 8px;
		gap: 8px;
	}

	.bf-card-icon {
		flex-basis: 30px;
		height: 30px;
	}

	.bf-card-icon svg {
		width: 26px;
		height: 26px;
	}

	.bf-card-text strong {
		font-size: 13px;
	}

	.bf-card-text span {
		font-size: 11px;
	}
}
