/* Quick search bar for pilot users (dp-quick-search). */
.dp-qs {
	background: var( --color-primary, #0b2d5b );
	border-top: 1px solid rgba( 255, 255, 255, 0.12 );
	padding: 8px 16px 10px;
}

.dp-qs__inner {
	margin: 0 auto;
	max-width: 960px;
	position: relative;
}

.dp-qs__form {
	align-items: center;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.15 );
	display: flex;
	height: 44px;
	margin: 0;
	padding: 0 6px 0 12px;
}

.dp-qs__form:focus-within {
	box-shadow: 0 0 0 3px var( --color-secondary, #f7a600 );
}

.dp-qs__label {
	clip: rect( 0 0 0 0 );
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.dp-qs__icon {
	fill: #555;
	flex: none;
	height: 20px;
	width: 20px;
}

.dp-qs .dp-qs__input {
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	border: 0;
	box-shadow: none;
	color: #1d1d1f;
	flex: 1;
	font-size: 1rem; /* 16px: keeps iOS from zooming in. */
	height: 100%;
	min-width: 0;
	outline: none;
	padding: 0 8px;
}

.dp-qs .dp-qs__input::-webkit-search-cancel-button {
	display: none;
}

.dp-qs__clear {
	background: none;
	border: 0;
	color: #666;
	cursor: pointer;
	font-size: 1.5rem;
	line-height: 1;
	padding: 4px 8px;
}

.dp-qs__panel {
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba( 0, 0, 0, 0.25 );
	color: #1d1d1f;
	left: 0;
	max-height: min( 70vh, 560px );
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 6px 0;
	position: absolute;
	right: 0;
	text-align: left;
	top: calc( 100% + 6px );
	z-index: 1000;
}

.dp-qs__panel[hidden] {
	display: none;
}

.dp-qs__hint {
	color: #555;
	font-size: 0.875rem;
	margin: 8px 14px;
}

.dp-qs__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 4px 14px 10px;
}

.dp-qs .dp-qs__chip {
	background: #f1f3f6;
	border: 1px solid #dde1e7;
	border-radius: 999px;
	color: #1d1d1f;
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 600;
	padding: 6px 12px;
}

.dp-qs .dp-qs__chip:hover {
	background: #e5e9ef;
}

.dp-qs__group + .dp-qs__group {
	border-top: 1px solid #eceef1;
}

.dp-qs .dp-qs__heading {
	align-items: center;
	color: #555;
	display: flex;
	font-size: 0.75rem;
	font-weight: 700;
	gap: 6px;
	letter-spacing: 0.04em;
	margin: 10px 14px 4px;
	text-transform: uppercase;
}

.dp-qs__count {
	background: #eceef1;
	border-radius: 999px;
	color: #555;
	font-size: 0.688rem;
	padding: 1px 7px;
}

.dp-qs .dp-qs__item {
	align-items: center;
	color: #1d1d1f;
	display: flex;
	gap: 10px;
	padding: 8px 14px;
	text-decoration: none;
}

.dp-qs .dp-qs__item:hover,
.dp-qs .dp-qs__item.is-active {
	background: #f1f5fb;
}

.dp-qs__badge {
	background: #eceef1;
	border-radius: 4px;
	color: #444;
	flex: none;
	font-size: 0.688rem;
	font-weight: 700;
	padding: 2px 6px;
	text-align: center;
	width: 66px;
}

.dp-qs__item--p .dp-qs__badge {
	background: #fff3d6;
	color: #7a5200;
}

.dp-qs__item--f .dp-qs__badge {
	background: #e3f4e8;
	color: #1d6b35;
}

.dp-qs__item--a .dp-qs__badge {
	background: #efe7fb;
	color: #5a2d91;
}

.dp-qs__item--c .dp-qs__badge {
	background: #e5eefc;
	color: #1d4a8f;
}

.dp-qs__text {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.dp-qs__name {
	font-size: 0.938rem;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dp-qs__name mark {
	background: none;
	color: inherit;
	font-weight: 800;
	text-decoration: underline;
	text-decoration-color: var( --color-secondary, #f7a600 );
	text-decoration-thickness: 2px;
	text-underline-offset: 2px;
}

.dp-qs__sub {
	color: #666;
	font-size: 0.813rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dp-qs__side {
	color: #1d1d1f;
	flex: none;
	font-size: 0.813rem;
	font-weight: 700;
}

.dp-qs .dp-qs__more {
	background: none;
	border: 0;
	color: #1d4a8f;
	cursor: pointer;
	font-size: 0.813rem;
	font-weight: 700;
	margin: 0 0 6px;
	padding: 6px 14px;
}

/* Phone layout parts: hidden until the phone media query below. */
.dp-qs__top {
	align-items: center;
	display: flex;
	gap: 4px;
}

.dp-qs__top .dp-qs__form {
	flex: 1;
	min-width: 0;
}

.dp-qs .dp-qs__back,
.dp-qs-tabs,
.dp-qs-search,
.dp-qs-wordmark-link,
.dp-qs-burger {
	display: none;
}

/* New layout. Phones and tablets (any touch screen up to 1366px, so tablets
   in landscape too; the theme's mobile header ends at 1199px) open the
   search full screen from an icon in the header. Desktop keeps the green
   guarantee bar and opens the search from the same icon, next to Get
   Premium: the box grows out of the icon and the X folds it back (Jose,
   2026-11-19). Same queries in quick-search.js. */
html.dp-qs-m .dp-qs-search {
	align-items: center;
	display: flex;
	flex: none;
	margin-left: auto;
	position: relative;
}

html.dp-qs-m .dp-qs-open-search {
	align-items: center;
	background: none;
	border: 0;
	color: #fff;
	cursor: pointer;
	display: flex;
	flex: none;
	height: 38px;
	justify-content: center;
	padding: 0;
	width: 38px;
}

.dp-qs-open-search__icon,
.dp-qs-open-search__icon svg {
	display: block;
	height: 24px;
	width: 24px;
}

.dp-qs .dp-qs__close {
	align-items: center;
	background: none;
	border: 0;
	color: #555;
	cursor: pointer;
	display: none;
	flex: none;
	height: 32px;
	justify-content: center;
	padding: 0;
	width: 32px;
}

/* The guarantee line that pages cached before 2026-11-19 still carry. */
.dp-qs .dp-qs__guarantee {
	display: none;
}

.dp-qs__close svg {
	display: block;
	fill: currentcolor;
	height: 20px;
	width: 20px;
}

@media ( min-width: 1367px ), ( min-width: 1200px ) and ( hover: hover ) {
	/* Left of Get Premium (or the account buttons). */
	html.dp-qs-m .dp-qs-search {
		margin-right: 12px;
		order: 1;
	}

	html.dp-qs-m .dp-qs-mainrow .site-header__utility {
		margin-left: 0;
		order: 2;
	}

	/* Folded into the icon until opened. Before the script moves it next to
	   the icon it sits hidden at the top of the header. */
	html.dp-qs-m .dp-qs {
		background: none;
		border: 0;
		padding: 0;
		position: absolute;
		right: 0;
		top: 50%;
		transform: translateY( -50% );
		transition: visibility 0s linear 0.25s;
		visibility: hidden;
		width: min( 440px, 40vw );
		z-index: 1001;
	}

	html.dp-qs-m .dp-qs.is-expanded {
		transition-delay: 0s;
		visibility: visible;
	}

	html.dp-qs-m .dp-qs__inner {
		max-width: none;
	}

	html.dp-qs-m .dp-qs__form {
		border-radius: 20px;
		clip-path: inset( 0 0 0 calc( 100% - 40px ) round 20px );
		height: 40px;
		opacity: 0;
		padding: 0 4px 0 14px;
		transition:
			clip-path 0.25s ease,
			opacity 0.2s ease;
	}

	html.dp-qs-m .dp-qs.is-expanded .dp-qs__form {
		clip-path: inset( 0 round 20px );
		opacity: 1;
	}

	html.dp-qs-m .dp-qs .dp-qs__clear {
		display: none;
	}

	html.dp-qs-m .dp-qs .dp-qs__close {
		display: flex;
	}

	html.dp-qs-m .dp-qs-open-search {
		transition: opacity 0.2s ease;
	}

	html.dp-qs-desk-open .dp-qs-open-search {
		opacity: 0;
	}

	html.dp-qs-m .dp-qs__panel {
		left: auto;
		width: min( 560px, 90vw );
	}
}

@media ( prefers-reduced-motion: reduce ) {
	html.dp-qs-m .dp-qs,
	html.dp-qs-m .dp-qs__form,
	html.dp-qs-m .dp-qs-open-search {
		transition: none;
	}
}

@media ( max-width: 1199px ), ( hover: none ) and ( max-width: 1366px ) {
	.dp-qs {
		padding: 6px 12px 8px;
	}

	.dp-qs__panel {
		max-height: calc( 100vh - 160px );
	}

	/* Pilot phone layout (Jose, 2026-11-18): the blue header row shows a
	   bigger menu button on the left, the name logo and a search icon on the
	   right; the search opens full screen from the icon. Signed in, the
	   account, My Picks and cart links move to a blue bar at the bottom. */
	html.dp-qs-m .dp-qs:not( .is-fullscreen ) {
		display: none;
	}

	/* A slim row: about 46px tall. !important: the row carries inline padding
	   from the block editor. */
	/* stylelint-disable declaration-no-important */
	html.dp-qs-m .dp-qs-mainrow {
		padding-bottom: 4px !important;
		padding-top: 4px !important;
	}
	/* stylelint-enable declaration-no-important */

	html.dp-qs-m .dp-qs-mainrow .site-header__primary {
		align-items: center;
		flex: 1;
		gap: 12px;
		min-width: 0;
	}

	html.dp-qs-m .dp-qs-mainrow .site-header__navigation {
		flex: none;
		order: -1;
	}

	html.dp-qs-m .dp-qs-mainrow .wp-block-navigation__responsive-container-open {
		padding: 4px 4px 4px 0;
	}

	/* The name logo replaces the mascot (the site logo block). */
	/* stylelint-disable declaration-no-important -- beats the block's own display. */
	html.dp-qs-has-wordmark .dp-qs-mainrow .wp-block-site-logo {
		display: none !important;
	}

	html.dp-qs-no-guarantee .dp-guarantee-bar,
	html.dp-qs-m body.logged-in .dp-guarantee-bar {
		display: none !important;
	}
	/* stylelint-enable declaration-no-important */

	html.dp-qs-has-wordmark .dp-qs-wordmark-link {
		display: flex;
		flex: 0 1 auto;
		min-width: 0;
	}

	/* Shrinks on narrow phones, where guests also have Get Premium. */
	html.dp-qs-has-wordmark .dp-qs-wordmark {
		display: block;
		height: 26px;
		max-width: min( 160px, 100% );
		object-fit: contain;
		object-position: left center;
		width: auto;
	}

	/* Signed in: the header's account, My Picks and cart links live in the
	   bottom bar. Guests keep Get Premium in the header; their My Picks and
	   cart links move to the bottom bar. Collapsed, not display:none, so the
	   cart panel they hold (position: fixed) still opens from the bottom bar. */
	html.dp-qs-m body.logged-in .dp-qs-mainrow .site-header__utility,
	html.dp-qs-m .dp-qs-mainrow .site-header__cart-actions {
		height: 0;
		overflow: hidden;
		position: absolute;
		width: 0;
	}

	html.dp-qs-m .dp-qs-mainrow .site-header__login-link {
		display: none;
	}

	html.dp-qs-tabs-on body,
	html.dp-qs-ssr body {
		/* stylelint-disable-next-line length-zero-no-unit -- calc() needs a unit. */
		padding-bottom: calc( 52px + env( safe-area-inset-bottom, 0px ) );
	}

	html.dp-qs-m .dp-qs-tabs {
		background: var( --wp--preset--color--primary-color, #1b4fc4 );
		bottom: 0;
		box-shadow: 0 -2px 8px rgba( 0, 0, 0, 0.12 );
		box-sizing: border-box;
		display: grid;
		grid-auto-columns: minmax( 0, 1fr );
		grid-auto-flow: column;
		/* stylelint-disable-next-line length-zero-no-unit -- calc() needs a unit. */
		height: calc( 52px + env( safe-area-inset-bottom, 0px ) );
		left: 0;
		padding-bottom: env( safe-area-inset-bottom, 0 );
		position: fixed;
		right: 0;
		z-index: 9990;
	}

	html.dp-qs-open .dp-qs-tabs {
		display: none;
	}

	/* HubSpot chat button above the bottom bar while the chat is closed
	   (quick-search.js toggles dp-qs-chat-lift). !important: HubSpot's own
	   rule pins it with bottom: 0 !important. */
	html.dp-qs-tabs-on.dp-qs-chat-lift #hubspot-messages-iframe-container {
		/* stylelint-disable-next-line declaration-no-important, length-zero-no-unit -- calc() needs a unit. */
		bottom: calc( 52px + env( safe-area-inset-bottom, 0px ) ) !important;
	}

	.dp-qs-tabs .dp-qs-tabs__item {
		align-items: center;
		background: none;
		border: 0;
		color: #fff;
		cursor: pointer;
		display: flex;
		flex-direction: column;
		font-family: inherit;
		font-size: 0.75rem;
		font-weight: 600;
		gap: 2px;
		justify-content: center;
		min-height: 40px;
		padding: 0;
		text-decoration: none;
	}

	.dp-qs-tabs .dp-qs-tabs__item[aria-current="page"] {
		/* The site's orange: a white line blends into a phone's white
		   home bar under the tabs. */
		box-shadow: inset 0 -3px 0 var( --color-orange, #ff5c35 );
		font-weight: 700;
	}

	.dp-qs-tabs__icon {
		display: flex;
		position: relative;
	}

	.dp-qs-tabs__icon svg {
		display: block;
		height: 22px;
		width: 22px;
	}

	.dp-qs-tabs__credits {
		font-weight: 700;
	}

	/* Guests: "Sign in" instead of the account label (both in the markup, so
	   cached pages show the right one before the script runs). */
	.dp-qs-tabs__signin,
	body:not( .logged-in ) .dp-qs-tabs__item--account .dp-qs-tabs__label {
		display: none;
	}

	body:not( .logged-in ) .dp-qs-tabs__item--account .dp-qs-tabs__signin {
		display: inline;
	}

	.dp-qs-tabs__count {
		/* The site's orange (the active tab underline). */
		background: var( --color-orange, #ff5c35 );
		border-radius: 9px;
		box-sizing: border-box;
		color: #fff;
		font-size: 0.688rem;
		font-weight: 700;
		height: 18px;
		line-height: 18px;
		min-width: 18px;
		padding: 0 4px;
		position: absolute;
		right: -10px;
		text-align: center;
		top: -6px;
	}

	.dp-qs-tabs__count[hidden] {
		display: none;
	}

	/* Tapping the search: only the search and its results, full screen. */
	html.dp-qs-open,
	html.dp-qs-open body {
		overflow: hidden;
	}

	/* html: beats the phone layout's padding on the bar above. */
	html .dp-qs.is-fullscreen {
		background: #fff;
		inset: 0;
		padding: 0;
		position: fixed;
		z-index: 100001;
	}

	.dp-qs.is-fullscreen .dp-qs__inner {
		display: flex;
		flex-direction: column;
		height: 100%;
		max-width: none;
	}

	/* Same blue as the header row and the bottom bar. */
	.dp-qs.is-fullscreen .dp-qs__top {
		background: var( --wp--preset--color--primary-color, #1b4fc4 );
		padding: 10px 12px 10px 2px;
	}

	.dp-qs.is-fullscreen .dp-qs__back {
		align-items: center;
		background: none;
		border: 0;
		cursor: pointer;
		display: flex;
		flex: none;
		height: 44px;
		justify-content: center;
		padding: 0;
		width: 44px;
	}

	.dp-qs__back svg {
		fill: #fff;
		height: 24px;
		width: 24px;
	}

	.dp-qs.is-fullscreen .dp-qs__panel {
		border-radius: 0;
		box-shadow: none;
		flex: 1;
		max-height: none;
		position: static;
	}

	.dp-qs.is-fullscreen .dp-qs__item {
		min-height: 56px;
		padding: 10px 16px;
	}

	.dp-qs.is-fullscreen .dp-qs__name {
		font-size: 1rem;
	}

	/* Three-line menu icon (quick-search.js); the core two-line one hides. */
	html.dp-qs-m .dp-qs-mainrow .dp-qs-burger {
		color: #fff;
		display: block;
	}

	/* Last in this block: the most specific svg rules (stylelint order). */
	html.dp-qs-m .dp-qs-mainrow .wp-block-navigation__responsive-container-open svg {
		display: block;
		height: 30px;
		width: 30px;
	}

	html.dp-qs-m .dp-qs-mainrow .wp-block-navigation__responsive-container-open .dp-qs-burger-core {
		display: none;
	}
}

.dp-qs .dp-qs__recent-item {
	background: none;
	border: 0;
	border-bottom: 1px solid #eceef1;
	color: #1d1d1f;
	cursor: pointer;
	display: block;
	font-size: 0.938rem;
	min-height: 44px;
	padding: 10px 14px;
	text-align: left;
	width: 100%;
}

.dp-qs .dp-qs__recent-item:hover {
	background: #f1f5fb;
}
