/* Search: header panel with live results (.tz-search) and the results page (.tz-search-head, .tz-shop__empty). */

/* ---------- Header button ---------- */
.tz-search__open {
	display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 40px; height: 40px; padding: 8px;
	color: inherit; text-decoration: none;
}
.tz-search svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tz-header__tools .tz-search svg { fill: none; }
.tz-search.is-open .tz-search__open { color: var(--tz-sand); }

/* ---------- Panel ---------- */
.tz-search__panel {
	position: absolute; left: 0; right: 0; top: 100%; z-index: 3;
	max-height: calc(100dvh - var(--tz-header-h)); overflow-y: auto; overscroll-behavior: contain;
	background: var(--tz-surface); color: var(--tz-ink); border-top: 1px solid var(--tz-line); box-shadow: 0 8px 24px rgba(28,28,26,.10);
	opacity: 0; visibility: hidden; transform: translateY(-6px);
	transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.tz-search.is-open .tz-search__panel { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .2s ease, visibility 0s; }
.tz-search__scrim {
	position: fixed; left: 0; right: 0; bottom: 0; top: var(--tz-header-h); z-index: 1;
	background: rgba(28,28,26,.45); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .2s;
}
.tz-search.is-open .tz-search__scrim { opacity: 1; visibility: visible; transition: opacity .2s ease, visibility 0s; }

.tz-search__inner {
	box-sizing: border-box;
	padding: 40px max(var(--tz-gutter, 48px), calc((100% - 1320px) / 2)) 48px;
}
.tz-search__panel a { color: var(--tz-ink); text-decoration: none; }
.tz-header .tz-search__open { color: inherit; }
.tz-search__panel :focus-visible { outline-color: var(--tz-forest); }

/* Field */
.tz-search__form { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--tz-ink); }
.tz-search__form > svg { flex: none; width: 28px; height: 28px; color: var(--tz-muted); }
.tz-search .tz-search__input {
	flex: 1; min-width: 0; min-height: 48px; padding: 0; border: 0 !important; border-radius: 0; background: none; box-shadow: none !important;
	font-family: var(--wp--preset--font-family--display); font-size: 34px; line-height: 44px; font-weight: 500; color: var(--tz-ink);
}
.tz-search .tz-search__input::placeholder { color: #9b9187; opacity: 1; }
.tz-search .tz-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.tz-search__submit {
	flex: none; padding: 10px 0; border: 0; background: none; cursor: pointer; color: var(--tz-ink);
	font: inherit; font-size: 13px; line-height: 16px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
	border-bottom: 1px solid var(--tz-sand);
}
.tz-search__close { flex: none; display: inline-flex; padding: 8px; margin-right: -8px; border: 0; background: none; color: var(--tz-ink); cursor: pointer; }

.tz-search__heading { margin: 0 0 14px; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--tz-muted); }

/* Before typing */
.tz-search__start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; padding-top: 32px; }
.tz-search__chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tz-search__chips a {
	display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border: 1px solid var(--tz-line-strong); border-radius: 999px;
	font-size: 14px; line-height: 20px; color: var(--tz-ink); text-decoration: none; transition: background-color .15s ease, border-color .15s ease;
}
.tz-search__chips a:hover { background: var(--tz-stone); border-color: var(--tz-ink); }
.tz-search__collections { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }
.tz-search__collections a { display: inline-flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 15px; line-height: 22px; color: #3a3833; }
.tz-search__collections a:hover { color: var(--tz-ink); text-decoration: underline; text-decoration-color: var(--tz-sand); text-underline-offset: 4px; }
.tz-search__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent, var(--tz-sand)); }

