/* Decant — search (style K): pill in the header, big field on the homepage, dropdown with photos, ⌘K overlay. */

.srch { position: relative; width: 100%; }
.srch__field {
	position: relative; display: flex; align-items: center; gap: 10px;
	height: 40px; padding: 0 10px 0 14px;
	background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill);
	transition: border-color .15s, background .15s, box-shadow .15s;
}
.srch__field:hover { border-color: var(--line-strong); }
.srch__field:focus-within { background: var(--bg); border-color: var(--tint); }
.srch__icon { flex: none; color: var(--muted); }
.srch__input {
	flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; outline: none;
	font-size: var(--fs-sm); color: var(--text);
	-webkit-appearance: none; appearance: none;
}
.srch__input::placeholder { color: var(--faint); }
.srch__input::-webkit-search-decoration,
.srch__input::-webkit-search-results-button { -webkit-appearance: none; }
.srch__input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.srch__input:focus-visible { outline: none; }
.srch__kbd, .srch__esc, .srch-opt__kbd {
	flex: none; font: 500 11px/1 var(--mono); color: var(--muted);
	border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; background: var(--bg);
}
.srch__field:focus-within .srch__kbd { opacity: 0; }

/* Hero (homepage) */
.srch--hero { max-width: 640px; margin: 0 auto; text-align: left; }
.srch--hero .srch__field {
	height: 60px; padding: 0 8px 0 20px; gap: 12px;
	background: var(--bg); border-color: var(--line-strong); border-radius: var(--r-lg);
	box-shadow: 0 1px 2px rgba(74,52,36,.05), 0 10px 30px -12px rgba(74,52,36,.18);
}
.srch--hero .srch__field:hover { border-color: #cdb59a; }
.srch--hero .srch__field:focus-within { border-color: var(--tint); box-shadow: 0 0 0 4px rgba(138,96,64,.16), 0 10px 30px -12px rgba(74,52,36,.18); }
.srch--hero .srch__icon { width: 20px; height: 20px; color: var(--text); }
.srch--hero .srch__input { font-size: var(--fs-lg); }
.srch--hero .srch__go { height: 44px; border-radius: var(--r-md); }
.srch__tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }

/* Dropdown panel */
.srch__panel {
	position: absolute; z-index: 60; top: calc(100% + 8px); right: 0;
	width: max(100%, 480px); max-height: min(72vh, 640px); overflow-y: auto; overscroll-behavior: contain;
	padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg);
	box-shadow: 0 18px 40px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
	text-align: left;
}
.srch--hero .srch__panel { left: 0; right: 0; width: auto; }
.srch__panel[hidden] { display: none; }
.srch__panel:has([role="listbox"]:empty) { display: none; }

.srch-group + .srch-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.srch-group__head {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	padding: 6px 8px 4px; font: 500 var(--fs-xs)/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--faint);
}
.srch-group__clear {
	border: 0; background: none; padding: 2px 4px; cursor: pointer;
	font: inherit; text-transform: none; letter-spacing: 0; color: var(--muted);
}
.srch-group__clear:hover { color: var(--text); text-decoration: underline; }

/* Options */
.srch-opt {
	display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center;
	padding: 8px; border-radius: var(--r-md); color: var(--text); text-decoration: none !important; cursor: pointer;
	scroll-margin: 8px;
}
.srch-opt.is-active { background: var(--surface); }
.srch-opt__ph {
	width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--surface); overflow: hidden;
	display: grid; place-items: center;
}
.srch-opt__ph img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; padding: 3px; }
.srch-opt__txt { display: flex; flex-direction: column; min-width: 0; }
.srch-opt__brand {
	font: 500 11px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.srch-opt__name { font-size: var(--fs-md); font-weight: 500; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srch-opt__pre { color: var(--muted); font-weight: 400; }
.srch-opt__sub { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srch-opt__price { font: 400 var(--fs-xs)/1.2 var(--mono); color: var(--text); white-space: nowrap; }
.srch-opt__meta { font: 400 var(--fs-xs)/1.2 var(--mono); color: var(--muted); white-space: nowrap; }
.srch-opt mark { background: none; color: inherit; font-weight: 700; }
.srch-opt__brand mark { color: var(--text); font-weight: 600; }
.srch-opt.is-oos .srch-opt__ph, .srch-opt.is-oos .srch-opt__txt { opacity: .5; }
.srch-opt.is-oos .srch-opt__price { color: var(--muted); }

.srch-opt--row, .srch-opt--brand { grid-template-columns: 28px minmax(0, 1fr) auto; min-height: 40px; padding: 6px 8px; }
.srch-opt--brand { grid-template-columns: 28px minmax(0, 1fr) auto 14px; }
.srch-opt__icon { display: grid; place-items: center; color: var(--muted); }
.srch-opt__mono {
	width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--surface);
	display: grid; place-items: center; font: 600 var(--fs-sm)/1 var(--font); color: var(--text);
}
.srch-opt__go { color: var(--faint); display: grid; place-items: center; }
.srch-opt--brand .srch-opt__name, .srch-opt--row .srch-opt__name { font-size: var(--fs-sm); }

.srch-opt--all {
	display: flex; justify-content: space-between; align-items: center; gap: 12px;
	margin-top: 6px; padding: 12px 8px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-md) var(--r-md);
	font-size: var(--fs-sm); font-weight: 500;
}
.srch-opt--all.is-active { border-radius: var(--r-md); }

.srch-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 8px; }
.srch-chip {
	display: inline-flex; align-items: center; height: 30px; padding: 0 12px;
	border: 1px solid var(--line); border-radius: var(--r-pill); font-size: var(--fs-sm); color: var(--text);
	text-decoration: none !important; cursor: pointer; white-space: nowrap;
}
.srch-chip:hover, .srch-chip.is-active { border-color: var(--text); background: var(--surface); }

