/* Emirates Elements: Taxonomy Filter. Colors, sizes and typography are set by the widget's style controls. */

.ee-filter {
	overflow: hidden;
	box-sizing: border-box;
}

.ee-filter *,
.ee-filter *::before,
.ee-filter *::after {
	box-sizing: border-box;
}

/* Header. */
.ee-filter__header {
	display: block;
}

.ee-filter__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: start;
	cursor: default;
}

.ee-filter__title {
	flex: 1 1 auto;
}

.ee-filter__badge {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	padding: 0 6px;
	border-radius: 100px;
}

/* Collapsible state (set from JS on the chosen breakpoints). */
.ee-filter--collapsible .ee-filter__toggle {
	cursor: pointer;
}

.ee-filter--collapsible .ee-filter__toggle::after {
	content: "";
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	margin-inline-start: 4px;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}

.ee-filter--collapsible .ee-filter__toggle[aria-expanded="true"]::after {
	transform: rotate(-135deg);
}

.ee-filter--collapsible.is-collapsed .ee-filter__body {
	display: none;
}

.ee-filter__toggle:focus-visible,
.ee-filter__clear:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Body and groups. */
.ee-filter__form {
	display: flex;
	flex-direction: column;
}

.ee-filter__group {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	border: 0;
}

.ee-filter__group-head {
	display: flex;
	flex-direction: column;
}

.ee-filter__line {
	width: 100%;
}

.ee-filter__options {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ee-filter__item {
	margin: 0;
	padding: 0;
	padding-inline-start: calc(var(--ee-depth, 0) * var(--ee-filter-indent, 24px));
	list-style: none;
}

/* Option with a custom checkbox. The real input stays focusable and screen-reader friendly. */
.ee-filter__option {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0;
	cursor: pointer;
}

.ee-filter__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.ee-filter__box {
	position: relative;
	display: inline-block;
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	border-style: solid;
	border-width: 1.5px;
	border-radius: 4px;
	background-color: transparent;
	box-shadow: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

/* The tick: a rotated "L" centered in the box. */
.ee-filter__box::after {
	content: "";
	position: absolute;
	top: 46%;
	left: 50%;
	width: 28%;
	height: 54%;
	border-style: solid;
	border-width: 0 1.5px 1.5px 0;
	border-radius: 0;
	opacity: 0;
	transform: translate(-50%, -58%) rotate(45deg);
	transition: opacity 0.1s ease;
}

.ee-filter__input:checked + .ee-filter__box::after {
	opacity: 1;
}

.ee-filter__input:focus-visible + .ee-filter__box {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ee-filter__label {
	flex: 0 1 auto;
	transition: color 0.15s ease;
}

.ee-filter__count {
	flex: 0 0 auto;
	margin-inline-start: -8px;
}

/* Clear all. */
.ee-filter__clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-style: solid;
	border-width: 1px;
	cursor: pointer;
	transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* ---------- Mobile drawer ----------
 * The drawer markup is always hidden; JS adds .ee-filter--drawer only on the devices chosen in the widget,
 * so none of this touches the desktop panel. */
.ee-filter__fab,
.ee-filter__backdrop,
.ee-filter__drawer-head,
.ee-filter__drawer-foot {
	display: none;
}

html.ee-filter-lock {
	overflow: hidden;
}

/* The in-page panel disappears: only the floating button and the drawer (both fixed) remain. */
.ee-filter--drawer,
.ee-filter-widget--drawer {
	display: contents;
}

.ee-filter--drawer .ee-filter__header,
.ee-filter--drawer .ee-filter__form .ee-filter__clear {
	display: none;
}

/* Floating "Filters" button. */
.ee-filter--drawer {
	--ee-drawer-z: 9990;
	--ee-fab-bottom: 20px;
	--ee-sheet-max: 85;
}

.ee-filter--drawer .ee-filter__fab {
	position: fixed;
	left: 50%;
	bottom: calc(var(--ee-fab-bottom) + env(safe-area-inset-bottom, 0px));
	z-index: var(--ee-drawer-z);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	margin: 0;
	padding: 0 24px;
	border: 0;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 24px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
	-webkit-tap-highlight-color: transparent;
}

.ee-filter--drawer.is-fab-visible:not(.is-open) .ee-filter__fab {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

.ee-filter--drawer .ee-filter__fab:focus-visible,
.ee-filter--drawer .ee-filter__close:focus-visible,
.ee-filter--drawer .ee-filter__done:focus-visible,
.ee-filter--drawer .ee-filter__drawer-clear:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.ee-filter--drawer .ee-filter__fab-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border-radius: 100px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}

.ee-filter--drawer .ee-filter__fab-badge[hidden] {
	display: none;
}

/* Backdrop. */
.ee-filter--drawer .ee-filter__backdrop {
	display: block;
	position: fixed;
	inset: 0;
	z-index: calc(var(--ee-drawer-z) + 1);
	background-color: rgba(37, 37, 37, 0.55);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s;
}

.ee-filter--drawer.is-open .ee-filter__backdrop {
	opacity: 1;
	visibility: visible;
}

/* The panel's own Content Padding must not pad the whole sheet (the drawer has its own padding control). */
.ee-filter.ee-filter--drawer .ee-filter__body {
	padding: 0;
}

/* The drawer itself: the filter body becomes a bottom sheet. */
.ee-filter--drawer .ee-filter__body {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: calc(var(--ee-drawer-z) + 2);
	display: flex;
	flex-direction: column;
	max-height: calc(var(--ee-sheet-max) * 1vh);
	max-height: calc(var(--ee-sheet-max) * 1dvh);
	overflow: hidden;
	box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
	transform: translateY(100%);
	visibility: hidden;
	transition: transform 0.3s ease, visibility 0.3s;
}

.ee-filter--drawer.is-open .ee-filter__body {
	transform: translateY(0);
	visibility: visible;
}

.ee-filter--drawer .ee-filter__form {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.ee-filter--drawer .ee-filter__drawer-head {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 8px 8px 8px 20px;
	border-bottom: 1px solid #d8c3a5;
}

.ee-filter--drawer .ee-filter__drawer-title {
	font-weight: 700;
}

.ee-filter--drawer .ee-filter__close {
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
}

/* The close "x", drawn with two bars. */
.ee-filter--drawer .ee-filter__close span::before,
.ee-filter--drawer .ee-filter__close span::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 2px;
	background-color: currentColor;
	transform: translate(-50%, -50%) rotate(45deg);
}

.ee-filter--drawer .ee-filter__close span::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.ee-filter--drawer .ee-filter__drawer-foot {
	display: flex;
	flex: 0 0 auto;
	gap: 12px;
	padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid #d8c3a5;
}

.ee-filter--drawer .ee-filter__done,
.ee-filter--drawer .ee-filter__drawer-clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	margin: 0;
	padding: 0 20px;
	border: 1px solid transparent;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.ee-filter--drawer .ee-filter__done {
	flex: 1 1 auto;
}

.ee-filter--drawer .ee-filter__drawer-clear {
	flex: 0 0 auto;
	background: transparent;
}

@media (prefers-reduced-motion: reduce) {
	.ee-filter *,
	.ee-filter__fab,
	.ee-filter__backdrop,
	.ee-filter__body {
		transition-duration: 0ms !important;
	}
}
