/**
 * Search — SE-1 Predictive panel (inc/search-predictive.php,
 * js/search-predictive.js).
 *
 * Figma 7:2 (desktop): the Search surface spans the full width directly below
 * the header (Paper, no shadow), padding 32/42/40. Field 43px, 1px Ink,
 * padding 8/12, gap 8, 16px icons. 32px below it, two columns 48px apart:
 * SUGGESTIONS (376px, Nav/Drawer Rows 48px, padding 12/20, Header 14) and
 * PRODUCTS (2×2 grid of 442px rows, 48px gutter; row = 64×80 thumb + name /
 * price in Body 14, gap 16, padding 12/0). Labels Header 12 Taupe, 8px above
 * their lists. VIEW ALL RESULTS 32px below: 348×55 secondary button. The
 * rest of the page sits under a 40% Ink scrim.
 *
 * Figma 12:306 (mobile): the surface fills the viewport below the header;
 * field inset 20px with a Taupe border; full-width rows; three 96px product
 * rows (padding 8/20); 24px between blocks; VIEW ALL RESULTS inset 20px.
 */

.vataly-search {
	position: fixed;
	top: var(--vataly-search-top, 0);
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 998;
}

.vataly-search[hidden] {
	display: none;
}

body.vataly-search-open {
	overflow: hidden;
}

.vataly-search__scrim {
	position: absolute;
	inset: 0;
	background-color: color-mix(in srgb, var(--ink_text) 40%, transparent); /* surface/scrim: --ink_text @ 40% */
}

.vataly-search__surface {
	position: relative;
	max-height: 100%;
	padding: var(--space_32) 42px 40px;
	box-sizing: border-box;
	overflow-y: auto;
	overscroll-behavior: contain;
	background-color: var(--bg_clr1);
	color: var(--ink_text);
}

/* Field ---------------------------------------------------------------- */

.vataly-search__form {
	margin: 0;
}

.vataly-search__field {
	display: flex;
	align-items: center;
	gap: var(--space_8);
	height: 43px;
	padding: var(--space_8) var(--space_12);
	box-sizing: border-box;
	border: 1px solid var(--ink_text);
	background-color: var(--bg_clr1);
}

/* Konte's .svg-icon wrapper is an inline box with its own line height. */
.vataly-search__icon {
	display: flex;
	flex: 0 0 16px;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	margin: 0;
	padding: 0;
	line-height: 0;
	color: var(--ink_text);
}

.vataly-search__icon svg {
	display: block;
	width: 16px;
	height: 16px;
}

.vataly-search__input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	font-family: var(--font2);
	font-weight: 300;
	font-size: 14px;
	line-height: normal;
	color: var(--ink_text);
	-webkit-appearance: none;
	appearance: none;
}

.vataly-search__input::placeholder {
	color: var(--ink_text);
	opacity: 1;
}

.vataly-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

.vataly-search__input:focus {
	outline: none;
}

.vataly-search__close {
	display: flex;
	flex: 0 0 16px;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ink_text);
	cursor: pointer;
}

.vataly-search__close:hover,
.vataly-search__close:focus {
	background: transparent;
	color: var(--ink_text);
}

/* Results -------------------------------------------------------------- */

.vataly-search__results {
	display: grid;
	grid-template-columns: 376px minmax(0, 1fr);
	align-items: start;
	gap: var(--space_32) var(--space_48);
	margin-top: var(--space_32);
}

.vataly-search__results[hidden],
.vataly-search__group[hidden] {
	display: none;
}

.vataly-search__group--suggestions {
	grid-column: 1;
}

.vataly-search__group--products {
	grid-column: 2;
}

.vataly-search__label {
	margin: 0 0 var(--space_8);
	font-family: var(--font2);
	font-weight: 700;
	font-size: 12px;
	line-height: normal;
	color: var(--h_clr);
}

.vataly-search__suggestions,
.vataly-search__products {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vataly-search__suggestions li,
.vataly-search__products li {
	margin: 0;
	padding: 0;
}

/* Nav/Drawer Row (Level=Primary, State=Default). */
.vataly-search__suggestion {
	display: flex;
	align-items: center;
	gap: var(--space_12);
	min-height: 48px;
	padding: var(--space_12) var(--space_20);
	box-sizing: border-box;
	font-family: var(--font2);
	font-weight: 700;
	font-size: 14px;
	line-height: normal;
	color: var(--ink_text);
	text-decoration: none;
}

.vataly-search__products {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: var(--space_48);
}

.vataly-search__product {
	display: flex;
	align-items: center;
	gap: var(--space_16);
	padding: var(--space_12) 0;
	color: var(--ink_text);
	text-decoration: none;
}

.vataly-search__thumb {
	flex: 0 0 64px;
	width: 64px;
	height: 80px;
	overflow: hidden;
	background-color: var(--bg_clr2); /* surface/subtle placeholder */
}

.vataly-search__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.vataly-search__text {
	display: flex;
	flex-direction: column;
	gap: var(--space_4);
	min-width: 0;
	font-family: var(--font2);
	font-weight: 300;
	font-size: 14px;
	line-height: normal;
	color: var(--ink_text);
}

.vataly-search__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vataly-search__price,
.vataly-search__price .amount,
.vataly-search__price ins,
.vataly-search__price del {
	font-family: var(--font2);
	font-weight: 300;
	font-size: 14px;
	color: var(--ink_text);
	background: none;
	text-decoration-thickness: 1px;
}

.vataly-search__suggestion:hover,
.vataly-search__suggestion:focus,
.vataly-search__product:hover .vataly-search__name,
.vataly-search__product:focus .vataly-search__name {
	color: var(--ink_text);
	text-decoration: underline;
}

/* Form/Button Type=Secondary. */
.vataly-search__all {
	grid-column: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 348px;
	max-width: 100%;
	height: 55px;
	padding: var(--space_12) var(--space_24);
	box-sizing: border-box;
	border: 1px solid var(--ink_text);
	background-color: var(--bg_clr1);
	font-family: var(--font2);
	font-weight: 700;
	font-size: 14px;
	line-height: normal;
	color: var(--ink_text);
	text-decoration: none;
}

.vataly-search__all:hover,
.vataly-search__all:focus {
	color: var(--ink_text);
	text-decoration: underline;
}

/* Mobile --------------------------------------------------------------- */

@media (max-width: 767px) {
	.vataly-search__surface {
		height: 100%;
		padding: var(--space_16) 0 var(--space_24);
	}

	.vataly-search__form {
		padding: 0 var(--space_20);
	}

	.vataly-search__field {
		border-color: var(--h_clr);
	}

	.vataly-search__field:focus-within {
		border-color: var(--ink_text);
	}

	.vataly-search__results {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: var(--space_24);
		margin-top: var(--space_24);
	}

	.vataly-search__label {
		padding: 0 var(--space_20);
	}

	.vataly-search__products {
		display: block;
	}

	/* Mobile shows three products (Figma 12:306). */
	.vataly-search__products li:nth-child(n+4) {
		display: none;
	}

	.vataly-search__product {
		padding: var(--space_8) var(--space_20);
	}

	.vataly-search__all {
		width: auto;
		margin: 0 var(--space_20);
	}
}
