.sort-filter-bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.sort-filter-bar select.sorter-options {
	padding: 0.25rem 0.5rem;
	border-radius: 6px;
	font-size: 1rem;
	border: 1px solid #ccc;
}

@media (max-width: 768px) {
	.sort-filter-bar {
		flex-direction: column;
		align-items: stretch;
	}
}

/* Gjelder sorterings-dropdown */
.sorter select,
.sorter .form-select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;

	border-radius: 6px;
	border: 1px solid #ccc;
	background-color: #fff;
	padding: 0.4rem 1.2rem 0.4rem 0.6rem;
	font-size: 0.95rem;
	color: #111;
	box-shadow: none;
}

.sorter .form-select:focus {
	border-color: #999;
	box-shadow: none;
	outline: none;
}

.sorter select {
	background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23111' stroke-width='2'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.5rem center;
	background-size: 12px 8px;
}

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

/* UTILITIES */
.custom-sort-hide {
	display: none;
}

.rotate-180 {
	transform: rotate(180deg);
	transition: transform 0.2s ease;
}

/* FILTER TOGGLE BUTTON */
.custom-filter-button {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: #333;
	font-weight: 500;
	border: 1px solid #ccc;
	border-radius: 5px;
	background: transparent;
	padding: 8px 12px;
	transition: color 0.2s ease;
}

.custom-filter-button:hover {
	color: #000;
}

/* OFF-CANVAS FILTER PANEL */
.custom-filter-panel {
	position: fixed;
	top: 0;
	left: -100%;
	width: 380px;
	height: 100vh;
	background: #fff;
	
	overflow-y: auto;
	transition: left 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
	z-index: 1050;
}

.custom-filter-panel.active {
	left: 0;
	box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.custom-filter-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.5);
	visibility: hidden;
	opacity: 0;
	transition: visibility 0s, opacity 0.3s ease;
	z-index: 1040;
}

.custom-filter-overlay.active {
	visibility: visible;
	opacity: 1;
}

/* FILTER CLOSE BUTTON */
.custom-filter-close {
	position: absolute;
	top: 15px;
	right: 15px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: #FFCF0F;
	border: none;
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.custom-filter-close:hover {
	background-color: #FFCF0F;
}

/* FILTER GROUPS */
.custom-filter-group {
	margin-bottom: 1.5rem;
}

.custom-filter-group strong {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 600;
	font-size: 1rem;
}

.custom-filter-list {
	list-style: none;
	padding-left: 0;
	margin: 0;
}

.custom-filter-item a {
	display: inline-block;
	padding: 4px 2px;
	color: #333;
	transition: color 0.2s ease;
	text-decoration: none;
}

.custom-filter-item a:hover {
	color: #000;
	text-decoration: underline;
}

.custom-filter-item a.active {
	color: #007bff;
	font-weight: 600;
	text-decoration: underline;
}

/* SELECTED FILTERS */
.custom-selected-filters {
	background: #f5f5f5;
	padding: 10px;
	border-radius: 5px;
	margin-bottom: 10px;
	font-size: 0.9rem;
}

#custom-filter-summary {
	display: inline;
	font-weight: 500;
	color: #333;
}

/* SWATCH STYLES */
.swatch-circle {
	display: inline-block;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 1px solid #ccc;
	margin-right: 6px;
	vertical-align: middle;
}

.swatch-summary {
	display: inline-flex;
	align-items: center;
}

.swatch-pill {
	display: inline-block;
	padding: 2px 8px;
	border: 1px solid #ccc;
	border-radius: 12px;
	font-size: 0.85rem;
	background-color: #f9f9f9;
	margin-right: 6px;
}

/* SORT DROPDOWN */
/* === SORT DROPDOWN WRAPPER === */
#sorter-wrapper {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 0.5rem;
	text-align: right;
	position: relative; /* Needed for absolute dropdown */
}

/* === DROPDOWN BUTTON === */
.sort-trigger {
	background: none;
	border: none;
	display: flex;
	align-items: center;
	font-size: 0.95rem;
	line-height: 1.2;
	padding: 0.5rem 1rem;
	cursor: pointer;
}

.sort-trigger:hover {
	background: none;
	border: none;
}

/* === DROPDOWN MENU === */
.sort-menu {
	position: absolute;
	top: 100%;
	right: 0;
	width: max-content;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transform: translateY(-5px);
	transition: max-height 0.3s ease, opacity 0.2s ease, transform 0.2s ease;
	background: #fff;
	box-shadow: 0 10px 20px rgba(0,0,0,0.08);
	border-radius: 10px;
	border: 1px solid #ddd;
	z-index: 999;
	pointer-events: none;
}

.sort-menu.open{
	display: block;
	max-height: 500px; /* Enough for several items */
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

/* === LIST STYLING === */
.sort-menu ul {
	list-style: none;
	padding: 0.5rem 0;
	margin: 0;
}

.sort-menu li {
	margin: 0;
}

/* === MENU OPTIONS === */
.sort-option {
	display: block;
	padding: 0.5rem 1rem;
	text-decoration: none;
	color: #333;
	cursor: pointer;
}

.sort-option:hover {
	background: #f9f9f9;
}

.sort-option.font-bold {
	font-weight: bold;
	color: #000;
}

.swatch-summary {
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.swatch-summary.removing {
  opacity: 0;
  transform: scale(0.95);
}

#custom-filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1rem;
}

.swatch-summary {
  display: inline-flex;
  align-items: center;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 500;
  line-height: 1;
  transition: background-color 0.2s;
}

.swatch-summary .remove-filter {
  display: inline-block;
  margin-right: 6px;
  font-size: 14px;
  cursor: pointer;
}

.swatch-summary .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

/* === MOBILE ADJUSTMENT === */
@media (max-width: 768px) {
	.sort-menu {
		right: 0;
		left: 0;
		width: 100%;
		max-width: none;
	}
}






/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
	.custom-filter-panel {
		width: 100vw;
		left: -100vw;
		transition: left 0.4s ease-out;
	}
	.custom-filter-panel.active {
		left: 0;
	}
}

@media (max-width: 480px) {
	#sorter-wrapper {
		margin-top: 0.75rem;
	}
	.sort-trigger {
		padding: 0.4rem 0.5rem;
	}
}