/*
 * BloomPost header (template-parts/bp-header.php)
 * Maten uit Figma "Kaart first flows": "header desktop" (>=1024px) en
 * "mobile header" (<=767px). Tablet (768-1023px) is daartussen afgeleid.
 * Het hoofdmenu is het Bloompost Mega Menu (plugin), dat onder 1024px naar
 * het hamburgermenu schakelt.
 */

.bp-header {
	--bp-ink: #0f2c30;
	--bp-green: #68bfad;
	--bp-field: #f0f2f2;
	--bp-font: "Helvetica-Neue", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--bp-font-alt: "Staatliches", "Bebas Neue", "Arial Narrow", sans-serif;
	--bp-topbar-size: 18px;
	--bp-slide-height: 20px;

	/* Geen eigen box: topbar, witte header en promobar zijn zo directe
	   flow-elementen van <body>, zodat alleen de witte header sticky is. */
	display: contents;
	color: var(--bp-ink);
	font-family: var(--bp-font);
	font-weight: 400;
	line-height: 1.1;
	text-align: left;
}

/* Topbar en promobar scrollen mee; de witte header blijft bovenaan staan. */
.bp-topbar,
.bp-header__main,
.bp-promobar {
	color: var(--bp-ink);
	font-family: var(--bp-font);
	line-height: 1.1;
	text-align: left;
}

.bp-header__main {
	position: sticky;
	top: 0;
	z-index: 999;
	background: #fff;
}

.bp-header__main:last-child,
.bp-header.is-collapsed .bp-header__main {
	box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}

body.admin-bar .bp-header__main {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media (max-width: 600px) {
	body.admin-bar .bp-header__main {
		top: 0;
	}
}

.bp-header *,
.bp-header *::before,
.bp-header *::after {
	box-sizing: border-box;
}

.bp-header .bp-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.bp-header .bp-icon {
	display: block;
	flex: none;
}

.bp-header__inner {
	width: min(1300px, calc(100% - 40px));
	margin: 0 auto;
}

/* knoppen: reset van de Hello Elementor-knopstijl */
.bp-header button.bp-search__submit,
.bp-header button.bp-header__search-toggle {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--bp-ink);
	font: inherit;
	line-height: 1;
	cursor: pointer;
	transition: none;
}

.bp-header button.bp-search__submit:hover,
.bp-header button.bp-search__submit:focus,
.bp-header button.bp-header__search-toggle:hover,
.bp-header button.bp-header__search-toggle:focus {
	background: transparent;
	color: var(--bp-ink);
}

/* ---------- topbar ---------- */
.bp-topbar {
	position: relative;
	background: var(--bp-green);
	color: #fff;
}

.bp-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 37px;
	padding: 8px 0;
	font-size: var(--bp-topbar-size);
	line-height: 1.1;
}

.bp-topbar__slider {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	height: var(--bp-slide-height);
	overflow: hidden;
}

.bp-topbar ul.bp-topbar__slides,
.bp-topbar ul.bp-topbar__menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bp-topbar__slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
	opacity: 0;
	transform: translateY(100%);
	transition: transform 0.6s ease, opacity 0.6s ease;
}

.bp-topbar__slide span {
	overflow: hidden;
	text-overflow: ellipsis;
}

.bp-topbar__slide.is-active {
	opacity: 1;
	transform: none;
}

.bp-topbar__slide.is-leaving {
	opacity: 0;
	transform: translateY(-100%);
}

.bp-topbar__slide .bp-icon--check {
	width: 0.78em;
	height: 0.78em;
}

.bp-topbar__nav {
	flex: none;
}

.bp-topbar ul.bp-topbar__menu {
	display: flex;
	align-items: center;
	gap: 16px;
}

.bp-topbar__menu li {
	margin: 0;
	padding: 0;
}

.bp-topbar__menu a,
.bp-topbar__menu a:visited {
	color: #fff;
	text-decoration: none;
	white-space: nowrap;
}

/* Muis over: geen underline. Toetsenbordfocus houdt de underline als focusindicatie (outline staat elders uit). */
.bp-topbar__menu a:hover {
	color: #fff;
	text-decoration: none;
}

