/* ==========================================================================
   SoFlo Motorcycles — Search Drawer
   Full-screen black takeover, slides down from top.
   ========================================================================== */

/* Bootstrap's .offcanvas-top sets height: 30vh by default — override to 100vh
   so the panel fills the viewport when triggered. */
.search-drawer.offcanvas-top {
	height: 100vh;
	max-height: 100vh;
	background: var(--color-ink);
	color: var(--color-bg);
	border: 0;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* Container — generous horizontal padding, vertical scroll if results overflow. */
.search-drawer__container {
	max-width: 1100px;
	margin: 0 auto;
	padding: 28px 36px 80px;
	height: 100%;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}

/* ----- Header (close button row) -----------------------------------------
   Sits flush top-right. Big enough to be findable, restrained enough to
   stay out of the way. */
.search-drawer__top-row {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 48px;
}

.search-drawer__close {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.18);
	color: var(--color-bg);
	padding: 9px 14px 9px 18px;
	border-radius: 999px;
	font-size: 11px;
	letter-spacing: 0.16em;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	font-weight: 700;
	text-transform: uppercase;
	transition: border-color 0.18s ease, background-color 0.18s ease;
}

.search-drawer__close:hover,
.search-drawer__close:focus {
	border-color: var(--brand-primary);
	background: rgba(245, 166, 35, 0.08);
}

.search-drawer__close-key {
	color: rgba(255, 255, 255, 0.45);
	font-size: 10px;
	padding-left: 12px;
	border-left: 1px solid rgba(255, 255, 255, 0.18);
}

/* ----- Header (the big search input) ------------------------------------- */
.search-drawer__header {
	display: flex;
	align-items: center;
	gap: 22px;
	padding-bottom: 28px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	margin-bottom: 36px;
}

.search-drawer__icon {
	font-size: 28px;
	color: var(--brand-primary);
	flex-shrink: 0;
}

.search-drawer__input {
	flex: 1;
	background: transparent;
	border: 0;
	outline: 0;
	color: var(--color-bg);
	font-family: 'Bebas Neue', 'Anton', 'Oswald', 'Impact', 'Arial Narrow Bold', sans-serif;
	font-size: clamp(28px, 5vw, 36px);
	font-weight: 400;
	letter-spacing: 0.01em;
	line-height: 1.1;
	padding: 6px 0;
	text-transform: uppercase;
	min-width: 0;
}

.search-drawer__input::placeholder {
	color: rgba(255, 255, 255, 0.25);
	font-weight: 400;
}

/* WebKit "x" clear icon — let the user have it, just style it. */
.search-drawer__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	height: 18px;
	width: 18px;
	background: rgba(255, 255, 255, 0.3);
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
	mask-size: contain;
	cursor: pointer;
}

/* ----- Body (state container) -------------------------------------------- */
.search-drawer__body {
	flex: 1;
}

/* ----- Empty state ------------------------------------------------------- */
.search-drawer__empty {
	padding-top: 8px;
}

.search-drawer__hint {
	font-size: 10px;
	letter-spacing: 0.2em;
	color: var(--brand-primary);
	font-weight: 700;
	text-transform: uppercase;
	margin-bottom: 16px;
}

.search-drawer__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.search-drawer__pill {
	background: rgba(255, 255, 255, 0.05);
	color: var(--color-bg);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 999px;
	padding: 10px 18px;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.18s ease;
}

.search-drawer__pill:hover,
.search-drawer__pill:focus {
	background: rgba(245, 166, 35, 0.12);
	border-color: rgba(245, 166, 35, 0.4);
	color: var(--brand-primary);
}

/* ----- Loading state ----------------------------------------------------- */
.search-drawer__loading {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 28px 0;
	color: rgba(255, 255, 255, 0.45);
	font-size: 13px;
	letter-spacing: 0.06em;
}

.search-drawer__loading-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--brand-primary);
	display: inline-block;
	animation: soflo-search-pulse 1.2s ease-in-out infinite;
}

.search-drawer__loading-dot:nth-child(2) { animation-delay: 0.15s; }
.search-drawer__loading-dot:nth-child(3) { animation-delay: 0.30s; }

.search-drawer__loading-label {
	margin-left: 10px;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	font-size: 11px;
}

@keyframes soflo-search-pulse {
	0%, 60%, 100% { opacity: 0.25; transform: scale(0.85); }
	30%           { opacity: 1;    transform: scale(1); }
}

/* ----- Results ----------------------------------------------------------- */
.search-drawer__group {
	margin-bottom: 32px;
}

