/* DTC Live Search 2.1 - Supplement Supply look: black / orange, Outfit, pill shapes, product-grid cards. */

.dtc-search-wrapper,
.dtc-search-panel {
	--dtc-white: #fff;
	--dtc-black: #0d0f12;
	--dtc-orange: #ff6b00;
	--dtc-line: #e5e7eb;
	--dtc-tile: #f4f5f7;
	--dtc-muted: #6b7280;
	--dtc-font: 'Outfit', 'Helvetica Neue', Arial, sans-serif;
	font-family: var(--dtc-font);
	box-sizing: border-box;
}
.dtc-search-wrapper { position: relative; display: inline-flex; }

.dtc-search-wrapper *,
.dtc-search-wrapper *::before,
.dtc-search-wrapper *::after,
.dtc-search-panel *,
.dtc-search-panel *::before,
.dtc-search-panel *::after { box-sizing: inherit; }

.dtc-sr-only {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---- Header icon (desktop) ---- */

.dtc-search-trigger-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	line-height: 0;
	background: transparent !important;
	border: none !important;
	color: var(--dtc-black);
	cursor: pointer;
	transition: color .15s ease;
}
.dtc-search-trigger-btn svg { display: block; width: 20px; height: 20px; }
.dtc-search-trigger-btn:hover,
.dtc-search-trigger-btn:focus-visible { background: transparent !important; color: var(--dtc-orange) !important; }

/* ---- Header search field (phones): looks like a search bar, opens the panel ---- */

.dtc-search-wrapper--field { display: flex; width: 100%; }
.dtc-search-field {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 40px;
	padding: 0 16px !important;
	background: #fff !important;
	border: 1px solid #e6e6e6 !important;
	border-radius: 999px !important;
	font-family: var(--dtc-font, 'Outfit', sans-serif);
	font-size: 14px;
	font-weight: 400;
	color: rgba(17, 17, 17, .55) !important;
	text-align: left;
	cursor: text;
}
.dtc-search-field svg { flex: 0 0 auto; color: #111; opacity: .55; }
.dtc-search-field span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dtc-search-field:hover,
.dtc-search-field:focus-visible { border-color: var(--dtc-orange, #ff6b00) !important; color: rgba(17, 17, 17, .7) !important; background: #fff !important; }

/* ---- Backdrop (desktop) + panel ---- */

.dtc-search-backdrop {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	top: 0;
	background: rgba(13, 15, 18, .45);
	z-index: 999995;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
}
.dtc-search-backdrop.is-open { opacity: 1; pointer-events: auto; }

.dtc-search-panel {
	position: fixed;
	top: var(--dtc-top, 0px);
	left: 0; right: 0;
	max-height: calc(100vh - var(--dtc-top, 0px));
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 22px 24px 28px;
	background: var(--dtc-white);
	border-radius: 0 0 28px 28px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
	z-index: 999996;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-8px);
	transition: opacity .18s ease, transform .18s ease;
}
/* Closed = transparent + inert (set from JS): not focusable, ignored by screen readers. No visibility toggle, so the
   input can take focus the instant it opens (iOS needs that inside the tap). */
.dtc-search-panel.is-open { opacity: 1; pointer-events: auto; transform: none; }

.dtc-search-center-col {
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1 1 auto;
}

.dtc-search-form { margin: 0; flex: 0 0 auto; }
.dtc-search-row { display: flex; align-items: center; gap: 14px; }

.dtc-search-bar {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 14px;
	height: 58px;
	padding: 0 26px;
	background: var(--dtc-white);
	border: 2px solid var(--dtc-black);
	border-radius: 999px;
	transition: border-color .15s ease, box-shadow .15s ease;
	cursor: text;
}
.dtc-search-panel:focus-within .dtc-search-bar { border-color: var(--dtc-orange); box-shadow: 0 0 0 4px rgba(255, 107, 0, .12); }
.dtc-search-bar-icon { flex: 0 0 auto; color: var(--dtc-muted); }

.dtc-search-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	padding: 0 !important;
	margin: 0;
	font-family: var(--dtc-font);
	font-size: 17px;
	line-height: 1.4;
	color: var(--dtc-black);
}
.dtc-search-input::placeholder { color: var(--dtc-muted); }

.dtc-search-close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px; height: 46px;
	padding: 0 !important;
	background: var(--dtc-tile) !important;
	border: none !important;
	border-radius: 50% !important;
	color: var(--dtc-black) !important;
	cursor: pointer;
	font-family: var(--dtc-font);
	transition: background-color .15s ease, color .15s ease;
}
.dtc-search-close:hover,
.dtc-search-close:focus-visible { background: var(--dtc-orange) !important; color: #fff !important; }
.dtc-close-text { display: none; }

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

.dtc-search-dropdown { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin-top: 26px; }
.dtc-search-results {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	max-height: calc(100vh - var(--dtc-top, 0px) - 230px);
	padding: 4px 4px 6px;
	margin: -4px;
}

.dtc-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 44px; align-items: start; }
.dtc-body--solo { grid-template-columns: minmax(0, 1fr); }
.dtc-side, .dtc-main { min-width: 0; }
.dtc-group + .dtc-group { margin-top: 32px; }

