/* Search overlay — full-screen sheet on mobile, dropdown panel on desktop. */

.odo-search-overlay {
	position: fixed;
	inset: 0;
	z-index: 60;
	background: hsl(var(--foreground) / 0.35);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	opacity: 0;
	transition: opacity 220ms cubic-bezier(0.32, 0.72, 0, 1);
	display: flex;
	flex-direction: column;
}

.odo-search-overlay[hidden] {
	display: none;
}

.odo-search-overlay.is-open {
	opacity: 1;
}

body.odo-search-open {
	overflow: hidden;
}

.odo-search-panel {
	background: hsl(var(--background));
	display: flex;
	flex-direction: column;
	width: 100%;
	transform: translateY(-8px) scale(0.99);
	opacity: 0;
	transition: transform 260ms cubic-bezier(0.32, 0.72, 0, 1), opacity 200ms ease;
	transform-origin: top center;
}

.odo-search-overlay.is-open .odo-search-panel {
	transform: translateY(0) scale(1);
	opacity: 1;
}

/* MOBILE — full-screen sheet */
@media (max-width: 767px) {
	.odo-search-panel {
		flex: 1 1 auto;
		min-height: 100%;
	}
}

/* DESKTOP — dropdown panel anchored under the sticky header */
@media (min-width: 768px) {
	.odo-search-overlay {
		align-items: flex-start;
	}
	.odo-search-panel {
		margin: 72px auto 0;
		max-width: 680px;
		width: calc(100% - 32px);
		border-radius: 0;
		box-shadow:
			0 1px 2px hsl(var(--foreground) / 0.04),
			0 12px 24px -6px hsl(var(--foreground) / 0.08),
			0 32px 64px -12px hsl(var(--foreground) / 0.18);
		max-height: calc(100vh - 104px);
		overflow: hidden;
		border: 1px solid hsl(var(--border) / 0.6);
	}
}

.odo-search-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 14px;
	border-bottom: 1px solid hsl(var(--border) / 0.7);
}

@media (min-width: 768px) {
	.odo-search-header {
		padding: 16px 16px;
	}
}

