/*
 * Teak Lifestyle WhatsApp Chat
 * Huisstijl: DM Serif Display (koppen), DM Sans (UI), creme #F3F2ED,
 * teakbruin #8B6F52 / #5C4433, charcoal #1E1A16, WhatsApp-groen #25D366.
 */

.tlwa-root {
	--tlwa-green: #25d366;
	--tlwa-green-dark: #1da851;
	--tlwa-cream: #f3f2ed;
	--tlwa-hairline: #e5e2da;
	--tlwa-teak: #8b6f52;
	--tlwa-teak-dark: #5c4433;
	--tlwa-charcoal: #1e1a16;
	--tlwa-ink: #444444;
	--tlwa-muted: #6d6a63;
	--tlwa-serif: "DM Serif Display", Georgia, "Times New Roman", serif;
	--tlwa-sans: "DM Sans", "Open Sans", Arial, sans-serif;

	position: fixed;
	right: 24px;
	bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	z-index: 999990;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	font-family: var(--tlwa-sans);
	line-height: 1.4;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.tlwa-root,
.tlwa-root * {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* ---------- Zwevende knop ---------- */

.tlwa-launcher {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 60px;
	min-width: 60px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--tlwa-green);
	color: #ffffff !important;
	text-decoration: none !important;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(30, 26, 22, 0.18), 0 2px 6px rgba(37, 211, 102, 0.28);
	transition: background-color 0.2s ease-out, box-shadow 0.2s ease-out, transform 0.2s ease-out;
	-webkit-appearance: none;
	appearance: none;
	line-height: 1;
}

.tlwa-launcher:hover,
.tlwa-launcher:focus-visible {
	background: var(--tlwa-green-dark);
	color: #ffffff !important;
	box-shadow: 0 10px 26px rgba(30, 26, 22, 0.24), 0 3px 8px rgba(37, 211, 102, 0.3);
	transform: translateY(-1px);
}

.tlwa-launcher:focus-visible {
	outline: 2px solid var(--tlwa-charcoal);
	outline-offset: 3px;
}

.tlwa-launcher-label {
	max-width: 0;
	opacity: 0;
	overflow: hidden;
	white-space: nowrap;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	transition: max-width 0.26s ease-out, opacity 0.2s ease-out, padding 0.26s ease-out;
}

.tlwa-launcher:hover .tlwa-launcher-label,
.tlwa-launcher:focus-visible .tlwa-launcher-label {
	max-width: 130px;
	opacity: 1;
	padding-left: 22px;
}

.tlwa-root.tlwa-open .tlwa-launcher .tlwa-launcher-label {
	display: none;
}

.tlwa-launcher-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	flex: 0 0 auto;
	transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.tlwa-launcher:hover .tlwa-launcher-icon-open,
.tlwa-launcher:focus-visible .tlwa-launcher-icon-open {
	width: 56px;
}

.tlwa-launcher-icon-close {
	position: absolute;
	top: 0;
	right: 0;
	opacity: 0;
	transform: rotate(-45deg) scale(0.7);
}

.tlwa-root.tlwa-open .tlwa-launcher-icon-open {
	opacity: 0;
	transform: rotate(45deg) scale(0.7);
}

.tlwa-root.tlwa-open .tlwa-launcher-icon-close {
	opacity: 1;
	transform: rotate(0deg) scale(1);
}

/* Eenmalige subtiele pulse na laden */
@keyframes tlwa-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.45);
	}
	100% {
		box-shadow: 0 0 0 22px rgba(37, 211, 102, 0);
	}
}

.tlwa-launcher.tlwa-pulse::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 999px;
	animation: tlwa-pulse 1.1s ease-out 1;
	pointer-events: none;
}

/* ---------- Chatvenster ---------- */

.tlwa-panel {
	width: 360px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 132px);
	margin-bottom: 16px;
	background: #ffffff;
	border: 1px solid var(--tlwa-hairline);
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(30, 26, 22, 0.16);
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	transform-origin: bottom right;
}

@supports (height: 100dvh) {
	.tlwa-panel {
		max-height: calc(100dvh - 132px);
	}
}

.tlwa-panel[hidden] {
	display: none;
}

@keyframes tlwa-panel-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.tlwa-panel.tlwa-panel-anim {
	animation: tlwa-panel-in 0.22s ease-out;
}

.tlwa-panel:focus {
	outline: none;
}

.tlwa-panel:focus-visible {
	outline: 2px solid var(--tlwa-teak);
	outline-offset: -2px;
}

