/* ============================================================================
   codex-20260613 mdsearch — instant search dropdown (Slice 1, desktop).
   ============================================================================ */
.mds-anchor { position: relative; }
.mds-results {
	position: absolute;
	left: 0; right: 0; top: 100%;
	z-index: 1200;
	margin-top: 8px;
	background: #fff;
	border: 1px solid var(--outlet-border, #e6e6e6);
	border-radius: 14px;
	box-shadow: 0 18px 50px -12px rgba(11, 13, 18, .28);
	overflow: hidden;
	max-height: min(70vh, 560px);
	display: flex;
	flex-direction: column;
}
.mds-results[hidden] { display: none; }

.mds-list { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px; }

.mds-item {
	display: flex; align-items: center; gap: 12px;
	padding: 8px 10px; border-radius: 10px;
	text-decoration: none; color: var(--outlet-ink, #0b0d12);
	transition: background-color .12s ease;
}
.mds-item:hover, .mds-item.is-active { background: var(--outlet-surface, #f4f6fa); }

.mds-thumb {
	flex: 0 0 auto; width: 54px; height: 54px;
	display: flex; align-items: center; justify-content: center;
	background: #fff; border: 1px solid var(--outlet-border, #eef0f3); border-radius: 9px; overflow: hidden;
}
.mds-thumb img { width: 100%; height: 100%; object-fit: contain; }
.mds-thumb.is-empty { background: var(--outlet-surface, #f1f3f7); }

.mds-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mds-name {
	font-size: .92rem; font-weight: 700; line-height: 1.25;
	overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.mds-name mark { background: #fff3bf; color: inherit; padding: 0 1px; border-radius: 2px; }
.mds-meta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mds-brand { font-size: .74rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: #8a9097; }
.mds-price { font-size: .9rem; font-weight: 850; margin-left: auto; }
.mds-price.is-promo { color: #e11; }
.mds-price s { color: #aab; font-weight: 600; margin-left: 5px; font-size: .8rem; }

.mds-empty { padding: 22px 16px; text-align: center; color: var(--outlet-muted, #8a9097); font-weight: 600; }

.mds-all {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%; flex: 0 0 auto;
	padding: 13px 14px; border: 0; border-top: 1px solid var(--outlet-border, #eef0f3);
	background: var(--outlet-surface, #f4f6fa); color: var(--outlet-ink, #0b0d12);
	font-weight: 800; font-size: .9rem; cursor: pointer;
}
.mds-all:hover { background: #e9edf3; }
.mds-all svg { flex: 0 0 auto; }

/* section headings (Продукти / Марки / Категории / ...) */
.mds-head {
	padding: 8px 10px 4px;
	font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
	color: var(--outlet-muted, #9aa0a8);
}

/* chip rows (brands, categories, recent, popular) */
.mds-chips { padding: 2px 8px 8px; border-top: 1px solid var(--outlet-border, #f0f2f5); }
.mds-chips:first-child { border-top: 0; }
.mds-chiprow { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 2px 4px; }
.mds-chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 7px 12px; border-radius: 999px;
	border: 1px solid var(--outlet-border, #e6e6e6); background: #fff;
	color: var(--outlet-ink, #0b0d12); font-size: .84rem; font-weight: 700;
	cursor: pointer; transition: background-color .12s ease, border-color .12s ease;
	text-decoration: none;
}
a.mds-chip:hover { text-decoration: none; }
.mds-chip:hover, .mds-chip.is-active { background: var(--outlet-surface, #f4f6fa); border-color: #d4d8de; }
.mds-chip-n {
	font-size: .68rem; font-weight: 800; color: var(--outlet-muted, #9aa0a8);
	background: var(--outlet-surface, #f1f3f7); border-radius: 999px; padding: 1px 7px;
}
.mds-chip-recent svg { color: var(--outlet-muted, #9aa0a8); flex: 0 0 auto; }
.mds-head-row { display: flex; align-items: center; justify-content: space-between; }
.mds-clear-recent {
	border: 0; background: none; cursor: pointer;
	font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
	color: var(--outlet-accent, #2f6bff); padding: 2px 4px;
}
.mds-clear-recent:hover { text-decoration: underline; }
.mds-chip-x {
	display: inline-flex; align-items: center; justify-content: center;
	border: 0; background: none; cursor: pointer; padding: 0; margin-left: 2px;
	color: var(--outlet-muted, #9aa0a8); border-radius: 50%;
}
.mds-chip-x:hover { color: var(--outlet-ink, #0b0d12); background: rgba(0,0,0,.06); }

/* "Пол · Категория" list (folder icon + text), tied to the search */
.mds-catbox { padding: 2px 6px 8px; border-top: 1px solid var(--outlet-border, #f0f2f5); }
.mds-cat {
	display: flex; align-items: center; gap: 12px;
	padding: 10px 10px; border-radius: 10px;
	text-decoration: none; color: var(--outlet-ink, #0b0d12);
	transition: background-color .12s ease;
}
.mds-cat:hover { background: var(--outlet-surface, #f4f6fa); text-decoration: none; }
.mds-cat-ic { flex: 0 0 auto; display: flex; color: var(--outlet-muted, #9aa0a8); }
.mds-cat-t { font-size: .95rem; font-weight: 600; line-height: 1.2; }

/* ---- Google-style suggestion rows (codex-20260613, approved mockup) ---- */
.mds-rows { padding: 2px 0; }
.mds-divide { height: 1px; background: var(--outlet-border, #ececef); margin: 4px 14px; }
.mds-row {
	display: flex; align-items: center; gap: 14px; padding: 11px 14px;
	text-decoration: none; color: var(--outlet-ink, #0b0d12);
}
.mds-row:hover, .mds-row.is-active { background: var(--outlet-surface, #f4f6fa); text-decoration: none; }
.mds-row-ic { flex: 0 0 auto; display: flex; color: var(--outlet-muted, #9aa0a8); }
.mds-row-t { flex: 1 1 auto; min-width: 0; font-size: .95rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mds-row-t b { font-weight: 700; }
.mds-row-crumb b { font-weight: 700; }
.mds-sep { color: var(--outlet-hint, #b6bbc1); margin: 0 5px; }
.mds-row-n { flex: 0 0 auto; font-size: .72rem; color: var(--outlet-hint, #9aa0a8); }
.mds-ins, .mds-rmv {
	flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
	border: 0; background: none; cursor: pointer; padding: 4px; margin: -4px;
	color: var(--outlet-hint, #9aa0a8); border-radius: 50%;
}
.mds-ins:hover, .mds-rmv:hover { color: var(--outlet-ink, #0b0d12); background: rgba(0,0,0,.05); }

/* back arrow inside the search field (left of the input) */
.mds-back {
	flex: 0 0 auto; border: 0; background: none; cursor: pointer; padding: 4px;
	display: none; align-items: center; justify-content: center;
	color: var(--outlet-accent, #2f6bff); border-radius: 50%;
}
.mds-back:hover { background: rgba(0,0,0,.05); }

/* body scroll lock while the full-screen mobile search is open */
body.mds-body-lock { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }

/* mobile: Google look — hide the theme header ("Търсене" + top-right ×), show the
   back arrow, lay the field out as one row. Saves the vertical space the header ate. */
@media (max-width: 991px) {
	#site-search-panel .search-panel-header,
	.search-container .search-panel-header { display: none !important; }
	#site-search-panel .form-group.mds-anchor,
	.search-container .form-group.mds-anchor { display: flex; align-items: center; gap: 6px; }
	.form-group.mds-anchor > form { flex: 1 1 auto; min-width: 0; }
	.mds-back { display: inline-flex; }
}

/* ============================================================================
   codex-20260615 — 2-column dropdown (terms | products), approved mockup.
   Desktop: left = terms (query/suggest/brands/categories/recent), right = products
   column with the "see all" tray at the bottom. Mobile: terms scroll, products
   become a fixed horizontal tray pinned to the bottom of the panel.
   Design tokens unchanged (var(--outlet-*)).
   ============================================================================ */
.mds-results.mds-2col {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	max-height: min(72vh, 560px);
	padding: 0;
}
.mds-2col .mds-aside {
	min-width: 0; min-height: 0;
	overflow-y: auto; -webkit-overflow-scrolling: touch;
	border-right: 1px solid var(--outlet-border, #eef0f3);
	padding: 6px 0;
}
.mds-2col .mds-main {
	min-width: 0; min-height: 0;
	display: flex; flex-direction: column;
	background: var(--outlet-surface, #fbfcfe);
}
.mds-2col .mds-main .mds-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.mds-2col .mds-main .mds-all { margin-top: auto; }

.mds-prodhead { display: flex; align-items: center; justify-content: space-between; }
.mds-count {
	color: var(--outlet-accent, #2f6bff); font-weight: 800;
	font-size: .78rem; letter-spacing: 0; text-transform: none;
}

/* ---- mobile: NO products — old single-column variant (terms + "see all" only) ----
   codex-20260615: the product tray was unfunctional on phones; drop the products column
   entirely on mobile and keep only the terms list + the "see all results" action. ---- */
@media (max-width: 991px) {
	.mds-results.mds-2col {
		display: flex; flex-direction: column;
		max-height: min(78vh, 600px);
	}
	.mds-2col .mds-aside {
		order: 1; flex: 1 1 auto; min-height: 0;
		border-right: 0; overflow-y: auto;
	}
	.mds-2col .mds-main {
		order: 2; flex: 0 0 auto; background: transparent;
	}
	/* hide everything in the product column except the "see all" footer button */
	.mds-2col .mds-main > *:not(.mds-all) { display: none; }
}
