/* Triggers (icon / link / inline bar) ------------------------------------ */
.bf-shop-search-trigger {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	background: none;
	border: none;
	cursor: pointer;
	color: inherit;
	font: inherit;
	line-height: 1;
	padding: 0.4em;
	text-decoration: none;
}
.bf-shop-search-trigger--icon .bf-shop-search-icon {
	line-height: 1;
}
.bf-shop-search-trigger--link:hover {
	opacity: 0.75;
}

.bf-shop-search-inline {
	position: relative;
	width: 100%;
	max-width: 420px;
}

.bf-shop-search-input-wrap {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}
.bf-shop-search-input-wrap .bf-shop-search-icon {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.06);
	font-size: 15px;
	opacity: 1;
	cursor: pointer;
}
.bf-shop-search-input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65em 1em;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 999px;
	font-size: 15px;
	background: #fff;
	color: #111;
}
.bf-shop-search-input:focus {
	outline: none;
	border-color: rgba(0, 0, 0, 0.35);
}

/* Backdrop used behind the inline dropdown ------------------------------- */
.bf-shop-search-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99990;
	background: rgba(0, 0, 0, 0.25);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}
.bf-shop-search-backdrop.is-active {
	opacity: 1;
	pointer-events: auto;
}

/* Full overlay panel (icon / link trigger, or #bf-shop-search links) ----- */
.bf-shop-search-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}
.bf-shop-search-overlay.is-active {
	opacity: 1;
	visibility: visible;
}
.bf-ss-overlay--transparent {
	background: rgba(0, 0, 0, 0.4);
}
.bf-ss-overlay--fullscreen {
	background: rgba(12, 12, 14, 0.97);
}

.bf-shop-search-panel {
	position: absolute;
	background: #fff;
	box-sizing: border-box;
	padding: 2rem;
	overflow-y: auto;
	transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.bf-ss-overlay--fullscreen .bf-shop-search-panel {
	background: transparent;
	color: #fff;
}
.bf-ss-overlay--fullscreen .bf-shop-search-input {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.25);
	color: #fff;
}
.bf-ss-overlay--fullscreen .bf-shop-search-input-wrap .bf-shop-search-icon {
	color: #fff;
	background: rgba(255, 255, 255, 0.12);
}

.bf-ss-panel--top {
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	max-height: 85vh;
	transform: translateY(-100%);
}
.bf-shop-search-overlay.is-active .bf-ss-panel--top {
	transform: translateY(0);
}

.bf-ss-panel--bottom {
	bottom: 0;
	left: 0;
	right: 0;
	width: 100%;
	max-height: 85vh;
	border-radius: 16px 16px 0 0;
	transform: translateY(100%);
}
.bf-shop-search-overlay.is-active .bf-ss-panel--bottom {
	transform: translateY(0);
}

.bf-ss-panel--side {
	top: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: 440px;
	transform: translateX(100%);
}
.bf-shop-search-overlay.is-active .bf-ss-panel--side {
	transform: translateX(0);
}

.bf-shop-search-close {
	position: absolute;
	top: 1rem;
	right: 1.25rem;
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	opacity: 0.7;
}
.bf-shop-search-close:hover {
	opacity: 1;
}

.bf-shop-search-panel .bf-shop-search-input-wrap {
	margin-top: 0.5rem;
	max-width: 640px;
}

/* Center the input/filters/results block for the top & bottom panels — the
   side drawer is already narrow, so it stays flush/full-width there. */
