/*
 * Container product search.
 *
 * Self-contained on purpose. There is no DreamIT theme on cdsvic.org.au, so
 * nothing here may reference the --vr-* tokens the concept demo relies on.
 * Custom properties are scoped to the block root rather than :root, so this
 * cannot leak a value into TBWA's design, and every selector is prefixed so
 * nothing generic escapes into their namespace.
 *
 * ## Every value below was measured, not guessed
 *
 * The client confirmed the eligible-containers page on uat-dit.cdsvic.org.au
 * as the design. This file reproduces it from the computed styles of that
 * page, read at 1440px and 390px in its initial, results and no-results
 * states (bin/check-parity.py holds the probe and re-runs the comparison).
 * Where a number looks odd -- a 44px page button with 32px of side padding,
 * a 1px grey border on a navy field -- it is odd on their page too, and the
 * comparison fails if it is "tidied".
 *
 * Fonts are named, not shipped. The host theme on cdsvic.org.au loads
 * Source Sans 3 and Asap Condensed; a host that does not gets the fallbacks.
 *
 * The block is either whole, or split in two by the `part` attribute. The
 * search field can sit inside a hero the page builder owns, with the
 * filters, table and pagination rendered further down the page from a second
 * instance. The section below the field is styled the same either way.
 */

.vr-product-search {
	--vr-ps-font: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
	--vr-ps-display: "Asap Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
	--vr-ps-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	--vr-ps-tracking: 0.48px;

	/* Their tokens.css, by name where it has one. */
	--vr-ps-page: #ecf0ff;      /* --color-background */
	--vr-ps-hero: #004c97;      /* --color-brand-primary-alt */
	--vr-ps-hero-fg: #fdfbff;   /* --color-primary-p9 */
	--vr-ps-hero-lede: #d6e3ff; /* --color-primary-p8 */
	--vr-ps-brand: #00468c;     /* their component's brand-blue-dark */
	--vr-ps-ink: #052e5e;       /* --color-brand-primary */
	--vr-ps-surface: #ffffff;
	--vr-ps-secondary: #f1f5f9; /* shadcn secondary / hover accent */
	--vr-ps-rule: #e5e7eb;      /* header rule, field border */
	--vr-ps-rule-soft: #ecf0ff; /* row rules */
	--vr-ps-muted: #64748b;
	--vr-ps-focus: #07255d;
	--vr-ps-glow: 0 0 12px 0 rgba(170, 199, 255, 0.4), 0 1px 2px 0 rgba(5, 46, 94, 0.25), 0 1px 3px 1px rgba(5, 46, 94, 0.25);

	--vr-ps-pill: 9999px;
	--vr-ps-radius: 24px;
	--vr-ps-hero-radius: 36px;
	--vr-ps-gap: 24px;
	--vr-ps-section-pad: 32px;

	box-sizing: border-box;
	font-family: var(--vr-ps-font);
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	letter-spacing: var(--vr-ps-tracking);
	color: var(--vr-ps-brand);
}

.vr-product-search *,
.vr-product-search *::before,
.vr-product-search *::after {
	box-sizing: inherit;
}

/* ------------------------------------------------------------------------
 * Hero, drawn only by a whole block. A split block's form sits inside a hero
 * the page builder owns.
 * --------------------------------------------------------------------- */

.vr-product-search .vr-product-search__form {
	margin: 0;
	padding: 0;
}

/* The 24px lavender frame their hero card sits in. */
.vr-product-search[data-vr-part="all"] > .vr-product-search__form {
	padding: var(--vr-ps-gap);
	background: var(--vr-ps-page);
}

.vr-product-search .vr-product-search__hero {
	padding: 48px;
	border-radius: var(--vr-ps-hero-radius);
	background: var(--vr-ps-hero);
	color: var(--vr-ps-hero-fg);
}

.vr-product-search .vr-product-search__title {
	margin: 0 0 var(--vr-ps-gap);
	max-width: 590px;
	font-family: var(--vr-ps-display);
	font-size: 64px;
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: 1.12px;
	text-transform: uppercase;
	color: var(--vr-ps-hero-fg);
}

.vr-product-search .vr-product-search__lede {
	/* 64px to the field's ring on their page: a 24px column gap, a 16px
	   collapsed margin left by the scan widget, and another 24px gap. */
	margin: 0 0 64px;
	max-width: 590px;
	font-size: 20px;
	line-height: 25px;
	letter-spacing: 0.2px;
	color: var(--vr-ps-hero-lede);
}

