.wmes-native-cat-hidden {
	display: none !important;
}

form.wmes-enabled {
	position: relative;
	overflow: visible !important;
}

form.wmes-enabled .wmes-dropdown {
	position: relative;
	display: flex;
	align-self: stretch;
	flex: 0 0 auto;
	min-width: 112px;
	max-width: 170px;
	z-index: 60;
}

form.wmes-enabled .wmes-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	min-height: 100%;
	padding: 0 14px;
	border: 0 !important;
	border-inline-start: 1px solid rgba(0, 0, 0, .12) !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: inherit;
	font: inherit;
	font-size: 13px;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
}
form.wmes-enabled:focus-within { z-index: 70; }
form.wmes-enabled .wmes-dropdown.is-open { z-index: 80; }

form.wmes-enabled .wmes-trigger:hover,
form.wmes-enabled .wmes-trigger:focus {
	background: rgba(0, 0, 0, .025) !important;
	outline: 0;
}

form.wmes-enabled .wmes-trigger-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

form.wmes-enabled .wmes-chevron,
form.wmes-enabled .wmes-branch-arrow {
	position: relative;
	display: inline-block;
	width: 7px;
	height: 7px;
	flex: 0 0 7px;
	border-inline-end: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	transition: transform .18s ease;
	opacity: .7;
}

form.wmes-enabled .wmes-dropdown.is-open > .wmes-trigger .wmes-chevron {
	transform: rotate(225deg) translate(-1px, -1px);
}

form.wmes-enabled .wmes-menu {
	position: absolute;
	top: calc(100% + 6px);
	inset-inline-end: 0;
	width: 286px;
	max-width: min(92vw, 340px);
	max-height: min(64vh, 480px);
	overflow-y: auto;
	direction: rtl;
	padding: 7px;
	border: 1px solid rgba(0, 0, 0, .11);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
	z-index: 99999;
}

form.wmes-enabled .wmes-menu[hidden] {
	display: none !important;
}

form.wmes-enabled .wmes-menu-item,
form.wmes-enabled .wmes-sub-item,
form.wmes-enabled .wmes-term-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	min-height: 38px;
	margin: 0;
	padding: 8px 10px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	box-shadow: none;
	color: #333;
	font: inherit;
	font-size: 13px;
	line-height: 1.45;
	text-align: right;
	cursor: pointer;
}

form.wmes-enabled .wmes-menu-item:hover,
form.wmes-enabled .wmes-sub-item:hover,
form.wmes-enabled .wmes-term-item:hover,
form.wmes-enabled .wmes-menu-item:focus,
form.wmes-enabled .wmes-sub-item:focus,
form.wmes-enabled .wmes-term-item:focus {
	background: rgba(0, 0, 0, .055);
	outline: 0;
}

form.wmes-enabled .wmes-menu-item.is-selected,
form.wmes-enabled .wmes-sub-item.is-selected,
form.wmes-enabled .wmes-term-item.is-selected {
	font-weight: 700;
	background: rgba(0, 0, 0, .07);
}

form.wmes-enabled .wmes-all-item {
	font-weight: 700;
}

form.wmes-enabled .wmes-group + .wmes-group {
	border-top: 1px solid rgba(0, 0, 0, .065);
}

form.wmes-enabled .wmes-branch-panel {
	display: none;
	margin: 0 7px 5px;
	padding: 4px;
	border-radius: 7px;
	background: rgba(0, 0, 0, .025);
}

form.wmes-enabled .wmes-branch.is-open > .wmes-branch-panel {
	display: block;
}

form.wmes-enabled .wmes-branch.is-open > .wmes-branch-toggle > .wmes-branch-arrow {
	transform: rotate(225deg) translate(-1px, -1px);
}

form.wmes-enabled .wmes-sub-item {
	min-height: 35px;
	font-size: 12.5px;
}

form.wmes-enabled .wmes-taxonomy + .wmes-taxonomy {
	border-top: 1px solid rgba(0, 0, 0, .055);
}

form.wmes-enabled .wmes-terms-panel {
	max-height: 240px;
	overflow-y: auto;
	margin: 0 4px 5px;
	padding: 3px;
	background: #fff;
}

form.wmes-enabled .wmes-term-item {
	min-height: 32px;
	padding-inline-start: calc(9px + (var(--wmes-depth, 0) * 12px));
	font-size: 12px;
	color: #555;
}

