/* Willms Chatbot – Widget v2.2
   Revierkarte: Kartenpapier, Waldgrün, STIHL-Orange — dieselben Werte wie im
   Child-Theme (boerger.css, Abschnitt 1). Schriften Bitter/Karla laedt das
   Theme; fehlen sie, greifen Georgia/Arial.
   Theme-sicher: Sichtbarkeit per Klassen + !important, Inputs gegen Flatsome gehaertet. */

#wfb-chat-root {
	--wfb-orange:      #F58220;
	--wfb-orange-dark: #d96f14;
	--wfb-orange-soft: #FDF0E4;
	--wfb-wald:        #2f4a35;
	--wfb-wald-2:      #3d6045;
	--wfb-papier:      #f4f1e6;
	--wfb-papier-2:    #efece0;
	--wfb-sand:        #fbfaf4;
	--wfb-linie:       #cfc7ad;
	--wfb-moos:        #5f6a58;
	--wfb-text:        #23291f;
	--wfb-titel:       'Bitter', Georgia, 'Times New Roman', serif;
	--wfb-schrift:     'Karla', 'Open Sans', Arial, sans-serif;
	--wfb-signal:      #3f8f52;
	font-family: var(--wfb-schrift);
}
#wfb-chat-root, #wfb-chat-root * { box-sizing: border-box !important; }

/* ---------- Launcher ---------- */
#wfb-launcher {
	position: fixed !important;
	right: 20px !important;
	bottom: 20px !important;
	z-index: 99998 !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 9px !important;
	padding: 12px 18px 12px 14px !important;
	margin: 0 !important;
	border: 1.5px solid var(--wfb-wald) !important;
	border-radius: 4px !important;
	background: var(--wfb-wald) !important;
	color: #fff !important;
	font-family: var(--wfb-schrift) !important;
	font-size: 14.5px !important;
	font-weight: 700 !important;
	letter-spacing: .02em !important;
	line-height: 1 !important;
	cursor: pointer !important;
	box-shadow: 0 8px 24px rgba(39, 60, 44, .28) !important;
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
	text-transform: none !important;
}
#wfb-launcher:hover {
	background: var(--wfb-wald-2) !important;
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(39, 60, 44, .34) !important;
}
#wfb-launcher.wfb-hidden { display: none !important; }
.wfb-launcher-icon {
	display: inline-flex; align-items: center; justify-content: center;
	width: 24px; height: 24px; border-radius: 50%;
	background: var(--wfb-orange); color: #fff;
	font-size: 13px; line-height: 1;
}

/* Online-Signal: Launcher atmet, solange der Bot antworten kann. */
#wfb-chat-root.wfb-signal #wfb-launcher { animation: wfb-glow 2.4s ease-out infinite; }
@keyframes wfb-glow {
	0%   { box-shadow: 0 8px 24px rgba(39, 60, 44, .28), 0 0 0 0 rgba(245, 130, 32, .45); }
	100% { box-shadow: 0 8px 24px rgba(39, 60, 44, .28), 0 0 0 16px rgba(245, 130, 32, 0); }
}

/* Maskottchen (Lottie) oder Bild-Avatar */
.wfb-mascot { display: inline-block; vertical-align: middle; }
#wfb-launcher .wfb-mascot { width: 30px; height: 30px; }
#wfb-head .wfb-mascot { width: 28px; height: 28px; margin-right: 10px; }
.wfb-avatar {
	display: block !important;
	width: 100% !important; height: 100% !important;
	border-radius: 50% !important;
	object-fit: cover !important;
	background: rgba(255, 255, 255, .15);
	margin: 0 !important; padding: 0 !important;
	box-shadow: none !important;
}
#wfb-head .wfb-mascot.wfb-has-avatar { width: 34px; height: 34px; }
#wfb-head-title { display: inline-flex; align-items: center; min-width: 0; }

/* Kopfzeile: Titel + Statuszeile mit Punkt */
#wfb-head-col { display: inline-flex; flex-direction: column; line-height: 1.2; min-width: 0; }
#wfb-head-txt {
	font-family: var(--wfb-titel);
	font-size: 16.5px; font-weight: 700; letter-spacing: -.01em;
}
#wfb-status {
	display: inline-flex; align-items: center; gap: 6px;
	margin-top: 3px;
	font-size: 11.5px; font-weight: 400; color: #c2ceba;
}
#wfb-status-dot {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--wfb-signal);
	box-shadow: 0 0 0 3px rgba(63, 143, 82, .28);
	animation: wfb-breathe 2s ease-in-out infinite;
}
#wfb-chat-root.wfb-offline #wfb-status-dot { background: #8ba088; box-shadow: none; animation: none; }
@keyframes wfb-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

@media (prefers-reduced-motion: reduce) {
	#wfb-chat-root.wfb-signal #wfb-launcher,
	#wfb-status-dot { animation: none !important; }
}

