/* WhatsApp Knop — front-end styles */

.wak-widget {
	--wak-color: #25d366;
	--wak-offset-x: 20px;
	--wak-offset-y: 20px;
	--wak-radius: 18px;
	--wak-shadow: 0 12px 32px rgba(11, 20, 26, 0.18), 0 2px 6px rgba(11, 20, 26, 0.12);

	position: fixed;
	bottom: var(--wak-offset-y);
	z-index: 99990;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.45;
	box-sizing: border-box;
}

.wak-widget *,
.wak-widget *::before,
.wak-widget *::after {
	box-sizing: border-box;
}

.wak-widget [hidden] {
	display: none;
}

.wak-widget--right {
	right: var(--wak-offset-x);
	left: auto;
	align-items: flex-end;
}

.wak-widget--left {
	left: var(--wak-offset-x);
	right: auto;
	align-items: flex-start;
}

/* ---------- Launcher ---------- */

.wak-widget .wak-launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	width: 60px;
	height: 60px;
	border: 0;
	border-radius: 999px;
	background: var(--wak-color);
	color: #fff;
	box-shadow: var(--wak-shadow);
	cursor: pointer;
	text-decoration: none;
	appearance: none;
	-webkit-appearance: none;
	justify-content: center;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.wak-widget .wak-launcher:hover,
.wak-widget .wak-launcher:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 16px 36px rgba(11, 20, 26, 0.24), 0 3px 8px rgba(11, 20, 26, 0.14);
	color: #fff;
}

.wak-widget .wak-launcher:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.9);
	outline-offset: 3px;
}

.wak-widget .wak-launcher:active {
	transform: translateY(0);
}

.wak-widget .wak-launcher__label {
	display: none;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	color: #fff;
}

.wak-widget .wak-launcher .wak-icon {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	transition: opacity 0.18s ease, transform 0.18s ease;
}

/* Knop met tekst: pil in plaats van cirkel. */
.wak-widget .wak-launcher--with-label {
	width: auto;
	height: 56px;
	padding: 0 22px 0 18px;
}

.wak-widget .wak-launcher--with-label .wak-launcher__label {
	display: inline;
}

/* Kruisje dat het icoon vervangt als de popup open staat. */
.wak-widget .wak-launcher__close {
	position: absolute;
	width: 22px;
	height: 22px;
	opacity: 0;
	transform: rotate(-90deg);
	transition: opacity 0.18s ease, transform 0.18s ease;
	pointer-events: none;
}

.wak-widget .wak-launcher__close::before,
.wak-widget .wak-launcher__close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 2.5px;
	border-radius: 2px;
	background: #fff;
}

.wak-widget .wak-launcher__close::before {
	transform: rotate(45deg);
}

.wak-widget .wak-launcher__close::after {
	transform: rotate(-45deg);
}

.wak-widget .wak-launcher {
	position: relative;
}

.wak-widget.wak-widget--open .wak-launcher .wak-icon--launcher {
	opacity: 0;
	transform: scale(0.6);
}

.wak-widget.wak-widget--open .wak-launcher__close {
	opacity: 1;
	transform: rotate(0deg);
}

.wak-widget.wak-widget--open .wak-launcher__label {
	display: none;
}

.wak-widget.wak-widget--open .wak-launcher--with-label {
	width: 60px;
	height: 60px;
	padding: 0;
}

/* ---------- Popup ---------- */

.wak-widget .wak-panel {
	width: 320px;
	max-width: calc(100vw - 32px);
	border-radius: var(--wak-radius);
	overflow: hidden;
	background: #efe7de;
	box-shadow: var(--wak-shadow);
	opacity: 0;
	transform: translateY(14px) scale(0.97);
	transform-origin: bottom right;
	transition: opacity 0.2s ease, transform 0.2s ease;
	color: #0b141a;
	text-align: left;
}

.wak-widget--left .wak-panel {
	transform-origin: bottom left;
}

.wak-widget.wak-widget--open .wak-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.wak-widget .wak-panel__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: var(--wak-color);
	color: #fff;
}

.wak-widget .wak-avatar {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	object-fit: cover;
	background: rgba(255, 255, 255, 0.22);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	max-width: none;
}

.wak-widget .wak-avatar--fallback .wak-icon {
	width: 26px;
	height: 26px;
	color: #fff;
}

.wak-widget .wak-panel__who {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.wak-widget .wak-panel__name {
	font-size: 15px;
	font-weight: 700;
	color: #fff;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wak-widget .wak-panel__role {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.88);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wak-widget .wak-panel__close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: #fff;
	cursor: pointer;
	opacity: 0.85;
	appearance: none;
	-webkit-appearance: none;
}

.wak-widget .wak-panel__close:hover,
.wak-widget .wak-panel__close:focus-visible {
	opacity: 1;
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
}

.wak-widget .wak-panel__body {
	padding: 20px 16px 16px;
	background-color: #efe7de;
	background-image: radial-gradient(rgba(11, 20, 26, 0.06) 1px, transparent 1px);
	background-size: 18px 18px;
}

.wak-widget .wak-bubble {
	position: relative;
	display: block;
	max-width: 100%;
	padding: 10px 12px 20px;
	border-radius: 0 10px 10px 10px;
	background: #fff;
	box-shadow: 0 1px 1px rgba(11, 20, 26, 0.12);
	font-size: 14px;
	color: #0b141a;
	animation: wak-pop 0.28s ease both;
}

.wak-widget .wak-bubble::before {
	content: "";
	position: absolute;
	top: 0;
	left: -8px;
	width: 0;
	height: 0;
	border-top: 8px solid #fff;
	border-left: 8px solid transparent;
}

.wak-widget .wak-bubble__title {
	display: block;
	font-weight: 700;
	margin-bottom: 2px;
}

.wak-widget .wak-bubble__text {
	display: block;
	color: #3b4a54;
}

.wak-widget .wak-bubble__time {
	position: absolute;
	right: 10px;
	bottom: 6px;
	font-size: 11px;
	color: #8696a0;
}

.wak-widget .wak-panel__footer {
	padding: 12px 16px 16px;
	background: #efe7de;
}

.wak-widget .wak-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 12px 16px;
	border: 0;
	border-radius: 999px;
	background: var(--wak-color);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(11, 20, 26, 0.16);
	transition: filter 0.18s ease;
}

.wak-widget .wak-cta:hover,
.wak-widget .wak-cta:focus-visible {
	filter: brightness(0.94);
	color: #fff;
	text-decoration: none;
}

.wak-widget .wak-cta .wak-icon {
	width: 22px;
	height: 22px;
}

@keyframes wak-pop {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ---------- Apparaten ---------- */

@media (max-width: 767px) {
	.wak-widget--no-mobile {
		display: none;
	}

	.wak-widget .wak-panel {
		width: calc(100vw - 32px);
	}
}

@media (min-width: 768px) {
	.wak-widget--no-desktop {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wak-widget .wak-panel,
	.wak-widget .wak-launcher,
	.wak-widget .wak-icon,
	.wak-widget .wak-launcher__close,
	.wak-widget .wak-bubble {
		transition: none;
		animation: none;
	}
}