.bp-topbar__menu a:focus-visible {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- logo, zoeken, winkelwagen ---------- */
.bp-header__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 700px) minmax(0, 1fr);
	grid-template-areas: "logo search actions";
	align-items: center;
	column-gap: 32px;
	padding: 16px 0;
}

.bp-header__burger {
	grid-area: burger;
	display: none;
}

.bp-header__logo {
	grid-area: logo;
	justify-self: start;
	display: block;
	line-height: 0;
}

.bp-header__logo img {
	display: block;
	width: 90px;
	height: 90px;
	max-width: none;
}

.bp-search {
	grid-area: search;
	position: relative;
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	height: 56px;
	margin: 0;
	padding: 0 20px;
	border-radius: 100px;
	background: var(--bp-field);
}

.bp-header input.bp-search__input,
.bp-header input.bp-search__input:focus {
	-webkit-appearance: none;
	appearance: none;
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	height: 100%;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	outline: none !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--bp-ink);
	font-family: var(--bp-font);
	font-size: 18px;
	font-weight: 300;
	line-height: 1;
	transition: none;
}

.bp-header input.bp-search__input::-webkit-search-decoration,
.bp-header input.bp-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.bp-header .bp-search__input::placeholder {
	color: rgba(15, 44, 48, 0.5) !important;
	font-style: italic;
	opacity: 1;
}

.bp-header .bp-search__input:focus::placeholder {
	color: transparent !important;
}

.bp-header button.bp-search__submit {
	flex: none;
	width: 32px;
	height: 32px;
}

.bp-search__submit .bp-icon,
.bp-header__search-toggle .bp-icon {
	width: 100%;
	height: 100%;
}

.bp-search.is-loading .bp-search__submit .bp-icon {
	animation: bp-search-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes bp-search-pulse {
	to {
		opacity: 0.35;
	}
}

.bp-header__actions {
	grid-area: actions;
	justify-self: end;
	display: flex;
	align-items: center;
	gap: 21px;
}

.bp-header button.bp-header__search-toggle {
	display: none;
	width: 24px;
	height: 24px;
}

.bp-header a.bp-cart-link,
.bp-header a.bp-cart-link:visited,
.bp-header a.bp-cart-link:hover {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--bp-ink);
	text-decoration: none;
	white-space: nowrap;
}

.bp-cart-link .bp-icon--cart {
	width: 32px;
	height: 32px;
}

.bp-header a.bp-cart-link.has-items {
	height: 48px; /* gelijk aan checkout header */
	padding: 8px;
	border: 1px solid var(--bp-ink);
	border-radius: 8px;
}

.bp-cart-link__total {
	font-family: var(--bp-font);
	font-size: 18px;
	font-weight: 700; /* gelijk aan checkout header */
	line-height: 1;
}

.bp-cart-link__total .woocommerce-Price-amount {
	color: inherit;
	font: inherit;
}

/* ---------- hoofdmenu (Bloompost Mega Menu) ---------- */
.bp-header .bpmm.bp-header__menu--desktop .bpmm-mobile,
.bp-header .bpmm.bp-header__menu--mobile .bpmm-desktop {
	display: none !important;
}

.bp-header .bp-header__menu--desktop {
	--bpmm-top-gap: 56px;
	--bpmm-bar-height: 39px;
	--bpmm-size-top: 18px;
}

.bp-header .bp-header__menu--desktop .bpmm-bar__link,
.bp-header .bp-header__menu--desktop button.bpmm-bar__link {
	align-items: flex-start;
	padding: 0 0 16px;
	letter-spacing: 0.08em;
	line-height: 23px;
}

.bp-header .bp-header__menu--desktop button.bpmm-bar__toggle {
	top: 0;
	margin-top: -2px;
}

.bp-header .bp-header__menu--mobile button.bpmm-burger {
	margin-left: -10px;
}