.dtc-label {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--dtc-muted);
}
.dtc-label--accent { color: var(--dtc-black); }
.dtc-label--accent::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dtc-orange); }
.dtc-label--row { justify-content: space-between; }
.dtc-clear {
	padding: 0 !important;
	background: transparent !important;
	border: none !important;
	font: inherit;
	letter-spacing: .02em;
	text-transform: none;
	color: var(--dtc-muted) !important;
	cursor: pointer;
	text-decoration: underline;
}

/* Category / brand list */
.dtc-links { display: flex; flex-direction: column; }
.dtc-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 0;
	border-bottom: 1px solid var(--dtc-line);
	color: var(--dtc-black) !important;
	text-decoration: none !important;
	font-size: 17px;
	font-weight: 500;
	line-height: 1.25;
}
.dtc-link-name { flex: 1 1 auto; min-width: 0; transition: color .15s ease; }
.dtc-link-count { font-size: 12px; font-weight: 500; color: var(--dtc-muted); }
.dtc-link-arrow {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px; height: 30px;
	border-radius: 50%;
	background: var(--dtc-tile);
	color: var(--dtc-black);
	transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.dtc-link-arrow svg { width: 14px; height: 14px; }
.dtc-link:hover .dtc-link-name,
.dtc-link.is-active .dtc-link-name { color: var(--dtc-orange); }
.dtc-link:hover .dtc-link-arrow,
.dtc-link.is-active .dtc-link-arrow { background: var(--dtc-orange); color: #fff; transform: translateX(2px); }

/* Recent searches */
.dtc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dtc-chip {
	padding: 8px 15px !important;
	background: var(--dtc-tile) !important;
	border: 1px solid transparent !important;
	border-radius: 999px !important;
	font-family: var(--dtc-font);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--dtc-black) !important;
	cursor: pointer;
	transition: border-color .12s ease, background-color .12s ease;
}
.dtc-chip:hover,
.dtc-chip:focus-visible { border-color: var(--dtc-orange) !important; background: #fff !important; }

/* Product cards: the site's product-grid cards, laid out for the panel */
.dtc-cards { --cepg-columns: 4; --cepg-gap-column: 16px; --cepg-gap-row: 16px; }
.dtc-cards .cepg-card { height: 100%; }
.dtc-cards .cepg-card.is-active { background: #fff; box-shadow: 0 10px 28px rgba(13, 15, 18, .1), 0 0 0 2px var(--dtc-orange); }

/* Plain fallback card (only when the product-grid plugin is missing) */
.dtc-plain { display: flex; flex-direction: column; gap: 4px; color: var(--dtc-black) !important; text-decoration: none !important; font-weight: 600; }
.dtc-plain-brand { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--dtc-muted); }
.dtc-plain-price { color: var(--dtc-orange); }
.dtc-search-panel img.dtc-search-result-thumb { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; }

.dtc-note { margin: 0 0 14px; font-size: 15px; color: var(--dtc-muted); }
.dtc-note strong { color: var(--dtc-black); }
.dtc-state { padding: 40px 0; text-align: center; color: var(--dtc-muted); font-size: 14px; }
.dtc-none { margin-bottom: 8px; }
.dtc-none-title { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.dtc-none-hint { margin: 0 0 26px; font-size: 15px; color: var(--dtc-muted); }

/* Footer: count on the left, one clear action on the right */
.dtc-foot {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 26px;
	padding-top: 22px;
	border-top: 1px solid var(--dtc-line);
}
.dtc-foot[hidden] { display: none; }
.dtc-foot-count { font-size: 14px; color: var(--dtc-muted); }
.dtc-foot-btn {
	display: inline-flex;
	align-items: center;
	gap: 16px;
	height: 54px;
	padding: 0 10px 0 30px;
	background: var(--dtc-black);
	border-radius: 999px;
	color: #fff !important;
	text-decoration: none !important;
	font-family: var(--dtc-font);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	transition: background-color .15s ease, box-shadow .15s ease;
}
.dtc-foot-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px; height: 36px;
	border-radius: 50%;
	background: var(--dtc-orange);
	color: #fff;
	transition: transform .15s ease;
}
.dtc-foot-btn:hover,
.dtc-foot-btn:focus-visible { background: #1d2127; box-shadow: 0 8px 22px rgba(13, 15, 18, .25); }
.dtc-foot-btn:hover .dtc-foot-arrow,
.dtc-foot-btn:focus-visible .dtc-foot-arrow { transform: translateX(3px); }

/* ---- Tablet ---- */
@media (max-width: 1023px) {
	.dtc-body { grid-template-columns: 210px minmax(0, 1fr); gap: 28px; }
	.dtc-cards { --cepg-columns: 3; }
}

/* ---- Phones: starts where the header search field is, full width and height below it ---- */
@media (max-width: 767px) {
	html body.dtc-search-open.dtc-search-open { overflow: hidden !important; } /* The theme forces overflow-y on body, so this must out-rank it. */

	.dtc-search-backdrop { display: none; }

	.dtc-search-panel {
		max-height: none;
		height: calc(100vh - var(--dtc-top, 0px));
		height: calc(100dvh - var(--dtc-top, 0px));
		padding: 8px 14px calc(12px + env(safe-area-inset-bottom, 0px));
		border-radius: 0;
		box-shadow: none;
		transform: translateY(10px);
	}

	.dtc-search-row { gap: 12px; }
	.dtc-search-bar { height: 46px; padding: 0 18px; border-width: 2px; }
	.dtc-search-input { font-size: 16px; } /* 16px stops iOS zooming in */
	.dtc-search-close { width: auto; height: 46px; padding: 0 2px !important; background: transparent !important; border-radius: 0 !important; color: var(--dtc-black) !important; }
	.dtc-search-close:hover, .dtc-search-close:focus-visible { background: transparent !important; color: var(--dtc-orange) !important; }
	.dtc-close-x { display: none; }
	.dtc-close-text { display: inline; font-size: 15px; font-weight: 600; }

	.dtc-search-dropdown { margin-top: 14px; }
	.dtc-search-results { max-height: none; padding: 4px; margin: -4px; }

	.dtc-body, .dtc-body--solo { display: flex; flex-direction: column; align-items: stretch; gap: 18px; }

	/* Categories: one line of pills you swipe through. Only the strip scrolls; the panel and page never do. */
	.dtc-search-panel, .dtc-search-results { overflow-x: hidden; }
	.dtc-links { flex-direction: row; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
	.dtc-links::-webkit-scrollbar { display: none; }
	.dtc-links { scroll-snap-type: x proximity; padding: 2px 2px 4px; margin: -2px; }
	.dtc-link {
		flex: 0 0 auto;
		gap: 7px;
		min-height: 36px;
		padding: 0 11px 0 15px;
		border: 1px solid #e3e5e8;
		border-radius: 999px;
		background: #fff;
		box-shadow: none;
		font-size: 13px;
		font-weight: 600;
		letter-spacing: .01em;
		white-space: nowrap;
		scroll-snap-align: start;
		transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
	}
	.dtc-link-arrow { display: inline-flex; width: 14px; height: 14px; background: none; color: var(--dtc-orange); transform: none; }
	.dtc-link-arrow svg { width: 11px; height: 11px; }
	.dtc-link:active, .dtc-link:hover { background: var(--dtc-black); border-color: var(--dtc-black); color: #fff !important; transform: scale(.98); }
	.dtc-link:active .dtc-link-name, .dtc-link:hover .dtc-link-name { color: #fff; }
	.dtc-link:active .dtc-link-arrow, .dtc-link:hover .dtc-link-arrow { background: none; color: var(--dtc-orange); transform: none; }
	.dtc-link-count { display: none; }
	.dtc-body:not(.dtc-body--home) .dtc-side .dtc-label { display: none; }
	.dtc-group + .dtc-group { margin-top: 18px; }
	.dtc-label { margin-bottom: 10px; }

	/* Two products side by side. */
	.dtc-cards { --cepg-columns: 2; --cepg-gap-column: 10px; --cepg-gap-row: 14px; }
	.dtc-cards .cepg-card { padding: 8px; }

	.dtc-foot { margin-top: 18px; padding: 16px 0 6px; flex-direction: column; align-items: stretch; gap: 8px; text-align: center; }
	.dtc-foot-btn { justify-content: space-between; width: 100%; height: 52px; }
	.dtc-foot-count { order: 2; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.dtc-search-panel, .dtc-search-backdrop, .dtc-link-arrow, .dtc-foot-arrow { transition: none; }
}
