/**
 * Navigation chrome on every page (Plan 3 Tasks 9 and 11, design brief §7, §8 and §9): the mobile bottom bar, the
 * FiboSearch skin and the Tools mega menu. Loaded after FiboSearch's stylesheet (inc/mobile-bar.php) so equal
 * specificity wins. Tokens only.
 */

/* Mobile bottom bar (< 921 px) --------------------------------------------------------- */

/*
 * --dv-mobile-bar-h is the room the bar takes at the bottom of the viewport, safe-area inset included: 0 from 921 px,
 * where the bar is hidden. Everything that is fixed or padded at the bottom of a mobile page adds it.
 */
:root {
	--dv-mobile-bar-h: 0px;
}

.dv-mobile-bar {
	display: none;
}

@media (max-width: 920px) {
	/* Only while the bar is printed (inc/mobile-bar.php: off by default, the design header replaces it). */
	:root:has(.dv-mobile-bar) {
		--dv-mobile-bar-h: calc(56px + env(safe-area-inset-bottom, 0px));
	}

	body {
		padding-bottom: var(--dv-mobile-bar-h);
	}

	.dv-mobile-bar {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 100;
		display: block;
		box-sizing: border-box;
		height: var(--dv-mobile-bar-h);
		padding-bottom: env(safe-area-inset-bottom, 0px);
		border-top: 1px solid var(--dv-console-border);
		background-color: var(--dv-console);
		color: var(--dv-console-ink-2);
	}

	/* Astra's scroll-to-top button rides above the bar. */
	#ast-scroll-top {
		bottom: calc(var(--dv-mobile-bar-h) + var(--dv-space-4));
	}
}

.dv-mobile-bar .dv-mobile-bar__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	height: 56px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dv-mobile-bar .dv-mobile-bar__cell {
	min-width: 0;
	margin: 0;
	padding: 0;
}

/* A <a> and a <button> that look the same: the theme's button reset is undone here, item by item. */
.dv-mobile-bar .dv-mobile-bar__item {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--dv-space-1);
	box-sizing: border-box;
	width: 100%;
	height: 56px;
	margin: 0;
	padding: 0 var(--dv-space-1);
	border: 0;
	border-radius: 0;
	background-color: transparent;
	box-shadow: none;
	color: var(--dv-console-ink-2);
	font-family: var(--dv-font-body);
	font-size: var(--dv-text-label);
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: color var(--dv-dur-fast) var(--dv-ease), background-color var(--dv-dur-fast) var(--dv-ease);
}

.dv-mobile-bar .dv-mobile-bar__item svg {
	display: block;
	flex: none;
	width: 20px;
	height: 20px;
}

.dv-mobile-bar .dv-mobile-bar__item:hover,
.dv-mobile-bar .dv-mobile-bar__item:focus {
	background-color: var(--dv-console-2);
	color: var(--dv-console-ink);
}

.dv-mobile-bar .dv-mobile-bar__label {
	display: block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/*
 * The current item: the brand icon and a brand rule over it. The label stays ink: --dv-brand (#DA2224) on the console is
 * 3.8:1 in light mode, under the 4.5:1 a 12 px label needs.
 */
.dv-mobile-bar .dv-mobile-bar__item[aria-current] {
	color: var(--dv-console-ink);
}

.dv-mobile-bar .dv-mobile-bar__item[aria-current] svg {
	color: var(--dv-brand);
}

.dv-mobile-bar .dv-mobile-bar__item[aria-current]::before {
	content: "";
	position: absolute;
	top: -1px;
	left: 50%;
	width: 24px;
	height: 2px;
	transform: translateX(-50%);
	background-color: var(--dv-brand);
}

/* Inset ring: the bar sits at the screen edge, a ring drawn outside would be cut off. */
.dv-mobile-bar .dv-mobile-bar__item:focus-visible {
	outline-offset: -4px !important;
}

@media print {
	.dv-mobile-bar {
		display: none !important;
	}

	body {
		padding-bottom: 0;
	}
}

/* The tool page's sticky bar (tool.css) rides above the bottom bar below 921 px, and the page keeps room for both. */
@media (max-width: 920px) {
	body .dv-tool .dv-sticky-bar.dv-console {
		bottom: var(--dv-mobile-bar-h);
		min-height: 64px;
		padding-bottom: 0;
	}

	/* "html body": tool.css loads after this file with the same specificity otherwise. */
	html body.dv-has-sticky-bar {
		padding-bottom: calc(64px + var(--dv-mobile-bar-h));
	}

	html body.dv-has-sticky-bar #ast-scroll-top {
		bottom: calc(64px + var(--dv-mobile-bar-h) + var(--dv-space-4));
	}
}

/* FiboSearch ---------------------------------------------------------------------------- */

/*
 * Three surfaces, one look. The suggestion panel, the header's flyout form and the mobile overlay are console surfaces
 * in both modes (the panel is appended to <body>, outside any .dv-console), so they re-point the semantic tokens the
 * way .dv-console does. The classic bar on the catalog page stays paper, like the other fields of the page.
 */
