.commerce-search-drawer {
	--commerce-overlay-z-index: var(--commerce-layer-overlay);
	--commerce-overlay-translate-x: 100%;
}

.commerce-search-drawer__backdrop {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: var(--commerce-color-overlay);
}

.commerce-search-drawer__panel {
	position: absolute;
	inset: 0 0 0 auto;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 460px;
	padding: 0;
	background: var(--commerce-color-background);
	box-shadow: var(--commerce-shadow-drawer);
	overflow: hidden;
	transform: translate3d(100%, 0, 0);
	transition: transform 600ms cubic-bezier(.7, 0, .2, 1);
}
.commerce-search-drawer:is([data-state="opening"], [data-state="open"]) .commerce-search-drawer__panel { transform: translate3d(0, 0, 0); }

.commerce-search-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--_commerce-space-md);
	min-height: 3.75rem;
	padding-inline: clamp(1rem, 4vw, 2rem);
	border-bottom: 1px solid var(--commerce-color-border);
}

.commerce-search-drawer__header h2 {
	margin: 0;
	font-family: var(--commerce-font-heading);
	font-size: var(--commerce-heading-sm);
	font-weight: var(--commerce-font-weight-heading);
}

.commerce-search-drawer__header .commerce-icon-button svg {
	transition: transform 300ms var(--commerce-motion-easing-standard);
}

.commerce-search-drawer__header .commerce-icon-button:hover svg,
.commerce-search-drawer__header .commerce-icon-button:focus-visible svg {
	transform: rotate(180deg);
}

.commerce-search-drawer__form {
	display: grid;
	gap: var(--_commerce-space-xs);
	padding: clamp(1.25rem, 4vw, 2rem);
}

.commerce-search-drawer__form label {
	font-size: var(--commerce-text-sm);
	font-weight: var(--commerce-font-weight-strong);
}

.commerce-search-drawer__field {
	position: relative;
	display: flex;
	align-items: center;
}

.commerce-search-drawer__field-icon { position: absolute; left: 0.875rem; display: grid; pointer-events: none; }

.commerce-search-drawer__field input {
	min-width: 0;
	min-height: max(var(--commerce-control-standard), var(--commerce-touch-target));
	width: 100%;
	padding: 0.7rem 4.5rem 0.7rem 3rem;
	border: 1px solid var(--commerce-color-border);
	border-radius: var(--commerce-radius-control);
	color: inherit;
	background: var(--commerce-color-background);
}

.commerce-search-drawer__reset { position: absolute; right: 0.875rem; display: inline-grid; min-height: var(--commerce-touch-target); padding: 0; border: 0; color: inherit; background: transparent; text-decoration: underline; text-underline-offset: 0.2em; opacity: 0; pointer-events: none; transition: opacity 200ms var(--commerce-motion-easing-standard); }
.commerce-search-drawer__form[data-has-query] .commerce-search-drawer__reset { opacity: 1; pointer-events: auto; }
.commerce-search-drawer__reset > * { grid-area: 1 / 1; align-self: center; }
.commerce-search-drawer__loader { width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; opacity: 0; visibility: hidden; }
.commerce-search-drawer__form[data-loading] .commerce-search-drawer__reset > span:first-child { opacity: 0; }
.commerce-search-drawer__form[data-loading] .commerce-search-drawer__loader { opacity: 1; visibility: visible; animation: commerce-search-spin 700ms linear infinite; transition: opacity 150ms 100ms; }

.commerce-search-drawer__field .commerce-button {
	min-height: max(var(--commerce-control-standard), var(--commerce-touch-target));
}

.commerce-search-drawer__status {
	min-height: 1.5rem;
	padding-inline: clamp(1.25rem, 4vw, 2rem);
	color: var(--commerce-color-muted);
	font-size: var(--commerce-text-sm);
}

.commerce-search-drawer__content {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-block: 1.5rem;
}

.commerce-predictive-results {
	display: grid;
	gap: clamp(1.5rem, 4vw, 2.5rem);
	padding: 0 clamp(1.25rem, 4vw, 2rem) 2rem;
}

.commerce-predictive-results__group { display: grid; gap: 0.75rem; }
.commerce-predictive-results__group h3 { margin: 0; font-family: var(--commerce-font-heading); font-size: var(--commerce-heading-xs); }
.commerce-predictive-results__group ul { display: grid; gap: 0; padding: 0; margin: 0; list-style: none; }
.commerce-predictive-results__group--queries ul,
.commerce-predictive-results__group--collections ul,
.commerce-predictive-results__group--content ul,
.commerce-predictive-results__group--keywords ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.commerce-predictive-results__group--queries .commerce-predictive-results__item { border: 0; }
.commerce-predictive-results__group--queries .commerce-predictive-results__link,
.commerce-predictive-results__group--keywords .commerce-predictive-results__link { display: inline-flex; padding: 0; text-decoration: underline; text-underline-offset: 0.2em; }

.commerce-predictive-results__item {
	border-bottom: 1px solid var(--commerce-color-border);
}

.commerce-predictive-results__link {
	display: grid;
	grid-template-columns: 4.5rem minmax(0, 1fr);
	align-items: center;
	gap: var(--_commerce-space-md);
	padding-block: 0.875rem;
	text-decoration: none;
}

.commerce-predictive-results__link:not(:has(img)) { grid-template-columns: minmax(0, 1fr); }
.commerce-predictive-results mark { color: inherit; background: transparent; font-weight: inherit; text-decoration: underline; }

.commerce-predictive-results__link img {
	width: 4.5rem;
	height: 4.5rem;
	border-radius: var(--commerce-radius-media);
	background: var(--commerce-color-surface);
	object-fit: cover;
}

.commerce-predictive-results__content {
	display: grid;
	gap: 0.2rem;
}

.commerce-predictive-results__content span,
.commerce-predictive-results__content small {
	color: var(--commerce-color-muted);
	font-size: var(--commerce-text-sm);
}

.commerce-search-drawer__all {
	display: inline-flex;
	justify-content: center;
	padding: 1rem;
	margin-top: 1rem;
	border-top: 1px solid var(--commerce-color-border);
	font-weight: var(--commerce-font-weight-strong);
	text-align: center;
}

.commerce-search-drawer__all[hidden] {
	display: none;
}

.commerce-search-drawer__state {
	display: flex;
	min-height: 18rem;
	padding-block: 3.125rem;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	text-align: center;
}

.commerce-search-drawer__state h3,
.commerce-search-drawer__state p { margin: 0; }

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

@media (prefers-reduced-motion: reduce) {
	.commerce-search-drawer__header .commerce-icon-button svg,
	.commerce-search-drawer__reset,
	.commerce-search-drawer__loader { transition-duration: 0.01ms; animation: none; }
}

@media (max-width: 480px) {
	.commerce-search-drawer__panel { width: 100%; }
}
