/*------------------------------------------------------------------
	Chatbot Widget
	Self-contained styles, layered on top of the theme's own
	CSS variables (--prime-one, --gr-one, --heading, gordita fonts)
	so it matches the rest of the design without touching style.css.
-------------------------------------------------------------------*/

.chatbot-widget {
	position: fixed;
	right: 28px;
	bottom: 28px;
	z-index: 999;
	font-family: 'gorditaregular';
}

/* Nudge the theme's own scroll-top button up so the two never overlap */
.scroll-top { bottom: 100px !important; right: 20px !important; }

/* ---------------- Toggle button ---------------- */
.chatbot-toggle-btn {
	position: relative;
	width: 62px;
	height: 62px;
	border: none;
	border-radius: 50%;
	background: var(--gr-one);
	color: #fff;
	font-size: 24px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 12px 28px rgba(255, 23, 29, 0.28);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.chatbot-toggle-btn:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(255, 23, 29, 0.34); }

.chatbot-toggle-btn .icon-close { display: none; }
.chatbot-widget.is-open .chatbot-toggle-btn .icon-open { display: none; }
.chatbot-widget.is-open .chatbot-toggle-btn .icon-close { display: inline-block; }

.chatbot-toggle-btn .ping-dot {
	position: absolute;
	top: 3px;
	right: 3px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #24D164;
	border: 2px solid #fff;
}
.chatbot-widget.is-open .ping-dot { display: none; }

/* ---------------- Panel ---------------- */
.chatbot-panel {
	position: absolute;
	right: 0;
	bottom: 78px;
	width: 366px;
	max-width: calc(100vw - 40px);
	height: 520px;
	max-height: 70vh;
	background: #fff;
	border-radius: 22px;
	box-shadow: 0 25px 60px rgba(1, 13, 76, 0.22);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(0.97);
	transform-origin: bottom right;
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.chatbot-widget.is-open .chatbot-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

/* ---------------- Header ---------------- */
.chatbot-header {
	background: var(--gr-one);
	padding: 18px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}
.chatbot-header-info { display: flex; align-items: center; gap: 12px; }
.chatbot-header .chatbot-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255,255,255,0.18);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	flex-shrink: 0;
}
.chatbot-header h6 { font-family: 'gorditamedium'; color: #fff; margin: 0 0 2px; font-size: 16px; }
.chatbot-header .chatbot-status {
	display: flex;
	align-items: center;
	gap: 6px;
	color: rgba(255,255,255,0.85);
	font-size: 12px;
}
.chatbot-header .status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #24D164;
	display: inline-block;
}
.chatbot-close-btn {
	border: none;
	background: rgba(255,255,255,0.16);
	color: #fff;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	font-size: 12px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background 0.2s ease;
}
.chatbot-close-btn:hover { background: rgba(255,255,255,0.3); }

/* ---------------- Body / messages ---------------- */
.chatbot-body {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	background: #F7F8FC;
}
.chatbot-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; }
.chatbot-msg.bot { align-self: flex-start; }
.chatbot-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.chatbot-avatar.sm {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--prime-one);
	color: #fff;
	font-size: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.chatbot-msg .bubble {
	padding: 10px 15px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--heading);
	background: #fff;
	box-shadow: 0 2px 10px rgba(1, 13, 76, 0.06);
}
.chatbot-msg.bot .bubble { border-bottom-left-radius: 4px; }
.chatbot-msg.user .bubble { background: var(--prime-one); color: #fff; border-bottom-right-radius: 4px; }

/* Typing indicator */
.chatbot-msg.typing .bubble { display: flex; align-items: center; gap: 4px; padding: 14px 16px; }
.chatbot-msg.typing .dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #b7bfd6;
	animation: chatbot-typing 1.2s infinite ease-in-out;
}
.chatbot-msg.typing .dot:nth-child(2) { animation-delay: 0.15s; }
.chatbot-msg.typing .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatbot-typing {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

/* ---------------- Quick replies ---------------- */
.chatbot-quick-replies {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 16px 12px;
	background: #F7F8FC;
	flex-shrink: 0;
}
.quick-reply-btn {
	border: 1px solid rgba(0,102,255,0.3);
	background: #fff;
	color: var(--prime-one);
	font-size: 12.5px;
	font-family: 'gorditamedium';
	padding: 7px 14px;
	border-radius: 30px;
	cursor: pointer;
	transition: all 0.2s ease;
}
.quick-reply-btn:hover { background: var(--prime-one); color: #fff; }

/* ---------------- Input row ---------------- */
.chatbot-input-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	border-top: 1px solid #eef0f6;
	background: #fff;
	flex-shrink: 0;
}
.chatbot-input-row input {
	flex: 1;
	border: 1px solid #e5e8f1;
	background: #F7F8FC;
	border-radius: 30px;
	padding: 11px 18px;
	font-size: 14px;
	color: var(--heading);
	outline: none;
	transition: border-color 0.2s ease;
}
.chatbot-input-row input:focus { border-color: var(--prime-one); }
.chatbot-send-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: var(--prime-one);
	color: #fff;
	font-size: 15px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: transform 0.2s ease, background 0.2s ease;
}
.chatbot-send-btn:hover { transform: scale(1.06); }

/* ---------------- Mobile ---------------- */
@media (max-width: 480px) {
	.chatbot-widget { right: 16px; bottom: 16px; }
	.chatbot-panel { width: calc(100vw - 32px); height: 70vh; bottom: 76px; right: -6px; }
	.scroll-top { right: 12px !important; }
}
