/* ==========================================================================
   HeadStash New York — live search panel (v1.0.41)
   Same language as the rest of the theme: cream canvas, 1px ink rules,
   Archivo Black names, JetBrains Mono labels, gold highlights.
   ========================================================================== */

/* ---------- Header field ---------- */
.hs-topbar__search { transition: width .2s ease, box-shadow .2s ease; }
.hs-topbar__search:focus-within { box-shadow: 3px 3px 0 var(--hs-ink); }
html.hs-sx-open--d .hs-topbar { z-index: 101; }
html.hs-sx-open--d .hs-topbar__search { width: min(340px, 30vw); background: #fff; }
.hs-topbar__search input::-webkit-search-cancel-button { cursor: pointer; }

/* ---------- Panel ---------- */
.hs-sx {
	position: absolute; top: 100%; right: 32px; z-index: 101;
	width: min(920px, calc(100% - 64px));
	max-height: min(640px, calc(100vh - 140px));
	display: flex; flex-direction: column;
	background: var(--hs-canvas); color: var(--hs-ink);
	border: 1px solid var(--hs-ink); border-top: 0;
	box-shadow: 8px 8px 0 var(--hs-ink);
	font-family: var(--hs-body-font);
	animation: hs-sx-in .16s ease-out;
}
.hs-sx[hidden] { display: none; }
@keyframes hs-sx-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.hs-sx-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(11,14,26,.38); animation: hs-sx-fade .16s ease-out; }
.hs-sx-backdrop[hidden] { display: none; }
@keyframes hs-sx-fade { from { opacity: 0; } to { opacity: 1; } }

.hs-sx__head {
	display: flex; align-items: center; gap: 16px;
	padding: 10px 16px; background: var(--hs-ink); color: var(--hs-canvas);
	font-family: var(--hs-mono-font); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
}
.hs-sx__kicker { color: var(--hs-gold); font-weight: 700; }
.hs-sx__keys { margin-left: auto; opacity: .6; letter-spacing: .08em; }
.hs-sx__x { background: transparent; border: 1px solid rgba(244,237,224,.35); color: var(--hs-canvas); font: inherit; letter-spacing: inherit; padding: 4px 8px; cursor: pointer; }
.hs-sx__x:hover { border-color: var(--hs-gold); color: var(--hs-gold); }

.hs-sx__body { display: grid; grid-template-columns: 260px 1fr; min-height: 0; flex: 1; overflow: hidden; }
.hs-sx__side { background: var(--hs-card-bg); border-right: 1px solid var(--hs-rule); padding: 16px; overflow-y: auto; }
.hs-sx__main { padding: 16px 18px 18px; overflow-y: auto; min-width: 0; }
.hs-sx__main--full { grid-column: 1 / -1; }

.hs-sx__sec + .hs-sx__sec { margin-top: 18px; }
.hs-sx__label {
	display: flex; align-items: baseline; gap: 8px;
	font-family: var(--hs-mono-font); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
	color: rgba(11,14,26,.55); margin-bottom: 10px;
}
.hs-sx__n { margin-left: auto; color: var(--hs-gold-deep); font-weight: 700; }
.hs-sx__clear { margin-left: auto; background: none; border: 0; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: rgba(11,14,26,.55); text-decoration: underline; cursor: pointer; }
.hs-sx__clear:hover { color: var(--hs-ink); }

.hs-sx mark { background: var(--hs-gold); color: var(--hs-ink); padding: 0 1px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- Chips (popular / recent / categories when nothing found) ---------- */
.hs-sx__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hs-sx__chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 7px 10px; background: #fff; border: 1px solid var(--hs-ink); color: var(--hs-ink);
	font-family: var(--hs-mono-font); font-size: 11px; letter-spacing: .04em; line-height: 1; cursor: pointer;
	transition: background .12s ease, transform .12s ease;
}
.hs-sx__chip:hover, .hs-sx__chip.is-active { background: var(--hs-gold); transform: translateY(-1px); }