/* Header */

.tlwa-panel-header {
	position: relative;
	padding: 22px 24px 18px;
	border-bottom: 1px solid var(--tlwa-hairline);
	background: #ffffff;
}

.tlwa-panel-kicker {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 1.5px;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--tlwa-teak);
	margin-bottom: 6px;
}

.tlwa-panel-title {
	display: block;
	font-family: var(--tlwa-serif);
	font-weight: 500;
	font-size: 24px;
	line-height: 1.15;
	color: #000000;
	margin-bottom: 8px;
}

.tlwa-panel-subtitle {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 13.5px;
	line-height: 1.4;
	color: #666666;
}

.tlwa-online-dot {
	width: 8px;
	height: 8px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--tlwa-green);
	box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.18);
}

.tlwa-close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #8d8a83;
	cursor: pointer;
	transition: background-color 0.15s ease-out, color 0.15s ease-out;
	-webkit-appearance: none;
	appearance: none;
}

.tlwa-close:hover {
	background: var(--tlwa-cream);
	color: var(--tlwa-charcoal);
}

.tlwa-close:focus-visible {
	outline: 2px solid var(--tlwa-teak);
	outline-offset: 2px;
	color: var(--tlwa-charcoal);
}

/* Body */

.tlwa-panel-body {
	padding: 20px 24px 4px;
	background: #ffffff;
}

.tlwa-bubble-sender {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 1.2px;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--tlwa-teak);
	margin-bottom: 8px;
}

.tlwa-bubble {
	background: var(--tlwa-cream);
	border-radius: 4px 12px 12px 12px;
	padding: 14px 16px;
	max-width: 92%;
}

.tlwa-bubble-text {
	font-size: 15px;
	line-height: 1.55;
	color: var(--tlwa-ink);
}

.tlwa-bubble-time {
	display: block;
	font-size: 11.5px;
	line-height: 1.4;
	color: var(--tlwa-muted);
	margin: 6px 0 0 2px;
}

/* Footer */

.tlwa-panel-footer {
	padding: 16px 24px 18px;
}

.tlwa-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 15px 18px;
	border-radius: 999px;
	background: var(--tlwa-green);
	color: #ffffff !important;
	text-decoration: none !important;
	font-family: var(--tlwa-sans);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	line-height: 1.2;
	box-shadow: 0 4px 14px rgba(37, 211, 102, 0.32);
	transition: background-color 0.2s ease-out, box-shadow 0.2s ease-out, transform 0.2s ease-out;
}

.tlwa-cta:hover {
	background: var(--tlwa-green-dark);
	color: #ffffff !important;
	box-shadow: 0 6px 18px rgba(29, 168, 81, 0.36);
	transform: translateY(-1px);
}

.tlwa-cta:focus-visible {
	outline: 2px solid var(--tlwa-charcoal);
	outline-offset: 3px;
}

.tlwa-cta .tlwa-icon-wa {
	flex: 0 0 auto;
}

.tlwa-footnote {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--tlwa-hairline);
	font-size: 11.5px;
	line-height: 1.5;
	text-align: center;
	color: var(--tlwa-muted);
}

/* ---------- Mobiel ---------- */

@media (max-width: 480px) {
	.tlwa-root {
		right: 16px;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	}

	.tlwa-launcher {
		height: 54px;
		min-width: 54px;
	}

	.tlwa-launcher-icon {
		width: 54px;
		height: 54px;
	}

	.tlwa-panel {
		width: calc(100vw - 32px);
		max-height: calc(100vh - 102px);
		margin-bottom: 12px;
	}

	@supports (height: 100dvh) {
		.tlwa-panel {
			max-height: calc(100dvh - 102px);
		}
	}

	.tlwa-panel-header {
		padding: 18px 20px 16px;
	}

	.tlwa-panel-body {
		padding: 16px 20px 4px;
	}

	.tlwa-panel-footer {
		padding: 14px 20px 16px;
	}

	/* Geen hover-uitschuif op touch */
	.tlwa-launcher .tlwa-launcher-label {
		display: none;
	}
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.tlwa-launcher,
	.tlwa-launcher-label,
	.tlwa-launcher-icon,
	.tlwa-cta,
	.tlwa-close {
		transition: none;
	}

	.tlwa-panel.tlwa-panel-anim {
		animation: none;
	}

	.tlwa-launcher.tlwa-pulse::after {
		animation: none;
	}
}
