/* ==========================================================================
   Cookiemelding — "Een koekje bij de koffie?"
   Klein glazen kaartje linksonder; geen muur over de pagina.
   ========================================================================== */
.cb-consent {
	position: fixed;
	left: max(16px, env(safe-area-inset-left));
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 120;
	width: min(410px, calc(100vw - 32px));
	opacity: 0;
	transform: translateY(18px) scale(0.98);
	transition: opacity 500ms var(--cb-ease), transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1);
	pointer-events: none;
}
.cb-consent.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.cb-consent.is-leaving { transition-duration: 400ms; }

.cb-consent__card {
	position: relative;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: var(--cb-space-4);
	padding: var(--cb-space-5) var(--cb-space-5) var(--cb-space-4);
	border-radius: 22px;
	background: linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.8) 60%, rgba(250, 248, 249, 0.88));
	backdrop-filter: blur(18px) saturate(170%);
	-webkit-backdrop-filter: blur(18px) saturate(170%);
	box-shadow:
		0 24px 60px -22px rgba(46, 11, 56, 0.45),
		0 2px 6px rgba(46, 11, 56, 0.06),
		inset 0 1px 0 #fff,
		inset 0 0 0 1px rgba(234, 228, 236, 0.95);
	overflow: hidden;
}
.cb-consent__card::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 3px;
	background: var(--cb-sunset);
}

/* — Het koekje — */
.cb-consent__cookie { display: block; width: 56px; height: 56px; margin-top: 2px; }
.cb-consent__cookie svg { display: block; overflow: visible; }
.cb-consent__bite { transform-box: fill-box; transform-origin: 80% 20%; transform: scale(0); transition: transform 380ms cubic-bezier(0.34, 1.6, 0.5, 1); }
.cb-consent__crumbs { opacity: 0; transition: opacity 300ms ease 200ms, transform 600ms ease 200ms; }
.cb-consent.is-accepted .cb-consent__bite { transform: scale(1); }
.cb-consent.is-accepted .cb-consent__crumbs { opacity: 1; transform: translate(3px, 6px); }
@media (prefers-reduced-motion: no-preference) {
	.cb-consent.is-visible:not(.is-done) .cb-consent__cookie svg { animation: cb-cookie-wiggle 5s ease-in-out 1.2s infinite; }
}
@keyframes cb-cookie-wiggle {
	0%, 88%, 100% { transform: rotate(0); }
	91% { transform: rotate(-7deg); }
	94% { transform: rotate(6deg); }
	97% { transform: rotate(-3deg); }
}

/* — Tekst — */
.cb-consent__title { margin: 0 0 4px; font-family: var(--cb-font-serif); font-size: 1.22rem; font-weight: 600; line-height: 1.25; color: var(--cb-text-accent); }
.cb-consent__text { margin: 0; font-size: 0.86rem; line-height: 1.55; color: var(--cb-ink-soft); }
.cb-consent__text a { margin-left: 0.25em; font-weight: 600; white-space: nowrap; }

/* — Voorkeuren — */
.cb-consent__prefs { display: grid; gap: 2px; margin: var(--cb-space-4) 0 0; padding: 0; border: 0; }
.cb-consent__prefs:not([hidden]) { animation: cb-consent-open 400ms var(--cb-ease); }
@keyframes cb-consent-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cb-consent__opt {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--cb-space-4);
	padding: 0.6rem 0;
	border-top: 1px solid rgba(91, 26, 107, 0.08);
	cursor: pointer;
}
.cb-consent__opt strong { display: block; font-size: 0.86rem; color: var(--cb-ink); }
.cb-consent__opt small { display: block; font-size: 0.76rem; line-height: 1.45; color: var(--cb-ink-muted); }

/* Schakelaar */
.cb-consent__switch {
	appearance: none;
	-webkit-appearance: none;
	flex: none;
	position: relative;
	width: 42px; height: 24px;
	margin: 0;
	border-radius: 99px;
	background: #E2DAE5;
	box-shadow: inset 0 1px 2px rgba(46, 11, 56, 0.15);
	cursor: pointer;
	transition: background var(--cb-dur) var(--cb-ease);
}
.cb-consent__switch::after {
	content: "";
	position: absolute;
	top: 3px; left: 3px;
	width: 18px; height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(46, 11, 56, 0.3);
	transition: transform var(--cb-dur) cubic-bezier(0.34, 1.4, 0.5, 1);
}
.cb-consent__switch:checked { background: var(--cb-purple); }
.cb-consent__switch:checked::after { transform: translateX(18px); }
.cb-consent__switch:disabled { background: rgba(91, 26, 107, 0.45); cursor: not-allowed; }
.cb-consent__switch:focus-visible { box-shadow: var(--cb-focus); }

/* — Knoppen: weigeren en accepteren even zwaar — */
.cb-consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--cb-space-2); margin-top: var(--cb-space-4); }
.cb-consent__actions--single { grid-template-columns: 1fr; }
.cb-consent__btn {
	min-height: 42px;
	padding: 0.55rem 0.9rem;
	border: 1.5px solid var(--cb-purple);
	border-radius: var(--cb-radius-pill);
	background: var(--cb-purple);
	color: var(--cb-white);
	font-size: 0.86rem;
	font-weight: 600;
	transition: background var(--cb-dur-fast) var(--cb-ease), transform var(--cb-dur-fast) var(--cb-ease);
}
.cb-consent__btn:hover { background: var(--cb-purple-dark); border-color: var(--cb-purple-dark); }
.cb-consent__btn:active { transform: translateY(1px); }

.cb-consent__secondary { display: flex; justify-content: center; margin-top: var(--cb-space-2); }
.cb-consent__link {
	padding: 0.35rem 0.6rem;
	background: none;
	border: 0;
	border-radius: 6px;
	color: var(--cb-text-accent);
	font-size: 0.8rem;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}
.cb-consent__link:hover { color: var(--cb-text-accent-strong); }

/* — Bevestiging — */
.cb-consent__toast { min-height: 0; margin: 0; font-family: var(--cb-font-serif); font-style: italic; color: var(--cb-text-accent); text-align: center; }
.cb-consent.is-done .cb-consent__actions,
.cb-consent.is-done .cb-consent__secondary,
.cb-consent.is-done .cb-consent__prefs { display: none; }
.cb-consent.is-done .cb-consent__toast { margin-top: var(--cb-space-3); font-size: 1rem; }

/* — Footer-link — */
.cb-consent-open {
	padding: 0;
	background: none;
	border: 0;
	color: rgba(255, 255, 255, 0.78);
	font: inherit;
	cursor: pointer;
}
.cb-consent-open:hover { color: var(--cb-gold); text-decoration: underline; }

@media (max-width: 480px) {
	.cb-consent { left: 12px; right: 12px; bottom: 12px; width: auto; }
	.cb-consent__card { grid-template-columns: 1fr; gap: var(--cb-space-2); }
	.cb-consent__cookie { width: 44px; height: 44px; }
	.cb-consent__cookie svg { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
	.cb-consent, .cb-consent__bite, .cb-consent__crumbs { transition: none; }
}

/* hidden-attribuut altijd laten winnen */
.cb-consent [hidden], .cb-consent__prefs[hidden] { display: none !important; }
