/* HolySmartphone — live search results panel.
 *
 * Chrome (loaded on every page): block-scoped BEM (.hs-search-pop__…,
 * .hs-search-group__…, .hs-search-result__…) so template stylesheets can never
 * reach it. Behaviour in assets/js/search.js, which builds the markup and
 * positions the panel (fixed) right under the field being typed in.
 *
 * Repairs and products must be told apart at a glance: each group heading
 * carries its own small icon (a wrench for repairs, a basket for products), and
 * each row says what it leads to: a repair, or a "v.a." price.
 */

.hs-search-pop {
	position: fixed; z-index: 1100; /* above the sticky header and the drawer */
	display: flex; flex-direction: column;
	padding: var(--sp-2);
	background: var(--bg-1); border-radius: var(--r-xl); box-shadow: var(--shadow-3);
	overflow: hidden;
	animation: hs-search-pop-in var(--dur-base) var(--ease-out);
}
.hs-search-pop[hidden] { display: none; }
@keyframes hs-search-pop-in { from { opacity: 0; transform: translateY(-4px); } }

.hs-search-pop__status { margin: 0; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-14); color: var(--fg-3); }
.hs-search-pop__status:empty { display: none; }

/* results scroll; the summary line and the foot stay put */
.hs-search-pop__results { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; transition: opacity var(--dur-fast) var(--ease-standard); }
.hs-search-pop.is-busy .hs-search-pop__results { opacity: .5; }

/* group heading: one quiet line — a 16px icon, black like the text, the name,
 * the count. Groups are separated by a very light rule. */
.hs-search-group { padding: var(--sp-1) 0; }
/* a very light rule between the groups: separates repairs from products
 * without turning the panel into a table */
.hs-search-group + .hs-search-group { margin-top: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid color-mix(in srgb, var(--border-2) 60%, transparent); }
.hs-search-group__title { display: flex; align-items: center; gap: var(--sp-2); margin: 0; padding: var(--sp-2) var(--sp-3) var(--sp-1); font-family: var(--font-sans); font-size: var(--fs-14); font-weight: var(--fw-bold); line-height: var(--lh-snug); letter-spacing: normal; text-transform: none; color: var(--fg-1); }
.hs-search-group__icon { display: inline-flex; color: var(--fg-1); } /* plain black, like the heading (15-10-2026) */
.hs-search-group__icon .hs-icon { width: 16px; height: 16px; }
.hs-search-group__count { font-weight: var(--fw-regular); color: var(--fg-3); }
.hs-search-group__list { list-style: none; margin: 0; padding: 0; }

/* one result row */
.hs-search-result { display: flex; align-items: center; gap: var(--sp-3); min-height: 56px; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-lg); color: var(--fg-1); text-decoration: none; transition: background var(--dur-fast) var(--ease-standard); }
.hs-search-result:hover { background: var(--bg-2); }
/* visible keyboard focus (2.4.7): an accent ring, not just the faint tint */
.hs-search-result:focus-visible { background: var(--bg-2); outline: 2px solid var(--accent); outline-offset: -2px; }
.hs-search-result__media { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--bg-2); color: var(--fg-3); overflow: hidden; }
.hs-search-result__media img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.hs-search-result__media .hs-icon { width: 20px; height: 20px; }
.hs-search-result__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hs-search-result__title { font-size: var(--fs-15); font-weight: var(--fw-semibold); line-height: var(--lh-snug); color: var(--fg-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-search-result__price { font-size: var(--fs-14); font-weight: var(--fw-semibold); color: var(--accent-hover); }
.hs-search-result__price del { margin-right: var(--sp-1); font-weight: var(--fw-regular); color: var(--fg-3); }
.hs-search-result__meta { font-size: var(--fs-14); color: var(--fg-3); }
.hs-search-result--repairs .hs-search-result__meta { color: var(--accent-hover); }

/* foot: the full product results page */
.hs-search-pop__foot { flex: none; padding: var(--sp-2) var(--sp-3) var(--sp-1); }
.hs-search-pop__all { display: inline-flex; align-items: center; min-height: 40px; font-size: var(--fs-14); font-weight: var(--fw-bold); color: var(--accent-hover); text-decoration: none; }
.hs-search-pop__all::after { content: " →"; white-space: pre; }
.hs-search-pop__all:hover { color: var(--accent-press); }
.hs-search-pop__all:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
