/* MG Wyszukiwacz – search suggestions. Colours from the theme unless the owner chose a colour set
   (the same CSS variables as the filters: --mgw-bg, --mgw-border, --mgw-text, --mgw-accent, --mgw-radius). */
.mgw-sg {
	--mgw-line: color-mix(in srgb, currentColor 16%, transparent);
	--mgw-soft: color-mix(in srgb, currentColor 7%, transparent);
	--mgw-a: var(--mgw-accent, var(--wp--preset--color--contrast, #1e1e1e));
	position: absolute;
	z-index: 99999;
	box-sizing: border-box;
	max-height: min(70vh, 560px);
	overflow-y: auto;
	padding: 6px;
	background: var(--mgw-bg, var(--wp--preset--color--base, #fff));
	color: var(--mgw-text, var(--wp--preset--color--contrast, #1e1e1e));
	border: 1px solid var(--mgw-border, var(--mgw-line));
	border-radius: var(--mgw-radius, 10px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
	line-height: 1.35;
	text-align: left;
}
.mgw-sg[hidden] { display: none; }
.mgw-sg *, .mgw-sg *::before, .mgw-sg *::after { box-sizing: border-box; }
.mgw-sg.is-loading { opacity: 0.7; }

.mgw-sg-heading {
	padding: 10px 10px 4px;
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.65;
}
.mgw-sg-option {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 8px 10px;
	border-radius: calc(var(--mgw-radius, 10px) * 0.7);
	color: inherit;
	text-decoration: none;
}
.mgw-sg-option:hover, .mgw-sg-option.is-active { background: var(--mgw-soft); color: inherit; }
.mgw-sg-option:focus { outline: none; }
.mgw-sg-option.is-active { box-shadow: inset 3px 0 0 var(--mgw-a); }

.mgw-sg-image {
	flex: none;
	width: 48px;
	height: 48px;
	overflow: hidden;
	border-radius: calc(var(--mgw-radius, 10px) * 0.6);
	background: var(--mgw-soft);
}
.mgw-sg-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mgw-sg-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.mgw-sg-name { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.mgw-sg-product .mgw-sg-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mgw-sg-price { text-align: right; }
.mgw-sg-price small, .mgw-sg-price .woocommerce-price-suffix { display: block; font-size: 0.75em; font-weight: 400; opacity: 0.7; }
.mgw-sg-stock { font-size: 0.82em; opacity: 0.7; }
.mgw-sg-stock--outofstock { color: #b32d2e; opacity: 1; }
.mgw-sg-price { flex: none; font-weight: 700; white-space: nowrap; }
.mgw-sg-price del { margin-right: 4px; font-weight: 400; opacity: 0.6; }
.mgw-sg-price ins { text-decoration: none; }

.mgw-sg-term { justify-content: flex-start; gap: 6px; }
.mgw-sg-group { opacity: 0.7; }
.mgw-sg-term .mgw-sg-name { flex: 1; }
.mgw-sg-count {
	flex: none;
	min-width: 1.9em;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--mgw-soft);
	font-size: 0.85em;
	text-align: center;
}
.mgw-sg-all {
	justify-content: center;
	margin-top: 6px;
	border-top: 1px solid var(--mgw-border, var(--mgw-line));
	border-radius: 0 0 calc(var(--mgw-radius, 10px) * 0.7) calc(var(--mgw-radius, 10px) * 0.7);
	color: var(--mgw-a);
	font-weight: 700;
}
/* “Show all results” stays visible while the list scrolls (long lists, phones). */
.mgw-sg-all { position: sticky; bottom: -6px; margin-bottom: -6px; padding-bottom: 12px; background: var(--mgw-bg, var(--wp--preset--color--base, #fff)); }
.mgw-sg-all.is-active, .mgw-sg-all:hover { background: var(--mgw-bg, var(--wp--preset--color--base, #fff)); text-decoration: underline; }
.mgw-sg-none { margin: 0; padding: 14px 10px; opacity: 0.8; }
.mgw-sg-fixed { margin: 0; padding: 8px 10px 4px; font-style: italic; opacity: 0.85; }
.mgw-search-fixed { margin: 0 0 1em; }

/* Own search field ([mg_wyszukiwarka] and the block). */
.mgw-search-form { display: flex; gap: 8px; max-width: 640px; }
.mgw-search-form input[type="search"] { flex: 1; min-width: 0; }
.mgw-sg-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
