/* MobinQ Chat Frontend Styles — Pure Vanilla CSS with RTL Logical Properties */
.mqchat-widget {
	position: fixed;
	bottom: 20px;
	inset-inline-end: 20px;
	z-index: 99990;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-family: inherit;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.mqchat-widget.mqchat-pos-bottom-start {
	inset-inline-end: auto;
	inset-inline-start: 20px;
	align-items: flex-start;
}

.mqchat-widget.mqchat-pos-side-end {
	bottom: auto;
	top: 50%;
	inset-inline-end: 0;
	transform: translateY(-50%);
	align-items: flex-end;
}

.mqchat-widget.mqchat-pos-side-start {
	bottom: auto;
	top: 50%;
	inset-inline-end: auto;
	inset-inline-start: 0;
	transform: translateY(-50%);
	align-items: flex-start;
}

.mqchat-widget.mqchat-pos-side-end .mqchat-launcher {
	border-start-start-radius: 14px;
	border-end-start-radius: 14px;
	border-start-end-radius: 0;
	border-end-end-radius: 0;
	writing-mode: vertical-rl;
	padding: 14px 10px;
}

.mqchat-widget.mqchat-pos-side-start .mqchat-launcher {
	border-start-start-radius: 0;
	border-end-start-radius: 0;
	border-start-end-radius: 14px;
	border-end-end-radius: 14px;
	writing-mode: vertical-rl;
	padding: 14px 10px;
}

.mqchat-widget.mqchat-pos-side-end .mqchat-panel,
.mqchat-widget.mqchat-pos-side-start .mqchat-panel,
.mqchat-widget.mqchat-pos-side-end .mqchat-greeting,
.mqchat-widget.mqchat-pos-side-start .mqchat-greeting {
	margin-inline: 12px;
}

.mqchat-widget.mqchat-is-deferred,
.mqchat-widget.mqchat-is-hidden-scroll,
.mqchat-widget.mqchat-is-hidden-device {
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transform: translateY(16px);
}

.mqchat-widget.mqchat-is-dimmed .mqchat-launcher {
	opacity: 0.72;
}

.mqchat-icon-stack {
	--mqchat-visible-count: var(--mqchat-desktop-count, 3);
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 4px;
	max-block-size: min(calc(var(--mqchat-visible-count) * 64px), calc(100vh - 40px));
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}

.mqchat-channel-link.mqchat-stack-link {
	display: flex;
	flex: 0 0 56px;
	align-items: center;
	justify-content: center;
	inline-size: 56px;
	block-size: 56px;
	min-inline-size: 56px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--mqchat-channel-color, #0f766e);
	color: #fff;
	box-shadow: 0 4px 14px rgba(15, 23, 42, .22);
}

.mqchat-channel-link.mqchat-stack-link:hover, .mqchat-channel-link.mqchat-stack-link:focus-visible {
	background: var(--mqchat-channel-color, #0f766e);
	color: #fff;
}

.mqchat-stack-link:focus-visible, .mqchat-icon-stack:focus-visible {
	outline: 3px solid #0f172a;
	outline-offset: 2px;
}

.mqchat-stack-link svg, .mqchat-stack-link img {
	inline-size: 28px;
	block-size: 28px;
	object-fit: contain;
}

.mqchat-icons-animated .mqchat-stack-link {
	animation: mqchat-icon-pulse 4s ease-in-out infinite;
}

@keyframes mqchat-icon-pulse {
	0%, 80%, 100% { transform: scale(1); }
	86% { transform: scale(1.08); }
	92% { transform: scale(1); }
}

@media (max-width: 1024px) {
	.mqchat-icon-stack { --mqchat-visible-count: var(--mqchat-tablet-count, 2); }
}

@media (max-width: 600px) {
	.mqchat-icon-stack { --mqchat-visible-count: var(--mqchat-phone-count, 2); }
}

@media (prefers-reduced-motion: reduce) {
	.mqchat-icons-animated .mqchat-stack-link { animation: none; }
}

/* Launcher Button */
.mqchat-launcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	border: 0;
	border-radius: 999px;
	background: var(--mqchat-accent, #0f766e);
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mqchat-launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 28px rgba(15, 23, 42, 0.26);
}

.mqchat-launcher svg {
	width: 22px;
	height: 22px;
	display: block;
}

.mqchat-launcher-icon-close[hidden],
.mqchat-launcher-icon-open[hidden] {
	display: none !important;
}

.mqchat-unread-badge {
	position: absolute;
	top: -4px;
	inset-inline-end: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 999px;
	background: #ef4444;
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.mqchat-unread-badge[hidden] {
	display: none !important;
}

/* Proactive Greeting Bubble */
.mqchat-greeting {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 270px;
	padding: 10px 14px;
	background: #ffffff;
	color: #0f172a;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
	text-align: start;
}

.mqchat-greeting[hidden] {
	display: none !important;
}

.mqchat-greeting-body {
	border: 0;
	background: transparent;
	padding: 0;
	margin: 0;
	min-height: 0;
	min-width: 0;
	box-shadow: none;
	color: inherit;
	font-size: 13px;
	line-height: 1.45;
	text-align: start;
	cursor: pointer;
}

.mqchat-greeting-close {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	min-height: 0;
	min-width: 0;
	box-shadow: none;
	border: 0;
	border-radius: 50%;
	background: #f1f5f9;
	color: #475569;
	cursor: pointer;
	padding: 0;
}

.mqchat-greeting-close svg {
	width: 13px;
	height: 13px;
}

/* Expandable Panel */
.mqchat-panel {
	width: min(350px, calc(100vw - 32px));
	max-height: min(520px, calc(100vh - 110px));
	display: flex;
	flex-direction: column;
	background: #ffffff;
	color: #0f172a;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
	text-align: start;
}

.mqchat-panel[hidden] {
	display: none !important;
}

.mqchat-panel-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	padding: 16px;
	background: var(--mqchat-accent, #0f766e);
	color: #ffffff;
}

.mqchat-panel-title {
	display: block;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.mqchat-panel-subtitle {
	display: block;
	font-size: 12px;
	opacity: 0.92;
	margin-block-start: 3px;
}

.mqchat-panel-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	min-height: 0;
	min-width: 0;
	box-shadow: none;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	color: #ffffff;
	cursor: pointer;
	padding: 0;
}

.mqchat-panel-close svg {
	width: 16px;
	height: 16px;
}

.mqchat-panel-body {
	padding: 12px 14px;
	overflow-y: auto;
	flex: 1;
}

.mqchat-channel-items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mqchat-channel-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid #e2e8f0;
	background: #f8fafc;
	color: #0f172a;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.mqchat-channel-link:hover {
	background: #f1f5f9;
	border-color: #cbd5e1;
	color: #0f172a;
}

.mqchat-channel-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 9px;
	color: #ffffff;
	flex-shrink: 0;
}

.mqchat-channel-icon svg {
	width: 18px;
	height: 18px;
}

.mqchat-custom-icon {
	inline-size: 24px;
	block-size: 24px;
	object-fit: contain;
	border-radius: 4px;
	flex: none;
}

.mqchat-panel-credit {
	padding: 8px 14px;
	text-align: center;
	font-size: 11px;
	background: #f8fafc;
	border-top: 1px solid #e2e8f0;
}

.mqchat-panel-credit a {
	color: #64748b;
	text-decoration: none;
}

/* QR & Copy-ID Modal */
.mqchat-modal [hidden] {
	display: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.mqchat-widget, .mqchat-widget .mqchat-launcher { transition: none; }
}

.mqchat-modal {
	inline-size: min(360px, calc(100% - 32px));
	max-block-size: calc(100% - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 16px;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
}

.mqchat-modal::backdrop {
	background: rgba(15, 23, 42, 0.58);
}

.mqchat-modal-card {
	position: relative;
	background: #ffffff;
	color: #0f172a;
	padding: 24px 20px;
	text-align: center;
}

.mqchat-modal-close {
	position: absolute;
	top: 12px;
	inset-inline-end: 12px;
	width: 30px;
	height: 30px;
	min-height: 0;
	min-width: 0;
	box-shadow: none;
	border: 0;
	border-radius: 50%;
	background: #f1f5f9;
	color: #334155;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.mqchat-modal-close svg {
	width: 16px;
	height: 16px;
}

.mqchat-modal-title {
	margin: 0 0 14px;
	font-size: 17px;
	font-weight: 700;
}

.mqchat-modal-qr-wrap img {
	width: 196px;
	height: 196px;
	object-fit: contain;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 6px;
	background: #ffffff;
	margin-block-end: 14px;
}

.mqchat-modal-copy-wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 10px;
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	margin-block-end: 12px;
}

#mqchat-modal-copy-val {
	direction: ltr;
	unicode-bidi: isolate;
}

.mqchat-modal-copy-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border: 0;
	border-radius: 6px;
	background: var(--mqchat-accent, #0f766e);
	color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}

.mqchat-modal-copy-btn svg {
	width: 14px;
	height: 14px;
}

.mqchat-modal-note {
	font-size: 13px;
	color: #475569;
	margin: 8px 0 0;
}

.mqchat-modal-ext {
	display: inline-block;
	margin-block-start: 12px;
	color: #0f766e;
	font-weight: 600;
	text-decoration: none;
	font-size: 13px;
}
