/* Catalog filter (includes/filter.php, js/fs-filter.js) ------------------
   Drawn to match the HUSKY sidebar it replaces: the switcher rows, the
   orange-ticked radios and checkboxes, the uppercase group titles and the
   rounded dropdown - plus a count on every option and greyed-out options
   that would give nothing. */

.fs-filter {
	--fs-filter-ink: #222;
	--fs-filter-muted: #9a9999;
	--fs-filter-line: #d3cfc8;
	--fs-filter-accent: var(--fs-color-secondary, #ff6f20);
	--fs-filter-accent-soft: #fddbca;
	font-size: .9em;
}

.fs-filter__name {
	flex: 0 1 auto;
	min-width: 0;
	margin-right: .5em;
}

.fs-filter__count {
	flex: none;
	margin-left: auto;
	padding-left: .55em;
	padding-right: .55em;
	border-radius: 1em;
	background: #f4f1f6;
	color: #77707d;
	font-size: .78em;
	font-weight: 700;
	line-height: 1.7;
}

.fs-filter .is-empty {
	opacity: .42;
	cursor: not-allowed;
}

.fs-filter .is-empty .fs-filter__count {
	background: transparent;
}

/* Group titles, as HUSKY's h4. */
.fs-filter__title {
	margin: 30px 0 18px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.05;
	letter-spacing: .05em;
	text-transform: uppercase;
}

/* Switches: the on/off filters and the product tags --------------------- */

.fs-filter__switches {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.fs-switch {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0 0 0 47px;
	min-height: 22px;
	font-weight: 700;
	color: #333;
	line-height: 1.3;
	cursor: pointer;
	user-select: none;
}

.fs-switch__input,
.fs-opt__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.fs-switch__track {
	position: absolute;
	top: 50%;
	left: 3px;
	width: 34px;
	height: 14px;
	margin-top: -7px;
	border-radius: 8px;
	background: var(--fs-filter-muted);
	transition: background .2s ease;
}

.fs-switch__track::after {
	content: "";
	position: absolute;
	top: -3px;
	left: -6px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 3px 8px rgba(154, 153, 153, .5);
	transition: transform .2s cubic-bezier(.8, .4, .3, 1.25), background .15s ease;
}

.fs-switch__input:checked + .fs-switch__track {
	background: var(--fs-filter-accent-soft);
}

.fs-switch__input:checked + .fs-switch__track::after {
	background: var(--fs-filter-accent);
	transform: translateX(24px);
}

.fs-switch__input:focus-visible + .fs-switch__track {
	outline: 2px solid var(--fs-filter-accent);
	outline-offset: 4px;
}

/* Radios and checkboxes -------------------------------------------------- */

/* Flatsome indents lists inside .col-inner - the mobile filter panel is one. */
.fs-filter ul.fs-filter__list,
.fs-filter ul.fs-filter__children,
.fs-filter ul.fs-combo__list {
	margin-left: 0;
	padding: 0;
	list-style: none;
}

.fs-filter ul.fs-filter__list {
	margin: 0;
}

.fs-filter li.fs-filter__item,
.fs-filter li.fs-combo__option {
	margin-left: 0;
}

.fs-filter__item {
	position: relative;
	margin: 0 0 6px;
	padding: 0;
}

.fs-filter ul.fs-filter__children {
	display: none;
	margin: 6px 0 4px 32px;
}

.fs-filter__item.is-open > .fs-filter__children {
	display: block;
}

.fs-opt {
	display: flex;
	align-items: center;
	margin: 0;
	padding: 3px 0;
	min-height: 28px;
	font-weight: 700;
	color: var(--fs-filter-ink);
	line-height: 1.3;
	cursor: pointer;
	user-select: none;
}

.fs-opt__box {
	position: relative;
	flex: none;
	width: 22px;
	height: 22px;
	margin-right: 10px;
	border: 2px solid #d9d4dd;
	border-radius: 4px;
	background: #fff;
	transition: border-color .15s ease, background-color .15s ease;
}

.fs-opt--radio .fs-opt__box {
	border-radius: 50%;
}

.fs-opt:not(.is-empty):hover .fs-opt__box,
.fs-opt__input:focus-visible + .fs-opt__box {
	border-color: var(--fs-filter-accent);
}

.fs-opt__input:checked + .fs-opt__box {
	border-color: var(--fs-filter-accent);
	background: var(--fs-filter-accent);
}

/* The white tick, as on the iCheck boxes before. */
.fs-opt__input:checked + .fs-opt__box::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 6px;
	height: 11px;
	box-sizing: border-box;
	border: solid #fff;
	border-width: 0 3px 3px 0;
	transform: rotate(45deg);
}

/* After the name: the radio's clear cross, the subcategory chevron. */
.fs-opt__clear,
.fs-filter__toggle {
	flex: none;
	width: 26px;
	height: 26px;
	min-height: 0;
	margin: 0 0 0 2px;
	padding: 0;
	border: 0;
	background: none;
	line-height: 26px;
	text-align: center;
	cursor: pointer;
}

.fs-opt__clear[hidden] {
	display: none;
}

.fs-opt.is-empty .fs-filter__toggle {
	cursor: pointer;
}

.fs-opt__clear {
	color: var(--fs-filter-accent);
	font-size: 12px;
}

.fs-opt__clear:hover {
	color: var(--fs-color-primary);
}

.fs-filter__toggle {
	color: var(--fs-color-primary);
	font-size: 18px;
}

.fs-filter__toggle i {
	display: inline-block;
	transition: transform .2s ease;
}

.fs-filter__item.is-open > .fs-opt .fs-filter__toggle i {
	transform: rotate(180deg);
}

/* Ingredient picker ----------------------------------------------------- */

.fs-combo {
	position: relative;
}

.fs-combo__button {
	display: flex;
	align-items: center;
	width: 100%;
	height: 39px;
	min-height: 0;
	margin: 0;
	padding: 0 34px 0 12px;
	border: 1px solid var(--fs-filter-line);
	border-radius: 10px;
	background: #fff;
	color: #444;
	font-size: 1.05em;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.2;
	text-align: left;
	text-transform: none;
	cursor: pointer;
}

.fs-combo__button .icon-angle-down {
	position: absolute;
	right: 12px;
	top: 50%;
	margin-top: -.5em;
	color: #777;
	transition: transform .2s ease;
}

.fs-combo.is-open .fs-combo__button {
	border-radius: 10px 10px 0 0;
	border-color: var(--fs-filter-accent);
}

.fs-combo.is-open .fs-combo__button .icon-angle-down {
	transform: rotate(180deg);
}

.fs-combo__value {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.fs-combo:not(.has-value) .fs-combo__value {
	font-weight: 400;
	color: #777;
}

/* The cross takes the chevron's place once something is chosen. */
.fs-combo__clear {
	display: none;
	position: absolute;
	top: 0;
	right: 4px;
	width: 32px;
	height: 39px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--fs-filter-accent);
	font-size: 12px;
	cursor: pointer;
}

.fs-combo__clear:hover {
	color: var(--fs-color-primary);
}

.fs-combo.has-value:not(.is-open) .fs-combo__clear {
	display: block;
}

.fs-combo.has-value:not(.is-open) .fs-combo__button .icon-angle-down {
	visibility: hidden;
}

.fs-combo__panel {
	position: absolute;
	z-index: 30;
	left: 0;
	right: 0;
	top: 100%;
	border: 1px solid var(--fs-filter-accent);
	border-top: 0;
	border-radius: 0 0 10px 10px;
	background: #fff;
	box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
	overflow: hidden;
}

.fs-combo__panel[hidden] {
	display: none;
}

/* .fs-combo in front: Flatsome's input[type="search"] sets width: 100%. */
.fs-combo .fs-combo__search {
	display: block;
	width: calc(100% - 16px);
	height: 34px;
	margin: 8px;
	padding: 0 10px;
	border: 1px solid var(--fs-filter-line);
	border-radius: 8px;
	box-shadow: none;
	font-size: .95em;
}

.fs-combo__list {
	max-height: 260px;
	margin: 0;
	padding: 0 0 6px;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
}

.fs-combo__option {
	display: flex;
	align-items: center;
	margin: 0;
	padding: 6px 12px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
}

.fs-combo__option[hidden] {
	display: none;
}

.fs-combo__option:not(.is-empty):hover,
.fs-combo__option.is-active {
	background: #f7f1fa;
}

.fs-combo__option[aria-selected="true"] {
	color: var(--fs-filter-accent);
}

.fs-combo__none {
	margin: 0;
	padding: 6px 12px 12px;
	color: #777;
}

/* Reset ----------------------------------------------------------------- */

.fs-filter .fs-filter__reset {
	margin: 24px 0 0;
}

.fs-filter__reset.is-hidden {
	display: none;
}

/* The listing ------------------------------------------------------------ */

.fs-filter-results {
	position: relative;
}

/* Spinners: Flatsome's own .loading-spin, centred, no backdrop. While a
   filter change loads: on the visible part of the listing (top set by
   fs-filter.js). While the next cards load: under the grid. */
.fs-filter-busy {
	display: none;
	position: absolute;
	z-index: 5;
	left: 50%;
	width: 30px;
	height: 30px;
	margin: -15px 0 0 -15px;
	pointer-events: none;
}

.fs-filter-results.is-loading > .fs-filter-busy {
	display: block;
}

.fs-filter-results .products {
	transition: opacity .15s ease;
}

.fs-filter-results.is-loading .products,
.fs-filter-results.is-loading .fs-filter-empty {
	opacity: .45;
	pointer-events: none;
}

/* The script loads the next cards itself; the links stay for crawlers and
   for visitors without script. */
.fs-filter-js .fs-filter-results .woocommerce-pagination {
	display: none;
}

.fs-filter-more .loading-spin {
	display: block;
	visibility: hidden;
	margin: 20px auto 30px;
}

.fs-filter-more.is-loading .loading-spin {
	visibility: visible;
}