/* ------------------------------------------------------------------------
 * The field. A navy pill, white text, white placeholder, magnifier at the
 * end, inside a 1px near-white ring at 28px radius that their page draws
 * with a bordered wrapper 443px wide. The ring is a spread shadow in the
 * 1px margin, so the pill's box stays 441px and its top sits 1px below the
 * ring's, exactly as theirs does. The glow is focus-only on their page, so
 * it is focus-only here, and it stacks outside the ring.
 * --------------------------------------------------------------------- */

.vr-product-search .vr-product-search__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	width: 100%;
	max-width: 440px;
}

.vr-product-search .vr-product-search__field {
	position: relative;
	display: flex;
	flex: 1 1 100%;
	align-items: center;
	height: 56px;
	padding: 0 12px;
	border: 1px solid var(--vr-ps-rule);
	border-radius: var(--vr-ps-pill);
	background: var(--vr-ps-brand);
	font-weight: 600;
	color: var(--vr-ps-ink);
	overflow: hidden;
}

.vr-product-search .vr-product-search__field:focus-within {
	box-shadow: var(--vr-ps-glow);
}

.vr-product-search .vr-product-search__field-inner {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	min-width: 0;
	height: 56px;
	padding: 0 12px;
	color: #fff;
}

/*
 * The controls set both halves of their colour, or neither. A control that
 * took only the inherited foreground onto a host theme's white field would
 * be white text in a white box.
 */
.vr-product-search .vr-product-search__input {
	flex: 1 1 auto;
	width: 100%;
	height: 56px;
	min-height: 0;
	display: flex;
	margin: 0;
	padding: 12px 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	font: inherit;
	font-weight: 600;
	line-height: 24px;
	letter-spacing: inherit;
	color: #fff;
	caret-color: #fff;
	outline: none;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
}

.vr-product-search .vr-product-search__input::placeholder {
	color: #fff;
	opacity: 1;
	font-weight: 600;
}

/* WebKit draws its own clear button in a search field; theirs is a text
   field and has none. */
.vr-product-search .vr-product-search__input::-webkit-search-decoration,
.vr-product-search .vr-product-search__input::-webkit-search-cancel-button {
	display: none;
	-webkit-appearance: none;
}

/*
 * The glyph is 16px because the design's is. The button is 16px too, so the
 * measured box matches, and the hit area is a 44px square drawn by the
 * pseudo-element around it: a target that size clears WCAG 2.5.8 without
 * moving anything the parity check reads.
 */
.vr-product-search .vr-product-search__submit {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	margin: 0 0 0 8px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	font: inherit;
	line-height: 24px;
	white-space: normal;
	text-align: start;
	color: #fff;
	cursor: pointer;
}

.vr-product-search .vr-product-search__submit::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	transform: translate(-50%, -50%);
}

.vr-product-search .vr-product-search__submit-icon,
.vr-product-search .vr-product-search__magnifier {
	display: block;
	width: 16px;
	height: 16px;
}

/*
 * Scan button. Their page shows it on phones only, as a pale pill above the
 * field. Ours renders hidden and is revealed by the script where a camera
 * and a decoder actually exist, so it is also absent on a desktop, which is
 * where the parity check would otherwise see one control too many.
 */
.vr-product-search .vr-product-search__scan {
	order: -1;
	flex: 1 1 100%;
	margin: 0 0 38px;
	height: 56px;
	padding: 8px 16px;
	border: 0;
	border-radius: var(--vr-ps-pill);
	background: var(--vr-ps-secondary);
	color: var(--vr-ps-ink);
	font: inherit;
	font-weight: 600;
	line-height: 24px;
	letter-spacing: inherit;
	white-space: nowrap;
	cursor: pointer;
}

.vr-product-search .vr-product-search__scan[hidden] {
	display: none;
}

.vr-product-search .vr-product-search__scan:not([hidden]) {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
}

.vr-product-search .vr-product-search__scan-icon {
	display: block;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
}

.vr-product-search .vr-product-search__scan:hover {
	background: rgba(241, 245, 249, 0.8);
}

@media (min-width: 768px) {
	/* Hidden from the tablet breakpoint up on their page, whatever the
	   pointer. */
	.vr-product-search .vr-product-search__scan:not([hidden]) {
		display: none;
	}
}

