/* SurgeArrest Product Filter Sidebar */

.sa-pf {
	--sa-accent: #b11e24;
	--sa-text: #1b1617;
	--sa-muted: #6b6b6b;
	--sa-border: #e6e6e6;
	position: relative;
	font-size: 14px;
	line-height: 1.4;
	color: var(--sa-text);
	width: 100%;
}

/* Two-column layout created by auto placement */
.sa-pf-layout {
	display: flex;
	align-items: flex-start;
	gap: 30px;
}
.sa-pf-layout > .sa-pf {
	flex: 0 0 280px;
	max-width: 280px;
	position: sticky;
	top: 90px;
}
.sa-pf-layout > .et_pb_module {
	flex: 1 1 auto;
	min-width: 0;
}

.sa-pf__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin: 0 0 14px;
}
.sa-pf__title {
	font-size: 17px;
	font-weight: 600;
	letter-spacing: 0.01em;
}
.sa-pf__clear {
	font-size: 12px;
	color: var(--sa-accent) !important;
	text-decoration: underline;
	white-space: nowrap;
}
.sa-pf__clear:hover {
	text-decoration: none;
}

/* Boxes */
.sa-pf__box {
	background: #fff;
	border: 1px solid var(--sa-border);
	border-radius: 10px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	margin: 0 0 16px;
	overflow: hidden;
}
/* High specificity + !important: the theme's global h1-h6 rules otherwise
   override these titles with large heading sizes. */
.sa-pf h3.sa-pf__box-title {
	margin: 0 !important;
	padding: 13px 16px !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	line-height: 1.4 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.08em !important;
	color: var(--sa-text) !important;
	border-bottom: 1px solid var(--sa-border);
	background: #fafafa;
}
.sa-pf__box--brands .sa-pf__box-title::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--sa-accent);
	margin-right: 8px;
	vertical-align: 1px;
}
.sa-pf__box-body {
	padding: 8px 8px;
}

/* Options */
.sa-pf__opt {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 8px 10px;
	border-radius: 7px;
	cursor: pointer;
	user-select: none;
	transition: background 0.15s ease;
	font-weight: 400;
}
.sa-pf__opt:hover {
	background: #f7f4f4;
}
.sa-pf__opt input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.sa-pf__check {
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	border: 2px solid #c9c9c9;
	border-radius: 5px;
	background: #fff;
	position: relative;
	transition: all 0.15s ease;
}
.sa-pf__opt:hover .sa-pf__check {
	border-color: var(--sa-accent);
}
.sa-pf__opt input:checked + .sa-pf__check {
	background: var(--sa-accent);
	border-color: var(--sa-accent);
}
.sa-pf__opt input:checked + .sa-pf__check::after {
	content: "";
	position: absolute;
	left: 4px;
	top: 1px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.sa-pf__opt input:focus-visible + .sa-pf__check {
	outline: 2px solid var(--sa-accent);
	outline-offset: 2px;
}
.sa-pf__name {
	flex: 1 1 auto;
	font-size: 13.5px;
	color: var(--sa-text);
}
.sa-pf__opt--current .sa-pf__name {
	font-weight: 600;
}
.sa-pf__count {
	flex: 0 0 auto;
	font-size: 11px;
	color: var(--sa-muted);
	background: #f1f1f1;
	border-radius: 20px;
	padding: 1px 8px;
	min-width: 24px;
	text-align: center;
}
.sa-pf__opt input:checked ~ .sa-pf__count {
	background: #f9e9ea;
	color: var(--sa-accent);
}

/* Tag list */
.sa-pf__list {
	max-height: 350px;
	overflow-y: auto;
	scrollbar-width: thin;
}
.sa-pf__list::-webkit-scrollbar {
	width: 6px;
}
.sa-pf__list::-webkit-scrollbar-thumb {
	background: #d5d5d5;
	border-radius: 3px;
}

/* Search inside tag box */
.sa-pf__search {
	display: block;
	width: calc(100% - 16px);
	margin: 6px 8px 8px;
	padding: 7px 12px;
	font-size: 13px;
	border: 1px solid var(--sa-border);
	border-radius: 7px;
	background: #fafafa;
}
.sa-pf__search:focus {
	outline: none;
	border-color: var(--sa-accent);
	background: #fff;
}

/* Chips */
.sa-pf__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 14px;
}
.sa-pf__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--sa-accent);
	background: #f9e9ea;
	border: 1px solid #ecc9cb;
	border-radius: 20px;
	padding: 3px 6px 3px 11px;
	cursor: pointer;
}
.sa-pf__chip:hover {
	background: #f3d8da;
}
.sa-pf__chip-x {
	font-size: 14px;
	line-height: 1;
	font-weight: 700;
}

/* Mobile toggle */
.sa-pf__mobile-toggle {
	display: none;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 11px 16px;
	font-size: 14px;
	font-weight: 600;
	color: var(--sa-text);
	background: #fff;
	border: 1px solid var(--sa-border);
	border-radius: 10px;
	cursor: pointer;
	margin: 0 0 12px;
}
.sa-pf__badge {
	background: var(--sa-accent);
	color: #fff;
	font-size: 11px;
	border-radius: 20px;
	padding: 1px 7px;
	margin-left: auto;
}

/* Loading overlay — display:flex below would defeat the hidden attribute
   and permanently block clicks on the sidebar, so force it off when hidden. */
.sa-pf__overlay[hidden] {
	display: none !important;
}
.sa-pf__overlay {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.6);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 60px;
	border-radius: 10px;
	z-index: 5;
}
.sa-pf__spinner {
	width: 26px;
	height: 26px;
	border: 3px solid #eecfd1;
	border-top-color: var(--sa-accent);
	border-radius: 50%;
	animation: sa-pf-spin 0.7s linear infinite;
}
@keyframes sa-pf-spin {
	to {
		transform: rotate(360deg);
	}
}
body.sa-pf-loading .sa-pf-layout > .et_pb_module,
body.sa-pf-loading .woocommerce ul.products {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* Product grid: WooCommerce's own responsive CSS packs 2 products per row
   below 480px, which is cramped once the sidebar also takes vertical space
   above the grid on phones. Single column reads much better here. */
@media (max-width: 480px) {
	.woocommerce ul.products[class*="columns-"] li.product {
		width: 100% !important;
		margin-right: 0 !important;
		float: none !important;
	}
}

/* Responsive */
@media (max-width: 980px) {
	.sa-pf-layout {
		flex-direction: column;
		gap: 0;
	}
	.sa-pf-layout > .sa-pf {
		flex: 1 1 auto;
		max-width: none;
		position: static;
	}
	.sa-pf__mobile-toggle {
		display: flex;
	}
	.sa-pf__panel {
		display: none;
	}
	.sa-pf--open .sa-pf__panel {
		display: block;
		margin-bottom: 16px;
	}
	.sa-pf__header {
		display: none;
	}
	.sa-pf--open .sa-pf__header {
		display: flex;
	}
}