/* ---------- promobar ---------- */
.bp-promobar {
	position: relative;
	z-index: 1;
	box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
	background: var(--bp-promobar-bg, #d9efeb);
	color: var(--bp-promobar-color, #68bfad);
}

.bp-promobar__content {
	padding: 8px 0;
	font-family: var(--bp-font);
	font-size: 18px;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
}

.bp-promobar__content p {
	margin: 0 !important;
}

.bp-promobar__content p + p {
	margin-top: 4px !important;
}

.bp-promobar__content a,
.bp-promobar__content a:hover {
	color: inherit;
	text-decoration: underline;
}

/* ---------- zoek-popup ---------- */
.bp-search__popup {
	position: absolute;
	top: calc(100% + 8px);
	left: 50%;
	z-index: 1001;
	width: min(560px, 100%);
	max-height: calc(100vh - 160px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(15, 44, 48, 0.18);
	text-align: left;
	transform: translateX(-50%);
}

.bp-search__popup[hidden] {
	display: none;
}

.bp-header ul.bp-search__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.bp-search__grid li {
	display: flex;
	margin: 0;
	padding: 0;
}

.bp-header a.bp-search__item,
.bp-header a.bp-search__item:visited,
.bp-header a.bp-search__item:hover {
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 3px 4.5px rgba(0, 0, 0, 0.2);
	color: var(--bp-ink);
	text-decoration: none;
}

.bp-search__media {
	display: block;
	aspect-ratio: 1 / 1;
	background: var(--bp-field);
}

.bp-search__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.bp-search__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	padding: 10px 10px 4px;
	font-size: 15px;
	font-weight: 300;
	line-height: 1.25;
}

.bp-search__item:hover .bp-search__title {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.bp-search__price {
	margin-top: auto;
	padding: 0 10px 10px;
	font-size: 15px;
	font-weight: 300;
	line-height: 1.25;
}

.bp-search__price .woocommerce-Price-amount {
	color: inherit;
	font-weight: 300;
}

.bp-search__price del {
	margin-right: 4px;
	color: #676f70;
	font-size: 0.85em;
	text-decoration-thickness: 1px;
}

.bp-search__price del .woocommerce-Price-amount {
	color: #676f70;
}

.bp-search__price ins {
	text-decoration: none;
}

.bp-search__price .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
}

.bp-search__price ins .woocommerce-Price-amount {
	color: #e05a5a;
}

.bp-search__message {
	margin: 0 !important;
	padding: 4px;
	font-size: 15px;
	font-weight: 300;
}

.bp-header a.bp-search__all,
.bp-header a.bp-search__all:visited {
	display: block;
	margin-top: 14px;
	color: var(--bp-ink);
	font-size: 15px;
	font-weight: 400;
	text-align: center;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- ingeklapte header (zodra de witte header bovenaan vastzit) ---------- */
.bp-header.is-collapsed .bp-header__logo img {
	width: 69px;
	height: 69px;
}

/* ---------- tablet ---------- */
@media (max-width: 1023.98px) {
	.bp-header {
		--bp-topbar-size: 16px;
		--bp-slide-height: 18px;
	}

	.bp-topbar__inner {
		min-height: 34px;
	}

	.bp-header__row {
		grid-template-columns: auto auto minmax(0, 1fr) auto;
		grid-template-areas: "burger logo search actions";
		column-gap: 24px;
	}

	.bp-header__burger {
		display: block;
	}

	.bp-header__logo img {
		width: 72px;
		height: 72px;
	}

	.bp-header.is-collapsed .bp-header__logo img {
		width: 56px;
		height: 56px;
	}

	.bp-search {
		height: 48px;
		padding: 0 16px;
	}

	.bp-header input.bp-search__input,
	.bp-header input.bp-search__input:focus {
		font-size: 16px;
	}

	.bp-header button.bp-search__submit {
		width: 28px;
		height: 28px;
	}

	.bp-header__nav {
		display: none;
	}

	.bp-promobar__content {
		font-size: 16px;
		line-height: 20px;
	}
}

/* ---------- mobiel ---------- */
@media (max-width: 767.98px) {
	.bp-header {
		--bp-topbar-size: 12px;
		--bp-slide-height: 14px;
	}

	.bp-topbar__inner {
		justify-content: center;
		min-height: 29px;
	}

	.bp-topbar__slide {
		justify-content: center;
		gap: 4px;
	}

	.bp-topbar__nav {
		display: none;
	}

	.bp-header__row {
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
		grid-template-areas:
			"burger logo actions"
			"search search search";
		column-gap: 16px;
		row-gap: 16px;
		padding: 16px 0;
	}

	.bp-header__burger {
		justify-self: start;
	}

	.bp-header__logo {
		justify-self: center;
	}

	.bp-header__logo img {
		width: 72px;
		height: 72px;
	}

	.bp-search {
		height: 40px;
		padding: 0 8px 0 16px;
		gap: 16px;
	}

	.bp-header input.bp-search__input,
	.bp-header input.bp-search__input:focus {
		font-size: 16px; /* geen automatische zoom op iOS */
	}

	.bp-header .bp-search__input::placeholder {
		font-size: 12px;
	}

	.bp-header button.bp-search__submit {
		width: 24px;
		height: 24px;
	}

	.bp-header__actions {
		gap: 24px;
	}

	.bp-cart-link .bp-icon--cart {
		width: 24px;
		height: 24px;
	}

	.bp-header a.bp-cart-link {
		gap: 6px;
	}

	.bp-header a.bp-cart-link.has-items {
		height: 34px;
		padding: 4px 6px;
		border-radius: 6px;
	}

	.bp-cart-link__total {
		font-size: 14px;
	}

	.bp-promobar__content {
		font-family: var(--bp-font-alt);
		font-size: 17px;
		font-weight: 400;
		letter-spacing: 0.03em;
		line-height: 1.1;
		text-transform: uppercase;
	}

	.bp-promobar__content strong,
	.bp-promobar__content b {
		font-weight: 400;
	}

	/* zoek-popup */
	.bp-search__popup {
		padding: 12px;
		max-height: calc(100vh - 220px);
	}

	.bp-header ul.bp-search__grid {
		gap: 8px;
	}

	.bp-search__title {
		padding: 6px 6px 2px;
		font-size: 12px;
	}

	.bp-search__price {
		padding: 0 6px 6px;
		font-size: 12px;
	}

	.bp-search__message,
	.bp-header a.bp-search__all {
		font-size: 13px;
	}

	/* ingeklapt (Figma "soort=collapsed"): 60px hoog, logo 44px, zoekicoon */
	.bp-header.is-collapsed .bp-header__row {
		row-gap: 0;
		column-gap: 8px;
		padding: 8px 0;
	}

	.bp-header.is-collapsed .bp-header__actions {
		gap: 16px;
	}

	.bp-header.is-collapsed.is-search-open .bp-header__row {
		row-gap: 8px;
	}

	.bp-header.is-collapsed .bp-header__logo img {
		width: 44px;
		height: 44px;
	}

	.bp-header.is-collapsed .bp-search {
		height: 0;
		opacity: 0;
		visibility: hidden;
		overflow: hidden;
	}

	.bp-header.is-collapsed.is-search-open .bp-search {
		height: 40px;
		opacity: 1;
		visibility: visible;
		overflow: visible;
	}

	.bp-header.is-collapsed button.bp-header__search-toggle {
		display: inline-flex;
	}
}

/* ---------- vloeiende overgang naar de compacte header ---------- */
.bp-header__main {
	transition: box-shadow 0.6s ease, margin-bottom 0.6s ease;
}

.bp-header__row {
	transition: padding 0.6s ease, row-gap 0.6s ease;
}

.bp-header__logo img {
	transition: width 0.6s ease, height 0.6s ease;
}

.bp-search {
	transition: height 0.6s ease, opacity 0.6s ease, visibility 0.6s ease;
}

.bp-header.is-collapsed button.bp-header__search-toggle {
	animation: bp-fade-in 0.6s ease;
}

@keyframes bp-fade-in {
	from {
		opacity: 0;
	}
}

/* tijdens het meten van de hoogtes (JS) geen overgangen */
.bp-header.bp-no-anim *,
.bp-header.bp-no-anim *::before,
.bp-header.bp-no-anim *::after {
	transition: none !important;
	animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.bp-header__main,
	.bp-header__row,
	.bp-header__logo img,
	.bp-search {
		transition: none;
	}

	.bp-topbar__slide {
		transition: none;
	}

	.bp-search.is-loading .bp-search__submit .bp-icon {
		animation: none;
	}
}

/* ---------- minicart (desktop + tablet) ---------- */
.bp-minicart {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 1002;
	height: 0;
	pointer-events: none;
}

.bp-minicart[hidden] {
	display: none;
}

.bp-minicart__inner {
	display: flex;
	justify-content: flex-end;
}

.bp-minicart__panel {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 372px;
	max-width: 100%;
	max-height: var(--bp-minicart-max, calc(100vh - 160px));
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 6px 12px 12px;
	border: 1px solid #676f70;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 3px 3px rgba(0, 0, 0, 0.25);
	color: var(--bp-ink);
	font-family: var(--bp-font);
	font-size: 13px;
	line-height: 1.1;
	text-align: left;
	pointer-events: auto;
	-webkit-font-smoothing: antialiased;
	animation: bp-minicart-in 0.2s ease;
}

@keyframes bp-minicart-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}

.bp-minicart__title {
	margin: 0;
	padding: 6px 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
}

.bp-minicart__content {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bp-minicart__empty {
	margin: 0;
	padding: 4px 0 6px;
	font-size: 13px;
	line-height: 1.4;
}

.bp-minicart__cols {
	display: flex;
	justify-content: space-between;
	gap: 6px;
	padding-bottom: 6px;
	border-bottom: 1px solid #000;
	color: #000;
}

.bp-minicart__items {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bp-minicart__item {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.bp-minicart__row {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 60px;
}

.bp-minicart__thumb {
	flex: 0 0 60px;
	width: 60px;
	height: 60px;
}

.bp-header .bp-minicart__thumb img {
	display: block;
	width: 60px;
	height: 60px;
	max-width: none;
	object-fit: cover;
	border-radius: 3px;
	box-shadow: none;
}

.bp-minicart__name {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 700;
	line-height: 1.2;
}

.bp-minicart__name a {
	color: inherit;
	text-decoration: none;
}

.bp-minicart__qty {
	font-weight: 400;
}

.bp-minicart__price,
.bp-minicart__total-value {
	flex: 0 0 auto;
	text-align: right;
	white-space: nowrap;
}

.bp-minicart .woocommerce-Price-amount {
	color: inherit;
	font: inherit;
}

.bp-minicart__message {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.bp-minicart__message-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 6px;
}

.bp-header a.bp-minicart__edit,
.bp-header a.bp-minicart__edit:visited {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	color: #459e8c;
	text-decoration: none;
}

.bp-header a.bp-minicart__edit:hover {
	color: var(--bp-ink);
}

.bp-minicart__message-box {
	padding: 6px;
	border: 1px solid #d2d8d9;
	border-radius: 6px;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.bp-minicart__totals {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding-top: 12px;
	border-top: 1px solid #000;
}

.bp-minicart__total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 6px;
	min-height: 18px;
}

.bp-minicart__total-label {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
}

.bp-minicart__total-label small {
	font-size: 11px;
	font-weight: 400;
	color: #676f70;
}

.bp-minicart__total--discount .bp-minicart__total-value {
	color: #68bfad;
}

.bp-minicart__total .bp-cart__muted {
	white-space: normal;
	font-size: 0.85em;
	color: #676f70;
}

.bp-header a.bp-minicart__button,
.bp-header a.bp-minicart__button:visited {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	margin-top: 4px;
	padding: 8px 16px;
	border-radius: 100px;
	background: var(--bp-ink);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.bp-header a.bp-minicart__button:hover,
.bp-header a.bp-minicart__button:focus-visible {
	background: #1d4a50;
	color: #fff;
}

@media (max-width: 767.98px) {
	.bp-minicart {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bp-minicart__panel {
		animation: none;
	}
}
