/* Diwan Canada – Book filters (Browse all side panel) */

/* ---------- Search box: the hint sits inside the box and may wrap ---------- */

.collection-search-layout .product-search-sidebar .dwfl-search {
	display: grid;
}

.collection-search-layout .product-search-sidebar .dwfl-search > input[ref-search],
.collection-search-layout .product-search-sidebar .dwfl-search > .dwfl-search__ph {
	grid-area: 1 / 1;
}

.collection-search-layout .product-search-sidebar .dwfl-search > input[ref-search] {
	align-self: stretch;
	height: auto;
	min-height: 44px;
}

.collection-search-layout .product-search-sidebar .dwfl-search > input[ref-search]::placeholder {
	color: transparent;
	opacity: 0;
}

.dwfl-search__ph {
	align-self: center;
	padding-block: 9px;
	padding-inline: 13px 37px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: 0;
	color: #5b5650;
	pointer-events: none;
}

.collection-search-layout .product-search-sidebar .dwfl-search > input[ref-search]:not(:placeholder-shown) ~ .dwfl-search__ph {
	visibility: hidden;
}

/* ---------- Filter sections ---------- */

.dwfl {
	display: flex;
	flex-direction: column;
	margin-bottom: -8px; /* with the menu's own -8px, sits flush with it like one list */
}

.dwfl[hidden] {
	display: none;
}

.dwfl__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Same size and weight as the menu headings below (Language, Authors…). */
.dwfl .dwfl__toggle {
	-webkit-appearance: none;
	appearance: none;
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 13px 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: none;
	color: inherit;
	cursor: pointer;
	text-align: start;
	text-transform: none;
	font-family: inherit;
	font-size: 20px;
	font-weight: 600;
	line-height: 24px;
	letter-spacing: -0.042em;
}

.dwfl .dwfl__toggle:hover,
.dwfl .dwfl__toggle:focus {
	background: none;
	color: inherit;
}

.dwfl .dwfl__toggle:focus-visible {
	outline: 2px solid #C63D32;
	outline-offset: 2px;
}

.dwfl__title {
	flex: 0 1 auto;
}

/* The chosen option, shown beside a closed section. */
.dwfl__current {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	text-align: end;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0;
	color: #C63D32;
}

.dwfl__group.is-open .dwfl__current {
	visibility: hidden;
}

.dwfl__chev {
	display: flex;
	flex: 0 0 20px;
	justify-content: center;
	width: 20px;
}

.dwfl__chev::after {
	content: "\e90c";
	font-family: cs-icons;
	font-size: 16px;
	font-weight: normal;
	line-height: 24px;
}

.dwfl__group.is-open .dwfl__chev::after {
	content: "\e90f";
}

.dwfl .dwfl__options {
	min-width: 0;
	margin: 0 0 10px;
	padding: 0;
	border: 0;
}

.dwfl .dwfl__options[hidden] {
	display: none;
}

/* ---------- Options ---------- */

.dwfl .dwfl__opt {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 6px 0;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0;
	color: #2D2926;
}

