/* Webwise Filter: matches the layout of the old Product Filter Widget, including the site's mobile overrides. */

.ww-filter {
	--wwf-sidebar-w: 15%;
	--wwf-sidebar-gap: 19px;
	--wwf-cols: 3;
	--wwf-gap: 30px;
	position: relative;
	display: flex;
	flex-direction: row;
	align-items: flex-start;
}

.ww-filter__sidebar {
	box-sizing: border-box;
	flex: 0 0 var(--wwf-sidebar-w);
	width: var(--wwf-sidebar-w);
	padding-right: var(--wwf-sidebar-gap);
}

.ww-filter__main {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
}

/* Filter block */

.ww-filter__form {
	margin: 0;
}

.ww-filter__block {
	margin: 0 0 30px;
}

.ww-filter .ww-filter__heading {
	margin: 0;
	padding: 0 0 10px;
	color: var(--e-global-color-primary);
	font-family: var(--e-global-typography-secondary-font-family), sans-serif;
	font-weight: var(--e-global-typography-secondary-font-weight);
}

/* Specific enough to beat the site's global select:not([size]):not([multiple]) rules, as the old widget did. */
.ww-filter .ww-filter__form select.ww-filter__select {
	display: inline-block;
	width: calc(100% - 10px);
	margin: 0 10px 0 0;
	border-style: solid;
	border-color: #e2e4ea;
	border-radius: 4px;
	background-color: #f7f8f9;
	color: #111;
	outline: none;
	cursor: pointer;
}

.ww-filter__options {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ww-filter__check {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0;
	padding-left: 26px;
	color: var(--e-global-color-text);
	font-family: var(--e-global-typography-text-font-family), sans-serif;
	font-weight: var(--e-global-typography-text-font-weight);
	line-height: 22px;
	cursor: pointer;
}

.ww-filter__check input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.ww-filter__check::before,
.ww-filter__check::after {
	content: "";
	position: absolute;
	display: block;
	box-sizing: content-box;
}

.ww-filter__check::before {
	left: 0;
	top: 2px;
	width: 14px;
	height: 14px;
	border: 2px solid #e2e4ea;
	border-radius: 4px;
	background-color: #f7f8f9;
}

.ww-filter__check::after {
	left: 6px;
	top: 5px;
	width: 4px;
	height: 8px;
	border: 2px solid #6c6f77;
	border-top: 0;
	border-left: 0;
	transform: rotate(45deg);
	opacity: 0;
}

.ww-filter__check:has(input:checked)::after {
	opacity: 1;
}

.ww-filter__check:has(input:focus-visible)::before {
	outline: 2px solid var(--e-global-color-primary, #00cccc);
	outline-offset: 2px;
}

/* Cards */

.ww-filter .ww-filter__grid {
	display: grid;
	grid-template-columns: repeat(var(--wwf-cols), minmax(0, 1fr));
	gap: var(--wwf-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: left;
}

.ww-filter .ww-filter__grid > li {
	margin: 0;
	list-style: none;
}

/* Load more / empty state */

.ww-filter__more {
	text-align: center;
}

.ww-filter .ww-filter__load-more {
	display: inline-block;
	margin: 30px 0 0;
	padding: 6px 24px 8px;
	border: 0;
	border-radius: 5px;
	background-color: #111;
	color: #fff;
	font-family: var(--e-global-typography-accent-font-family), sans-serif;
	font-size: 16px;
	font-weight: var(--e-global-typography-accent-font-weight);
	line-height: 1.6;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	transition: opacity .2s;
}

.ww-filter .ww-filter__load-more:hover,
.ww-filter .ww-filter__load-more:focus {
	background-color: #111;
	color: #fff;
	opacity: .85;
}

.ww-filter .ww-filter__load-more[hidden] {
	display: none;
}

.ww-filter__empty {
	width: 100%;
	text-align: center;
}

.ww-filter .ww-filter__clear {
	margin: 0 10px 10px 0;
	padding: 5px 15px;
	border: 1px solid #111;
	border-radius: 30px;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.ww-filter .ww-filter__clear i {
	font-style: normal;
}

/* Loading */

.ww-filter.is-loading .ww-filter__main::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 9;
	background: rgba(255, 255, 255, .33) no-repeat center 120px / 48px
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='%2300cccc' stroke-width='4' stroke-linecap='round' stroke-dasharray='90 150'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.9s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E");
}

.ww-filter__apply {
	margin-top: 10px;
}

/* Responsive */

@media (max-width: 1024px) {
	.ww-filter { --wwf-cols: 2; }
}

@media (max-width: 767px) {
	.ww-filter {
		--wwf-cols: 1;
		flex-direction: column;
		align-items: stretch;
	}

	/* The site showed the filter inline on phones as a white box overlapping the section above. */
	.ww-filter__sidebar {
		position: relative;
		z-index: 1;
		flex-basis: auto;
		width: 100%;
		margin: -25px 0 20px;
		padding-right: 0;
		border-radius: 7px 7px 0 0;
		background-color: #fff;
	}

	.ww-filter .ww-filter__heading {
		margin-bottom: 10px;
		padding: 10px 5px;
	}

	.ww-filter__main {
		width: 100%;
	}
}

@media (max-width: 460px) {
	.ww-filter .ww-filter__grid { grid-template-columns: minmax(0, 1fr); }
}