.odo-search-input-wrap {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	background: hsl(var(--muted) / 0.65);
	border: 1px solid transparent;
	border-radius: 0;
	padding: 0 14px;
	height: 48px;
	transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.odo-search-input-wrap:focus-within {
	background: hsl(var(--background));
	border-color: hsl(var(--primary) / 0.4);
	box-shadow: 0 0 0 4px hsl(var(--primary) / 0.08);
}

.odo-search-input-wrap > svg {
	flex-shrink: 0;
	color: hsl(var(--muted-foreground));
	transition: color 160ms ease;
}

.odo-search-input-wrap:focus-within > svg {
	color: hsl(var(--primary));
}

.odo-search-input {
	flex: 1;
	border: 0;
	background: transparent;
	outline: none;
	font-size: 15px;
	font-weight: 400;
	color: hsl(var(--foreground));
	min-width: 0;
	padding: 0;
	-webkit-appearance: none;
	line-height: 1.4;
}

.odo-search-input::placeholder {
	color: hsl(var(--muted-foreground) / 0.8);
}

.odo-search-input::-webkit-search-cancel-button,
.odo-search-input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.odo-search-clear {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	border: 0;
	background: hsl(var(--muted-foreground) / 0.18);
	color: hsl(var(--background));
	cursor: pointer;
	border-radius: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	visibility: hidden;
	transition: background 140ms ease, transform 140ms ease;
}

.odo-search-clear:hover {
	background: hsl(var(--muted-foreground) / 0.32);
	transform: scale(1.06);
}

.odo-search-clear:active {
	transform: scale(0.94);
}

.odo-search-close {
	flex-shrink: 0;
	height: 40px;
	border: 0;
	background: transparent;
	color: hsl(var(--foreground));
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 0 10px;
	border-radius: 0;
	font-size: 14px;
	font-weight: 500;
	transition: background 140ms ease, color 140ms ease;
}

.odo-search-close:hover {
	background: hsl(var(--muted) / 0.8);
}

.odo-search-close:active {
	background: hsl(var(--muted));
}

@media (max-width: 767px) {
	.odo-search-close {
		width: 40px;
		padding: 0;
		justify-content: center;
	}
}

.odo-search-body {
	flex: 1;
	overflow-y: auto;
	padding: 4px 0 12px;
	-webkit-overflow-scrolling: touch;
}

/* Status block — used for "type to search" prompt + error/empty states. */
.odo-search-status {
	padding: 40px 24px 32px;
	text-align: center;
	color: hsl(var(--muted-foreground));
	font-size: 14px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	line-height: 1.5;
}

.odo-search-status[hidden],
.odo-search-results[hidden] {
	display: none;
}

.odo-search-status svg {
	width: 36px;
	height: 36px;
	color: hsl(var(--muted-foreground) / 0.6);
	margin-bottom: 4px;
}

.odo-search-status strong {
	color: hsl(var(--foreground));
	font-weight: 600;
	font-size: 15px;
}

.odo-search-results {
	display: flex;
	flex-direction: column;
	padding: 6px 6px;
}

.odo-search-section {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px 6px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: hsl(var(--muted-foreground));
}

.odo-search-section svg {
	width: 14px;
	height: 14px;
	color: hsl(var(--primary));
}

@media (min-width: 768px) {
	.odo-search-results {
		padding: 8px 8px;
	}
}

.odo-search-result {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 12px;
	text-decoration: none;
	color: hsl(var(--foreground));
	border-radius: 0;
	transition: background 140ms ease;
	position: relative;
}

.odo-search-result + .odo-search-result {
	margin-top: 2px;
}

.odo-search-result:hover,
.odo-search-result:focus-visible,
.odo-search-result.is-active {
	background: hsl(var(--muted) / 0.7);
	outline: none;
}

.odo-search-result:active {
	background: hsl(var(--muted));
}

.odo-search-result__thumb {
	width: 56px;
	height: 56px;
	flex-shrink: 0;
	border-radius: 0;
	overflow: hidden;
	background: hsl(var(--muted) / 0.5);
	border: 1px solid hsl(var(--border) / 0.5);
}

.odo-search-result__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.odo-search-result__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.odo-search-result__brand {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: hsl(var(--muted-foreground));
	line-height: 1.2;
}

.odo-search-result__title {
	font-size: 14px;
	font-weight: 500;
	color: hsl(var(--foreground));
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.odo-search-result__price {
	font-size: 13px;
	color: hsl(var(--foreground));
	margin-top: 3px;
	line-height: 1.2;
}

.odo-search-result__price del {
	color: hsl(var(--muted-foreground));
	margin-right: 6px;
	font-weight: 400;
}

.odo-search-result__price ins {
	background: transparent;
	text-decoration: none;
	color: hsl(var(--primary));
	font-weight: 600;
}

.odo-search-result__arrow {
	color: hsl(var(--muted-foreground));
	flex-shrink: 0;
	opacity: 0;
	transform: translateX(-4px);
	transition: opacity 160ms ease, transform 160ms ease;
}

.odo-search-result:hover .odo-search-result__arrow,
.odo-search-result:focus-visible .odo-search-result__arrow,
.odo-search-result.is-active .odo-search-result__arrow {
	opacity: 1;
	transform: translateX(0);
}

.odo-search-viewall {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 4px 8px 4px;
	padding: 14px;
	color: hsl(var(--primary));
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.02em;
	text-decoration: none;
	border-top: 1px solid hsl(var(--border) / 0.6);
	transition: background 140ms ease;
	border-radius: 0;
}

.odo-search-viewall:hover {
	background: hsl(var(--muted) / 0.5);
}

.odo-search-viewall svg {
	width: 14px;
	height: 14px;
	transition: transform 160ms ease;
}

.odo-search-viewall:hover svg {
	transform: translateX(2px);
}

/* Search trigger button reset */
.odo-search-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Subtle stagger on result entry — applied by JS via .is-loaded class. */
.odo-search-results.is-loaded .odo-search-result {
	animation: odoSearchFadeUp 240ms cubic-bezier(0.32, 0.72, 0, 1) both;
}

.odo-search-results.is-loaded .odo-search-result:nth-child(1) { animation-delay: 0ms; }
.odo-search-results.is-loaded .odo-search-result:nth-child(2) { animation-delay: 24ms; }
.odo-search-results.is-loaded .odo-search-result:nth-child(3) { animation-delay: 48ms; }
.odo-search-results.is-loaded .odo-search-result:nth-child(4) { animation-delay: 72ms; }
.odo-search-results.is-loaded .odo-search-result:nth-child(5) { animation-delay: 96ms; }
.odo-search-results.is-loaded .odo-search-result:nth-child(6) { animation-delay: 120ms; }
.odo-search-results.is-loaded .odo-search-result:nth-child(7) { animation-delay: 144ms; }
.odo-search-results.is-loaded .odo-search-result:nth-child(8) { animation-delay: 168ms; }

@keyframes odoSearchFadeUp {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes odoSearchSpin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.odo-search-overlay,
	.odo-search-panel,
	.odo-search-result__arrow,
	.odo-search-results.is-loaded .odo-search-result,
	.odo-search-viewall svg {
		transition: none !important;
		animation: none !important;
	}
}