/* ---------- Panel: standardmaessig ZU, nur mit .wfb-open sichtbar ---------- */
#wfb-panel { display: none !important; }
#wfb-panel.wfb-open {
	display: flex !important;
	position: fixed !important;
	right: 20px !important;
	bottom: 20px !important;
	z-index: 99999 !important;
	width: 380px !important;
	max-width: calc(100vw - 32px) !important;
	height: 580px !important;
	max-height: calc(100vh - 40px) !important;
	flex-direction: column !important;
	background: var(--wfb-papier) !important;
	border: 1.5px solid var(--wfb-linie) !important;
	border-radius: 6px !important;
	overflow: hidden !important;
	box-shadow: 0 16px 44px rgba(39, 60, 44, .26) !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Kopf: Waldgrün mit Schraffur und oranger Kante — wie die grünen Flächen im Shop */
#wfb-head {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 10px;
	padding: 14px 16px !important;
	background: var(--wfb-wald) !important;
	background-image: repeating-linear-gradient(58deg, transparent 0 40px, rgba(255, 255, 255, .045) 40px 41.5px) !important;
	border-top: 4px solid var(--wfb-orange) !important;
	color: #fff !important;
	flex: 0 0 auto;
}
#wfb-close {
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	color: #c2ceba !important;
	font-size: 26px !important;
	line-height: 1 !important;
	cursor: pointer !important;
	padding: 0 4px !important;
	margin: 0 !important;
	min-width: 0 !important; width: auto !important; height: auto !important;
	text-transform: none !important;
	transition: color .15s ease;
}
#wfb-close:hover { color: var(--wfb-orange) !important; }

/* Verlauf auf Kartenpapier mit schwachen Höhenlinien */
#wfb-log {
	flex: 1 1 auto !important;
	overflow-y: auto !important;
	padding: 16px 14px !important;
	display: flex !important;
	flex-direction: column !important;
	gap: 10px !important;
	background-color: var(--wfb-papier) !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 140' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23c8bfa2' stroke-width='1' opacity='.32'%3E%3Cpath d='M-20 120C120 70 180 150 300 110s180-120 320-90 200 10 220 40'/%3E%3Cpath d='M-20 90C110 40 170 122 290 80s190-124 330-98 190 6 220 36'/%3E%3Cpath d='M-20 60C100 10 160 92 280 50s196-126 336-100 186 4 216 34'/%3E%3C/g%3E%3C/svg%3E") !important;
	background-size: 100% 220px !important;
	background-repeat: repeat-y !important;
	margin: 0 !important;
	scrollbar-width: thin;
	scrollbar-color: var(--wfb-linie) transparent;
}
#wfb-log::-webkit-scrollbar { width: 8px; }
#wfb-log::-webkit-scrollbar-thumb { background: var(--wfb-linie); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }

.wfb-msg {
	max-width: 86%;
	padding: 10px 14px !important;
	border-radius: 4px;
	font-family: var(--wfb-schrift) !important;
	font-size: 14.5px !important;
	line-height: 1.55 !important;
	white-space: pre-wrap;
	word-wrap: break-word;
	color: var(--wfb-text);
	margin: 0 !important;
}
/* Kunde: Waldgrün, rechts */
.wfb-user {
	align-self: flex-end;
	background: var(--wfb-wald) !important;
	color: #fff !important;
	border: 1.5px solid var(--wfb-wald);
	border-bottom-right-radius: 0;
}
/* Bot: Sandkarte mit oranger Kante, links */
.wfb-assistant {
	animation: wfb-in .25s ease-out;
	align-self: flex-start;
	background: var(--wfb-sand) !important;
	border: 1.5px solid var(--wfb-linie);
	border-left: 3px solid var(--wfb-orange);
	border-bottom-left-radius: 0;
	overflow-wrap: anywhere;
}
.wfb-assistant strong { font-weight: 700; color: var(--wfb-text); }
.wfb-assistant a {
	color: var(--wfb-orange-dark) !important;
	text-decoration: none !important;
	border-bottom: 1px solid currentColor;
	font-weight: 700;
}
.wfb-assistant a:hover { color: var(--wfb-orange) !important; }

@keyframes wfb-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#wfb-log { scroll-behavior: smooth; }