/* Live results */
.tz-search__results { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; padding-top: 32px; transition: opacity .15s ease; }
.tz-search__results[hidden], .tz-search__start[hidden], .tz-search__terms[hidden], .tz-search__none[hidden], .tz-search__all[hidden] { display: none; }
.tz-search__results.is-loading { opacity: .55; }
.tz-search__terms { grid-column: 1; }
.tz-search__terms ul { list-style: none; margin: 0; padding: 0; }
.tz-search__terms a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--tz-line); font-size: 15px; line-height: 22px; }
.tz-search__terms a:hover span:first-child { text-decoration: underline; text-decoration-color: var(--tz-sand); text-underline-offset: 4px; }
.tz-search__kind { flex: none; font-size: 11px; line-height: 16px; letter-spacing: .14em; text-transform: uppercase; color: var(--tz-muted); }
.tz-search__products { grid-column: 2; display: flex; flex-direction: column; }
.tz-search__terms[hidden] + .tz-search__products { grid-column: 1 / -1; }
.tz-search__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.tz-search__card { display: flex; flex-direction: column; gap: 10px; }
.tz-search__media { display: block; aspect-ratio: 1; overflow: hidden; background: var(--tz-stone); }
.tz-search__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tz-search__card:hover .tz-search__media img { transform: scale(1.03); }
.tz-search__body { display: flex; flex-direction: column; gap: 4px; }
.tz-search__eyebrow { font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--tz-muted); }
.tz-search__name { font-family: var(--wp--preset--font-family--display); font-size: 17px; line-height: 22px; font-weight: 500; }
.tz-search__card:hover .tz-search__name { text-decoration: underline; text-decoration-color: var(--tz-sand); text-underline-offset: 4px; }
.tz-search__price { font-size: 14px; line-height: 20px; }
.tz-search__price del { color: var(--tz-muted); margin-right: 6px; }
.tz-search__price ins { text-decoration: none; }
.tz-search__none { margin: 0; font-size: 15px; line-height: 24px; color: var(--tz-muted); }
.tz-search a.tz-search__all { margin-top: 28px; font-size: 13px; }
.tz-search a.tz-search__all:hover::after { transform: translateX(3px); }

/* Results heading on the results page */
.tz-search-head { display: flex; flex-direction: column; }
.tz-search-head .tz-eyebrow { margin: 0 0 12px; }
.tz-search-head__q { font-style: italic; }
.tz-search-head__form { display: flex; align-items: center; max-width: 480px; margin-top: 20px; border-bottom: 1px solid var(--tz-line-strong); }
.tz-search-head__form:focus-within { border-bottom-color: var(--tz-forest); }
.tz-search-head__form input[type="search"] { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; background: none; padding: 0; font-size: 16px; }
.tz-search-head__submit { display: inline-flex; padding: 10px; margin-right: -10px; border: 0; background: none; color: var(--tz-ink); cursor: pointer; }
.tz-search-head__submit svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

/* No results */
div.tz-shop__empty { max-width: 640px; color: var(--tz-muted); font-size: 16px; line-height: 26px; }
div.tz-shop__empty > p { margin: 0 0 16px; }
.tz-shop__empty-title { font-family: var(--wp--preset--font-family--display); font-size: 26px; line-height: 32px; color: var(--tz-ink); }
div.tz-shop__empty .tz-search__chips { margin-bottom: 24px; }
div.tz-shop__empty a { color: var(--tz-forest); }
div.tz-shop__empty .tz-search__chips a { color: var(--tz-ink); text-decoration: none; }

@media (max-width: 1240px) {
	.tz-search__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 781px) {
	.tz-search__inner { padding-top: 20px; padding-bottom: 28px; }
	.tz-search .tz-search__input { font-size: 24px; line-height: 32px; }
	.tz-search__form { gap: 10px; }
	.tz-search__form > svg { width: 22px; height: 22px; }
	.tz-search__submit { display: none; }
	.tz-search__start, .tz-search__results { grid-template-columns: 1fr; gap: 28px; padding-top: 24px; }
	.tz-search__products, .tz-search__terms { grid-column: 1; }
	.tz-search__collections { grid-template-columns: 1fr; }
	/* Results as a list on phones */
	.tz-search__grid { grid-template-columns: 1fr; gap: 12px; }
	.tz-search__card { flex-direction: row; align-items: center; gap: 14px; }
	.tz-search__media { flex: none; width: 72px; }
}
@media (prefers-reduced-motion: reduce) {
	.tz-search__panel, .tz-search__scrim, .tz-search__media img, .tz-search__results { transition: none !important; }
}

/* While search or a mega menu is open the header sits above everything on the page
   (the shop's mobile filter bar uses the same layer as the header otherwise). */
.tz-header:has(.tz-search.is-open), .tz-header:has(.tz-mega.has-open) { z-index: 60; }
