/* Modus Search. Inherits the theme's font and colours; override the variables to restyle. */
.ms-wrap {
	--ms-accent: #22315e;
	--ms-border: #c1cae2;
	--ms-bg: #fff;
	--ms-text: #1d2433;
	--ms-muted: #5b6477;
	--ms-hover: #f1f4fa;
	--ms-radius: 8px;
	position: relative;
	width: 100%;
	max-width: 100%;
}

.ms-form {
	position: relative;
	display: flex;
	align-items: stretch;
	margin: 0;
}

.ms-label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.ms-input,
.ms-cat {
	box-sizing: border-box;
	min-height: 44px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--ms-border);
	background: var(--ms-bg);
	color: var(--ms-text);
	font: inherit;
}

.ms-input {
	flex: 1 1 auto;
	min-width: 0;
	border-radius: var(--ms-radius) 0 0 var(--ms-radius);
}

.ms-cat {
	flex: 0 0 auto;
	max-width: 40%;
	border-right: 0;
	border-radius: var(--ms-radius) 0 0 var(--ms-radius);
}

.ms-cat + .ms-input {
	border-radius: 0;
}

.ms-input:focus-visible,
.ms-cat:focus-visible,
.ms-submit:focus-visible {
	outline: 2px solid var(--ms-accent);
	outline-offset: 1px;
}

.ms-submit {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var(--ms-accent);
	border-radius: 0 var(--ms-radius) var(--ms-radius) 0;
	background: var(--ms-accent);
	color: #fff;
	cursor: pointer;
}

.ms-submit:hover {
	filter: brightness(1.15);
}

.ms-panel {
	position: absolute;
	z-index: 99999;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 4px;
	max-height: min(70vh, 560px);
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid var(--ms-border);
	border-radius: var(--ms-radius);
	background: var(--ms-bg);
	color: var(--ms-text);
	box-shadow: 0 12px 32px rgba(20, 30, 60, 0.16);
}

.ms-panel[hidden] {
	display: none;
}

.ms-status {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.ms-list {
	margin: 0;
	padding: 4px 0;
	list-style: none;
}

.ms-list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ms-opt {
	display: flex;
	align-items: center;
}

.ms-link {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	padding: 8px 14px;
	color: inherit;
	text-decoration: none;
}

.ms-opt.ms-active,
.ms-opt:hover {
	background: var(--ms-hover);
}

.ms-img {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	object-fit: contain;
	border-radius: 4px;
	background: #fff;
}

.ms-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ms-title {
	font-weight: 500;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.ms-title mark {
	background: none;
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 2px;
}

.ms-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	color: var(--ms-muted);
	font-size: 0.8125em;
}

.ms-stock-in { color: #146c2e; }
.ms-stock-out { color: #b3261e; }
.ms-stock-backorder { color: #8a5a00; }

.ms-price {
	flex: 0 0 auto;
	font-weight: 600;
	white-space: nowrap;
}

.ms-price del {
	margin-right: 4px;
	color: var(--ms-muted);
	font-weight: 400;
}

.ms-price ins {
	text-decoration: none;
}

.ms-atc {
	flex: 0 0 auto;
	margin-right: 14px;
	padding: 6px 12px;
	border: 1px solid var(--ms-accent);
	border-radius: var(--ms-radius);
	color: var(--ms-accent);
	font-size: 0.8125em;
	text-decoration: none;
	white-space: nowrap;
}

.ms-atc:hover {
	background: var(--ms-accent);
	color: #fff;
}

.ms-term .ms-link {
	justify-content: space-between;
}

.ms-note,
.ms-empty {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 14px;
	color: var(--ms-muted);
	font-size: 0.875em;
}

.ms-empty {
	flex-direction: column;
	padding: 18px 14px;
}

.ms-clear {
	padding: 0;
	border: 0;
	background: none;
	color: var(--ms-accent);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.ms-all {
	border-top: 1px solid var(--ms-border);
	font-weight: 600;
}

.ms-all .ms-link {
	justify-content: center;
	color: var(--ms-accent);
}

@media (max-width: 600px) {
	.ms-cat {
		max-width: 34%;
	}

	.ms-panel {
		max-height: 60vh;
	}

	.ms-atc {
		display: none;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.ms-submit {
		transition: filter 0.15s;
	}
}