/* Schnellfragen */
.wfb-quick { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 92%; margin: -2px 0 4px; }
.wfb-quick__chip {
	appearance: none; -webkit-appearance: none;
	background: #fff !important; color: var(--wfb-wald) !important;
	border: 1.5px solid var(--wfb-wald) !important; border-radius: 99px !important;
	padding: 8px 14px !important; margin: 0 !important; min-height: 0 !important; height: auto !important; line-height: 1.3 !important;
	font-family: var(--wfb-schrift) !important; font-size: 13.5px !important; font-weight: 700 !important;
	letter-spacing: 0 !important; text-transform: none !important; box-shadow: none !important;
	cursor: pointer; transition: background .15s ease, color .15s ease;
}
.wfb-quick__chip:hover { background: var(--wfb-wald) !important; color: #fff !important; }

.wfb-quick__chip--guide { background: var(--wfb-orange) !important; border-color: var(--wfb-orange) !important; color: #fff !important; }
.wfb-quick__chip--guide:hover { background: var(--wfb-orange-dark) !important; border-color: var(--wfb-orange-dark) !important; }
.wfb-quick__chip--leise { border-color: var(--wfb-linie) !important; color: var(--wfb-moos) !important; font-weight: 400 !important; }
.wfb-quick__chip--leise:hover { background: var(--wfb-papier-2) !important; color: var(--wfb-text) !important; }
.wfb-user--zusammenfassung { font-size: 13px !important; }

/* Produktkarten unter einer Antwort */
.wfb-cards { display: flex; gap: 8px; align-self: flex-start; max-width: 100%; overflow-x: auto; padding: 2px 0 6px; margin: -4px 0 2px; scrollbar-width: thin; }
a.wfb-card {
	flex: 0 0 132px; display: flex !important; flex-direction: column; gap: 4px;
	background: #fff; border: 1.5px solid var(--wfb-linie) !important; border-radius: 4px;
	padding: 8px; text-decoration: none !important; color: var(--wfb-text) !important;
	transition: border-color .15s ease;
}
a.wfb-card:hover { border-color: var(--wfb-wald) !important; }
.wfb-card__img { height: 84px; background: #fff center / contain no-repeat; border-bottom: 1px dashed var(--wfb-linie); }
.wfb-card__name { font-size: 12px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wfb-card__price { font-family: var(--wfb-titel); font-size: 13.5px; font-weight: 800; color: var(--wfb-orange-dark); margin-top: auto; }
.wfb-card__price del { font-family: var(--wfb-schrift); font-size: 11px; font-weight: 400; color: var(--wfb-moos); margin-right: 4px; }
.wfb-card__price .amount { color: inherit; }

/* Typing-Indikator */
.wfb-typing { display: inline-flex; gap: 4px; align-items: center; }
.wfb-typing span {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--wfb-orange); display: inline-block;
	animation: wfb-blink 1.2s infinite ease-in-out;
}
.wfb-typing span:nth-child(2) { animation-delay: .2s; }
.wfb-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes wfb-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* ---------- Eingabezeile ---------- */
#wfb-form {
	display: flex !important;
	align-items: flex-end !important;
	gap: 8px !important;
	padding: 10px !important;
	margin: 0 !important;
	border-top: 1.5px solid var(--wfb-linie) !important;
	background: var(--wfb-sand) !important;
	flex: 0 0 auto;
}
#wfb-input {
	flex: 1 1 auto !important;
	resize: none !important;
	border: 1.5px solid var(--wfb-linie) !important;
	border-radius: 3px !important;
	padding: 11px 12px !important;
	margin: 0 !important;
	font-family: var(--wfb-schrift) !important;
	font-size: 14.5px !important;
	line-height: 1.4 !important;
	height: 44px;              /* Starthoehe – JS erhoeht bei Bedarf */
	min-height: 44px !important;
	max-height: 120px !important;
	outline: none !important;
	box-shadow: none !important;
	background: #fff !important;
	color: var(--wfb-text) !important;
}
#wfb-input::placeholder { color: #8f8a78; }
#wfb-input:focus { border-color: var(--wfb-wald) !important; box-shadow: none !important; }
#wfb-send {
	flex: 0 0 auto !important;
	width: 44px !important;
	height: 44px !important;
	min-width: 44px !important;
	border: 2px solid var(--wfb-orange) !important;
	border-radius: 3px !important;
	background: var(--wfb-orange) !important;
	color: #fff !important;
	font-size: 16px !important;
	line-height: 1 !important;
	cursor: pointer !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
	transition: background .15s ease, border-color .15s ease;
	text-transform: none !important;
}
#wfb-send:hover:not(:disabled) { background: var(--wfb-orange-dark) !important; border-color: var(--wfb-orange-dark) !important; }
#wfb-send:disabled { opacity: .45; cursor: default; }

#wfb-foot {
	padding: 8px 12px !important;
	font-family: var(--wfb-schrift) !important;
	font-size: 11px !important;
	color: var(--wfb-moos) !important;
	text-align: center !important;
	background: var(--wfb-papier-2) !important;
	border-top: 1px dashed var(--wfb-linie) !important;
	flex: 0 0 auto;
	margin: 0 !important;
}
#wfb-foot a {
	color: var(--wfb-orange-dark) !important;
	text-decoration: none !important;
	font-weight: 700;
}
#wfb-foot a:hover { text-decoration: underline !important; }
#wfb-foot .wfb-ver { white-space: nowrap; opacity: .7; }

/* ---------- Mobil ---------- */
@media (max-width: 480px) {
	#wfb-launcher { right: 14px !important; bottom: 14px !important; }
	#wfb-panel.wfb-open {
		right: 0 !important;
		left: 0 !important;
		bottom: 0 !important;
		width: 100vw !important;
		max-width: 100vw !important;
		height: 88vh !important;
		max-height: 88vh !important;
		border-radius: 6px 6px 0 0 !important;
		border-left: 0 !important; border-right: 0 !important; border-bottom: 0 !important;
	}
	.wfb-msg { max-width: 92%; }
}
