/*
 * The search drawer.
 *
 * Inherits the panel, overlay, motion and mobile behaviour from side-cart.css —
 * this sheet only styles what is inside. Loading order is enforced by the
 * dependency in inc/search.php, not by hope.
 */

.pv-search__form {
	border-bottom: 1px solid var(--pv-border-default);
	padding: 0 20px 16px;
}

.pv-search__field {
	align-items: center;
	background: var(--pv-surface-card);
	border: 1.5px solid var(--pv-border-default);
	border-radius: var(--pv-radius-full);
	display: flex;
	gap: 11px;
	padding: 12px 18px;
}

.pv-search__field:focus-within {
	border-color: var(--pv-brand-orange, #ef7e3f);
}

.pv-search__field svg {
	color: var(--pv-neutral-300);
	flex: none;
}

.pv-search__field input {
	background: none;
	border: 0;
	color: var(--pv-text);
	font: inherit;
	font-size: 16px; /* 16px keeps iOS from zooming the page on focus. */
	min-width: 0;
	outline: none;
	width: 100%;
}

.pv-search__results {
	padding: 8px 12px 24px;
}

.pv-search__group {
	margin: 0 0 22px;
}

.pv-search__group:last-of-type {
	margin-bottom: 0;
}

.pv-search__group-title {
	color: var(--pv-neutral-300);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.13em;
	margin: 0 0 8px;
	padding: 0 8px;
	text-transform: uppercase;
}

.pv-search__row {
	align-items: center;
	border-radius: 10px;
	color: inherit;
	display: flex;
	gap: 12px;
	padding: 9px 8px;
	text-decoration: none;
}

.pv-search__row:hover,
.pv-search__row:focus-visible {
	background: var(--pv-surface-muted);
}

.pv-search__row--article {
	align-items: flex-start;
}

.pv-search__thumb {
	background: var(--pv-surface-muted);
	border-radius: 8px;
	flex: none;
	height: 46px;
	object-fit: cover;
	width: 46px;
}

.pv-search__thumb--wide {
	height: 48px;
	width: 68px;
}

.pv-search__row-text {
	min-width: 0;
}

.pv-search__row-title {
	color: var(--pv-text);
	display: block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
}

.pv-search__row-meta {
	color: var(--pv-neutral-300);
	display: block;
	font-size: 13px;
	line-height: 1.4;
	margin-top: 2px;
}

.pv-search__price {
	color: var(--pv-text);
	font-size: 13px;
	font-weight: 700;
	margin-left: auto;
	padding-left: 8px;
	text-align: right;
}

.pv-search__count {
	color: var(--pv-neutral-300);
	font-size: 13px;
	margin-left: auto;
}

/* The ingredient answer. Set apart, because it is making a different kind of
   claim than a product row: not "here is what you asked for" but "here is where
   it is". */
.pv-search__group--ingredient {
	background: var(--pv-surface-muted);
	border-radius: var(--pv-radius);
	padding: 14px 10px 8px;
}

.pv-search__explain {
	color: var(--pv-text);
	font-size: 14px;
	line-height: 1.5;
	margin: 0 0 10px;
	padding: 0 8px;
}

.pv-search__correction {
	color: var(--pv-neutral-300);
	font-size: 13px;
	margin: 0 0 14px;
	padding: 0 8px;
}

.pv-search__correction strong {
	color: var(--pv-text);
}

.pv-search__hint {
	color: var(--pv-neutral-300);
	font-size: 14px;
	margin: 0;
	padding: 16px 8px;
}

.pv-search__none {
	padding: 20px 8px;
}

.pv-search__none-title {
	color: var(--pv-text);
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 4px;
}

.pv-search__none .pv-search__hint {
	padding: 0;
}

.pv-search__all {
	border-top: 1px solid var(--pv-border-default);
	color: var(--pv-text-primary);
	display: block;
	font-size: 14px;
	font-weight: 700;
	margin-top: 18px;
	padding: 16px 8px 0;
	text-align: center;
	text-decoration: none;
}

.pv-search__all:hover {
	text-decoration: underline;
}

/* Popular searches, offered before anything has been typed. */
.pv-search__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 8px;
}

.pv-search__chip {
	background: none;
	border: 1.5px solid var(--pv-border-default);
	border-radius: var(--pv-radius-full);
	color: var(--pv-text);
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	padding: 8px 16px;
	transition: border-color 150ms ease;
}

.pv-search__chip:hover,
.pv-search__chip:focus-visible {
	border-color: var(--pv-text-primary);
}

/* The circled arrow from the article cards, inside the ingredient panels only.
   Solid by default here, as on the cards: there is at most one or two per
   panel, so the weight reads as an invitation rather than as clutter, and the
   rows it marks need the invitation most — they look like a specification
   until something says they are a way through. */
.pv-search__go {
	align-items: center;
	background: var(--pv-text);
	border: 1.5px solid var(--pv-text);
	border-radius: 50%;
	color: var(--pv-text-inverse, #fff);
	display: flex;
	flex: none;
	height: 30px;
	justify-content: center;
	/* Pushed to the row's edge so the arrows line up down the panel rather than
	   trailing whatever length the amount happens to be. */
	margin-left: auto;
	transition: background 150ms ease, border-color 150ms ease;
	width: 30px;
}

.pv-search__row:hover .pv-search__go,
.pv-search__row:focus-visible .pv-search__go {
	background: var(--pv-brand-purple, #493b6b);
	border-color: var(--pv-brand-purple, #493b6b);
}

.pv-search__price,
.pv-search__count {
	margin-left: auto;
}