/* Focus is restyled, never removed. Their ring: 2px, offset 2px. */
.vr-product-search :focus-visible {
	outline: 2px solid var(--vr-ps-focus);
	outline-offset: 2px;
}

/*
 * Except on the field's own input, where the wrapper carries the indication.
 *
 * The rule above is a descendant selector, so it reached the input and drew a
 * second ring inside the pill: a dark bar across the navy field on top of the
 * glow :focus-within already puts around the control.
 *
 * Focus is not removed. __field:focus-within still glows, and it is what a
 * person reads as "the field", so CONVENTIONS.md's rule that focus is
 * restyled rather than removed holds. Every other control keeps the ring.
 */
.vr-product-search .vr-product-search__input:focus-visible {
	outline: none;
}

/*
 * Except in forced colours, which suppress box-shadow outright.
 *
 * The rule above leans on the wrapper's glow to say where focus is, and that
 * glow is a shadow, so in a high-contrast theme a focused field had no
 * indicator at all -- the one setting where it matters most. The ring comes
 * back here in the system's own text colour, which is the only colour a
 * forced-colours theme will honour.
 */
@media (forced-colors: active) {
	.vr-product-search .vr-product-search__input:focus-visible {
		outline: 2px solid CanvasText;
		outline-offset: 2px;
	}
}

/* A visually hidden label, prefixed rather than borrowed. The host theme may
   not define screen-reader-text, and relying on it would silently expose the
   text if it does not. */
.vr-product-search .vr-product-search__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------------------
 * The section below the field: filters, Clear All, the card, pagination.
 * Their component paints it lavender with 32px of padding and 24px between
 * children.
 * --------------------------------------------------------------------- */

.vr-product-search .vr-product-search__section {
	padding: var(--vr-ps-section-pad);
	background: var(--vr-ps-page);
}

.vr-product-search .vr-product-search__section > * + * {
	margin-top: var(--vr-ps-gap);
}

/* Nothing searched yet: no region, no gap. */
.vr-product-search .vr-product-search__results:empty {
	display: none;
}

.vr-product-search .vr-product-search__filters {
	margin: 0;
}

.vr-product-search .vr-product-search__filter-row {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.vr-product-search .vr-product-search__filter {
	width: 100%;
	margin: 0;
}

@media (min-width: 640px) {
	.vr-product-search .vr-product-search__filter-row {
		flex-direction: row;
		align-items: center;
	}

	/* Each pill sits in a 200px slot and is as wide as its widest option,
	   which is how the second pill on their page runs past its slot. */
	.vr-product-search .vr-product-search__filter {
		width: 200px;
	}
}

/*
 * As wide as its widest option, like theirs, up to the width the design's
 * own Types pill reaches. Their option labels are short editorial names;
 * ours are the registry's values as supplied, some of them fifty characters,
 * and a pill sized to those runs to 464px. The closed pill normally reads
 * "All Types"; a long selected value is clipped with an ellipsis, and the
 * open list still shows every label in full.
 */
.vr-product-search .vr-product-search__select {
	display: inline-block;
	width: auto;
	max-width: 245px;
	height: 56px;
	overflow: hidden;
	text-overflow: ellipsis;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-radius: var(--vr-ps-pill);
	background-color: var(--vr-ps-brand);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-position: calc(100% - 3px) 50%;
	background-size: 16px 16px;
	background-repeat: no-repeat;
	font: inherit;
	font-weight: 600;
	line-height: 24px;
	letter-spacing: inherit;
	color: #fff;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.vr-product-search .vr-product-search__select option {
	color: var(--vr-ps-ink);
	background: var(--vr-ps-surface);
	font-weight: 400;
}

.vr-product-search .vr-product-search__filter-hint {
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 20px;
}

.vr-product-search .vr-product-search__clear-wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: var(--vr-ps-gap) 0 0;
}

/* A ghost button on their page. A link here so it works with the script
   absent, drawn the same. */
.vr-product-search .vr-product-search__clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: auto;
	padding: 4px 32px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	font: inherit;
	font-size: 12px;
	font-weight: 500;
	line-height: 16px;
	letter-spacing: inherit;
	color: var(--vr-ps-brand);
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
}

