/* M2 WhatsApp floating widget */
.m2-wa {
	position: fixed;
	z-index: 99999;
	bottom: calc(20px + env(safe-area-inset-bottom, 0px));
	font-family: inherit;
	direction: ltr;
}

.m2-wa.right-bottom {
	right: calc(16px + env(safe-area-inset-right, 0px));
	left: auto;
}

.m2-wa.left-bottom {
	left: calc(16px + env(safe-area-inset-left, 0px));
	right: auto;
}

.m2-wa--rtl {
	direction: rtl;
}

.m2-wa-fab {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: 0;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #25D366;
	color: #fff !important;
	box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
	cursor: pointer;
	text-decoration: none !important;
	position: relative;
	z-index: 2;
	animation: m2-wa-pulse 2.2s ease-out infinite;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.m2-wa-fab:hover,
.m2-wa-fab:focus {
	background: #1ebe57;
	color: #fff !important;
	text-decoration: none !important;
	outline: none;
}

.m2-wa-fab .fa {
	font-size: 32px;
	line-height: 1;
}

@keyframes m2-wa-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
	}
	70% {
		box-shadow: 0 0 0 16px rgba(37, 211, 102, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
	}
}

/* Chat panel */
.m2-wa-panel {
	position: absolute;
	bottom: 76px;
	width: min(320px, calc(100vw - 32px));
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 16px 40px rgba(5, 20, 31, 0.22);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px) scale(0.96);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	z-index: 3;
}

.m2-wa.right-bottom .m2-wa-panel {
	right: 0;
}

.m2-wa.left-bottom .m2-wa-panel {
	left: 0;
}

.m2-wa.is-open .m2-wa-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

.m2-wa-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 12px 12px 14px;
	background: #075E54;
	color: #fff;
}

.m2-wa-panel__profile {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.m2-wa-panel__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(255, 255, 255, 0.35);
	flex-shrink: 0;
	background: #fff;
}

.m2-wa-panel__meta {
	min-width: 0;
}

.m2-wa-panel__title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.m2-wa-panel__status {
	font-size: 12px;
	opacity: 0.9;
	margin-top: 2px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.m2-wa-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #25D366;
	display: inline-block;
	box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.25);
}

.m2-wa-panel__close {
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
	border-radius: 8px;
	-webkit-tap-highlight-color: transparent;
}

.m2-wa-panel__close:hover {
	background: rgba(255, 255, 255, 0.12);
}

.m2-wa-panel__body {
	padding: 16px;
	background: #ECE5DD;
	min-height: 120px;
}

.m2-wa-bubble {
	display: inline-block;
	max-width: 90%;
	background: #fff;
	color: #05141F;
	padding: 10px 12px;
	border-radius: 0 12px 12px 12px;
	font-size: 14px;
	line-height: 1.45;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
	white-space: pre-wrap;
}

.m2-wa--rtl .m2-wa-bubble {
	border-radius: 12px 0 12px 12px;
}

.m2-wa-panel__hint {
	margin-top: 10px;
	font-size: 12px;
	color: #667781;
}

.m2-wa-panel__footer {
	padding: 12px 14px 14px;
	background: #fff;
}

.m2-wa-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 16px;
	border-radius: 999px;
	background: #25D366;
	color: #fff !important;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none !important;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.m2-wa-cta:hover,
.m2-wa-cta:focus {
	background: #1ebe57;
	color: #fff !important;
	text-decoration: none !important;
}

.m2-wa-cta .fa {
	font-size: 18px;
}

/* Greeting tip / bubble mode */
.m2-wa-tip {
	position: absolute;
	bottom: 76px;
	max-width: min(240px, calc(100vw - 90px));
	background: #fff;
	color: #05141F;
	padding: 12px 28px 12px 14px;
	border-radius: 14px;
	box-shadow: 0 10px 28px rgba(5, 20, 31, 0.18);
	font-size: 13px;
	line-height: 1.4;
	z-index: 3;
}

.m2-wa.right-bottom .m2-wa-tip {
	right: 0;
}

.m2-wa.left-bottom .m2-wa-tip {
	left: 0;
}

.m2-wa-tip.is-hidden {
	display: none;
}

.m2-wa-tip p {
	margin: 0;
}

.m2-wa-tip__close {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 28px;
	height: 28px;
	border: 0;
	background: transparent;
	color: #667781;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.m2-wa--rtl .m2-wa-tip {
	padding: 12px 14px 12px 28px;
}

.m2-wa--rtl .m2-wa-tip__close {
	right: auto;
	left: 4px;
}

@media (max-width: 767px) {
	.m2-wa {
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	}

	.m2-wa.right-bottom {
		right: calc(12px + env(safe-area-inset-right, 0px));
	}

	.m2-wa.left-bottom {
		left: calc(12px + env(safe-area-inset-left, 0px));
	}

	.m2-wa-fab {
		width: 56px;
		height: 56px;
	}

	.m2-wa-fab .fa {
		font-size: 28px;
	}

	.m2-wa-panel,
	.m2-wa-tip {
		bottom: 70px;
	}
}
