/**
 * HB Extended Search — Fase 4.2
 *
 * Stijlen voor de aparte zoekpagina /zoeken/?q=...
 *  - Header met zoekformulier
 *  - "Onze selectie" sectie (WC product grid)
 *  - "Ook te bestellen" sectie (Boekenbank cards)
 *
 * Past op de Hoekjes en Boekjes-paletten: cream/navy/terracotta/sand.
 */

/* ============================================================
   Page wrapper + header
============================================================ */
/* Override Astra's globale #primary spacing (60px margin-top) op deze
   zoekpagina. We willen "Zoeken" dichter bij de site-header zien. */
body.hb-page-zoeken #primary {
	margin-top: 1.25rem !important;
}

.hb-zoeken-page {
	max-width: var(--hb-max-width, 1440px);
	margin: 0 auto;
	padding: 0 1.5rem 4rem;
}

.hb-zoeken-header {
	text-align: center;
	margin-bottom: 1.5rem;
	padding-bottom: 0;
}

.hb-zoeken-header__title {
	font-family: var(--hb-font-heading, "Fraunces", Georgia, serif);
	font-size: clamp(1.75rem, 3vw, 2.25rem);
	color: var(--hb-navy, #1D3557);
	margin: 0 0 0.5rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.hb-zoeken-header__lead {
	color: var(--hb-muted, #6B6357);
	font-size: 1rem;
	line-height: 1.55;
	max-width: 580px;
	margin: 0 auto 1.75rem;
}

/* Search form */
.hb-zoeken-form {
	display: flex;
	gap: 0.5rem;
	max-width: 580px;
	margin: 0 auto;
	background: var(--hb-white, #FFFFFF);
	border-radius: var(--hb-radius-md, 12px);
	box-shadow: var(--hb-shadow-sm, 0 2px 8px rgba(29, 53, 87, 0.06));
	padding: 0.5rem;
}

.hb-zoeken-form__input {
	flex: 1;
	border: none;
	background: transparent;
	padding: 0.75rem 1rem;
	font-family: var(--hb-font-body, "Nunito", sans-serif);
	font-size: 1rem;
	color: var(--hb-text, #2C2C2C);
	outline: none;
}

.hb-zoeken-form__input::placeholder {
	color: var(--hb-muted, #6B6357);
	opacity: 0.7;
}

.hb-zoeken-form__button {
	background: var(--hb-terracotta, #C8624A);
	color: var(--hb-white, #FFFFFF);
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: var(--hb-radius-sm, 8px);
	font-family: var(--hb-font-body, "Nunito", sans-serif);
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.hb-zoeken-form__button:hover {
	background: #B15640;
}

/* Empty / no-results states */
.hb-zoeken-empty,
.hb-zoeken-no-results {
	text-align: center;
	color: var(--hb-muted, #6B6357);
	max-width: 580px;
	margin: 2rem auto;
	font-size: 1rem;
	line-height: 1.6;
}

.hb-zoeken-no-results em {
	color: var(--hb-terracotta, #C8624A);
	font-style: italic;
}

.hb-zoeken-no-results a {
	color: var(--hb-terracotta, #C8624A);
	font-weight: 600;
	text-decoration: none;
}

.hb-zoeken-no-results a:hover {
	text-decoration: underline;
}

.hb-zoeken-results-count {
	text-align: center;
	color: var(--hb-muted, #6B6357);
	font-size: 0.95rem;
	margin: 0 0 1.5rem;
}

.hb-zoeken-results-count em {
	color: var(--hb-terracotta, #C8624A);
	font-style: italic;
}

/* ============================================================
   Section wrapper (Onze selectie + Ook te bestellen)
============================================================ */
.hb-zoeken-section,
.hb-ook-te-bestellen {
	margin: 0 0 3rem;
}

.hb-zoeken-section + .hb-ook-te-bestellen,
.hb-zoeken-section + .hb-zoeken-section {
	margin-top: 3rem;
	padding-top: 2.5rem;
	border-top: 1px dashed var(--hb-sand, #D4B896);
}

.hb-zoeken-section__header,
.hb-ook-te-bestellen__header {
	margin-bottom: 1.75rem;
}

.hb-zoeken-section__title,
.hb-ook-te-bestellen__title {
	font-family: var(--hb-font-heading, "Fraunces", Georgia, serif);
	font-size: clamp(1.4rem, 2.5vw, 1.75rem);
	color: var(--hb-navy, #1D3557);
	margin: 0 0 0.5rem;
	font-weight: 600;
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
}

.hb-zoeken-section__count {
	color: var(--hb-muted, #6B6357);
	font-size: 0.75em;
	font-weight: 400;
}

.hb-zoeken-section__lead,
.hb-ook-te-bestellen__lead {
	color: var(--hb-muted, #6B6357);
	font-size: 0.95rem;
	line-height: 1.55;
	max-width: 700px;
	margin: 0;
	text-wrap: pretty;
}

/* ============================================================
   "Ook te bestellen" sub-groups (Bestelbaar / Tijdelijk / Niet meer)
============================================================ */
.hb-ook-te-bestellen__count {
	color: var(--hb-muted, #6B6357);
	font-size: 0.75em;
	font-weight: 400;
	margin-left: 0.25rem;
}

.hb-ook-group {
	margin: 2.5rem 0 0;
}

.hb-ook-group:first-of-type {
	margin-top: 0.5rem;
}

.hb-ook-group__header {
	margin-bottom: 1rem;
	padding-left: 0.85rem;
	border-left: 3px solid;
}

.hb-ook-group--available .hb-ook-group__header        { border-left-color: var(--hb-sage, #7A9E7E); }
.hb-ook-group--temp_unavailable .hb-ook-group__header { border-left-color: #E8A33E; }

.hb-ook-group__title {
	font-family: var(--hb-font-heading, "Fraunces", Georgia, serif);
	font-size: 1.15rem;
	color: var(--hb-navy, #1D3557);
	margin: 0 0 0.25rem;
	font-weight: 600;
}

.hb-ook-group__count {
	color: var(--hb-muted, #6B6357);
	font-size: 0.85em;
	font-weight: 400;
	margin-left: 0.25rem;
}

.hb-ook-group__lead {
	color: var(--hb-muted, #6B6357);
	font-size: 0.85rem;
	line-height: 1.4;
	margin: 0;
}

/* Card-state varianten */
.hb-ook-card--temp_unavailable {
	opacity: 0.97;
}

.hb-ook-card__supply-date {
	font-size: 0.78rem;
	color: #8B5A1F;
	margin: 0.25rem 0 0.4rem;
	background: #FDF5E6;
	padding: 4px 8px;
	border-radius: 4px;
	display: inline-block;
}

.hb-ook-card__supply-date strong {
	color: #6B4014;
}

/* Badge varianten per status */
.hb-ook-card__badge--available        { background: var(--hb-sage, #7A9E7E); }
.hb-ook-card__badge--temp_unavailable { background: #E8A33E; }

/* ============================================================
   Onze selectie (curated) — override WC's default grid zodat
   de cards exact dezelfde breedte hebben als die in "Ook te
   bestellen" (anders zien Lampje/Krekel er breder uit dan Bonje).
============================================================ */
.hb-zoeken-section--curated ul.products,
.hb-zoeken-section--curated ul.products.columns-4 {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr) !important;
	gap: 1.5rem !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	width: 100%;
}

.hb-zoeken-section--curated ul.products > li.product {
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	float: none !important;
	clear: none !important;
}

@media (max-width: 1024px) {
	.hb-zoeken-section--curated ul.products,
	.hb-zoeken-section--curated ul.products.columns-4 {
		grid-template-columns: repeat(3, 1fr) !important;
	}
}

@media (max-width: 768px) {
	.hb-zoeken-section--curated ul.products,
	.hb-zoeken-section--curated ul.products.columns-4 {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 1rem !important;
	}
}

@media (max-width: 380px) {
	.hb-zoeken-section--curated ul.products,
	.hb-zoeken-section--curated ul.products.columns-4 {
		grid-template-columns: 1fr !important;
	}
}

/* ============================================================
   "Ook te bestellen" sectie — Boekenbank stubs
============================================================ */

/* Grid — vaste 4 kolommen op desktop, schaalt responsive.
   Door vaste kolommen blijft de cardbreedte consistent, ongeacht het
   aantal items (anders rekt 1 item zich uit tot ~25% en 4 items tot ~25%
   wat OK is, maar met auto-fill kreeg je 1 item op 200px en 4 items
   die de hele rij vulden). */
.hb-ook-te-bestellen__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.5rem;
	margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
	.hb-ook-te-bestellen__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Card */
.hb-ook-card {
	background: var(--hb-white, #FFFFFF);
	border-radius: var(--hb-radius-md, 12px);
	box-shadow: var(--hb-shadow-sm, 0 2px 8px rgba(29, 53, 87, 0.06));
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hb-ook-card:hover {
	box-shadow: var(--hb-shadow-md, 0 6px 20px rgba(29, 53, 87, 0.10));
	transform: translateY(-2px);
}

.hb-ook-card__cover {
	position: relative;
	aspect-ratio: 2 / 3;
	background: var(--hb-cream, #F5F0E8);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.hb-ook-card__cover img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 0.5rem;
	display: block;
}

.hb-ook-card__cover-placeholder {
	font-size: 3rem;
	opacity: 0.4;
}

.hb-ook-card__badge {
	position: absolute;
	top: 10px;
	right: 10px;
	background: var(--hb-navy, #1D3557);
	color: var(--hb-white, #FFF);
	font-size: 0.7rem;
	padding: 4px 10px;
	border-radius: 4px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-family: var(--hb-font-body, "Nunito", sans-serif);
	pointer-events: none;
}

.hb-ook-card__body {
	padding: 1rem 1rem 0.5rem;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.hb-ook-card__title {
	font-family: var(--hb-font-heading, "Fraunces", Georgia, serif);
	font-size: 1rem;
	color: var(--hb-text, #2C2C2C);
	margin: 0 0 0.35rem;
	line-height: 1.3;
	font-weight: 600;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.hb-ook-card__author {
	font-size: 0.85rem;
	color: var(--hb-muted, #6B6357);
	margin: 0 0 0.25rem;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.hb-ook-card__publisher {
	font-size: 0.75rem;
	color: var(--hb-muted, #6B6357);
	opacity: 0.75;
	margin: 0 0 0.5rem;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.hb-ook-card__price {
	font-size: 1rem;
	color: var(--hb-navy, #1D3557);
	font-weight: 700;
	margin: auto 0 0.25rem;
}

.hb-ook-card__button {
	background: var(--hb-terracotta, #C8624A);
	color: var(--hb-white, #FFFFFF);
	border: none;
	padding: 0.7rem 1rem;
	margin: 0.5rem 1rem 1rem;
	border-radius: var(--hb-radius-sm, 8px);
	font-family: var(--hb-font-body, "Nunito", sans-serif);
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.1s ease;
	width: calc(100% - 2rem);
	display: block;
}

.hb-ook-card__button:hover:not(:disabled) {
	background: #B15640;
}

.hb-ook-card__button:active {
	transform: scale(0.98);
}

.hb-ook-card__button:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.hb-ook-card__button.is-loading .hb-ook-card__button-default {
	display: none;
}

.hb-ook-card__button:not(.is-loading) .hb-ook-card__button-loading {
	display: none;
}

.hb-ook-te-bestellen__footer {
	color: var(--hb-muted, #6B6357);
	font-size: 0.9rem;
	margin-top: 1rem;
}

.hb-ook-te-bestellen__footer a {
	color: var(--hb-terracotta, #C8624A);
	text-decoration: none;
	font-weight: 600;
}

.hb-ook-te-bestellen__footer a:hover {
	text-decoration: underline;
}

/* ============================================================
   Mobiel
============================================================ */
@media (max-width: 768px) {
	.hb-zoeken-page {
		padding: 1.5rem 1rem 2.5rem;
	}
	.hb-zoeken-header {
		margin-bottom: 2rem;
	}
	.hb-zoeken-form {
		flex-direction: column;
	}
	.hb-zoeken-form__button {
		width: 100%;
	}
	.hb-ook-te-bestellen__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 1rem;
	}
	.hb-ook-card__body {
		padding: 0.75rem 0.75rem 0.25rem;
	}
	.hb-ook-card__title {
		font-size: 0.9rem;
	}
	.hb-ook-card__author {
		font-size: 0.8rem;
	}
	.hb-ook-card__button {
		padding: 0.6rem 0.75rem;
		margin: 0.5rem 0.75rem 0.75rem;
		width: calc(100% - 1.5rem);
		font-size: 0.8rem;
	}
}

@media (max-width: 380px) {
	.hb-ook-te-bestellen__grid {
		grid-template-columns: 1fr;
	}
}