.vr-product-search .vr-product-search__clear:hover {
	background: var(--vr-ps-secondary);
	color: var(--vr-ps-ink);
	text-decoration: none;
}

/* ------------------------------------------------------------------------
 * Results. A white card with 24px corners, the table inside a scroll box so
 * a phone keeps all five columns and slides sideways.
 * --------------------------------------------------------------------- */

.vr-product-search .vr-product-search__results {
	margin: 0;
}

.vr-product-search .vr-product-search__results > * + * {
	margin-top: var(--vr-ps-gap);
}

.vr-product-search .vr-product-search__card {
	border-radius: var(--vr-ps-radius);
	background: var(--vr-ps-surface);
	overflow-x: auto;
}

.vr-product-search .vr-product-search__scroll {
	position: relative;
	width: 100%;
	overflow: auto;
}

.vr-product-search .vr-product-search__table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	border-spacing: 0;
	table-layout: auto;
	caption-side: bottom;
	background: transparent;
	font-size: 14px;
	line-height: 20px;
	color: var(--vr-ps-brand);
}

.vr-product-search .vr-product-search__head tr {
	border-bottom: 1px solid var(--vr-ps-rule);
}

.vr-product-search .vr-product-search__column {
	height: 56px;
	padding: 1px 20px;
	border: 0;
	background: transparent;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	letter-spacing: inherit;
	text-align: left;
	vertical-align: middle;
	white-space: normal;
}

/* Hello Elementor's reset draws a top rule on the first header row with a
   (0,2,3) selector, which outranks a class pair. One class more wins. */
.vr-product-search .vr-product-search__table .vr-product-search__column {
	border-top: 0;
	border-block-start: 0;
}

.vr-product-search .vr-product-search__result {
	border-bottom: 1px solid var(--vr-ps-rule-soft);
	transition: background-color 0.15s;
}

.vr-product-search .vr-product-search__result:last-child {
	border-bottom: 0;
}

.vr-product-search .vr-product-search__result:hover {
	background: rgba(241, 245, 249, 0.5);
}

.vr-product-search .vr-product-search__cell {
	min-width: 120px;
	max-width: 240px;
	padding: 16px 20px;
	border: 0;
	background: transparent;
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	letter-spacing: inherit;
	text-align: left;
	vertical-align: middle;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

@media (min-width: 768px) {
	.vr-product-search .vr-product-search__cell {
		min-width: 0;
		max-width: none;
		white-space: normal;
	}
}

.vr-product-search .vr-product-search__cell > span {
	display: block;
}

.vr-product-search .vr-product-search__name {
	font-weight: 500;
}

.vr-product-search .vr-product-search__barcode-value {
	font-family: var(--vr-ps-mono);
	font-size: 14px;
	letter-spacing: inherit;
}

/*
 * The barcode as a second line under the name, below the table's breakpoint.
 *
 * Hidden at every width that has room for the barcode column, so exactly one
 * barcode is on screen -- and in the accessibility tree -- at a time. The
 * column is hidden in the same media query, and shown by default, so the pair
 * swap places rather than both appearing.
 */
.vr-product-search .vr-product-search__cell .vr-product-search__name-barcode {
	display: none;
}

@media (max-width: 767px) {
	/*
	 * Without room for all five columns the barcode leaves its own and moves
	 * under the name, where the first view shows it without a sideways swipe
	 * that nothing on iOS signals.
	 */
	.vr-product-search .vr-product-search__column--barcode,
	.vr-product-search .vr-product-search__cell--barcode {
		display: none;
	}

	.vr-product-search .vr-product-search__cell .vr-product-search__name-barcode {
		display: block;
	}
}

.vr-product-search .vr-product-search__read-value {
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
	letter-spacing: 0.03em;
}

.vr-product-search .vr-product-search__copy {
	margin-left: 8px;
	min-height: 32px;
	padding: 0 10px;
	border: 1px solid var(--vr-ps-rule);
	border-radius: var(--vr-ps-pill);
	background: transparent;
	font: inherit;
	font-size: 13px;
	color: inherit;
	cursor: pointer;
}

/* ------------------------------------------------------------------------
 * Messages: not found, unavailable, too short. The same white card their
 * empty state uses, text centred.
 * --------------------------------------------------------------------- */

.vr-product-search .vr-product-search__message {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--vr-ps-radius);
	background: var(--vr-ps-surface);
	color: var(--vr-ps-brand);
	font-size: 16px;
	line-height: 24px;
	overflow-x: auto;
}

