/*
 * Glasbestellen — live header search dropdown.
 *
 * Self-contained. Loaded as its own stylesheet so it stays independent
 * from the rest of the theme's compiled CSS. Sized in em/rem so it
 * picks up the surrounding input's font sizing.
 */

/* Dropdown is anchored to the existing .header-search__field label
   (already position: relative). No wrapper is created in JS. */
.gb-search-results {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 1100;
	max-height: min(70vh, 540px);
	overflow-y: auto;
	background: #fff;
	border: 1px solid rgba(15, 23, 42, 0.10);
	border-radius: 10px;
	box-shadow: 0 12px 32px -10px rgba(15, 23, 42, 0.22);
	font-size: 0.95em;
	color: #1f2937;
	-webkit-overflow-scrolling: touch;
}

.gb-search-results[hidden] {
	display: none;
}

.gb-search-results__notice {
	padding: 1em 1.25em;
	color: #6b7280;
	font-size: 0.9em;
}

.gb-search-results__notice--loading {
	display: flex;
	align-items: center;
	gap: 0.6em;
}

.gb-search-spinner {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	border: 2px solid rgba(15, 23, 42, 0.18);
	border-top-color: #0e5a94;
	border-radius: 50%;
	animation: gb-search-spin 0.7s linear infinite;
}

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

/* Group = "Producten" / "Categorieën" block */
.gb-search-results__group + .gb-search-results__group {
	border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.gb-search-results__heading {
	padding: 1.1em 1.25em 0.7em;
	color: #64748b;
	font-size: 0.72em;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.gb-search-results__list {
	margin: 0;
	padding: 0 0 0.4em;
	list-style: none;
}

/* A single result row */
.gb-search-result {
	display: flex;
	align-items: center;
	gap: 0.85em;
	padding: 0.55em 1.25em;
	color: inherit;
	text-decoration: none;
	transition: background 0.12s ease;
}

.gb-search-result:hover,
.gb-search-result.is-focused {
	background: #f8fafc;
	color: #0e5a94;
}

.gb-search-result__thumb {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 6px;
	object-fit: cover;
	background: #f3f4f6;
}

.gb-search-result__thumb--placeholder {
	display: inline-block;
	border: 1px dashed rgba(15, 23, 42, 0.15);
}

.gb-search-result__body {
	display: flex;
	flex-direction: column;
	gap: 0.1em;
	min-width: 0;
}

.gb-search-result__title {
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.gb-search-result__subtitle,
.gb-search-result__price {
	font-size: 0.85em;
	color: #6b7280;
}

.gb-search-result__price {
	color: #0e5a94;
	font-weight: 600;
}

/* Footer link — "Alle resultaten voor X" */
.gb-search-results__view-all {
	display: block;
	padding: 0.75em 1.25em;
	border-top: 1px solid rgba(15, 23, 42, 0.08);
	color: #0e5a94;
	font-size: 0.85em;
	font-weight: 600;
	text-decoration: none;
}

.gb-search-results__view-all:hover {
	background: #f8fafc;
	text-decoration: underline;
}

/* Loading subtle pulse on the panel */
.gb-search-results.loading .gb-search-results__notice {
	opacity: 0.7;
}

/* ===================================================================
 * search.php results page
 * =================================================================== */

.search-page {
	padding: 2.5rem 0 4rem;
	color: #1f2937;
}

.search-page__header {
	margin-bottom: 2rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid rgba(15, 23, 42, 0.10);
}

.search-page__title {
	margin: 0 0 0.35em;
	font-size: clamp(1.5rem, 2.4vw, 2rem);
	font-weight: 600;
	color: #0f172a;
	line-height: 1.2;
}

.search-page__count {
	margin: 0;
	color: #64748b;
	font-size: 0.95rem;
}

.search-page__notice {
	margin: 1.5rem 0;
	padding: 1.25rem 1.5rem;
	background: #f8fafc;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 10px;
	color: #475569;
}

.search-page__notice p {
	margin: 0 0 0.5em;
}

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

.search-page__notice--error {
	background: #fef2f2;
	border-color: rgba(220, 38, 38, 0.20);
	color: #b91c1c;
}

.search-page__group {
	margin-bottom: 2.5rem;
}

.search-page__group-heading {
	margin: 0 0 1.1rem;
	color: #475569;
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.search-page__grid {
	display: grid;
	grid-template-columns: repeat( 2, 1fr );
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media ( min-width: 540px ) {
	.search-page__grid {
		grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
		gap: 1rem;
	}
}

.search-page__card-wrap {
	display: block;
}

.search-page__card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 12px;
	overflow: hidden;
	color: inherit;
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.search-page__card:hover,
.search-page__card:focus-visible {
	border-color: rgba(14, 90, 148, 0.35);
	box-shadow: 0 12px 28px -16px rgba(15, 23, 42, 0.30);
	transform: translateY(-2px);
}

.search-page__thumb {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	background: #f3f4f6;
	overflow: hidden;
}

.search-page__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.search-page__thumb-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background:
		linear-gradient(135deg, transparent 48%, rgba(15, 23, 42, 0.08) 48%, rgba(15, 23, 42, 0.08) 52%, transparent 52%),
		#f3f4f6;
}

.search-page__card-body {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.9rem 1rem 1rem;
}

.search-page__card-title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.3;
	color: #0f172a;
}

.search-page__card-subtitle {
	font-size: 0.82rem;
	color: #64748b;
}

.search-page__group--category .search-page__card {
	background: linear-gradient( 180deg, #fafbfc 0%, #fff 60% );
}