.bf-ss-panel--top .bf-shop-search-input-wrap,
.bf-ss-panel--bottom .bf-shop-search-input-wrap,
.bf-ss-panel--top .bf-shop-search-filters,
.bf-ss-panel--bottom .bf-shop-search-filters,
.bf-ss-panel--top .bf-shop-search-results-area,
.bf-ss-panel--bottom .bf-shop-search-results-area,
.bf-ss-panel--top .bf-shop-search-view-all,
.bf-ss-panel--bottom .bf-shop-search-view-all {
	margin-left: auto;
	margin-right: auto;
}
.bf-ss-panel--top .bf-shop-search-filters,
.bf-ss-panel--bottom .bf-shop-search-filters {
	justify-content: center;
}
.bf-ss-panel--top .bf-shop-search-view-all,
.bf-ss-panel--bottom .bf-shop-search-view-all {
	text-align: center;
}

/* Filters ----------------------------------------------------------------- */
.bf-shop-search-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 1rem;
	max-width: 640px;
}
.bf-shop-search-filters select,
.bf-shop-search-filters input {
	padding: 0.5em 0.75em;
	border-radius: 8px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	font-size: 14px;
	background: #fff;
	color: #111;
}
.bf-ss-overlay--fullscreen .bf-shop-search-filters select,
.bf-ss-overlay--fullscreen .bf-shop-search-filters input {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.25);
	color: #fff;
}
.bf-shop-search-filters .bf-shop-search-filter-min,
.bf-shop-search-filters .bf-shop-search-filter-max {
	width: 110px;
}

/* Results ------------------------------------------------------------------ */
.bf-shop-search-results-area {
	margin-top: 1.25rem;
	max-width: 760px;
	display: none;
	gap: 1rem;
}
.bf-shop-search-results-area.is-open {
	display: flex;
}

.bf-shop-search-inline .bf-shop-search-results-area {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
	z-index: 99991;
	max-width: none;
	width: 420px;
	margin-top: 0;
	padding: 0.5rem;
}

.bf-shop-search-results {
	flex: 1 1 280px;
	min-width: 0;
	max-height: 70vh;
	overflow-y: auto;
}

/* Preview pane — desktop only; hover/focus a product row to populate it. */
.bf-shop-search-preview {
	display: none;
	flex: 1 1 260px;
	min-width: 0;
	max-height: 70vh;
	overflow-y: auto;
	padding-left: 1rem;
	border-left: 1px solid rgba(0, 0, 0, 0.1);
}
.bf-ss-overlay--fullscreen .bf-shop-search-preview {
	border-left-color: rgba(255, 255, 255, 0.2);
}
@media (min-width: 700px) {
	.bf-shop-search-preview.is-visible {
		display: block;
	}
	.bf-shop-search-inline .bf-shop-search-results-area {
		width: 640px;
	}
}
.bf-shop-search-preview-image {
	width: 100%;
	max-width: 220px;
	border-radius: 8px;
	display: block;
	margin-bottom: 0.75rem;
}
.bf-shop-search-preview-title {
	font-size: 16px;
	font-weight: 700;
	margin-bottom: 0.25rem;
}
.bf-shop-search-preview-sku {
	font-size: 12px;
	opacity: 0.6;
	margin-bottom: 0.5rem;
}
.bf-shop-search-preview-price {
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 0.5rem;
}
.bf-shop-search-preview-excerpt {
	font-size: 13px;
	opacity: 0.8;
	line-height: 1.5;
	margin: 0;
}