/* ---------- Category / brand rows ---------- */
.hs-sx__terms { display: flex; flex-direction: column; border-top: 1px solid var(--hs-rule); }
.hs-sx__term {
	display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
	padding: 9px 8px; border-bottom: 1px solid var(--hs-rule);
	font-weight: 700; font-size: 13px; line-height: 1.25;
}
.hs-sx__term-parent { display: block; font-family: var(--hs-mono-font); font-weight: 400; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: rgba(11,14,26,.5); margin-top: 2px; }
.hs-sx__count { font-family: var(--hs-mono-font); font-size: 10px; color: rgba(11,14,26,.45); font-weight: 400; }
.hs-sx__term:hover, .hs-sx__term.is-active { background: #fff; box-shadow: inset 3px 0 0 var(--hs-ink); }

/* ---------- Product rows ---------- */
.hs-sx__list { display: flex; flex-direction: column; border-top: 1px solid var(--hs-rule); }
.hs-sx__item {
	display: grid; grid-template-columns: 64px 1fr auto 16px; align-items: center; gap: 14px;
	padding: 10px 10px 10px 8px; border-bottom: 1px solid var(--hs-rule); color: var(--hs-ink);
	transition: background .12s ease;
}
.hs-sx__item:hover, .hs-sx__item.is-active { background: #fff; box-shadow: inset 3px 0 0 var(--hs-ink); }
.hs-sx__thumb {
	position: relative; width: 64px; height: 64px; overflow: hidden;
	background: var(--hs-card-bg); border: 1px solid var(--hs-ink);
	display: flex; align-items: center; justify-content: center;
}
.hs-sx__thumb::before {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background-image: radial-gradient(circle, rgba(11,14,26,.07) 1px, transparent 1.6px); background-size: 10px 10px;
}
.hs-sx__thumb img { position: relative; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.hs-sx__mono { position: relative; font-family: var(--hs-display-font); font-size: 26px; color: var(--hs-gold-deep); text-transform: uppercase; }
.hs-sx__info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hs-sx__brand { font-family: var(--hs-mono-font); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: rgba(11,14,26,.55); }
.hs-sx__name { font-family: var(--hs-display-font); font-size: 15px; line-height: 1.12; letter-spacing: -.01em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hs-sx__cat { font-family: var(--hs-mono-font); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--hs-gold-deep); }
.hs-sx__price { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-family: var(--hs-mono-font); font-size: 12px; white-space: nowrap; text-align: right; }
.hs-sx__price del { opacity: .45; }
.hs-sx__price ins { text-decoration: none; color: var(--hs-sale); font-weight: 700; }
.hs-sx__go { opacity: 0; transform: translateX(-4px); transition: opacity .12s ease, transform .12s ease; font-family: var(--hs-mono-font); }
.hs-sx__item:hover .hs-sx__go, .hs-sx__item.is-active .hs-sx__go { opacity: 1; transform: none; }
.hs-sx__item.is-soldout .hs-sx__thumb img { opacity: .5; }
.hs-sx__item.is-soldout .hs-sx__name { color: rgba(11,14,26,.6); }

/* ---------- "See all" ---------- */
.hs-sx__all {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	margin-top: 14px; padding: 14px 16px;
	background: var(--hs-ink); color: var(--hs-gold); border: 1px solid var(--hs-ink);
	font-family: var(--hs-mono-font); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
	transition: filter .12s ease;
}
.hs-sx__main > .hs-sx__all { position: sticky; bottom: 0; }
.hs-sx__all:hover, .hs-sx__all.is-active { filter: brightness(1.2); box-shadow: 3px 3px 0 var(--hs-gold-deep); }

/* ---------- Nothing found ---------- */
.hs-sx__none { padding: 6px 0; }
.hs-sx__none-title { font-family: var(--hs-display-font); font-size: clamp(22px, 2.4vw, 30px); line-height: 1; letter-spacing: -.02em; margin-bottom: 14px; overflow-wrap: anywhere; }
.hs-sx__dym { font-size: 15px; margin-bottom: 14px; }
.hs-sx__dym-btn { background: var(--hs-gold); border: 1px solid var(--hs-ink); padding: 3px 8px; font-family: var(--hs-display-font); font-size: 15px; cursor: pointer; }
.hs-sx__dym-btn:hover, .hs-sx__dym-btn.is-active { box-shadow: 2px 2px 0 var(--hs-ink); }
.hs-sx__empty-hint { font-size: 13px; color: rgba(11,14,26,.7); margin-bottom: 12px; }

/* ---------- Loading ---------- */
.hs-sx__skel { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--hs-rule); }
.hs-sx__skel span { display: block; height: 64px; background: linear-gradient(90deg, rgba(11,14,26,.06), rgba(11,14,26,.12), rgba(11,14,26,.06)); background-size: 200% 100%; animation: hs-sx-sh 1.1s linear infinite; }
.hs-sx__skel span + span { height: 14px; width: 70%; }
@keyframes hs-sx-sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.hs-sx__cancel { display: none; }

/* ---------- Phones: full-screen sheet under the search bar ---------- */
@media (max-width: 900px) {
	html.hs-sx-open--m, html.hs-sx-open--m body { overflow: hidden; }
	html.hs-sx-open--m .hs-topbar__search-mobile {
		position: fixed; top: 0; left: 0; right: 0; z-index: 1001;
		display: flex; align-items: center; gap: 10px;
		box-shadow: 0 1px 0 var(--hs-ink);
	}
	html.hs-sx-open--m .hs-topbar__search-mobile form { flex: 1; min-width: 0; }
	html.hs-sx-open--m .hs-sx__cancel {
		display: block; background: none; border: 0; padding: 8px 0; color: var(--hs-ink);
		font-family: var(--hs-mono-font); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
	}
	.hs-sx {
		position: fixed; top: var(--hsx-top, 58px); left: 0; right: 0; bottom: 0; z-index: 1000;
		width: auto; max-height: none; border: 0; box-shadow: none;
		animation: hs-sx-up .18s ease-out;
	}
	@keyframes hs-sx-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
	.hs-sx__head { display: none; }
	.hs-sx__body { display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
	.hs-sx__side { order: 0; border-right: 0; border-bottom: 1px solid var(--hs-rule); overflow: visible; padding: 14px 16px; }
	.hs-sx__main { order: 1; overflow: visible; padding: 14px 16px 32px; }
	/* On phones, categories/brands become a horizontal strip of chips. */
	.hs-sx__terms { flex-direction: row; gap: 6px; border-top: 0; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
	.hs-sx__terms::-webkit-scrollbar { display: none; }
	.hs-sx__term { flex: 0 0 auto; border: 1px solid var(--hs-ink); background: #fff; padding: 8px 10px; white-space: nowrap; font-size: 12px; }
	.hs-sx__term-parent { display: none; }
	.hs-sx__item { grid-template-columns: 56px 1fr auto; gap: 12px; padding: 10px 2px; }
	.hs-sx__thumb { width: 56px; height: 56px; }
	.hs-sx__go { display: none; }
	.hs-sx__name { font-size: 14px; }
	.hs-sx__all { position: sticky; bottom: 12px; box-shadow: 4px 4px 0 var(--hs-gold-deep); }
}

@media (prefers-reduced-motion: reduce) {
	.hs-sx, .hs-sx-backdrop { animation: none; }
}
