/* WhatsApp Floating Chat */
.wafc-widget {
	--wafc-accent: #25D366;
	position: fixed;
	bottom: 22px;
	z-index: 99990;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}
.wafc-widget * { box-sizing: border-box; }
.wafc-pos-right { right: 22px; }
.wafc-pos-left  { left: 22px; }

/* Launcher-Button */
.wafc-launcher {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: 0;
	background: var(--wafc-accent);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	transition: transform .2s ease, box-shadow .2s ease;
	position: relative;
	padding: 0;
}
.wafc-launcher:hover { transform: scale(1.06); }
.wafc-launcher:active { transform: scale(0.97); }
.wafc-launcher .wafc-icon { width: 34px; height: 34px; }

.wafc-launcher__badge {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	background: #ff3b30;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
	border-radius: 10px;
	box-shadow: 0 0 0 2px #fff;
}
.wafc-widget.wafc-open .wafc-launcher__badge { display: none; }

/* Sanftes Pulsieren */
.wafc-launcher::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	box-shadow: 0 0 0 0 var(--wafc-accent);
	animation: wafc-pulse 2.2s infinite;
}
.wafc-widget.wafc-open .wafc-launcher::after { animation: none; }
@keyframes wafc-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); }
	70%  { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
	100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Panel */
.wafc-panel {
	position: absolute;
	bottom: 76px;
	width: 320px;
	max-width: calc(100vw - 44px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
	overflow: hidden;
	transform-origin: bottom right;
	opacity: 0;
	transform: translateY(12px) scale(.96);
	pointer-events: none;
	transition: opacity .22s ease, transform .22s ease;
}
.wafc-pos-right .wafc-panel { right: 0; }
.wafc-pos-left  .wafc-panel { left: 0; transform-origin: bottom left; }

.wafc-widget.wafc-open .wafc-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}
.wafc-panel[hidden] { display: block; } /* via JS gesteuert */

.wafc-panel__header {
	background: var(--wafc-accent);
	color: #fff;
	padding: 16px;
	display: flex;
	align-items: center;
	gap: 12px;
}
.wafc-avatar {
	position: relative;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	background: rgba(255, 255, 255, .2);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.wafc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wafc-avatar .wafc-icon { width: 26px; height: 26px; color: #fff; }
.wafc-online {
	position: absolute;
	bottom: 1px;
	right: 1px;
	width: 11px;
	height: 11px;
	background: #4ade80;
	border: 2px solid var(--wafc-accent);
	border-radius: 50%;
}
.wafc-panel__meta { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.wafc-panel__meta strong { font-size: 15px; }
.wafc-panel__meta span { font-size: 12px; opacity: .9; }

.wafc-close {
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	opacity: .85;
	padding: 0 2px;
}
.wafc-close:hover { opacity: 1; }

.wafc-panel__body {
	padding: 22px 16px;
	background: #e5ddd5;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='4' cy='4' r='1' fill='%23d3cabd'/%3E%3C/svg%3E");
	min-height: 90px;
}
.wafc-bubble {
	position: relative;
	background: #fff;
	color: #303030;
	padding: 10px 14px 18px;
	border-radius: 0 10px 10px 10px;
	font-size: 14px;
	line-height: 1.45;
	max-width: 85%;
	box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
	animation: wafc-bubble-in .3s ease;
}
.wafc-bubble::before {
	content: "";
	position: absolute;
	top: 0;
	left: -7px;
	border: 7px solid transparent;
	border-top-color: #fff;
	border-right-color: #fff;
}
.wafc-bubble__time {
	position: absolute;
	bottom: 4px;
	right: 10px;
	font-size: 10px;
	color: #8a8a8a;
}
@keyframes wafc-bubble-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* „Kontakt speichern" – nur beim Chat-Start, oben im Fenster */
.wafc-savecard {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0 0 12px;
	padding: 7px 12px;
	background: #fff;
	color: #333 !important;
	text-decoration: none;
	border-radius: 18px;
	font-size: 12.5px;
	font-weight: 600;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
	transition: background .2s ease;
}
.wafc-savecard:hover { background: #f1f1f1; }
.wafc-savecard .wafc-icon { width: 16px; height: 16px; color: var(--wafc-accent); }

/* Nachrichtenfeld (Desktop) */
.wafc-compose {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px;
	background: #f6f6f6;
}
.wafc-input {
	flex: 1 1 auto;
	min-width: 0; /* erlaubt das Schrumpfen, sonst drückt das Feld den Button raus */
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 10px 14px;
	font-size: 14px;
	font-family: inherit;
	line-height: 1.4;
	resize: none;
	outline: none;
	background: #fff;
	color: #303030;
	max-height: 120px;
	transition: border-color .2s ease;
}
.wafc-input:focus { border-color: var(--wafc-accent); }
.wafc-send {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	min-width: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wafc-accent);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: filter .2s ease, transform .1s ease;
}
.wafc-send:hover { filter: brightness(.95); }
.wafc-send:active { transform: scale(.94); }
.wafc-send svg { width: 22px; height: 22px; display: block; }

/* Sichtbarkeit */
@media (max-width: 767px) {
	.wafc-hide-mobile { display: none !important; }
}
@media (min-width: 768px) {
	.wafc-hide-desktop { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
	.wafc-launcher::after { animation: none; }
	.wafc-panel { transition: opacity .15s ease; }
}
