/* WeGo chat widget */
.wego-chat [hidden] { display: none !important; }

.wego-chat {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wego-chat-launch {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	border: 0;
	cursor: pointer;
	background: linear-gradient(180deg, #e5c15c, #c9992b);
	color: #0a1c42;
	display: grid;
	place-items: center;
	box-shadow: 0 12px 30px -10px rgba(10, 28, 66, 0.5);
	transition: transform 0.2s;
}
.wego-chat-launch:hover { transform: translateY(-2px); }
.wego-chat.is-open .wego-chat-launch { transform: scale(0.9); opacity: 0.85; }

/* Attention-grabber: Periodic bounce and wobble */
@keyframes wego-chat-attention {
	0%, 100% {
		transform: translateY(0) rotate(0deg) scale(1);
	}
	15% {
		transform: translateY(-14px) rotate(-8deg) scale(1.06);
	}
	30% {
		transform: translateY(0) rotate(6deg) scale(1);
	}
	42% {
		transform: translateY(-7px) rotate(-4deg) scale(1.03);
	}
	54% {
		transform: translateY(0) rotate(2deg) scale(1);
	}
	65% {
		transform: translateY(-2px) rotate(0deg) scale(1);
	}
	75%, 100% {
		transform: translateY(0) rotate(0deg) scale(1);
	}
}

.wego-chat:not(.is-open) .wego-chat-launch {
	animation: wego-chat-attention 4.5s cubic-bezier(0.28, 0.84, 0.42, 1) infinite;
	transform-origin: center bottom;
}
.wego-chat:not(.is-open) .wego-chat-launch:hover {
	animation: none;
	transform: translateY(-3px) scale(1.04);
}

.wego-chat-panel {
	position: absolute;
	right: 0;
	bottom: 70px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border: 1px solid #e5dfcf;
	border-radius: 12px;
	box-shadow: 0 24px 60px -20px rgba(10, 28, 66, 0.45);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.wego-chat-head {
	background: #0a1c42;
	color: #fff;
	padding: 16px 18px;
	position: relative;
}
.wego-chat-head b { display: block; font-size: 14px; }
.wego-chat-head span { font-size: 11px; color: #9aa3b5; }
.wego-chat-x {
	position: absolute;
	top: 10px;
	right: 12px;
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.7;
}
.wego-chat-x:hover { opacity: 1; }

.wego-chat-body {
	flex: 1;
	overflow-y: auto;
	background: #faf7f0;
	position: relative;
}

/* "New message" pill — sticks to the bottom of the scroll area when the
   visitor has scrolled up and a message arrives below the fold. */
.wego-chat-jump {
	position: sticky;
	bottom: 10px;
	z-index: 4;
	display: block;
	width: -moz-fit-content;
	width: fit-content;
	max-width: calc(100% - 24px);
	margin: -34px auto 10px;
	padding: 7px 14px;
	border: 0;
	border-radius: 999px;
	background: #0a1c42;
	color: #fff;
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 10px 24px -8px rgba(10, 28, 66, 0.6);
}
.wego-chat-jump:hover { background: #10265a; }
.wego-chat-jump span,
.wego-chat-jump svg { vertical-align: middle; }
.wego-chat-jump svg { margin-left: 5px; }

.wego-chat-pre {
	padding: 20px 18px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.wego-chat-greeting-banner {
	background: #0a1c42;
	color: #fff;
	padding: 12px 14px;
	border-radius: 8px;
	margin-bottom: 6px;
	box-shadow: 0 4px 12px rgba(10, 28, 66, 0.15);
	position: relative;
	border-left: 3px solid #e5c15c;
}
.wego-chat-greeting-title {
	font-weight: 700;
	font-size: 14px;
	color: #e5c15c;
	margin: 0 0 4px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.wego-chat-greeting-desc {
	font-size: 12px;
	line-height: 1.45;
	color: #f1ede4;
	margin: 0;
}
.wego-chat-pre p { margin: 0 0 4px; font-size: 13px; color: #2b2b2b; line-height: 1.5; }
.wego-chat-pre input {
	border: 1px solid #e5dfcf;
	border-radius: 6px;
	padding: 10px 12px;
	font-size: 13px;
	font-family: inherit;
}
.wego-chat-pre input:focus { outline: none; border-color: #c9992b; }
.wego-chat-hp { position: absolute; left: -9999px; opacity: 0; height: 0; }
.wego-chat-pre button {
	background: linear-gradient(180deg, #e5c15c, #c9992b);
	color: #0a1c42;
	border: 0;
	border-radius: 6px;
	padding: 11px;
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
}

.wego-chat-log {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.wego-chat-msg {
	max-width: 82%;
	padding: 9px 12px;
	border-radius: 12px;
	font-size: 13px;
	line-height: 1.5;
	word-wrap: break-word;
}
.wego-chat-visitor {
	align-self: flex-end;
	background: #0a1c42;
	color: #fff;
	border-bottom-right-radius: 3px;
}
.wego-chat-bot,
.wego-chat-agent {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #e5dfcf;
	color: #2b2b2b;
	border-bottom-left-radius: 3px;
}
.wego-chat-agent { border-color: #e5c15c; }

.wego-chat-send {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e5dfcf;
	background: #fff;
}
.wego-chat-send textarea {
	flex: 1;
	resize: none;
	border: 1px solid #e5dfcf;
	border-radius: 8px;
	padding: 9px 12px;
	font-size: 13px;
	font-family: inherit;
	line-height: 1.4;
	max-height: 96px;
}
.wego-chat-send textarea:focus { outline: none; border-color: #c9992b; }
.wego-chat-send button {
	width: 38px;
	border: 0;
	border-radius: 8px;
	background: linear-gradient(180deg, #e5c15c, #c9992b);
	color: #0a1c42;
	cursor: pointer;
	display: grid;
	place-items: center;
	flex: none;
}

@media (max-width: 480px) {
	.wego-chat { right: 12px; bottom: 12px; }
	/* Pin the panel to the viewport with equal margins so it always fits. */
	.wego-chat-panel {
		position: fixed;
		left: 12px;
		right: 12px;
		top: 12px;
		bottom: 76px;
		width: auto;
		max-width: none;
		height: auto;
		max-height: none;
	}
}

/* /chat/ landing page — brand copy above, chat below, both visible */
body.wego-chat-landing .wego-chat-launch,
body.wego-chat-landing .wego-chat-x { display: none; }

body.wego-chat-landing .wego-chat { position: static; }

body.wego-chat-landing .wego-chat-panel {
	position: static;
	inset: auto;
	transform: none;
	margin: 26px auto 0;
	width: 420px;
	max-width: calc(100vw - 28px);
	height: min(60vh, 560px);
	min-height: 420px;
	box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.55);
}

/* Landing-page mobile overrides live in templates/chat-landing.php's inline
   <style> — it loads after this file, so it must own those rules. */
