/**
 * Floating WhatsApp bubble.
 *
 * Colour is the one place this module ignores the brand Crayon Box. WhatsApp
 * green is load-bearing — the glyph in a brand gold reads as a generic chat
 * icon, and the whole point of the bubble is that it is recognised at a
 * glance. Everything else here is structural.
 *
 * --cc-wa-bottom is set inline per request by CC_WhatsApp_Button::render(),
 * so this file stays static and cacheable while the offset still responds to
 * whether a floating cart is present. The 20px fallback is the no-cart case.
 */

.cc-wa-button {
	position: fixed;
	right: 20px;
	bottom: var(--cc-wa-bottom, 20px);

	/* Below the cart toggle (99998) so its overlay (99999) and drawer
	   (100000) both cover this cleanly when the cart is open. */
	z-index: 99990;

	/* 48px against the cart's 56px — deliberately the smaller of the two, so
	   the cart stays the primary action. */
	width: 48px;
	height: 48px;
	border-radius: 50%;

	display: flex;
	align-items: center;
	justify-content: center;

	background: #25d366;
	color: #fff;
	box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);

	/* Themes love to style bare anchors. */
	text-decoration: none;
	border: 0;
	padding: 0;

	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.cc-wa-button svg {
	width: 26px;
	height: 26px;
	display: block;
}

.cc-wa-button:hover,
.cc-wa-button:focus {
	background: #1eb959;
	color: #fff;
	transform: scale(1.06);
	box-shadow: 0 6px 18px rgba(37, 211, 102, 0.5);
}

/* Keyboard users need to see where they are; the hover scale alone isn't it. */
.cc-wa-button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.6);
}

@media (prefers-reduced-motion: reduce) {
	.cc-wa-button {
		transition: none;
	}
	.cc-wa-button:hover,
	.cc-wa-button:focus {
		transform: none;
	}
}

@media print {
	.cc-wa-button {
		display: none;
	}
}