.dgwt-wcas-suggestions-wrapp,
.dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-form {
	--dv-bg-surface: var(--dv-console-2);
	--dv-bg-subtle: var(--dv-console-2);
	--dv-border: var(--dv-console-border);
	--dv-ink: var(--dv-console-ink);
	--dv-ink-2: var(--dv-console-ink-2);
	--dv-ink-3: var(--dv-console-ink-2);
	--dv-link: var(--dv-console-ink);
	color-scheme: dark;
	color: var(--dv-console-ink);
}

/* The search field -------------------------------------------------------------------- */

/* Paper by default (the catalog bar): 48 px, the design system's field. */
.dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
	height: 48px;
	padding: 0 var(--dv-space-6) 0 44px;
	border: 1px solid var(--dv-border);
	border-radius: var(--dv-radius-md);
	background-color: var(--dv-bg-surface);
	box-shadow: none;
	color: var(--dv-ink);
	font-family: var(--dv-font-body);
	font-size: var(--dv-text-body);
	line-height: 1.5;
	transition: border-color var(--dv-dur-fast) var(--dv-ease);
}

.dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input:focus {
	border-color: var(--dv-ink);
	background-color: var(--dv-bg-surface);
	box-shadow: none;
}

.dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input::placeholder {
	color: var(--dv-ink-3);
	font-style: normal;
	font-weight: 400;
	opacity: 1;
}

/* The ring is the theme's focus ring (theme.css); its offset must not reach into the panel under the field. */
.dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input:focus-visible {
	outline-offset: -2px !important;
}

/* The field's open state does not square its corners: the panel is a separate surface 4 px below. */
.dgwt-wcas-open .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
	border-radius: var(--dv-radius-md);
}

/* Magnifier inside the field, the preloader and the clear button: our line icon and the muted ink. */
.dgwt-wcas-search-wrapp .dgwt-wcas-ico-magnifier,
.dgwt-wcas-search-wrapp .dgwt-wcas-ico-magnifier-handler {
	fill: none;
	stroke: currentColor;
}

.dgwt-wcas-search-wrapp .dgwt-wcas-no-submit .dgwt-wcas-ico-magnifier,
.dgwt-wcas-search-wrapp.dgwt-wcas-no-submit .dgwt-wcas-ico-magnifier {
	left: var(--dv-space-4);
	width: 20px;
	height: 20px;
	max-height: none;
	margin: auto 0;
	color: var(--dv-ink-3);
	opacity: 1;
	pointer-events: none;
}

.dgwt-wcas-search-wrapp .dgwt-wcas-loader-circular-path {
	stroke: var(--dv-ink-3);
}

.dgwt-wcas-search-wrapp .dgwt-wcas-close path,
.dgwt-wcas-search-wrapp .dgwt-wcas-voice-search path {
	fill: var(--dv-ink-3);
}

.dgwt-wcas-search-wrapp .dgwt-wcas-close:not(.dgwt-wcas-inner-preloader) {
	width: 44px;
	height: 100%;
	right: 0;
}

/* The catalog page's bar: the width of the page's search field. */
.dv-catalog-header__search--fibo .dgwt-wcas-search-wrapp {
	min-width: 0;
	max-width: none;
	margin: 0;
}

/* Header icon -------------------------------------------------------------------------- */

/* The same 40 px round, hairline button as the theme toggle and the drawer trigger (theme.css), with a 44 px hit area. */
#masthead .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon {
	display: flex;
	align-items: center;
	width: 40px;
	min-width: 0;
	max-width: none;
	margin: 0;
}

#masthead .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-icon {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 40px;
	height: 40px;
	border: 1px solid var(--dv-border);
	border-radius: var(--dv-radius-full);
	color: var(--dv-ink);
	text-decoration: none;
	transition: background-color var(--dv-dur-fast) var(--dv-ease), border-color var(--dv-dur-fast) var(--dv-ease);
}

#masthead .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-icon::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	transform: translate(-50%, -50%);
}

#masthead .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-icon:hover,
#masthead .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-icon[aria-expanded="true"] {
	border-color: var(--dv-ink);
	background-color: var(--dv-bg-subtle);
}

#masthead .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-icon .dgwt-wcas-ico-magnifier-handler {
	display: block;
	width: 20px;
	height: 20px;
	margin: 0;
	max-width: none;
}

/* While open FiboSearch fades the icon; it stays solid, the flyout is the state. */
#masthead .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon.dgwt-wcas-layout-icon-open .dgwt-wcas-search-icon {
	opacity: 1;
}

#masthead .dgwt-wcas-search-icon-arrow {
	display: none !important;
}

/* Header flyout (desktop): a console field 4 px under the icon row, as wide as the panel it opens. */
html:not(.dgwt-wcas-overlay-mobile-on) #masthead .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-form {
	top: calc(100% + var(--dv-space-3));
	min-width: 480px;
}

html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
	border-color: var(--dv-console-border);
	background-color: var(--dv-console);
	color: var(--dv-console-ink);
}

html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input:focus {
	border-color: var(--dv-console-ink);
	background-color: var(--dv-console);
}

