/**
 * Styling for the EP facet replica.
 *
 * Written fresh — fSelect's stylesheet ships inside the paid FacetWP plugin and
 * cannot come with us — but deliberately matching its geometry (220px wrap, 6/8px
 * label padding, 200px scroll cap, 5px CSS-triangle arrow) so the sidebar looks
 * unchanged at cutover, per the faithful-replica decision.
 *
 * The site's own facet styling (`.facet-label`, `.facetwp-flyout .flyout-row`)
 * lives in the Bricks shortcode element's _cssCustom on templates #57/#308110 and
 * in snippets 019/071/214. Nothing here should fight it — this file only covers
 * what the removed plugins used to provide.
 */

/* ---------- searchable multi-select ---------- */

.fs-wrap {
	width: 100%;
	max-width: 220px;
	display: inline-block;
	position: relative;
	cursor: pointer;
	line-height: 1;
}

.fs-label-wrap {
	position: relative;
	background-color: #fff;
	border: 1px solid #ddd;
	cursor: default;
	user-select: none;
}

.fs-label-wrap .fs-label {
	padding: 6px 22px 6px 8px;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
}

.fs-arrow {
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 5px solid #333;
	position: absolute;
	top: 0;
	right: 5px;
	bottom: 0;
	margin: auto;
	transition: ease-in 0.15s;
}

.fs-open .fs-arrow {
	transform: rotate(-180deg);
}

.fs-dropdown {
	width: 100%;
	position: absolute;
	background-color: #fff;
	border: 1px solid #ddd;
	border-top: none;
	z-index: 1000;
	user-select: none;
}

.fs-dropdown.fs-hidden {
	display: none;
}

.fs-dropdown .fs-search input {
	width: 100%;
}

.fs-dropdown .fs-search,
.fs-search {
	width: 100%;
	box-sizing: border-box;
	padding: 6px 8px;
	border: none;
	border-bottom: 1px solid #eee;
	outline: none;
}

.fs-dropdown .fs-options {
	max-height: 200px;
	overflow: auto;
}

.fs-dropdown .fs-option {
	padding: 6px 8px;
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
}

.fs-dropdown .fs-option:hover {
	background-color: #f4f4f4;
}

.fs-dropdown .fs-option .fs-checkbox {
	width: 13px;
	height: 13px;
	flex: 0 0 13px;
	border: 1px solid #aaa;
	background: #fff;
	position: relative;
}

.fs-dropdown .fs-option.selected .fs-checkbox::after {
	content: "";
	position: absolute;
	left: 3px;
	top: 0;
	width: 4px;
	height: 8px;
	border: solid #333;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.fs-dropdown .fs-no-results {
	padding: 6px 8px;
	color: #888;
}

/* The server-rendered list stays in the DOM for the flyout to read, but the
   widget is what the shopper sees. */
.facetwp-checkbox.fs-hidden {
	display: none;
}

/* ---------- choice rows ---------- */

/*
 * Ported from FacetWP's front.css, which the replica does NOT load: taking over
 * the [facetwp] shortcode means FacetWP never renders, so it never enqueues its
 * stylesheet — and the file leaves with the plugin anyway. Without these rules
 * the choices lose their checkbox entirely and the sidebar loses its rhythm.
 *
 * The two checkbox images are the plugin's own 104x104 PNGs (272 and 128 bytes),
 * inlined as data URIs rather than copied into this directory. They live under
 * wp-content/plugins/facetwp/assets/images/ and would 404 the moment the plugin
 * is deleted; inlining makes the replica self-contained, which is the whole point.
 */
.facetwp-facet {
	margin-bottom: 40px;
}

.facetwp-checkbox {
	background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAABoBAMAAADvMqiSAAAAHlBMVEVtbW3w8PD19fX5+fnt7e3////y8vL7+/v39/f8/PwPc0wvAAAArUlEQVRYw+3OMQrCUBBFUbcQEBeQItin0FZwCxaWWrgBC7HVxg2IuFu7ZyDNv/Mhw4Q5U1/eLFIcB2DW0bGcx9IbIEui6AvURXfAYekDKLoBddEGcFi6Aop6wPJeb1nKaBQ9AUVbwGHpBdRFa0DRA3BYagHLe61lKaNwUVd6wwhUijrL0hn4LwGKLkCUaAUoOgGKGsDyXhNlKaMY0bKcx9IOIEuiaA9kNH2UwvgB7+fpXJJlp8UAAAAASUVORK5CYII=') 0 50% no-repeat;
	background-size: 14px 14px;
	margin-bottom: 4px;
	padding-left: 20px;
	cursor: pointer;
}

.facetwp-checkbox.checked {
	background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAABoAgMAAABgcl0yAAAACVBMVEV1dXVtbW3///9/jamWAAAAMklEQVRIx2MIxQmGutQqrGA4SDFggFGpUalRqVGpUalRqVEpOksNtuYB9aQGU3OOulIARYaoH3viXdEAAAAASUVORK5CYII=');
}

.facetwp-display-value {
	padding-right: 5px;
}

/* Pushed to the right edge, away from the label, exactly as FacetWP places it. */
.facetwp-checkbox .facetwp-expand {
	float: right;
}

/* ---------- hierarchical facets ---------- */

/* Child terms nest inside .facetwp-depth wrappers (one per level, matching
   FacetWP's render_hierarchy). Without an indent the tree reads as a flat list
   and a child is indistinguishable from a sibling of its parent. */
.facetwp-depth {
	margin-left: 12px;
}

/* The whole tree is in the DOM (FacetWP does the same — 290 rows on prod, 7
   visible) and branches are collapsed until expanded, either by [+] or because
   the branch contains the current selection. FacetWP ships no CSS for this; it
   collapses via JS, so the replica has to own the rule. */
.facetwp-depth.ep-collapsed {
	display: none;
}

.facetwp-expand {
	cursor: pointer;
	user-select: none;
}

/* ---------- soft limit ("See more") ---------- */

/* Rows past the soft limit are rendered but hidden, so the toggle is instant and
   a visitor without JS still sees every choice. */
.facetwp-hidden {
	display: none;
}

.facetwp-toggle {
	display: inline-block;
	margin-top: 4px;
	cursor: pointer;
	text-decoration: underline;
}

/* Must out-specify `.facetwp-toggle` above: both are single-class selectors, so
   the later rule would otherwise win and "See less" would render next to
   "See more" on load. */
.facetwp-toggle.facetwp-hidden {
	display: none;
}

/* ---------- AJAX refresh state ---------- */

/* Dim the results while a refresh is in flight, and block clicks so a shopper
   cannot queue three filters against a page that is about to be replaced.
   The facets stay interactive on purpose — the refresh aborts and re-issues. */
body.ep-facets-loading .brxe-woocommerce-products {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.12s linear;
}

/* ---------- mobile flyout ---------- */

.facetwp-flyout {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: 85%;
	max-width: 340px;
	background: #fff;
	z-index: 100000;
	transform: translateX(-100%);
	transition: transform 0.2s ease-in-out;
	display: flex;
	flex-direction: column;
}

.facetwp-flyout.active {
	transform: translateX(0);
}

.facetwp-flyout-wrap {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.facetwp-flyout-content {
	padding: 16px;
}

.facetwp-flyout-close {
	position: absolute;
	top: 8px;
	right: 12px;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	z-index: 1;
}

.facetwp-flyout-fog {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99999;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease-in-out;
}

.facetwp-flyout-fog.active {
	opacity: 1;
	pointer-events: auto;
}

body.facetwp-flyout-open {
	overflow: hidden;
}
