/* Starcom Search — live suggestions */
.ms-search-wrap {
	position: relative;
	max-width: 560px;
	width: 100%;
}

.ms-search-form {
	display: flex;
	align-items: stretch;
	border: 2px solid #3D3C6C;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
}

.ms-search-input {
	flex: 1 1 auto;
	border: 0;
	outline: 0;
	padding: 10px 14px;
	font-size: 15px;
	line-height: 1.3;
	background: transparent;
	color: #222;
	min-width: 0;
}

/* Same light blue as the menu row (.whb-header-bottom is rgba(230,239,253,1)).
   The icon is currentColor, so it goes dark to stay legible on the light fill. */
.ms-search-submit {
	flex: 0 0 auto;
	border: 0;
	background: #e6effd;
	color: #3D3C6C;
	padding: 0 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease;
}
.ms-search-submit:hover { background: #d3e2fb; }

/* The dropdown is deliberately NOT tied to the width of the input — the search
   box sits in a narrow header slot, and two columns of products inside it are
   unreadable. It is centred on the field and clamped to the viewport; when that
   would still push it off-screen (field near a screen edge) the script nudges it
   back by overriding the translate. */
.ms-suggestions {
	position: absolute;
	z-index: 9999;
	top: calc(100% + 4px);
	left: 50%;
	right: auto;
	transform: translateX(-50%);
	width: 1120px;
	max-width: calc(100vw - 24px);
	background: #fff;
	border: 1px solid #e3e3ec;
	border-radius: 6px;
	box-shadow: 0 8px 28px rgba(20, 20, 50, .14);
	max-height: 70vh;
	overflow-y: auto;
	padding: 6px;
}

/* Three columns. `.ms-main` is a two-column flow: categories, tags and pages sit
   as one unbreakable block at the top of column 1, then products run down
   column 1 and continue into column 2. Repair services get column 3 to
   themselves — a price answer reads badly interleaved with products. */
.ms-results-cols {
	display: flex;
	align-items: flex-start;
	gap: 16px;
}
.ms-main {
	flex: 1 1 auto;
	min-width: 0;
	column-count: 2;
	column-gap: 18px;
	column-rule: 1px solid #f0f0f5;
}
.ms-main > * {
	-webkit-column-break-inside: avoid;
	break-inside: avoid;
}
/* Service labels are "device — repair type" and long by nature ("iPhone 13 Pro
   Max — Aku vahetus"), with a price beside them. The column gets real width and
   the title wraps instead of being clipped to two ellipsised lines. */
.ms-services-col {
	flex: 0 0 340px;
	min-width: 0;
	border-left: 1px solid #f0f0f5;
	padding-left: 14px;
}
.ms-services-col .ms-suggestion {
	align-items: flex-start;
	gap: 8px;
}
/* Must out-specify `.ms-suggestion .ms-title`, which clips with an ellipsis and
   is declared further down this file. */
.ms-services-col .ms-suggestion .ms-title {
	display: block;
	-webkit-line-clamp: none;
	overflow: visible;
	text-overflow: clip;
	white-space: normal;
}
.ms-services-col .ms-suggestion .ms-price {
	padding-left: 6px;
}

@media ( max-width: 1160px ) {
	.ms-suggestions {
		width: calc(100vw - 24px);
	}
}
/* Not enough room for three side by side: services drop under the products. */
@media ( max-width: 860px ) {
	.ms-results-cols {
		display: block;
	}
	.ms-services-col {
		border-left: 0;
		border-top: 1px solid #f0f0f5;
		padding-left: 0;
		padding-top: 6px;
		margin-top: 6px;
	}
}
@media ( max-width: 600px ) {
	.ms-main {
		column-count: 1;
		column-rule: 0;
	}
}

.ms-suggestion {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 10px;
	border-radius: 5px;
	text-decoration: none;
	color: #222;
}

/* Rows inside the two-column layout. There is room now that the dropdown is no
   longer the width of the input, so these stay close to the default sizing. */
.ms-results-cols .ms-suggestion {
	gap: 10px;
	padding: 8px 10px;
}
.ms-results-cols .ms-thumb {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
}
.ms-results-cols .ms-thumb img {
	max-width: 44px;
	max-height: 44px;
}
.ms-results-cols .ms-price {
	font-size: 13px;
}
/* Titles get the leftover width instead of being truncated early. */
.ms-suggestion .ms-info {
	min-width: 0;
}
.ms-suggestion .ms-title {
	overflow: hidden;
	text-overflow: ellipsis;
}
.ms-suggestion:hover,
.ms-suggestion.is-active {
	background: #f1f1f8;
}

.ms-thumb {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ms-thumb img {
	max-width: 48px;
	max-height: 48px;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 4px;
}

.ms-info {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.ms-title {
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.ms-metarow {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: #888;
}
.ms-sku { letter-spacing: .02em; }
.ms-oos-badge {
	color: #b3261e;
	background: #fdecea;
	padding: 1px 6px;
	border-radius: 3px;
	font-size: 11px;
}
.ms-suggestion.is-oos .ms-title { color: #777; }

.ms-price {
	flex: 0 0 auto;
	font-weight: 600;
	font-size: 14px;
	color: #3D3C6C;
	white-space: nowrap;
	margin-left: auto;
	padding-left: 8px;
}
.ms-price del { color: #aaa; font-weight: 400; margin-right: 4px; }

.ms-viewall {
	display: block;
	text-align: center;
	padding: 10px;
	margin-top: 4px;
	font-size: 13px;
	font-weight: 600;
	color: #3D3C6C;
	text-decoration: none;
	border-top: 1px solid #eee;
	border-radius: 0 0 5px 5px;
}
.ms-viewall:hover,
.ms-viewall.is-active { background: #f1f1f8; }

.ms-headline {
	padding: 10px 10px 4px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #9a9ab0;
}

.ms-suggestion.ms-tax .ms-title { font-weight: 500; }
.ms-suggestion.ms-article .ms-title { font-weight: 500; }
.ms-crumbs { color: #aaa; font-size: 12px; }

/* Service mode: repair prices only — one column. */
.ms-mode-service .ms-main { column-count: 1; }

.ms-count {
	flex: 0 0 auto;
	margin-left: auto;
	padding-left: 8px;
	font-size: 12px;
	color: #888;
	white-space: nowrap;
}

.ms-empty,
.ms-loading {
	padding: 16px;
	text-align: center;
	font-size: 13px;
	color: #888;
}

/* Repair services (device — repair type + price) */
.ms-suggestion.ms-service .ms-title { font-weight: 500; }
.ms-suggestion.ms-service .ms-price { white-space: nowrap; font-weight: 600; }
