/**
 * Pétale Nocturne live-search presentation.
 */

.petale-header-search {
	position: relative;
	z-index: 20;
}

.petale-search-suggestions[hidden] {
	display: none !important;
}

.petale-search-suggestions {
	background: #fffdf9;
	border: 1px solid rgba( 58, 35, 44, 0.15 );
	box-shadow: 0 24px 60px rgba( 14, 9, 11, 0.24 );
	color: var( --petale-ink, #24191e );
	font-family: var( --petale-sans, sans-serif );
	position: relative;
	text-align: left;
	z-index: 100;
}

.petale-header-search .petale-search-suggestions {
	position: absolute;
	right: -1px;
	top: calc( 100% + 12px );
	width: min( 460px, calc( 100vw - 32px ) );
}

.petale-search-suggestions::before {
	background: var( --petale-pink, #a83d63 );
	content: "";
	height: 2px;
	left: -1px;
	top: -1px;
	position: absolute;
	transform: scaleX( 0 );
	transform-origin: left;
	transition: transform 180ms ease;
	width: calc( 100% + 2px );
}

.petale-search-suggestions.is-loading::before {
	animation: petale-search-progress 950ms ease-in-out infinite;
}

.petale-search-suggestions__list {
	max-height: min( 65vh, 520px );
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-color: rgba( 104, 65, 80, 0.35 ) transparent;
	scrollbar-width: thin;
}

.petale-search-result,
.petale-search-results-all {
	color: var( --petale-ink, #24191e ) !important;
	text-decoration: none !important;
}

.petale-search-result {
	align-items: center;
	border-bottom: 1px solid rgba( 67, 42, 52, 0.1 );
	display: grid;
	gap: 12px;
	grid-template-columns: 64px minmax( 0, 1fr ) auto;
	min-height: 86px;
	padding: 9px 16px 9px 10px;
	position: relative;
	transition: background-color 150ms ease;
}

.petale-search-result::before,
.petale-search-results-all::before {
	background: var( --petale-pink, #a83d63 );
	bottom: 0;
	content: "";
	left: 0;
	position: absolute;
	top: 0;
	transform: scaleY( 0 );
	transition: transform 150ms ease;
	width: 2px;
}

.petale-search-result:hover,
.petale-search-result[aria-selected="true"],
.petale-search-results-all:hover,
.petale-search-results-all[aria-selected="true"] {
	background: #f8f1ed;
}

.petale-search-result:hover::before,
.petale-search-result[aria-selected="true"]::before,
.petale-search-results-all:hover::before,
.petale-search-results-all[aria-selected="true"]::before {
	transform: scaleY( 1 );
}

.petale-search-result__media {
	align-items: center;
	align-self: stretch;
	background: #f5efea;
	display: flex;
	justify-content: center;
	min-height: 66px;
	overflow: hidden;
}

.petale-search-result__media img {
	display: block;
	height: 62px;
	max-width: 62px;
	object-fit: contain;
	padding: 5px;
	width: 62px;
}

.petale-search-result__monogram {
	color: rgba( 88, 48, 64, 0.48 );
	font-family: var( --petale-serif, serif );
	font-size: 26px;
	font-weight: 400;
}

.petale-search-result__content {
	display: block;
	min-width: 0;
}

.petale-search-result__brand {
	color: var( --petale-pink, #a83d63 );
	display: block;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1.2;
	margin-bottom: 4px;
	overflow: hidden;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
}

.petale-search-result__name {
	display: block;
	font-family: var( --petale-serif, serif );
	font-size: 16px;
	font-weight: 500;
	line-height: 1.18;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.petale-search-result__details {
	color: rgba( 47, 31, 38, 0.58 );
	display: block;
	font-size: 10px;
	line-height: 1.3;
	margin-top: 4px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.petale-search-result__price {
	color: rgba( 35, 23, 28, 0.82 );
	font-size: 11px;
	font-weight: 700;
	padding-left: 6px;
	white-space: nowrap;
}

.petale-search-results-all {
	align-items: center;
	display: flex;
	font-size: 10px;
	font-weight: 750;
	justify-content: space-between;
	letter-spacing: 0.13em;
	min-height: 50px;
	padding: 0 17px;
	position: relative;
	text-transform: uppercase;
}

.petale-search-results-all > span:last-child {
	font-size: 18px;
	font-weight: 400;
	letter-spacing: 0;
}

.petale-search-suggestions__message {
	color: rgba( 48, 31, 38, 0.68 );
	font-size: 12px;
	line-height: 1.55;
	margin: 0;
	padding: 20px 18px;
}

.petale-search-suggestions.is-loading .petale-search-suggestions__message {
	padding-left: 39px;
	position: relative;
}

.petale-search-suggestions.is-loading .petale-search-suggestions__message::before {
	background: var( --petale-pink, #a83d63 );
	border-radius: 50%;
	content: "";
	height: 7px;
	left: 20px;
	position: absolute;
	top: 25px;
	width: 7px;
}

.petale-mobile-search form {
	position: relative;
}

.petale-mobile-search button[type="submit"] {
	height: 50px !important;
	min-height: 50px;
}

.petale-mobile-search .petale-search-suggestions {
	margin-top: 8px;
	width: 100%;
}

.petale-mobile-search .petale-search-suggestions__list {
	max-height: min( 58dvh, 480px );
}

@keyframes petale-search-progress {
	0% {
		transform: scaleX( 0 );
		transform-origin: left;
	}
	48% {
		transform: scaleX( 1 );
		transform-origin: left;
	}
	52% {
		transform: scaleX( 1 );
		transform-origin: right;
	}
	100% {
		transform: scaleX( 0 );
		transform-origin: right;
	}
}

@media ( max-width: 480px ) {
	.petale-mobile-search {
		padding-inline: 16px;
	}

	.petale-mobile-search button[type="submit"] {
		font-size: 9px;
		padding-inline: 12px;
	}

	.petale-search-result {
		gap: 10px;
		grid-template-columns: 56px minmax( 0, 1fr ) auto;
		min-height: 80px;
		padding: 8px 10px 8px 8px;
	}

	.petale-search-result__media {
		min-height: 60px;
	}

	.petale-search-result__media img {
		height: 56px;
		width: 56px;
	}

	.petale-search-result__name {
		font-size: 15px;
	}

	.petale-search-result__price {
		font-size: 10px;
		padding-left: 2px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.petale-search-suggestions::before,
	.petale-search-result,
	.petale-search-result::before,
	.petale-search-results-all::before {
		animation: none !important;
		transition: none !important;
	}
}
