/**
 * RDS WhatsApp Floating Button - Stylesheet
 * WCAG 2.1 AA compliant: contrast ratio, focus indicators, motion preferences.
 */

/* Wrapper: fixed bottom-right positioning */
#rds-wab-wrapper {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 9999;

	/* Smooth entrance animation */
	animation: rds-wab-fadein 0.3s ease-in-out;
}

/* Respect user's reduced-motion preference (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
	#rds-wab-wrapper {
		animation: none;
	}
}

@keyframes rds-wab-fadein {
	from { opacity: 0; transform: scale(0.8); }
	to   { opacity: 1; transform: scale(1); }
}

/* The anchor element */
#rds-wab-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 20px;
	background-color: #25D366; /* WhatsApp brand green */
	color: #ffffff;
	border-radius: 50px;
	text-decoration: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.20);
	transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;

	/* Minimum target size: 44x44px (WCAG 2.5.5) */
	min-height: 44px;
	min-width: 44px;
}

/* Hover state - contrast stays above 3:1 against background (WCAG 1.4.3) */
#rds-wab-btn:hover {
	background-color: #128C7E;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
	transform: translateY(-2px);
}

/* Visible focus indicator - 3px solid offset outline (WCAG 2.4.7 / 2.4.11) */
#rds-wab-btn:focus-visible {
	outline: 3px solid #005f73;
	outline-offset: 4px;
	background-color: #128C7E;
}

/* Remove default focus ring for mouse users, keep for keyboard */
#rds-wab-btn:focus:not(:focus-visible) {
	outline: none;
}

/* SVG icon sizing */
#rds-wab-btn svg {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
}

/* Visible label text */
.rds-wab-label {
	white-space: nowrap;
}

/* On very small screens collapse label to icon only */
@media (max-width: 380px) {
	.rds-wab-label {
		/* Visually hide but keep accessible text */
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	#rds-wab-btn {
		padding: 14px;
		border-radius: 50%;
	}
}