/* The design pads the text, not the card. */
.vr-product-search .vr-product-search__message-body {
	padding: var(--vr-ps-section-pad);
	text-align: center;
}

.vr-product-search .vr-product-search__message p {
	margin: 0 0 8px;
}

.vr-product-search .vr-product-search__message p:last-child {
	margin-bottom: 0;
}

.vr-product-search .vr-product-search__read {
	display: flex;
	align-items: baseline;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
}

.vr-product-search .vr-product-search__read-label {
	color: var(--vr-ps-muted);
	font-size: 14px;
}

.vr-product-search .vr-product-search__read-label::after {
	content: ":";
}

.vr-product-search .vr-product-search__read-value {
	font-size: 18px;
	font-weight: 600;
}

/*
 * A filter that was asked for and not recognised.
 *
 * Sits above the results rather than replacing them, because the search did
 * run and did answer; only the value was dropped. Marked by a rule rather
 * than by colour alone.
 */
.vr-product-search .vr-product-search__message--ignored {
	padding: 16px 20px;
	border-left: 4px solid var(--vr-ps-brand);
	border-radius: 12px;
	text-align: left;
}

.vr-product-search .vr-product-search__caveat {
	color: var(--vr-ps-muted);
	font-size: 15px;
}

/*
 * The empty line for an ordinary name or filter search.
 *
 * Larger and heavier than the sentences in the other panels, and grey rather
 * than the brand navy, which is what the approved production page shows. Its
 * own class rather than the message paragraph's, so the barcode panel and the
 * unavailable notice keep the size they have.
 */
.vr-product-search .vr-product-search__nothing {
	color: var(--vr-ps-muted);
	font-size: 20px;
	line-height: 28px;
	font-weight: 700;
}

/* ------------------------------------------------------------------------
 * Load More. One pill centred under the card, where the numbered pagination
 * used to sit. It keeps the page control's shape, defined below, so the row
 * under the table reads at the weight it did.
 * --------------------------------------------------------------------- */

.vr-product-search .vr-product-search__more {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: var(--vr-ps-gap) 0 0;
	padding: 0;
}

.vr-product-search .vr-product-search__page {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 44px;
	padding: 0 32px;
	border: 0;
	border-radius: var(--vr-ps-pill);
	background: transparent;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	letter-spacing: inherit;
	color: var(--vr-ps-brand);
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
}

.vr-product-search .vr-product-search__page:hover {
	background: var(--vr-ps-secondary);
	color: var(--vr-ps-ink);
	text-decoration: none;
}

.vr-product-search .vr-product-search__page--more {
	border: 1px solid var(--vr-ps-brand);
}

/*
 * While its page is in flight: dimmed, and not activatable a second time.
 * Set by the script and never rendered from PHP, so with JavaScript absent
 * the control is only ever an ordinary link.
 */
.vr-product-search .vr-product-search__page--more[aria-disabled="true"] {
	opacity: 0.5;
	pointer-events: none;
	cursor: default;
}

/* ------------------------------------------------------------------------
 * The loading indicator.
 *
 * One element with two homes: over the magnifier while a search is in
 * flight, and inside the Load More pill while a page is. Absolutely
 * positioned in both, so an idle control and a waiting one measure the same
 * -- a button that grew while it worked would shove the field beside it, and
 * a pill that widened would move under the pointer that had just pressed it.
 *
 * The magnifier is hidden rather than removed, for the same reason: taking
 * it out of flow would collapse a 16px button to nothing.
 *
 * A bordered ring rather than an animated glyph, because the reduced-motion
 * rule at the end of this file turns off every animation here and the
 * indicator still has to be visible once it has.
 * --------------------------------------------------------------------- */

.vr-product-search .vr-product-search__spinner {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	box-sizing: border-box;
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	opacity: 0.85;
	animation: vr-product-search-spin 0.7s linear infinite;
}

/* Set by the script and never rendered from PHP, so with JavaScript absent
   the element is in the markup and never seen. */
.vr-product-search [data-vr-busy] > .vr-product-search__spinner {
	display: block;
}

.vr-product-search .vr-product-search__submit[data-vr-busy] .vr-product-search__submit-icon {
	visibility: hidden;
}