/* The icon layout hides the in-field magnifier while open; the field keeps its own inset instead. */
.dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon.dgwt-wcas-layout-icon-open.dgwt-wcas-no-submit .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
	padding-left: 44px;
}

.dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon.dgwt-wcas-layout-icon-open:not(.dgwt-wcas-has-submit) .dgwt-wcas-sf-wrapp .dgwt-wcas-ico-magnifier {
	display: block;
}

/* Suggestion panel -------------------------------------------------------------------- */

.dgwt-wcas-suggestions-wrapp {
	margin-top: var(--dv-space-1);
	padding: var(--dv-space-2);
	border: 1px solid var(--dv-console-border);
	border-radius: var(--dv-radius-md);
	background-color: var(--dv-console);
	box-shadow: none;
	scrollbar-color: var(--dv-console-border) transparent;
}

.dgwt-wcas-suggestions-wrapp.dgwt-wcas-suggestions-wrapp--top,
.dgwt-wcas-open-pirx .dgwt-wcas-suggestions-wrapp {
	border: 1px solid var(--dv-console-border);
	padding: var(--dv-space-2);
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion,
.dgwt-wcas-has-img .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion.dgwt-wcas-suggestion-product {
	min-height: 56px;
	padding: var(--dv-space-2);
	border-bottom: 0;
	border-radius: var(--dv-radius-sm);
	color: var(--dv-console-ink);
	font-family: var(--dv-font-body);
	font-size: var(--dv-text-body-s);
	text-decoration: none;
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion:hover,
.dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion.dgwt-wcas-suggestion-selected {
	background-color: var(--dv-console-2);
}

/* Image tile: 44 px, radius 6; the product image sits whole inside it, 4 px in from the edge. */
.dgwt-wcas-suggestions-wrapp .dgwt-wcas-si {
	flex: none;
	width: 44px;
	height: 44px;
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-si img {
	width: 44px;
	height: 44px;
	max-width: none;
	max-height: none;
	padding: var(--dv-space-1);
	border: 1px solid var(--dv-console-border);
	border-radius: var(--dv-radius-sm);
	background-color: var(--dv-console-3);
	object-fit: contain;
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-content-wrapp {
	min-width: 0;
	gap: var(--dv-space-3);
	padding-left: var(--dv-space-3);
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-st {
	min-width: 0;
	color: var(--dv-console-ink);
}

/* Name: Bricolage 600, 15 px. */
.dgwt-wcas-suggestions-wrapp .dgwt-wcas-st-title {
	display: block;
	overflow: hidden;
	color: var(--dv-console-ink);
	font-family: var(--dv-font-display);
	font-size: 15px; /* Brief §9: the name is 15 px; no token sits between body-s and body. */
	font-weight: 600;
	line-height: 1.3;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion strong {
	font-weight: 700;
}

/* One line of description, muted. */
.dgwt-wcas-suggestions-wrapp .dgwt-wcas-sd {
	overflow: hidden;
	margin-top: 2px;
	color: var(--dv-console-ink-2);
	font-size: var(--dv-text-label);
	line-height: 1.4;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-sd strong {
	color: var(--dv-console-ink);
	font-weight: 500;
}

/* Price: Geist Mono, tabular, right-aligned. */
.dgwt-wcas-suggestions-wrapp .dgwt-wcas-meta {
	flex: none;
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-sp {
	padding-left: 0;
	color: var(--dv-console-ink);
	font-family: var(--dv-font-mono);
	font-size: var(--dv-text-body-s);
	font-variant-numeric: tabular-nums;
	font-weight: 500;
	text-align: right;
	white-space: nowrap;
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-sp del {
	color: var(--dv-console-ink-2);
	opacity: 1;
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-sp ins {
	text-decoration: none;
}

/* Group headings (categories): mono eyebrow. */
.dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion.dgwt-wcas-suggestion-headline,
.dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion.dgwt-wcas-suggestion-headline-v2 {
	min-height: 0;
	margin: var(--dv-space-2) 0 0;
	padding: var(--dv-space-2) var(--dv-space-2) var(--dv-space-1);
	color: var(--dv-console-ink-2);
	font-family: var(--dv-font-mono);
	font-size: var(--dv-text-label);
	font-weight: 500;
	letter-spacing: var(--dv-tracking-eyebrow);
	text-transform: uppercase;
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-headline .dgwt-wcas-st,
.dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-headline-v2 .dgwt-wcas-st {
	margin: 0;
	padding: 0;
	color: var(--dv-console-ink-2);
	font-size: var(--dv-text-label);
}

/* Category rows: FiboSearch Pro marks them .dgwt-wcas-suggestion-tax (plus -tax-<taxonomy> or -cat). A name
   only, no tile or price, so the row is one line tall. */
.dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion.dgwt-wcas-suggestion-tax {
	min-height: 44px;
	align-items: center;
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-tax .dgwt-wcas-st {
	font-family: var(--dv-font-body);
	font-size: var(--dv-text-body-s);
	font-weight: 500;
}

/* "See all results": a full-width row under a hairline. */
.dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion.dgwt-wcas-suggestion-more {
	justify-content: center;
	min-height: 44px;
	margin-top: var(--dv-space-1);
	border-top: 1px solid var(--dv-console-border);
	border-radius: 0 0 var(--dv-radius-sm) var(--dv-radius-sm);
	color: var(--dv-console-ink);
	font-weight: 500;
	text-transform: none;
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-more .dgwt-wcas-st-more {
	color: var(--dv-console-ink);
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-st-more-total {
	color: var(--dv-console-ink-2);
	font-family: var(--dv-font-mono);
	font-variant-numeric: tabular-nums;
}

/* No results. */
.dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-nores {
	padding: var(--dv-space-4);
	color: var(--dv-console-ink-2);
	font-size: var(--dv-text-body-s);
	line-height: 1.5;
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-nores p {
	margin: 0;
	font-size: var(--dv-text-body);
}

/* Search modal ------------------------------------------------------------------------- */

/*
 * The header search is FiboSearch's overlay at every width (the shortcode's mobile_overlay_breakpoint, inc/site-shell.php):
 * a card centred on a dimmed, blurred page with the field and a close button on one row and the results scrolling
 * under it; on a phone the card is the whole screen. FiboSearch builds <div .dgwt-wcas-overlay-mobile><div .dgwt-wcas-om-bar>
 * [close button][search wrapper][suggestions]</div></div> in <body>; the card follows the site theme (semantic tokens),
 * not the console. The panel's own inline position, width and height are overridden here.
 */
html.dgwt-wcas-overlay-mobile-on {
	overflow: hidden;
}

.dgwt-wcas-overlay-mobile {
	/* The suggestion rows and the field read the console tokens: inside the modal they are the theme's. */
	--dv-console: var(--dv-bg-surface);
	--dv-console-2: var(--dv-bg-subtle);
	--dv-console-3: var(--dv-bg-subtle);
	--dv-console-border: var(--dv-border);
	--dv-console-ink: var(--dv-ink);
	--dv-console-ink-2: var(--dv-ink-2);
	position: fixed;
	inset: 0;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	box-sizing: border-box;
	padding: clamp(16px, 10vh, 120px) 16px 16px;
	overflow: hidden;
	background-color: rgb(18 17 19 / 48%);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	animation: dv-search-fade var(--dv-dur-fast) var(--dv-ease);
}

.dgwt-wcas-overlay-mobile .dgwt-wcas-om-bar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-content: start;
	align-items: center;
	column-gap: var(--dv-space-2);
	box-sizing: border-box;
	width: min(100%, 780px);
	height: auto;
	max-height: 100%;
	padding: var(--dv-space-4);
	border: 1px solid var(--dv-border);
	border-radius: 20px;
	background-color: var(--dv-bg-surface);
	color: var(--dv-ink);
	box-shadow: 0 32px 80px rgb(18 17 19 / 30%);
	animation: dv-search-in var(--dv-dur) var(--dv-ease);
}

/* The field, left; the close button, right. FiboSearch prints the button first, the grid reorders them. */
.dgwt-wcas-overlay-mobile .dgwt-wcas-om-bar .dgwt-wcas-search-wrapp-mobile {
	grid-column: 1;
	grid-row: 1;
	width: auto;
	min-width: 0;
	max-width: none;
	margin: 0;
}

.dgwt-wcas-om-bar button.dgwt-wcas-om-return,
.dgwt-wcas-om-bar button.dgwt-wcas-om-return:hover,
.dgwt-wcas-om-bar button.dgwt-wcas-om-return:focus,
.dgwt-wcas-om-bar button.dgwt-wcas-om-return:active {
	grid-column: 2;
	grid-row: 1;
	position: relative;
	display: block;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--dv-border);
	border-radius: var(--dv-radius-full);
	background-color: transparent;
	color: var(--dv-ink);
	cursor: pointer;
	transition: background-color var(--dv-dur-fast) var(--dv-ease), border-color var(--dv-dur-fast) var(--dv-ease);
}

.dgwt-wcas-om-bar button.dgwt-wcas-om-return:hover,
.dgwt-wcas-om-bar button.dgwt-wcas-om-return:focus-visible {
	border-color: var(--dv-ink);
	background-color: var(--dv-bg-subtle);
}

.dgwt-wcas-om-bar .dgwt-wcas-om-return svg {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	transform: translate(-50%, -50%);
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

/* The field: a soft pill with the magnifier inside, in the theme's colours. */
.dgwt-wcas-overlay-mobile-on .dgwt-wcas-search-wrapp-mobile input[type="search"].dgwt-wcas-search-input,
.dgwt-wcas-overlay-mobile-on .dgwt-wcas-search-wrapp-mobile input[type="search"].dgwt-wcas-search-input:focus {
	height: 48px !important;
	padding-left: 46px;
	border: 1px solid var(--dv-border);
	border-radius: var(--dv-radius-full);
	background-color: var(--dv-bg-subtle);
	color: var(--dv-ink);
	font-size: 16px; /* 16 px stops iOS zooming into the field */
	box-shadow: none;
}

.dgwt-wcas-overlay-mobile-on .dgwt-wcas-search-wrapp-mobile input[type="search"].dgwt-wcas-search-input:focus {
	border-color: var(--dv-ink);
	background-color: var(--dv-bg-surface);
}

.dgwt-wcas-overlay-mobile .dgwt-wcas-search-wrapp-mobile .dgwt-wcas-ico-magnifier {
	display: block;
}

/* The results: under the field, inside the card, scrolling on their own. */
.dgwt-wcas-overlay-mobile-on .dgwt-wcas-overlay-mobile .dgwt-wcas-suggestions-wrapp,
html.dgwt-wcas-overlay-mobile-on.dgwt-wcas-is-ios .dgwt-wcas-overlay-mobile .dgwt-wcas-suggestions-wrapp {
	grid-column: 1 / -1;
	grid-row: 2;
	position: static !important;
	top: auto !important;
	left: auto !important;
	width: auto !important;
	height: auto !important;
	max-height: min(560px, calc(100dvh - 240px)) !important;
	margin: var(--dv-space-3) 0 0;
	padding: var(--dv-space-3) 0 0;
	overflow-y: auto;
	border: 0;
	border-top: 1px solid var(--dv-border);
	border-radius: 0;
	background-color: transparent;
	color: var(--dv-ink);
	scrollbar-color: var(--dv-border) transparent;
	overscroll-behavior: contain;
}

/* The list is in the card now, so its rows take the card's colours. */
.dgwt-wcas-overlay-mobile .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion:hover,
.dgwt-wcas-overlay-mobile .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion.dgwt-wcas-suggestion-selected {
	background-color: var(--dv-bg-subtle);
}

/* Group headings: a hairline in the card's border colour, not FiboSearch's ink. */
.dgwt-wcas-overlay-mobile .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-headline,
.dgwt-wcas-overlay-mobile .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-headline-v2,
.dgwt-wcas-overlay-mobile .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-headline .dgwt-wcas-st,
.dgwt-wcas-overlay-mobile .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-headline-v2 .dgwt-wcas-st {
	border-color: var(--dv-border);
}

/* "See all results" stays at the foot of the card while the list scrolls, as a "Search for ..." row. */
.dgwt-wcas-overlay-mobile .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion.dgwt-wcas-suggestion-more {
	position: sticky;
	bottom: 0;
	justify-content: space-between;
	padding: 0 var(--dv-space-3);
	background-color: var(--dv-bg-surface);
}

/* A phone: the card is the screen. */
@media (max-width: 640px) {
	.dgwt-wcas-overlay-mobile {
		padding: 0;
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}

	.dgwt-wcas-overlay-mobile .dgwt-wcas-om-bar {
		width: 100%;
		height: 100%;
		max-height: none;
		padding: var(--dv-space-3);
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.dgwt-wcas-overlay-mobile-on .dgwt-wcas-overlay-mobile .dgwt-wcas-suggestions-wrapp,
	html.dgwt-wcas-overlay-mobile-on.dgwt-wcas-is-ios .dgwt-wcas-overlay-mobile .dgwt-wcas-suggestions-wrapp {
		max-height: calc(100dvh - 120px) !important;
		min-height: 0;
		padding-bottom: calc(var(--dv-space-2) + env(safe-area-inset-bottom, 0px));
	}
}

@keyframes dv-search-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes dv-search-in {
	from { opacity: 0; transform: translateY(-10px) scale(.985); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.dgwt-wcas-overlay-mobile,
	.dgwt-wcas-overlay-mobile .dgwt-wcas-om-bar {
		animation: none;
	}
}

/* Currency control (design brief §9) ---------------------------------------------------- */

/*
 * [dv_currency_toggle]: <div class="dv-seg" role="group" aria-label="Currency"> with one link per currency. 32 px high, mono labels,
 * the active one (aria-current="true") filled with the ink and an inverted label. The colours are semantic tokens, so the
 * control is ink on paper and console ink on a .dv-console surface without a variant. Each link is 44 px tall for a
 * finger: the pseudo-element extends the hit area above and below the 26 px segment.
 */
.dv-seg {
	display: inline-flex;
	flex: none;
	align-items: stretch;
	box-sizing: border-box;
	height: 32px;
	margin: 0;
	padding: 2px;
	border: 1px solid var(--dv-border);
	border-radius: var(--dv-radius-full);
	background-color: var(--dv-bg-surface);
	vertical-align: middle;
}

.dv-seg .dv-seg__item {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 44px;
	margin: 0;
	padding: 0 var(--dv-space-3);
	border-radius: var(--dv-radius-full);
	color: var(--dv-ink-2);
	font-family: var(--dv-font-mono);
	font-size: var(--dv-text-label);
	font-weight: 500;
	letter-spacing: .02em;
	line-height: 1;
	text-decoration: none;
	transition: background-color var(--dv-dur-fast) var(--dv-ease), color var(--dv-dur-fast) var(--dv-ease);
}

.dv-seg .dv-seg__item::before {
	position: absolute;
	top: -9px;
	right: 0;
	bottom: -9px;
	left: 0;
	content: "";
}

.dv-seg .dv-seg__item:hover {
	color: var(--dv-ink);
}

.dv-seg .dv-seg__item[aria-current="true"] {
	background-color: var(--dv-ink);
	color: var(--dv-bg-canvas);
}

.dv-seg .dv-seg__item:focus-visible {
	outline: 2px solid var(--dv-link);
	outline-offset: 2px;
}

/*
 * In the header the control sits beside the theme toggle, in one wrapper (Astra's HTML 1 element, config/README.md):
 * wpautop would otherwise wrap the two shortcodes in a <p>, and a block element cannot live inside one.
 */
.dv-header-prefs {
	display: flex;
	align-items: center;
	gap: var(--dv-space-3);
}

/* The header has no room for it on a phone; the footer's preferences row keeps the control. */
@media (max-width: 599px) {
	#masthead .dv-seg {
		display: none;
	}
}

/* Tools mega menu (design brief §7) ----------------------------------------------------- */

/*
 * inc/mega-menu.php and assets/js/menu.js. From 922 px the Tools item is its link, a chevron button and the panel
 * #dv-mega: a console surface hung 8 px under the header bar, as wide as the header's content (logo to "Client area"),
 * in both colour modes.
 *
 * The panel's containing block is Astra's header container (.site-primary-header-wrap, 72 px tall): it sits inside the
 * header bar, which Astra Pro fixes to the top while stuck, so the panel stays attached in both states. The item and
 * the menu list, which Astra positions, step aside. Stacking: the header (#masthead, z-index 99) is above the page,
 * FiboSearch's panels (appended to <body>) above it.
 *
 * Three literal lengths in this section are deliberate exceptions to "tokens only", each matching something outside
 * the token scale: 20px is Astra's header container gutter (theme.css uses it for the footer too), 120ms is the
 * brief's hover-intent delay that the reveal matches (--dv-dur-fast is 150ms), and 6px is the menu link padding that
 * keeps the header on one row below 1100 px (the scale steps from 4 to 8).
 */
@media (min-width: 922px) {
	#ast-desktop-header .site-primary-header-wrap {
		position: relative;
	}

	#masthead .ast-builder-menu-1 .main-header-menu,
	#masthead .ast-builder-menu-1 .main-header-menu > .dv-mega-item {
		position: static;
	}

	/* Astra stacks a menu item's children (flex column, for its submenus): the link and the button sit in a row. */
	#masthead .ast-builder-menu-1 .main-header-menu > .dv-mega-item {
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	/* The chevron sits right after the word: the link gives up its right padding to the button. */
	#masthead .ast-builder-menu-1 .main-header-menu > .dv-mega-item > .menu-link {
		padding-right: var(--dv-space-1);
	}
}

/*
 * Below 1100 px the menu has little room between the logo and the utilities (theme.css): the button narrows to 24 px
 * (the WCAG minimum target; 44 px tall), the link drops its right padding, and the menu's links take 6 px a side
 * instead of 8, so the button costs the row nothing.
 */
@media (min-width: 922px) and (max-width: 1099px) {
	#masthead .ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link {
		padding-right: 6px;
		padding-left: 6px;
	}

	#masthead .ast-builder-menu-1 .main-header-menu > .dv-mega-item > .menu-link {
		padding-right: 0;
	}

	:is(#masthead, #dv-header) .dv-mega-item .dv-mega__toggle,
	:is(#masthead, #dv-header) .dv-mega-item .dv-mega__toggle:hover,
	:is(#masthead, #dv-header) .dv-mega-item .dv-mega__toggle:focus {
		width: var(--dv-space-5);
	}
}

#masthead .ast-builder-menu-1 .main-header-menu > .dv-mega-item--open > .menu-link {
	color: var(--dv-ink);
}

/* The disclosure button: a 16 px chevron in a 32 x 44 px target, muted like the menu, ink when hovered or open. */
:is(#masthead, #dv-header) .dv-mega-item .dv-mega__toggle,
:is(#masthead, #dv-header) .dv-mega-item .dv-mega__toggle:hover,
:is(#masthead, #dv-header) .dv-mega-item .dv-mega__toggle:focus {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 32px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--dv-radius-sm);
	background-color: transparent;
	box-shadow: none;
	color: var(--dv-ink-2);
	line-height: 1;
	cursor: pointer;
	transition: color var(--dv-dur-fast) var(--dv-ease);
}

:is(#masthead, #dv-header) .dv-mega-item .dv-mega__toggle:hover,
:is(#masthead, #dv-header) .dv-mega-item .dv-mega__toggle[aria-expanded="true"],
:is(#masthead, #dv-header) .dv-mega-item:hover .dv-mega__toggle {
	color: var(--dv-ink);
}

:is(#masthead, #dv-header) .dv-mega-item .dv-mega__toggle svg {
	display: block;
	width: 16px;
	height: 16px;
	transition: transform var(--dv-dur-fast) var(--dv-ease);
}

:is(#masthead, #dv-header) .dv-mega-item .dv-mega__toggle[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

/*
 * The panel. .dv-console gives the hairline, radius and the console tokens; the surface is one step up the console
 * scale (console-2), so the panel stands off the console panels it opens over (the catalog shell, the cards) in both
 * modes without a shadow. The padding and the scroll live on the grid inside, so the panel itself never clips: its
 * ::before bridges the 8 px gap to the bar for a pointer on its way down. Hidden (the hidden attribute) until menu.js
 * opens it; the open class fades it in over 120 ms (brief §7: hover intent is 120 ms, the reveal matches it).
 */
:is(#masthead, #dv-header) .dv-mega.dv-console {
	--dv-bg-canvas: var(--dv-console-2);
	--dv-bg-subtle: var(--dv-console-3);
	position: absolute;
	top: calc(100% + var(--dv-space-2));
	right: 20px;
	left: 20px;
	z-index: 10;
	box-sizing: border-box;
	padding: 0;
	background-color: var(--dv-console-2);
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 120ms var(--dv-ease), transform 120ms var(--dv-ease);
	font-family: var(--dv-font-body);
	font-size: var(--dv-text-body-s);
	line-height: 1.4;
	text-align: left;
	white-space: normal;
}

:is(#masthead, #dv-header) .dv-mega.dv-console.dv-mega--open {
	opacity: 1;
	transform: none;
}

/* While it fades out (and before the fade in starts) it is not a target: no click lands on it, no hover restarts. */
:is(#masthead, #dv-header) .dv-mega:not(.dv-mega--open) {
	pointer-events: none;
}

:is(#masthead, #dv-header) .dv-mega::before {
	content: "";
	position: absolute;
	right: 0;
	bottom: 100%;
	left: 0;
	height: var(--dv-space-2);
}

/* Three columns from 1200 px (2 : 1 : 1.2), hairlines between them; scrolls inside when the window is short. */
.dv-mega .dv-mega__grid {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.2fr);
	box-sizing: border-box;
	max-height: calc(100vh - 72px - var(--dv-space-2) - var(--dv-space-4)); /* The bar (72 px), the gap, a margin. */
	padding: var(--dv-space-5);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-color: var(--dv-console-border) transparent;
}

.dv-mega .dv-mega__col {
	min-width: 0;
	padding: 0 var(--dv-space-5);
	border-left: 1px solid var(--dv-console-border);
}

.dv-mega .dv-mega__col:first-child {
	padding-left: 0;
	border-left: 0;
}

.dv-mega .dv-mega__col:last-child {
	padding-right: 0;
}

/* Column headings: mono-style eyebrows, inset like the row text under them. */
.dv-mega .dv-mega__title.dv-eyebrow {
	margin: 0 0 var(--dv-space-2);
	padding: 0 var(--dv-space-3);
	color: var(--dv-console-ink-2);
	font-family: var(--dv-font-mono);
	font-size: var(--dv-text-label);
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: var(--dv-tracking-eyebrow);
}

.dv-mega .dv-mega__col--spotlight .dv-mega__title.dv-eyebrow {
	padding: 0;
}

.dv-mega .dv-mega__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dv-mega .dv-mega__list > li {
	margin: 0;
	padding: 0;
	break-inside: avoid;
}

/* The Categories column ends with the "All tools" row, on the panel's bottom line (level with the spotlight card). */
.dv-mega .dv-mega__col--cats {
	display: flex;
	flex-direction: column;
}

/* A total row: a hairline over the column's width, the name left and the count at the right edge, as in the rows above. */
.dv-mega .dv-mega__all {
	margin-top: auto;
	border-top: 1px solid var(--dv-console-border);
	border-radius: 0;
}

/* Categories: two sub-columns, filled down (8 then 7). */
.dv-mega .dv-mega__list--cats {
	margin-bottom: var(--dv-space-3);
	column-count: 2;
	column-gap: var(--dv-space-2);
}

/* A 44 px row: icon (when the category has one), name, count; the row fills (console-3) on hover. */
.dv-mega .dv-mega__link {
	display: flex;
	align-items: center;
	gap: var(--dv-space-3);
	box-sizing: border-box;
	min-height: 44px;
	padding: var(--dv-space-2) var(--dv-space-3);
	border-radius: var(--dv-radius-sm);
	color: var(--dv-console-ink);
	font-family: var(--dv-font-body);
	font-size: var(--dv-text-body-s);
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color var(--dv-dur-fast) var(--dv-ease);
}

.dv-mega .dv-mega__link:hover,
.dv-mega .dv-mega__link:focus {
	background-color: var(--dv-console-3);
	color: var(--dv-console-ink);
	text-decoration: none;
}

.dv-mega .dv-mega__link:focus-visible {
	outline-offset: -2px !important;
}

.dv-mega .dv-mega__icon {
	display: grid;
	flex: none;
	place-items: center;
	width: 20px;
	height: 20px;
	color: var(--dv-console-ink-2);
}

.dv-mega .dv-mega__icon svg {
	display: block;
	width: 20px;
	height: 20px;
}

.dv-mega .dv-mega__name {
	flex: 1;
	min-width: 0;
}

.dv-mega .dv-mega__count {
	flex: none;
	color: var(--dv-console-ink-2);
	font-size: var(--dv-text-label);
	font-weight: 400;
}

.dv-mega .dv-mega__link:hover .dv-mega__count {
	color: var(--dv-console-ink);
}

/* Spotlight: one ToolCard (card.css), the column's width (the class repeats to beat card.css's grid rule). */
.dv-mega .products.dv-grid.dv-grid.dv-grid.dv-grid--1 {
	grid-template-columns: minmax(0, 1fr);
}

/*
 * 922 to 1199 px: two columns. Categories take the first row (three sub-columns, five rows), Browse by and Spotlight
 * share the second; the card keeps a catalog card's size instead of stretching to half the panel.
 */
@media (max-width: 1199px) {
	.dv-mega .dv-mega__grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		row-gap: var(--dv-space-5);
	}

	.dv-mega .dv-mega__col--cats {
		grid-column: 1 / -1;
		padding: 0 0 var(--dv-space-3);
	}

	.dv-mega .dv-mega__list--cats {
		column-count: 3;
	}


	.dv-mega .dv-mega__col--cats + .dv-mega__col {
		padding-left: 0;
		border-left: 0;
	}

	.dv-mega .dv-mega__col--spotlight .dv-grid {
		max-width: 280px;
	}
}

/*
 * The drawer (below 922 px): Astra's submenu of the Tools item, the categories as quiet rows under the big menu
 * links, indented, 44 px tall, no counts.
 */
#ast-mobile-popup .ast-builder-menu-mobile .main-header-menu .dv-mega-sub {
	margin: 0;
	padding: var(--dv-space-2) 0;
	border-bottom: 1px solid var(--dv-border);
	background-color: transparent;
}

#ast-mobile-popup .ast-builder-menu-mobile .main-header-menu .dv-mega-sub > .menu-item > .menu-link {
	display: flex;
	align-items: center;
	box-sizing: border-box;
	min-height: 44px;
	padding: var(--dv-space-2) var(--dv-space-5) var(--dv-space-2) var(--dv-space-6);
	border: 0;
	background-color: transparent;
	color: var(--dv-ink-2);
	font-family: var(--dv-font-body);
	font-size: var(--dv-text-body);
	font-weight: 500;
	line-height: 1.3;
}

/*
 * Astra's submenu toggle: centred on the 61 px row of the big link (it is 48 px tall at the top of the row), ink when
 * open (Astra paints it brand red, the colour of the current page here).
 */
#ast-mobile-popup .ast-builder-menu-mobile .main-header-menu > .menu-item-has-children > .ast-menu-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	height: calc(var(--dv-space-4) * 2 + var(--dv-text-h2) * 1.2);
	color: var(--dv-ink-2);
}

#ast-mobile-popup .ast-builder-menu-mobile .main-header-menu > .ast-submenu-expanded > .ast-menu-toggle,
#ast-mobile-popup .ast-builder-menu-mobile .main-header-menu > .menu-item-has-children > .ast-menu-toggle:hover {
	color: var(--dv-ink);
}

#ast-mobile-popup .ast-builder-menu-mobile .main-header-menu > .menu-item-has-children > .ast-menu-toggle svg {
	fill: currentColor;
}

#ast-mobile-popup .ast-builder-menu-mobile .main-header-menu .dv-mega-sub > .menu-item > .menu-link:hover {
	background-color: var(--dv-bg-subtle);
	color: var(--dv-ink);
}

/* Motion ------------------------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.dv-mobile-bar .dv-mobile-bar__item,
	.dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input,
	#masthead .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-icon {
		transition: none;
	}

	.dv-seg .dv-seg__item {
		transition: none;
	}

	:is(#masthead, #dv-header) .dv-mega.dv-console,
	:is(#masthead, #dv-header) .dv-mega-item .dv-mega__toggle,
	:is(#masthead, #dv-header) .dv-mega-item .dv-mega__toggle svg,
	.dv-mega .dv-mega__link {
		transition: none;
	}

	:is(#masthead, #dv-header) .dv-mega.dv-console {
		transform: none;
	}

	.dgwt-wcas-loader-circular,
	.dgwt-wcas-loader-circular-path {
		animation-duration: 0.01ms;
		animation-iteration-count: 1;
	}
}

html[data-motion="reduce"] .dv-seg .dv-seg__item,
html[data-motion="reduce"] .dv-mobile-bar .dv-mobile-bar__item,
html[data-motion="reduce"] .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input,
html[data-motion="reduce"] #masthead .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-icon {
	transition: none;
}

html[data-motion="reduce"] :is(#masthead, #dv-header) .dv-mega.dv-console,
html[data-motion="reduce"] :is(#masthead, #dv-header) .dv-mega-item .dv-mega__toggle,
html[data-motion="reduce"] :is(#masthead, #dv-header) .dv-mega-item .dv-mega__toggle svg,
html[data-motion="reduce"] .dv-mega .dv-mega__link {
	transition: none;
}

html[data-motion="reduce"] :is(#masthead, #dv-header) .dv-mega.dv-console {
	transform: none;
}
