/* =========================================================
   AI ASSISTANT — FLOATING BUTTON
   ========================================================= */

.mse-ai-assistant-trigger {
	position: fixed;
	bottom: 24px;
	z-index: 9999;

	width: var(--mse-ai-size, 58px);
	height: var(--mse-ai-size, 58px);

	border: none;
	border-radius: 50%;

	background: var(--mse-ai-color, #f57c20);
	color: #ffffff;

	display: flex;
	align-items: center;
	justify-content: center;

	font-size: calc(var(--mse-ai-size, 58px) * 0.42);

	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);

	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mse-ai-assistant-trigger:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.mse-ai-assistant-position-bottom-right {
	right: 24px;
}

.mse-ai-assistant-position-bottom-left {
	left: 24px;
}

/* If a floating WhatsApp button is ALSO present on the
   same side (shouldn't normally happen since the router
   only shows one at a time, but kept as a safety margin) */
.mse-hide-mobile {
	display: flex;
}

.mse-hide-desktop {
	display: flex;
}

@media (max-width: 767px) {
	.mse-hide-mobile {
		display: none !important;
	}
}

@media (min-width: 768px) {
	.mse-hide-desktop {
		display: none !important;
	}
}


/* =========================================================
   AI ASSISTANT — CHAT WINDOW
   ========================================================= */

.mse-ai-assistant-window {
	position: fixed;
	bottom: 96px;
	right: 24px;
	z-index: 9999;

	width: min(360px, calc(100vw - 32px));
	max-height: min(520px, calc(100vh - 140px));

	background: var(--mse-ai-window-bg, #ffffff);
	color: var(--mse-ai-window-text, #0d2149);

	border-radius: var(--mse-ai-radius, 16px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);

	display: flex;
	flex-direction: column;
	overflow: hidden;

	opacity: 0;
	transform: translateY(16px) scale(0.98);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.mse-ai-assistant-window.mse-ai-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.mse-combined-position-bottom-left ~ .mse-ai-assistant-window,
.mse-ai-assistant-position-bottom-left + .mse-ai-assistant-window {
	right: auto;
	left: 24px;
}


.mse-ai-assistant-header {
	display: flex;
	align-items: center;
	justify-content: space-between;

	padding: 14px 16px;

	background: var(--mse-ai-accent, #f57c20);
	color: #ffffff;
}

.mse-ai-assistant-header-name {
	font-weight: 600;
	font-size: 15px;
}

.mse-ai-assistant-close {
	background: none;
	border: none;
	color: #ffffff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}


.mse-ai-assistant-messages {
	flex: 1;
	overflow-y: auto;

	padding: 14px 16px;

	display: flex;
	flex-direction: column;
	gap: 10px;

	font-size: 14px;
	line-height: 1.5;
}

.mse-ai-msg {
	max-width: 85%;
	padding: 9px 13px;
	border-radius: 14px;
	word-wrap: break-word;
}

.mse-ai-msg-bot {
	align-self: flex-start;
	background: var(--mse-ai-bot-bubble, #f2f4f8);
	color: var(--mse-ai-window-text, #0d2149);
	border-bottom-left-radius: 4px;
}

.mse-ai-msg-user {
	align-self: flex-end;
	background: var(--mse-ai-user-bubble, #0d2149);
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

.mse-ai-msg-typing {
	align-self: flex-start;
	background: var(--mse-ai-bot-bubble, #f2f4f8);
	color: var(--mse-ai-window-text, #0d2149);
	border-bottom-left-radius: 4px;
	font-style: italic;
	opacity: 0.7;
}


.mse-ai-assistant-handoff {
	display: block;
	text-align: center;

	padding: 8px 12px;
	margin: 0 16px 10px;

	font-size: 12.5px;
	color: #25D366;

	border: 1px solid #25D366;
	border-radius: 8px;

	text-decoration: none;
}

.mse-ai-assistant-handoff:hover {
	background: #25D366;
	color: #ffffff;
}


.mse-ai-assistant-form {
	display: flex;
	align-items: center;
	gap: 8px;

	padding: 10px 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.mse-ai-assistant-input {
	flex: 1;

	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 20px;

	padding: 9px 14px;
	font-size: 14px;

	outline: none;
}

.mse-ai-assistant-input:focus {
	border-color: var(--mse-ai-accent, #f57c20);
}

.mse-ai-assistant-send {
	width: 38px;
	height: 38px;
	flex-shrink: 0;

	border: none;
	border-radius: 50%;

	background: var(--mse-ai-accent, #f57c20);
	color: #ffffff;

	display: flex;
	align-items: center;
	justify-content: center;

	cursor: pointer;
	font-size: 14px;
}


/* =========================================================
   COMBINED CONTACT BUTTON
   (shown when WhatsApp + AI Assistant are both enabled)
   ========================================================= */

.mse-combined-contact {
	position: fixed;
	bottom: 24px;
	z-index: 9999;
}

.mse-combined-position-bottom-right {
	right: 24px;
}

.mse-combined-position-bottom-left {
	left: 24px;
}

.mse-combined-trigger {
	width: var(--mse-ai-size, 58px);
	height: var(--mse-ai-size, 58px);

	border: none;
	border-radius: 50%;

	background: var(--mse-ai-color, #f57c20);
	color: #ffffff;

	display: flex;
	align-items: center;
	justify-content: center;

	font-size: calc(var(--mse-ai-size, 58px) * 0.4);

	cursor: pointer;
	box-shadow:
		0 6px 18px rgba(245, 124, 32, 0.35),
		0 2px 6px rgba(0, 0, 0, 0.15);

	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mse-combined-trigger:hover {
	transform: translateY(-3px) scale(1.04);
	box-shadow:
		0 10px 24px rgba(245, 124, 32, 0.45),
		0 3px 8px rgba(0, 0, 0, 0.2);
}

.mse-combined-trigger.mse-combined-active {
	transform: rotate(90deg);
}


.mse-combined-menu {
	position: absolute;
	bottom: calc(var(--mse-ai-size, 58px) + 18px);
	right: 0;

	min-width: 240px;

	background: #ffffff;
	border-radius: 18px;
	box-shadow:
		0 16px 40px rgba(13, 33, 73, 0.18),
		0 4px 12px rgba(13, 33, 73, 0.08);

	padding: 10px;
	overflow: hidden;

	display: flex;
	flex-direction: column;
	gap: 4px;

	opacity: 0;
	transform: translateY(12px) scale(0.96);
	pointer-events: none;
	transform-origin: bottom right;
	transition:
		opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
		transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.mse-combined-position-bottom-left .mse-combined-menu {
	right: auto;
	left: 0;
	transform-origin: bottom left;
}

.mse-combined-menu.mse-combined-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.mse-combined-menu-label {
	padding: 8px 12px 4px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: #8a94a6;
}

.mse-combined-menu-item {
	display: flex;
	align-items: center;
	gap: 12px;

	padding: 11px 12px;
	border-radius: 12px;

	background: none;
	border: none;

	font-size: 14.5px;
	font-weight: 600;
	color: #0d2149;
	text-decoration: none;
	text-align: left;

	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.mse-combined-menu-item:hover {
	background: #f5f7fb;
	transform: translateX(2px);
}

.mse-combined-menu-item i {
	width: 38px;
	height: 38px;
	flex-shrink: 0;

	display: flex;
	align-items: center;
	justify-content: center;

	border-radius: 50%;
	font-size: 16px;

	background: rgba(245, 124, 32, 0.12);
	color: var(--mse-ai-color, #f57c20);
}

.mse-combined-menu-item .fa-whatsapp {
	background: rgba(37, 211, 102, 0.12);
	color: #25D366;
}

/* Mobile: keep chat window full-width-ish and buttons closer to edge */
@media (max-width: 480px) {

	.mse-ai-assistant-trigger,
	.mse-combined-trigger {
		bottom: 16px;
	}

	.mse-ai-assistant-position-bottom-right,
	.mse-combined-position-bottom-right {
		right: 16px;
	}

	.mse-ai-assistant-position-bottom-left,
	.mse-combined-position-bottom-left {
		left: 16px;
	}

	.mse-ai-assistant-window {
		right: 16px;
		bottom: 88px;
	}

	.mse-combined-position-bottom-left .mse-ai-assistant-window {
		right: auto;
		left: 16px;
	}

}