.srch-msg { padding: 14px 8px; font-size: var(--fs-sm); color: var(--muted); }
.srch-none { padding: 12px 8px 4px; }
.srch-none__title { margin: 0 0 2px; font-weight: 500; }
.srch-none__hint { margin: 0; font-size: var(--fs-sm); color: var(--muted); }

/* "Did you mean" under the empty catalog (server side) */
.srch-dym { margin-top: 16px; font-size: var(--fs-md); }
.srch-dym__line { margin: 0 0 8px; }
.srch-dym a { text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }

/* Overlay (⌘K, "/", phones) */
.srch-lock, .srch-lock body { overflow: hidden; }
.srch-ov { position: fixed; inset: 0; z-index: 120; }
.srch-ov[hidden] { display: none; }
.srch-ov__backdrop { position: absolute; inset: 0; background: rgba(10,10,10,.32); opacity: 0; transition: opacity .18s; }
.srch-ov.is-on .srch-ov__backdrop { opacity: 1; }
.srch-ov__box {
	position: relative; width: min(680px, calc(100% - 32px)); margin: 10vh auto 0;
	background: var(--bg); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
	transform: translateY(-8px); opacity: 0; transition: transform .2s var(--ease), opacity .18s;
}
.srch-ov.is-on .srch-ov__box { transform: none; opacity: 1; }
.srch--overlay .srch__field {
	height: 60px; padding: 0 12px 0 20px; background: var(--bg);
	border: 0; border-bottom: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.srch--overlay .srch__field:focus-within { border-color: var(--line); }
.srch--overlay .srch__input { font-size: var(--fs-lg); }
.srch__close {
	display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 6px;
	border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: var(--r-sm);
}
.srch__close:hover { color: var(--text); }
.srch__close svg { display: none; }
.srch--overlay .srch__panel {
	position: static; width: auto; max-height: min(64vh, 620px); border: 0; box-shadow: none; border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.srch--overlay .srch__panel:has([role="listbox"]:empty) { display: block; }

@media (max-width: 900px) {
	.srch--header .srch__kbd { display: none; }
	.srch--header .srch__field { height: 42px; }
	.srch--header .srch__input { font-size: 16px; } /* no iOS zoom */
	.srch--header .srch__panel { display: none; }   /* phones use the overlay */

	.srch-ov__box {
		width: 100%; height: 100%; margin: 0; border-radius: 0; display: flex; flex-direction: column;
		transform: none;
	}
	.srch--overlay { display: flex; flex-direction: column; height: 100%; }
	.srch--overlay .srch__field { flex: none; height: 56px; padding: 0 8px 0 16px; border-radius: 0; }
	.srch--overlay .srch__input { font-size: 16px; }
	.srch--overlay .srch__panel { flex: 1; max-height: none; padding: 8px 8px calc(16px + env(safe-area-inset-bottom, 0px)); border-radius: 0; }
	.srch__esc { display: none; }
	.srch__close svg { display: block; }
	.srch__close { width: 40px; justify-content: center; }
	.srch-opt { min-height: 48px; }
}

@media (max-width: 560px) {
	.srch--hero .srch__field { height: 54px; padding-left: 16px; }
	.srch--hero .srch__go { display: none; }
	.srch--hero .srch__input { font-size: 16px; }
	.srch--hero .srch__panel { max-height: 60vh; }
	.srch-opt { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; }
	.srch-opt__ph { width: 40px; height: 40px; }
}
