/* Eyeworx Autoflex – knop + popup
 * De knop krijgt zijn uiterlijk via CSS-variabelen (--b-*) die in het beheer
 * worden ingesteld. :not(#ewaf) houdt themaselectors (#top button, .button) buiten de deur.
 */

/* ---------- Knop ---------- */
.ewaf-sitebtn:not(.ewaf-sitebtn--theme):not(#ewaf) {
	--b-bg: #0b5cff;
	--b-fg: #fff;
	--b-hover: color-mix(in srgb, var(--b-bg) 86%, #000);
	--b-border: transparent;
	--b-bw: 0px;
	--b-radius: 40px;
	--b-fs: 16px;
	--b-fw: 600;
	--b-ff: inherit;
	--b-tt: none;
	--b-ls: normal;
	--b-py: 13px;
	--b-px: 22px;
	--b-shadow: none;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .55em;
	width: auto;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: calc(var(--b-py) - var(--b-bw)) calc(var(--b-px) - var(--b-bw));
	background: var(--b-bg);
	color: var(--b-fg);
	border: var(--b-bw) solid var(--b-border);
	border-radius: var(--b-radius);
	box-shadow: var(--b-shadow);
	font-family: var(--b-ff);
	font-size: var(--b-fs);
	font-weight: var(--b-fw);
	font-style: normal;
	line-height: 1.15;
	letter-spacing: var(--b-ls);
	text-transform: var(--b-tt);
	text-decoration: none;
	text-shadow: none;
	white-space: nowrap;
	vertical-align: middle;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.ewaf-sitebtn:not(.ewaf-sitebtn--theme):not(#ewaf):hover { background: var(--b-hover); color: var(--b-fg); transform: translateY(-1px); text-decoration: none; }
.ewaf-sitebtn:not(.ewaf-sitebtn--theme):not(#ewaf):active { transform: translateY(0); }
.ewaf-sitebtn:not(#ewaf):focus { outline: none; }
.ewaf-sitebtn:not(#ewaf):focus-visible { outline: 3px solid color-mix(in srgb, var(--b-bg, currentColor) 45%, transparent); outline-offset: 3px; }

.ewaf-sitebtn--shadow-sm:not(#ewaf) { --b-shadow: 0 2px 8px -2px rgba(15, 23, 42, .28); }
.ewaf-sitebtn--shadow-md:not(#ewaf) { --b-shadow: 0 10px 24px -8px color-mix(in srgb, var(--b-bg) 60%, rgba(15, 23, 42, .6)), 0 2px 6px rgba(15, 23, 42, .12); }
.ewaf-sitebtn--shadow-lg:not(#ewaf) { --b-shadow: 0 18px 40px -10px color-mix(in srgb, var(--b-bg) 70%, rgba(15, 23, 42, .7)), 0 4px 12px rgba(15, 23, 42, .16); }

/* Rand en link (shortcode stijl="rand" / stijl="link") */
.ewaf-sitebtn--rand:not(.ewaf-sitebtn--theme):not(#ewaf) { --b-bw: 2px; background: transparent; color: var(--b-bg); border-color: var(--b-bg); box-shadow: none; }
.ewaf-sitebtn--rand:not(.ewaf-sitebtn--theme):not(#ewaf):hover { background: var(--b-bg); color: var(--b-fg); }
.ewaf-sitebtn--link:not(.ewaf-sitebtn--theme):not(#ewaf) { padding: 0; background: none; color: var(--b-bg); border: 0; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
.ewaf-sitebtn--link:not(.ewaf-sitebtn--theme):not(#ewaf):hover { background: none; color: var(--b-hover); transform: none; }

.ewaf-sitebtn__icon { width: 1.15em; height: 1.15em; flex: none; }
.ewaf-sitebtn__mlabel { display: none; }
.ewaf-sitebtn--theme { display: inline-flex; align-items: center; gap: .5em; }

/* ---------- Zwevende knop ---------- */
.ewaf-fab {
	position: fixed;
	z-index: 99990;
	right: var(--x, 24px);
	bottom: calc(var(--y, 24px) + env(safe-area-inset-bottom));
	transition: opacity .3s ease, transform .3s ease;
}
.ewaf-fab--left { left: var(--x, 24px); right: auto; }
.ewaf-fab.is-waiting, .ewaf-fab.is-covered { opacity: 0; transform: translateY(16px); pointer-events: none; }
.ewaf-fab .ewaf-sitebtn { position: relative; }
.ewaf-fab.is-attention .ewaf-sitebtn::after {
	content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
	box-shadow: 0 0 0 0 color-mix(in srgb, var(--b-bg, #0b5cff) 55%, transparent);
	animation: ewaf-pulse 1.6s ease-out 3;
}
@keyframes ewaf-pulse { to { box-shadow: 0 0 0 16px transparent; } }

@media (max-width: 640px) {
	.ewaf-fab { --x: 16px; --y: 16px; }
	.ewaf-fab .ewaf-sitebtn:has(.ewaf-sitebtn__mlabel) .ewaf-sitebtn__label { display: none; }
	.ewaf-fab .ewaf-sitebtn__mlabel { display: inline; }
	.ewaf-fab--m-hide { display: none; }
	.ewaf-fab--m-icon .ewaf-sitebtn__label, .ewaf-fab--m-icon .ewaf-sitebtn__mlabel { display: none !important; }
	.ewaf-fab--m-icon .ewaf-sitebtn:not(#ewaf) { width: 58px; height: 58px; padding: 0; }
	.ewaf-fab--m-icon .ewaf-sitebtn__icon { width: 24px; height: 24px; }
	.ewaf-fab--m-bar { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
	.ewaf-fab--m-bar .ewaf-sitebtn:not(#ewaf) { width: 100%; }
	.ewaf-fab--m-bar .ewaf-sitebtn__mlabel { display: none; }
	.ewaf-fab--m-bar .ewaf-sitebtn:has(.ewaf-sitebtn__mlabel) .ewaf-sitebtn__label { display: inline; }
}

/* ---------- Popup ---------- */
html.ewaf-locked, html.ewaf-locked body { overflow: hidden !important; }

.ewaf-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	font-size: 16px;
}
.ewaf-modal[hidden] { display: none; }
.ewaf-modal__backdrop {
	position: absolute; inset: 0;
	background: rgba(15, 23, 42, .58);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity .22s ease;
}
.ewaf-modal__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1120px, 100%);
	height: min(900px, calc(100vh - 48px));
	height: min(900px, calc(100dvh - 48px));
	background: var(--ewaf-surface, #fff); /* eigen achtergrond van de planner (Vormgeving) */
	color: #1e293b;
	border-radius: 18px;
	box-shadow: 0 40px 100px -24px rgba(15, 23, 42, .55), 0 0 0 1px rgba(15, 23, 42, .06);
	overflow: hidden;
	opacity: 0;
	transform: translateY(14px) scale(.985);
	transition: opacity .22s ease, transform .26s cubic-bezier(.2, .8, .2, 1);
}
.ewaf-modal__panel:focus { outline: none; }
.ewaf-modal.is-open .ewaf-modal__backdrop { opacity: 1; }
.ewaf-modal.is-open .ewaf-modal__panel { opacity: 1; transform: none; }

.ewaf-modal__bar {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	flex: none;
	padding: 10px 10px 10px 24px;
	border-bottom: 1px solid color-mix(in srgb, #0f172a 10%, transparent);
	background: var(--ewaf-surface, #fff);
}
.ewaf-modal__title { font-size: 14px; font-weight: 600; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ewaf-modal__close:not(#ewaf) {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; min-height: 0; margin: 0; padding: 0;
	background: transparent; color: #0f172a; border: 0; border-radius: 10px; box-shadow: none;
	cursor: pointer; transition: background-color .15s;
}
.ewaf-modal__close:not(#ewaf):hover { background: #f1f5f9; }
.ewaf-modal__close:not(#ewaf):focus-visible { outline: 2px solid #0f172a; outline-offset: 2px; }

.ewaf-modal__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 28px 32px 32px;
}
.ewaf--modal { max-width: none; }
.ewaf--modal .ewaf-head__eyebrow { display: none; }
.ewaf--modal .ewaf-loading { min-height: 320px; }

@media (max-width: 640px) {
	.ewaf-modal { padding: 0; align-items: stretch; }
	.ewaf-modal__panel {
		width: 100%;
		height: 100vh; height: 100dvh;
		border-radius: 0;
		transform: translateY(32px);
	}
	.ewaf-modal__bar { padding: 6px 6px 6px 16px; padding-top: calc(6px + env(safe-area-inset-top)); }
	.ewaf-modal__body { padding: 20px 16px 0; }
}

@media (prefers-reduced-motion: reduce) {
	.ewaf-fab, .ewaf-modal__backdrop, .ewaf-modal__panel, .ewaf-sitebtn { transition: none !important; }
	.ewaf-fab.is-attention .ewaf-sitebtn::after { animation: none; }
}

/* Tablet: de actiebalk van de planner plakt onderaan de popup. */
@media (max-width: 900px) { .ewaf-modal__body { padding-bottom: 0; } }
