.custom-filter-wrapper {
	width: 100%;
	overflow: hidden;

	@media (width >= 768px) {
		overflow: visible;
	}
}

.custom-filter-heading {
	margin: 0 0 10px 0;
}

.custom-filter-heading--collapsible {
	display: flex;
	align-items: center;
	cursor: pointer;
	user-select: none;

	&:focus-visible {
		outline: 2px solid currentColor;
		outline-offset: 2px;
	}
}

.custom-filter-heading-text {
	flex: 1;
}

.custom-filter-heading-toggle {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;

	@media (width < 768px) {
		display: none;
	}
}

.custom-filter-heading-toggle svg,
.custom-filter-heading-toggle img {
	display: block;
}

.custom-filter-icon-collapsed,
.custom-filter-icon-expanded {
	display: inline-flex;
	align-items: center;
}

.custom-filter-icon-collapsed {
	display: none;
}

.custom-filter-heading.is-collapsed .custom-filter-icon-expanded {
	display: none;
}

.custom-filter-heading.is-collapsed .custom-filter-icon-collapsed {
	display: inline-flex;
}

.custom-pills-container {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	gap: 12px;
	padding: 5px 0 15px 0;
	scrollbar-width: none;
	scroll-behavior: smooth;

	&::-webkit-scrollbar {
		display: none;
	}

	&.is-collapsed {
		display: none;
	}

	@media (width < 768px) {
		padding: 5px 0;

		&.is-collapsed {
			display: flex;
		}
	}

	@media (width >= 768px) {
		flex-direction: column;
		flex-wrap: nowrap;
		overflow-x: visible;
		gap: 0;
		padding: 0;
	}
}

.custom-filter-group {
	@media (width < 768px) {
		position: relative;

		/* &::after {
			content: "";
			position: absolute;
			top: 0;
			right: 0;
			bottom: 0;
			width: 32px;
			pointer-events: none;
			background: linear-gradient(to left, var(--e-global-color-primary, #fff), transparent);
			opacity: 0;
			transition: opacity 0.3s ease;
		} */

		&.has-scroll::after {
			opacity: 1;
		}
	}
}

.custom-filter-group + .custom-filter-group {
	margin-top: 20px;

	@media (width < 768px) {
		margin-top: 0;
	}
}

button.filter-pill:not(.active):hover,
button.filter-pill:not(.active):focus {
	background-color: #f3f0ed;
	color: #3b2d22;
}

.filter-pill {
	flex: 0 0 auto;
	background-color: #f3f0ed;
	color: #3b2d22;
	border: 1px solid transparent;
	border-radius: 50px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
	white-space: nowrap;
	padding: 8px 18px;

	&.active {
		background-color: #ff40001a;
		border: 1px solid #ff4000;
		color: #ff4000;
	}
	
	@media (hover: hover) {
		&:hover:not(.active) {
			background-color: #f3f0ed;
			color: #ff4000;
		}
	}

	@media (width >= 768px) {
		border-radius: 0;
		background-color: transparent;
		border: none;
		font-size: 15px;
		color: #3b2d22;
		text-align: left;
		width: 100%;

		@media (hover: hover) {
			&:hover:not(.active) {
				background-color: transparent;
				border: none;
				color: #ff4000;
			}
		}

		&.active {
			background-color: transparent;
			border: none;
			color: #ff4000;
			font-weight: 600;
		}
	}
}

@media (width < 768px) {
	.custom-filter-wrapper {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5rem;
	}

	.custom-filter-wrapper[data-mobile-layout="side"] {
		align-items: center;
		gap: 1rem;
	}

	.custom-filter-wrapper[data-mobile-layout="below"] {
		flex-direction: column;
		align-items: stretch;
	}

	.custom-filter-wrapper[data-mobile-layout="below"] .custom-filter-heading {
		margin-bottom: 0;
	}

	.custom-filter-wrapper[data-mobile-layout="below"] .custom-pills-container {
		width: 100%;
	}
}

.clf-loop-grid-container {
	position: relative;
}

.clf-grid-loader {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255 255 255 / 0.6);
	z-index: 10;

	.spinner {
		width: 40px;
		height: 40px;
		border: 4px solid #e5e7eb;
		border-top-color: #ff4000;
		border-radius: 50%;
		animation: clf-spin 0.8s linear infinite;
	}
}

@keyframes clf-spin {
	to {
		transform: rotate(360deg);
	}
}