/* In the pill's right-hand padding rather than over its label, which stays
   readable and stays put. */
.vr-product-search .vr-product-search__page--more > .vr-product-search__spinner {
	left: auto;
	right: 10px;
	margin-left: 0;
}

@keyframes vr-product-search-spin {
	to {
		transform: rotate(360deg);
	}
}

/* currentColor and transparent are both at the mercy of a forced palette, so
   the ring names its own system colours and keeps a visible edge. */
@media (forced-colors: active) {
	.vr-product-search .vr-product-search__spinner {
		border-color: ButtonText;
		border-top-color: Highlight;
		opacity: 1;
	}
}

/* ------------------------------------------------------------------------
 * The scanner viewport.
 *
 * Sized by this stylesheet rather than by the camera. Left to itself a video
 * element takes the stream's own aspect ratio, and a phone hands back a
 * portrait stream, so at full width the preview grew taller than the screen
 * and pushed its own instructions out of view.
 * --------------------------------------------------------------------- */

.vr-product-search .vr-product-search__scanner {
	margin: 0 0 var(--vr-ps-gap);
	max-width: 32rem;
	border: 1px solid var(--vr-ps-rule);
	border-radius: 1rem;
	overflow: hidden;
	background: #000;
	color: #fff;
}

/* Instructions above the picture, where they are read before it fills the
   screen, and where the close control is reachable without scrolling. */
.vr-product-search .vr-product-search__scanner-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.5rem 0.5rem 0.5rem 0.75rem;
}

.vr-product-search .vr-product-search__scanner-status {
	margin: 0;
	font-size: 0.875rem;
	color: #ddd;
}

.vr-product-search .vr-product-search__scanner-close {
	flex: 0 0 auto;
	min-height: 40px;
	padding: 0 0.75rem;
	border: 1px solid rgba(255, 255, 255, 0.55);
	border-radius: var(--vr-ps-pill);
	background: transparent;
	font: inherit;
	font-size: 0.875rem;
	color: inherit;
	cursor: pointer;
}

.vr-product-search .vr-product-search__viewport {
	position: relative;
	background: #000;
	line-height: 0;
}

.vr-product-search .vr-product-search__video {
	display: block;
	width: 100%;
	/* Both are needed. The ratio keeps a portrait stream from dictating the
	   height, and the cap keeps the preview from swallowing a short screen. */
	aspect-ratio: 4 / 3;
	max-height: 45vh;
	object-fit: cover;
	background: #000;
}

/*
 * A target region, so people know where to hold the barcode.
 *
 * Decorative: the whole frame is decoded, not just this area. It exists
 * because a bare rectangle of camera output gives no clue where to aim, and
 * people hold the container too far away or too close.
 */
.vr-product-search .vr-product-search__target {
	position: absolute;
	inset: 50% 12% auto;
	transform: translateY(-50%);
	aspect-ratio: 5 / 2;
	border: 2px solid rgba(255, 255, 255, 0.9);
	border-radius: 0.5rem;
	box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
	pointer-events: none;
}

.vr-product-search .vr-product-search__torch {
	position: absolute;
	right: 0.5rem;
	bottom: 0.5rem;
	min-height: 44px;
	min-width: 44px;
	padding: 0 0.75rem;
	border: 1px solid rgba(255, 255, 255, 0.7);
	border-radius: var(--vr-ps-pill);
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font: inherit;
	font-size: 0.875rem;
	line-height: 1.2;
	cursor: pointer;
}

/* ------------------------------------------------------------------------
 * Phone. Their hero runs edge to edge with rounded bottom corners; the
 * heading and field step down; the field fills the column.
 * --------------------------------------------------------------------- */

@media (max-width: 767px) {
	.vr-product-search[data-vr-part="all"] > .vr-product-search__form {
		padding: 0;
	}

	.vr-product-search .vr-product-search__hero {
		padding: 64px 24px 56px;
		border-radius: 0 0 var(--vr-ps-hero-radius) var(--vr-ps-hero-radius);
	}

	.vr-product-search .vr-product-search__title {
		font-size: 40px;
		letter-spacing: 0.64px;
	}

	.vr-product-search .vr-product-search__lede {
		margin-bottom: 22px;
	}

	.vr-product-search .vr-product-search__controls {
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vr-product-search * {
		animation: none !important;
		transition: none !important;
	}
}
