/**
* --------------------------------------------------------------------------
* Floating Contact Widget
* All rules are scoped under .rcw and use !important on visual-critical
* properties to stay isolated from theme defaults (Astra, Hello Elementor,
* Divi, GeneratePress, etc. all style buttons/links differently).
* --------------------------------------------------------------------------
*/

.rcw,
.rcw *,
.rcw *::before,
.rcw *::after {
	box-sizing: border-box !important;
	-webkit-tap-highlight-color: transparent;
}

/* Wrapper: fixed to viewport corner, stacks children bottom-up */
.rcw {
	position: fixed !important;
	right: 20px;
	bottom: 100px; /* leaves room for a scroll-to-top button if present */
	z-index: 999999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	pointer-events: none; /* wrapper itself is not clickable */
	margin: 0;
	padding: 0;
	list-style: none;
}

.rcw > * {
	pointer-events: auto; /* only direct children receive clicks */
}

/* Expandable menu */
.rcw__menu {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
	visibility: hidden; /* hidden but keeps layout space so items animate in-place */
}

.rcw__menu.is-open {
	visibility: visible;
}

/* "সরাসরি কথা বলুন" label */
.rcw__label {
	background: #ffffff !important;
	color: #1a1a2e !important;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	padding: 10px 18px;
	border-radius: 999px !important;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.10);
	white-space: nowrap;
	font-family: inherit;
	border: none;

	/* Slide-up-and-fade-in starting state */
	opacity: 0;
	transform: translateY(8px) scale(0.95);
	transition: opacity 0.28s ease, transform 0.28s ease;
}

/* Contact pill buttons */
.rcw__item {
	display: inline-flex !important;
	align-items: center;
	gap: 10px;
	padding: 11px 20px 11px 14px;
	border-radius: 999px !important;
	text-decoration: none !important;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	color: #ffffff !important;
	border: none;
	box-shadow:
		0 4px 16px rgba(0, 0, 0, 0.14),
		0 1px  3px rgba(0, 0, 0, 0.08);
	white-space: nowrap;
	font-family: inherit;
	cursor: pointer;

	/* Slide-up-and-fade-in starting state */
	opacity: 0;
	transform: translateY(10px) scale(0.95);
	transition:
		opacity    0.28s ease,
		transform  0.28s ease,
		box-shadow 0.22s ease;
}

.rcw__item:hover,
.rcw__item:focus-visible {
	color: #ffffff !important;
	text-decoration: none !important;
	transform: translateY(-2px) scale(1.02);
	box-shadow:
		0 8px 24px rgba(0, 0, 0, 0.20),
		0 2px  6px rgba(0, 0, 0, 0.10);
}

.rcw__item:visited {
	color: #ffffff !important;
}

.rcw__item:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 2px;
}

.rcw__item svg {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	display: block;
}

/* Brand colours */
.rcw__item--wa { background: #25D366 !important; }
.rcw__item--ph { background: #5C35B4 !important; }
.rcw__item--ms { background: #0084FF !important; }

/* Subtle hover tints so the colour doesn't flatten */
.rcw__item--wa:hover { background: #20bf5a !important; }
.rcw__item--ph:hover { background: #5030a8 !important; }
.rcw__item--ms:hover { background: #0076e8 !important; }

/* Open-state: animate items in with staggered delays */
.rcw__menu.is-open .rcw__label {
	opacity: 1;
	transform: translateY(0) scale(1);
	transition-delay: 0.04s;
}

.rcw__menu.is-open .rcw__item:nth-child(2) {
	opacity: 1;
	transform: translateY(0) scale(1);
	transition-delay: 0.09s;
}

.rcw__menu.is-open .rcw__item:nth-child(3) {
	opacity: 1;
	transform: translateY(0) scale(1);
	transition-delay: 0.14s;
}

.rcw__menu.is-open .rcw__item:nth-child(4) {
	opacity: 1;
	transform: translateY(0) scale(1);
	transition-delay: 0.19s;
}

/* Toggle button — MUST stay a perfect circle on every theme */
.rcw__toggle {
	appearance: none !important;
	-webkit-appearance: none !important;
	position: relative;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 58px !important;
	height: 58px !important;
	min-width: 58px;
	min-height: 58px;
	aspect-ratio: 1 / 1;
	border-radius: 50% !important;
	background-color: transparent;
	background-image: linear-gradient(135deg, #25d366, #128c7e) !important;
	border: none !important;
	outline: none;
	margin: 0;
	padding: 0 !important;
	cursor: pointer;
	color: #ffffff !important;   /* add this new */
	flex-shrink: 0;
	line-height: 1;
	box-shadow:
		0 6px 20px rgba(18, 140, 126, 0.45),
		0 2px  6px rgba(0,   0,   0,   0.12);
	transition:
		filter     0.25s ease,
		transform  0.28s ease,
		box-shadow 0.28s ease;
}

/* Hover / focus / active → same gradient, just a touch deeper (via brightness,
   so it transitions smoothly across all browsers instead of swapping
   background-image, which doesn't animate reliably) */
.rcw__toggle:hover,
.rcw__toggle:focus-visible,
.rcw__toggle:active {
	filter: brightness(0.92);
	transform: scale(1.08);
	box-shadow:
		0 10px 28px rgba(18, 140, 126, 0.50),
		0  3px  8px rgba(0,   0,   0,   0.14);
}

.rcw__toggle:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 3px;
}

/* Icon switching: two SVGs layered, one fades in as the other fades out */
.rcw__toggle .rcw-ico-chat,
.rcw__toggle .rcw-ico-close {
	width: 24px;
	height: 24px;
	fill: #ffffff !important;
	position: absolute;
	display: block;
	transition:
		opacity   0.22s ease,
		transform 0.30s ease;
}

.rcw__toggle .rcw-ico-chat path,
.rcw__toggle .rcw-ico-close path {
	fill: #ffffff !important;
}

/* Default (closed): show the new chat icon */
.rcw__toggle .rcw-ico-chat  { opacity: 1; transform: rotate(0deg);   }
.rcw__toggle .rcw-ico-close { opacity: 0; transform: rotate(-90deg); }

/* Open: swap to X icon */
.rcw__toggle.is-open .rcw-ico-chat  { opacity: 0; transform: rotate(90deg); }
.rcw__toggle.is-open .rcw-ico-close { opacity: 1; transform: rotate(0deg);  }

/* Mobile tweaks */
@media (max-width: 768px) {
	.rcw {
		right: 14px;
		bottom: 120px;
		gap: 8px;
	}

	.rcw__toggle {
		width: 50px !important;
		height: 50px !important;
		min-width: 50px;
		min-height: 50px;
	}

	.rcw__toggle .rcw-ico-chat,
	.rcw__toggle .rcw-ico-close {
		width: 20px;
		height: 20px;
	}

	.rcw__item {
		font-size: 13px;
		padding: 9px 16px 9px 11px;
	}

	.rcw__item svg {
		width: 20px;
		height: 20px;
	}

	.rcw__label {
		font-size: 13px;
		padding: 9px 15px;
	}
}

/* Respect user's motion preference */
@media (prefers-reduced-motion: reduce) {
	.rcw,
	.rcw * {
		transition: none !important;
		animation:  none !important;
	}
}