.search-drawer__group:last-child {
	margin-bottom: 0;
}

.search-drawer__group-label {
	color: var(--brand-primary);
	font-size: 10px;
	letter-spacing: 0.22em;
	font-weight: 700;
	text-transform: uppercase;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.search-drawer__group-items {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.search-drawer__result {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px 14px;
	border-radius: 10px;
	text-decoration: none;
	color: var(--color-bg);
	transition: background-color 0.14s ease, transform 0.14s ease;
}

.search-drawer__result:hover,
.search-drawer__result:focus {
	background: rgba(245, 166, 35, 0.08);
	color: var(--color-bg);
}

.search-drawer__thumb {
	width: 72px;
	height: 52px;
	object-fit: cover;
	border-radius: 4px;
	flex-shrink: 0;
	background: rgba(255, 255, 255, 0.04);
}

.search-drawer__thumb--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.28);
	font-size: 18px;
}

.search-drawer__result-text {
	flex: 1;
	min-width: 0;
}

.search-drawer__result-title {
	font-size: 15px;
	font-weight: 500;
	color: var(--color-bg);
	line-height: 1.3;
}

.search-drawer__result-meta {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.5);
	margin-top: 3px;
}

.search-drawer__result-sub {
	color: rgba(255, 255, 255, 0.4);
	font-weight: 400;
}

.search-drawer__result-arrow {
	color: rgba(255, 255, 255, 0.25);
	font-size: 14px;
	flex-shrink: 0;
	transition: transform 0.14s ease, color 0.14s ease;
}

.search-drawer__result:hover .search-drawer__result-arrow {
	color: var(--brand-primary);
	transform: translateX(2px);
}

/* Compact rows (categories, locations, brands) */
.search-drawer__result--compact {
	padding: 11px 14px;
}

.search-drawer__result--compact > i {
	color: rgba(255, 255, 255, 0.35);
	font-size: 14px;
	width: 18px;
	text-align: center;
	flex-shrink: 0;
}

.search-drawer__result--compact .search-drawer__result-title {
	flex: 1;
	font-size: 14px;
}

.search-drawer__result-count {
	color: rgba(255, 255, 255, 0.35);
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
}

/* ----- No results -------------------------------------------------------- */
.search-drawer__no-results {
	padding: 48px 0;
	text-align: center;
}

.search-drawer__no-results-title {
	font-family: 'Bebas Neue', 'Anton', 'Oswald', 'Impact', sans-serif;
	font-size: clamp(24px, 3vw, 36px);
	color: var(--color-bg);
	margin-bottom: 12px;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.search-drawer__no-results-hint {
	color: rgba(255, 255, 255, 0.4);
	font-size: 13px;
	max-width: 420px;
	margin: 0 auto;
	line-height: 1.5;
}

/* ----- Tablet ------------------------------------------------------------ */
@media (max-width: 992px) {
	.search-drawer__container {
		padding: 22px 28px 60px;
	}
	.search-drawer__header {
		gap: 16px;
		margin-bottom: 28px;
	}
	.search-drawer__top-row {
		margin-bottom: 32px;
	}
}

/* ----- Mobile ------------------------------------------------------------ */
@media (max-width: 640px) {
	.search-drawer__container {
		padding: 18px 18px 60px;
	}

	.search-drawer__top-row {
		margin-bottom: 24px;
	}

	.search-drawer__close-text {
		display: none;
	}

	.search-drawer__close-key {
		padding-left: 0;
		border-left: 0;
	}

	.search-drawer__close {
		padding: 9px 14px;
	}

	.search-drawer__header {
		gap: 14px;
		padding-bottom: 20px;
		margin-bottom: 24px;
	}

	.search-drawer__icon {
		font-size: 22px;
	}

	.search-drawer__thumb {
		width: 56px;
		height: 42px;
	}

	.search-drawer__pills {
		gap: 8px;
	}

	.search-drawer__pill {
		padding: 8px 14px;
		font-size: 12px;
	}
}

/* Mobile drawer search trigger — looks like a search input but is a button
   that opens the shared AJAX search drawer. */

.mobile-search-trigger {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 12px 30px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 999px;
	color: var(--color-text-muted);
	font-family: inherit;
	font-size: 14px;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mobile-search-trigger:hover,
.mobile-search-trigger:focus {
	background: rgba(255, 255, 255, 0.10);
	border-color: var(--brand-primary);
	color: var(--color-bg);
	outline: none;
}

.mobile-search-trigger i {
	font-size: 15px;
	flex-shrink: 0;
	left:30px;
}
