/* PA Design Blocks — product search. */
.pasd-search { --pasd-accent: #6528f7; --pasd-line: #d8d8f5; --pasd-text: #070707; --pasd-muted: #5b6270; position: relative; }
.pasd-search *, .pasd-search *::before, .pasd-search *::after { box-sizing: border-box; }

/* form */
.pasd-search__form {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	margin: 0;
	border: 2px solid var(--pasd-line);
	border-radius: 999px;
	background: #fff;
	transition: border-color .2s, box-shadow .2s;
}
.pasd-search__form:focus-within { border-color: var(--pasd-accent); box-shadow: 0 0 0 4px rgba(101, 40, 247, .12); }
.pasd-search__lens { display: flex; padding-left: 16px; color: var(--pasd-muted); }
.pasd-search__lens svg, .pasd-search__toggle svg { width: 20px; height: 20px; fill: currentColor; }
.pasd-search__input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	height: 48px;
	margin: 0;
	padding: 0 12px;
	border: 0 !important;
	outline: 0;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--pasd-text);
	font-size: 16px;
}
.pasd-search__input::-webkit-search-cancel-button { cursor: pointer; }
.pasd-search__submit {
	flex: 0 0 auto;
	height: 40px;
	margin: 0 4px 0 0;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--pasd-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 40px;
	cursor: pointer;
	transition: background-color .2s;
}
.pasd-search__submit:hover, .pasd-search__submit:focus-visible { background: #4b16c9; color: #fff; }
.pasd-search__spinner {
	display: none;
	width: 18px;
	height: 18px;
	margin-right: 8px;
	border: 2px solid var(--pasd-line);
	border-top-color: var(--pasd-accent);
	border-radius: 50%;
	animation: pasd-spin .7s linear infinite;
}
.pasd-search.is-loading .pasd-search__spinner { display: block; }
@keyframes pasd-spin { to { transform: rotate(360deg); } }

/* suggestions */
.pasd-search__results {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 99999;
	max-height: min(70vh, 560px);
	overflow-y: auto;
	padding: 8px;
	border: 1px solid var(--pasd-line);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 18px 40px rgba(13, 6, 20, .14);
	text-align: left;
}
.pasd-search__results[hidden] { display: none; }
.pasd-search__group { margin: 6px 8px 4px; color: var(--pasd-muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.pasd-search__note { margin: 4px 8px 8px; color: var(--pasd-muted); font-size: 14px; }
.pasd-search__note strong { color: var(--pasd-text); }
.pasd-search__opt {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: 10px;
	color: var(--pasd-text) !important;
	text-decoration: none !important;
	transition: background-color .15s;
}
.pasd-search__opt:hover, .pasd-search__opt.is-active { background: #f2f0fe; }
.pasd-search__img { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 8px; background: #f6f6fb; object-fit: contain; }
.pasd-search__body { min-width: 0; flex: 1 1 auto; }
.pasd-search__name { display: block; overflow: hidden; font-size: 15px; font-weight: 500; line-height: 1.35; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pasd-search__name mark { padding: 0; background: none; color: var(--pasd-accent); font-weight: 700; }
.pasd-search__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; color: var(--pasd-muted); font-size: 13px; }
.pasd-search__price { color: var(--pasd-text); font-weight: 600; }
.pasd-search__price del { color: var(--pasd-muted); font-weight: 400; }
.pasd-search__out { color: #c62828; }
.pasd-search__cat { padding: 8px 10px; }
.pasd-search__cat .pasd-search__count { margin-left: auto; color: var(--pasd-muted); font-size: 13px; }
.pasd-search__all {
	display: block;
	margin: 6px 0 2px;
	padding: 12px;
	border-radius: 10px;
	background: var(--pasd-line);
	color: #1d1340 !important;
	font-weight: 600;
	text-align: center;
	text-decoration: none !important;
}
.pasd-search__all:hover, .pasd-search__all.is-active { background: var(--pasd-accent); color: #fff !important; }
.pasd-search__empty { padding: 14px 10px; color: var(--pasd-muted); }

/* icon layout */
.pasd-search__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--pasd-accent);
	cursor: pointer;
}
.pasd-search__toggle:hover, .pasd-search__toggle[aria-expanded="true"] { background: #f2f0fe; color: var(--pasd-accent); }
.pasd-search__toggle svg { width: 22px; height: 22px; }
.pasd-search__panel {
	position: absolute;
	top: calc(100% + 12px);
	right: 0;
	z-index: 99998;
	width: min(640px, 92vw);
	padding: 14px;
	border: 1px solid var(--pasd-line);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 18px 40px rgba(13, 6, 20, .16);
}
.pasd-search__panel[hidden] { display: none; }
/* inside the panel the suggestions flow under the bar */
.pasd-search__panel .pasd-search__results { position: static; max-height: min(60vh, 520px); margin-top: 10px; box-shadow: none; }
.pasd-search__close { display: none; }

/* header bar */
.pasd-search--header.pasd-search--bar { width: min(420px, 34vw); }
.pasd-search--header .pasd-search__input[type="search"] { height: 42px; font-size: 15px; }
.pasd-search--header .pasd-search__submit { height: 34px; line-height: 34px; padding: 0 16px; }

/* mobile: the panel becomes a full-screen search */
@media (max-width: 768px) {
	.pasd-search__submit { padding: 0 14px; }
	.pasd-search--icon .pasd-search__panel {
		position: fixed;
		inset: 0;
		width: auto;
		padding: 64px 14px 14px;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		overflow-y: auto;
	}
	.pasd-search--icon .pasd-search__close {
		position: absolute;
		top: 10px;
		right: 12px;
		display: block;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 0;
		background: transparent;
		color: var(--pasd-text);
		font-size: 34px;
		line-height: 44px;
		cursor: pointer;
	}
	.pasd-search--icon .pasd-search__results { max-height: none; }
	body.pasd-search-open { overflow: hidden; }
}
.pasd-corrected { margin: 0 0 16px; }
@media (prefers-reduced-motion: reduce) { .pasd-search__spinner { animation-duration: 2s; } }