.bf-shop-search-section-heading {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	opacity: 0.55;
	padding: 0.6rem 0.4rem 0.3rem;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.bf-shop-search-section-heading:first-child {
	border-top: none;
	padding-top: 0.4rem;
}
.bf-ss-overlay--fullscreen .bf-shop-search-section-heading {
	border-top-color: rgba(255, 255, 255, 0.15);
}

.bf-shop-search-term-list {
	padding: 0 0.4rem 0.4rem;
}
.bf-shop-search-term-link {
	display: block;
	padding: 0.35rem 0;
	font-size: 14px;
	text-decoration: underline;
	color: inherit;
}
.bf-shop-search-term-link:hover {
	opacity: 0.75;
}

.bf-shop-search-result {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.6rem 0.4rem;
	text-decoration: none;
	color: inherit;
	border-radius: 8px;
}
.bf-shop-search-result:hover {
	background: rgba(0, 0, 0, 0.05);
}
.bf-ss-overlay--fullscreen .bf-shop-search-result:hover {
	background: rgba(255, 255, 255, 0.08);
}
.bf-shop-search-result img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
}
.bf-shop-search-result-info {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}
.bf-shop-search-result-title {
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.bf-shop-search-result-price {
	font-size: 13px;
	opacity: 0.75;
}
.bf-shop-search-no-results {
	padding: 0.75rem 0.5rem;
	font-size: 14px;
	opacity: 0.7;
}

.bf-shop-search-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.9rem;
	padding: 2.25rem 1rem;
}
.bf-shop-search-loading-label {
	font-size: 14px;
	font-weight: 600;
	opacity: 0.75;
}

.bf-shop-search-spinner {
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	border: 4px solid rgba(0, 0, 0, 0.12);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: bf-shop-search-spin 0.7s linear infinite;
}
.bf-ss-overlay--fullscreen .bf-shop-search-spinner {
	border-color: rgba(255, 255, 255, 0.2);
	border-top-color: currentColor;
}
@keyframes bf-shop-search-spin {
	to {
		transform: rotate(360deg);
	}
}

.bf-shop-search-dots {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}
.bf-shop-search-dots span {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.3;
	animation: bf-shop-search-bounce 0.9s ease-in-out infinite;
}
.bf-shop-search-dots span:nth-child(2) {
	animation-delay: 0.15s;
}
.bf-shop-search-dots span:nth-child(3) {
	animation-delay: 0.3s;
}
@keyframes bf-shop-search-bounce {
	0%, 80%, 100% {
		transform: translateY(0);
		opacity: 0.3;
	}
	40% {
		transform: translateY(-10px);
		opacity: 1;
	}
}

/* Recent searches / picks -------------------------------------------------- */
.bf-shop-search-history-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.6rem 0.4rem 0.3rem;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	opacity: 0.6;
}
.bf-shop-search-clear-history {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	text-decoration: underline;
	color: inherit;
	opacity: 0.8;
	padding: 0;
}
.bf-shop-search-history-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	padding: 0 0.4rem 0.5rem;
}
.bf-shop-search-history-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	background: rgba(0, 0, 0, 0.06);
	border-radius: 999px;
	padding: 0.3em 0.4em 0.3em 0.85em;
	font-size: 13px;
}
.bf-ss-overlay--fullscreen .bf-shop-search-history-chip {
	background: rgba(255, 255, 255, 0.1);
}
.bf-shop-search-history-chip-text {
	cursor: pointer;
}
.bf-shop-search-chip-remove {
	background: none;
	border: none;
	cursor: pointer;
	color: inherit;
	opacity: 0.6;
	font-size: 15px;
	line-height: 1;
	padding: 0 0.15em;
}
.bf-shop-search-chip-remove:hover {
	opacity: 1;
}

.bf-shop-search-view-all {
	display: none;
	margin-top: 1rem;
	font-weight: 600;
	text-decoration: underline;
	color: inherit;
}

body.bf-shop-search-lock {
	overflow: hidden;
}

/* Mobile responsive --------------------------------------------------------- */
@media (max-width: 640px) {
	.bf-shop-search-panel {
		padding: 1.25rem;
	}
	.bf-ss-panel--side {
		max-width: 100%;
	}
	.bf-shop-search-filters {
		flex-direction: column;
		align-items: stretch;
	}
	.bf-shop-search-filters .bf-shop-search-filter-min,
	.bf-shop-search-filters .bf-shop-search-filter-max {
		width: 100%;
	}
	.bf-shop-search-inline {
		max-width: 100%;
	}
	.bf-shop-search-inline .bf-shop-search-results-area {
		width: 90vw;
		max-width: 420px;
	}
}