/* Keep the selector visually inside WoodMart's search box. */
.wd-search-form form.wmes-enabled,
.wd-header-search form.wmes-enabled,
.wd-search-full-screen form.wmes-enabled {
	display: flex;
	align-items: stretch;
}

/* WoodMart sometimes gives inner search wrappers a hidden overflow. */
.wd-search-form,
.wd-header-search,
.wd-search-full-screen {
	overflow: visible;
}

@media (max-width: 768px) {
	form.wmes-enabled .wmes-dropdown {
		min-width: 92px;
		max-width: 118px;
	}

	form.wmes-enabled .wmes-trigger {
		padding-inline: 10px;
		font-size: 11.5px;
	}

	form.wmes-enabled .wmes-menu {
		width: min(290px, calc(100vw - 24px));
		max-height: 58vh;
		inset-inline-end: -4px;
	}
}

/* The input owns the outline; the selector overlays its reserved left area. */
form.wmes-enabled {
	--wmes-selector-width: clamp(110px, 30%, 174px);
	direction: rtl;
	display: block !important;
}
form.wmes-enabled input[name="s"] {
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
	padding-left: calc(var(--wmes-selector-width) + 12px) !important;
	padding-right: 44px !important;
	border-radius: 28px !important;
	direction: rtl;
}
form.wmes-enabled .wmes-dropdown {
	position: absolute;
	left: 1px;
	right: auto;
	top: calc(var(--wmes-input-top, 0px) + 1px);
	height: calc(var(--wmes-input-height, 48px) - 2px);
	width: var(--wmes-selector-width);
	min-width: 0;
	max-width: none;
	direction: rtl;
}
form.wmes-enabled .wmes-trigger {
	position: static !important;
	height: 100%;
	min-height: 0;
	border-radius: 28px 0 0 28px !important;
	color: #777;
	text-transform: none;
}
form.wmes-enabled > button[type="submit"]:not(.wmes-view-all) {
	left: auto !important;
	right: 1px !important;
}
form.wmes-enabled .wmes-menu {
	left: 0;
	right: auto;
	width: 286px;
	max-width: calc(100vw - 32px);
	border-radius: 3px;
	box-sizing: border-box;
	overscroll-behavior: contain;
}
form.wmes-enabled button:focus-visible,
form.wmes-enabled .wmes-result:focus-visible {
	outline: 2px solid #008c95;
	outline-offset: -2px;
}
form.wmes-enabled .wmes-results {
	position: absolute;
	top: calc(var(--wmes-input-top, 0px) + var(--wmes-input-height, 48px) + 5px);
	left: 0;
	right: 0;
	z-index: 55;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	max-height: min(65vh, 540px);
	overflow: auto;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	box-shadow: 0 8px 24px #00000014;
	overscroll-behavior: contain;
}
form.wmes-enabled .wmes-results[hidden] { display: none !important; }
form.wmes-enabled .wmes-result {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 15px;
	min-width: 0;
	border-bottom: 1px solid #e5e5e5;
	color: #333;
	text-decoration: none;
	text-align: right;
}
form.wmes-enabled .wmes-result:nth-child(odd) { border-left: 1px solid #e5e5e5; }
form.wmes-enabled .wmes-result:hover { background: #f8f9fa; }
form.wmes-enabled .wmes-result img { width: 65px; height: 85px; object-fit: contain; flex: 0 0 65px; border-radius: 5px; }
form.wmes-enabled .wmes-result-text { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
form.wmes-enabled .wmes-result-text small { color: #888; font-size: 11px; }
form.wmes-enabled .wmes-price { color: #00a5ad; }
form.wmes-enabled .wmes-price del { color: #aaa; font-size: 11px; }
form.wmes-enabled .wmes-view-all,
form.wmes-enabled .wmes-empty { grid-column: 1 / -1; margin: 0; padding: 12px; text-align: center; }
form.wmes-enabled .wmes-view-all { position: static !important; width: 100%; height: auto; background: #f8f8f8; color: #333; font: inherit; border: 0; }
form.wmes-enabled .wmes-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 480px) {
	form.wmes-enabled { --wmes-selector-width: clamp(88px, 32%, 120px); }
	form.wmes-enabled .wmes-trigger { padding-inline: 9px; font-size: 11px; }
	form.wmes-enabled .wmes-results { grid-template-columns: minmax(0, 1fr); }
	form.wmes-enabled .wmes-result:nth-child(odd) { border-left: 0; }
	form.wmes-enabled .wmes-result { padding: 12px; }
}