.dwfl .dwfl__opt input {
	position: absolute;
	inset-inline-start: 0;
	width: 18px;
	height: 18px;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.dwfl__box {
	position: relative;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	box-sizing: border-box;
	border: 1.5px solid #bdb5ad;
	border-radius: 4px;
	background: #fff;
	transition: background-color 0.15s, border-color 0.15s;
}

.dwfl__opt:hover .dwfl__box {
	border-color: #C63D32;
}

.dwfl__opt input:checked + .dwfl__box {
	border-color: #C63D32;
	background: #C63D32;
}

.dwfl__opt input:checked + .dwfl__box::after {
	content: "";
	position: absolute;
	top: 1.5px;
	left: 5px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.dwfl__opt input:focus-visible + .dwfl__box {
	outline: 2px solid #C63D32;
	outline-offset: 2px;
}

.dwfl__label {
	flex: 1 1 auto;
	min-width: 0;
}

.dwfl__count {
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 700;
	color: #6f6760;
}

/* Nothing to show for this choice yet. */
.dwfl .dwfl__opt.is-disabled {
	opacity: 0.45;
	cursor: default;
}

.dwfl .dwfl__opt.is-disabled input {
	cursor: default;
}

.dwfl__opt.is-disabled:hover .dwfl__box {
	border-color: #bdb5ad;
}

/* ---------- Clear ---------- */

.dwfl .dwfl__clear {
	-webkit-appearance: none;
	appearance: none;
	align-self: flex-start;
	height: auto;
	min-height: 0;
	margin: 2px 0 10px;
	padding: 4px 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: none;
	color: #C63D32;
	cursor: pointer;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.dwfl .dwfl__clear:hover,
.dwfl .dwfl__clear:focus {
	background: none;
	color: #a8322a;
}

.dwfl .dwfl__clear[hidden] {
	display: none;
}

/* ---------- 1.1.0: hidden entries ---------- */

/* Choices and sections with no books in the shop yet. */
.dwfl .dwfl-empty,
.dwfl .dwfl__opt.dwfl-empty {
	display: none !important;
}

/* Side-menu entries that now live in the filters (Language, Authors, Publishers). */
.product-search-widgets li.dwfl-moved {
	display: none !important;
}

/* ---------- 1.1.0: Price ---------- */

.dwfl .dwfl__price-boxes {
	margin-top: 8px;
}

.dwfl .dwfl__price-boxes .price-range-row {
	margin: 0;
}

/* ---------- 1.1.0: Author and Publisher ---------- */

.dwfl .dwfl__find {
	display: block;
	width: 100%;
	height: 38px;
	min-height: 0;
	margin: 2px 0 6px;
	padding: 6px 10px;
	box-sizing: border-box;
	border: 1px solid #bdb5ad;
	border-radius: 6px;
	background: #fff;
	color: #2D2926;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0;
}

.dwfl .dwfl__find:focus {
	border-color: #C63D32;
	outline: none;
	box-shadow: 0 0 0 1px #C63D32;
}

.dwfl .dwfl__find::placeholder {
	color: #6f6760;
	opacity: 1;
}

/* Names in both scripts: each one follows its own direction. */
.dwfl .dwfl__names .dwfl__label {
	unicode-bidi: plaintext;
	text-align: left;
	text-align: match-parent; /* line up with the panel, not with the name's own script */
}

.dwfl .dwfl__note {
	margin: 4px 0;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0;
	color: #6f6760;
}

.dwfl .dwfl__note[hidden] {
	display: none;
}

.dwfl .dwfl__all {
	display: inline-block;
	margin: 6px 0 2px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0;
	color: #C63D32;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.dwfl .dwfl__all:hover,
.dwfl .dwfl__all:focus {
	color: #a8322a;
}

.dwfl .dwfl__all:empty {
	display: none;
}

/* ---------- 1.3.0: chosen filters as chips, with Clear all ---------- */

/* The row under the search box, above Price. */
.dwfl .dwfl__active {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 14px 0 4px;
}

.dwfl .dwfl__active[hidden] {
	display: none;
}

.dwfl .dwfl__clearall {
	-webkit-appearance: none;
	appearance: none;
	height: auto;
	min-height: 0;
	margin: 0;
	margin-inline-end: 4px;
	padding: 6px 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: none;
	color: #2D2926;
	cursor: pointer;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 0.25em;
}

.dwfl .dwfl__clearall:hover,
.dwfl .dwfl__clearall:focus {
	background: none;
	color: #C63D32;
}

/* One chosen filter: its name and a ×. The whole chip removes it. */
.dwfl .dwfl__chip {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: 100%;
	height: auto;
	min-height: 32px;
	margin: 0;
	padding-block: 5px;
	padding-inline: 12px 10px;
	box-sizing: border-box;
	border: 0;
	border-radius: 8px;
	box-shadow: none;
	background: #F7DFD0;
	color: #2D2926;
	cursor: pointer;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: 0;
	text-align: start;
	text-transform: none;
	transition: background-color 0.15s;
}

.dwfl .dwfl__chip:hover,
.dwfl .dwfl__chip:focus {
	background: #F2CCB5;
	color: #2D2926;
}

.dwfl .dwfl__chip:focus-visible,
.dwfl .dwfl__clearall:focus-visible {
	outline: 2px solid #C63D32;
	outline-offset: 2px;
}

.dwfl .dwfl__chip-label {
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* The ×, drawn as two lines so it stays crisp. */
.dwfl .dwfl__chip-x {
	position: relative;
	flex: 0 0 11px;
	width: 11px;
	height: 11px;
	color: #2D2926;
	transition: color 0.15s;
}

.dwfl .dwfl__chip-x::before,
.dwfl .dwfl__chip-x::after {
	content: "";
	position: absolute;
	top: 50%;
	left: -1px;
	width: 13px;
	height: 2px;
	margin-top: -1px;
	border-radius: 1px;
	background: currentColor;
	transform: rotate(45deg);
}

.dwfl .dwfl__chip-x::after {
	transform: rotate(-45deg);
}

.dwfl .dwfl__chip:hover .dwfl__chip-x {
	color: #C63D32;
}
