/*
 * Defensive resets: this widget is embedded into arbitrary WordPress
 * themes/page builders that often carry global `button` element styles
 * (e.g. "button { width:100%; display:block; }" for mobile forms). Those
 * rules can win against a plain .ctcw-fab selector and stretch our pill
 * button into a full-width bar. The !important declarations below exist
 * specifically to survive that kind of host-page CSS, not for our own
 * cascade — do not remove them when tweaking colors/sizes elsewhere.
 */
#ctcw-root {
	--ctcw-color: #BA0000;
	--ctcw-color-dark: #1ea952;
	position: fixed !important;
	bottom: 24px !important;
	top: auto !important;
	z-index: 999999 !important;
	width: auto !important;
	height: auto !important;
	max-width: none !important;
	margin: 0 !important;
	box-sizing: border-box !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#ctcw-root * {
	box-sizing: border-box;
}

#ctcw-root.ctcw-right { right: 24px !important; left: auto !important; }
#ctcw-root.ctcw-left  { left: 24px !important; right: auto !important; }

.ctcw-hidden { display: none !important; }

/* Main FAB — pill shape enclosing icon + label */
#ctcw-root .ctcw-fab {
	display: inline-flex !important;
	position: relative !important;
	width: auto !important;
	max-width: none !important;
	min-width: 0 !important;
	height: 60px !important;
	margin: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	padding-left: 11px;
	padding-right: 25px;
	border-radius: 20px !important;
	background: var(--ctcw-color);
	box-shadow: 0 4px 16px rgba(0,0,0,0.25);
	align-items: center;
	gap: 4px;
	cursor: pointer;
	border: none !important;
	float: none !important;
	text-align: left !important;
	line-height: normal !important;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#ctcw-root.ctcw-left .ctcw-fab {
	padding-right: 11px;
	padding-left: 25px;
	flex-direction: row-reverse;
}
#ctcw-root .ctcw-fab.ctcw-icon-only {
	padding-right: 0;
	padding-left: 0;
}
#ctcw-root.ctcw-left .ctcw-fab.ctcw-icon-only {
	padding-left: 0;
}
#ctcw-root .ctcw-fab:hover {
	transform: scale(1.03);
	box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.ctcw-fab-icon-circle {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
}
.ctcw-fab svg {
	width: 24px;
	height: 24px;
	fill: #fff;
	transition: transform 0.25s ease;
	position: relative;
	z-index: 1;
}
#ctcw-root.ctcw-open .ctcw-fab svg.ctcw-icon-phone {
	transform: rotate(135deg) scale(0.9);
}
.ctcw-fab-label {
	color: #fff;
	font-weight: 700;
	font-size: 16px;
	white-space: nowrap;
	position: relative;
	z-index: 1;
}

/* Pulse ring — covers the entire pill, matching its shape */
.ctcw-pulse-ring {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: #fff;
	opacity: 0.45;
	animation: ctcw-pulse 2.2s ease-out infinite;
	pointer-events: none;
	z-index: 0;
}
@keyframes ctcw-pulse {
	0%   { transform: scale(1);    opacity: 0.4; }
	70%  { transform: scale(1.15); opacity: 0; }
	100% { transform: scale(1.15); opacity: 0; }
}

/* Expanding channel menu */
.ctcw-menu {
	position: absolute;
	bottom: 72px;
	right: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: flex-end;
}
#ctcw-root.ctcw-left .ctcw-menu { right: auto; left: 0; align-items: flex-start; }

.ctcw-menu-item {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border-radius: 16px;
	padding: 10px 20px 10px 10px;
	box-shadow: 0 3px 12px rgba(0,0,0,0.18);
	text-decoration: none;
	color: #222;
	opacity: 0;
	transform: translateY(10px) scale(0.9);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	white-space: nowrap;
}
#ctcw-root.ctcw-left .ctcw-menu-item {
	flex-direction: row-reverse;
	padding: 10px 10px 10px 20px;
}
#ctcw-root.ctcw-open .ctcw-menu-item {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}
.ctcw-menu-item .ctcw-menu-icon {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.ctcw-menu-item .ctcw-menu-icon svg {
	width: 22px;
	height: 22px;
	fill: #fff;
}
.ctcw-menu-item .ctcw-menu-text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}
.ctcw-menu-item .ctcw-menu-label {
	font-size: 17px;
	font-weight: 600;
}
.ctcw-menu-item .ctcw-menu-detail {
	font-size: 14px;
	font-weight: 400;
	color: #555;
}
.ctcw-menu-item.ctcw-call .ctcw-menu-icon     { background: var(--ctcw-color); }
.ctcw-menu-item.ctcw-call2 .ctcw-menu-icon    { background: var(--ctcw-color); }
.ctcw-menu-item.ctcw-whatsapp .ctcw-menu-icon { background: #25D366; }
.ctcw-menu-item.ctcw-sms .ctcw-menu-icon      { background: #3B82F6; }
.ctcw-menu-item.ctcw-email .ctcw-menu-icon    { background: #6B7280; }

/* Card panel style */
.ctcw-menu-cards {
	align-items: flex-end;
}
#ctcw-root.ctcw-left .ctcw-menu-cards {
	align-items: flex-start;
}
.ctcw-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 6px 24px rgba(0,0,0,0.18);
	padding: 24px 22px;
	text-decoration: none;
	color: #222;
	width: 260px;
	max-width: 82vw;
	opacity: 0;
	transform: translateY(10px) scale(0.95);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}
#ctcw-root.ctcw-open .ctcw-card {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}
.ctcw-card-logo {
	max-width: 90px;
	max-height: 70px;
	object-fit: contain;
	margin-bottom: 14px;
}
.ctcw-card-headline {
	font-weight: 700;
	color: #111;
	line-height: 1.25;
	margin-bottom: 16px;
}
.ctcw-card-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: transparent;
	border: 1px solid var(--ctcw-color);
	padding: 8px 20px;
	border-radius: 30px;
	max-width: 100%;
	box-sizing: border-box;
}
.ctcw-card-pill-icon {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}
.ctcw-card-pill-icon svg {
	width: 18px;
	height: 18px;
	fill: var(--ctcw-color);
}
.ctcw-card-pill-text {
	font-weight: 700;
	color: var(--ctcw-color);
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
	line-height: 1.3;
}

@media (max-width: 480px) {
	#ctcw-root { bottom: 16px; }
	#ctcw-root.ctcw-right { right: 16px; }
	#ctcw-root.ctcw-left  { left: 16px; }
	.ctcw-fab { height: 54px; }
	.ctcw-fab-icon-circle { width: 54px; height: 54px; }
	.ctcw-fab-label { font-size: 14px; }
	.ctcw-card { width: 240px; padding: 20px 18px; }
}
