/**
 * Floating WhatsApp button (site-wide).
 * Colours and offsets come from inline custom properties set in PHP.
 */

.fm-wa-button {
	--fm-wa-bg: #25d366;
	--fm-wa-fg: #ffffff;
	--fm-wa-offset-bottom: 24px;
	--fm-wa-offset-side: 24px;
	--fm-wa-size: 56px;

	position: fixed;
	bottom: var(--fm-wa-offset-bottom);
	z-index: 9990;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	box-sizing: border-box;
	min-height: var(--fm-wa-size);
	padding: 0;
	border: 0;
	border-radius: calc(var(--fm-wa-size) / 2);
	background: var(--fm-wa-bg);
	color: var(--fm-wa-fg);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
	text-decoration: none;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	transition: transform .2s ease, box-shadow .2s ease;
}

.fm-wa-button--bottom-right {
	right: var(--fm-wa-offset-side);
}

.fm-wa-button--bottom-left {
	left: var(--fm-wa-offset-side);
}

.fm-wa-button:hover,
.fm-wa-button:focus {
	color: var(--fm-wa-fg);
	text-decoration: none;
	transform: translateY(-2px);
	box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
}

.fm-wa-button:focus-visible {
	outline: 3px solid var(--fm-wa-bg);
	outline-offset: 3px;
}

.fm-wa-button__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 var(--fm-wa-size);
	width: var(--fm-wa-size);
	height: var(--fm-wa-size);
}

.fm-wa-button__icon svg {
	display: block;
	width: 26px;
	height: 26px;
}

/* The label is present for screen readers but only painted when opted in. */
.fm-wa-button__label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

@media (min-width: 768px) {
	.fm-wa-button--has-label {
		padding-right: 22px;
	}

	.fm-wa-button--has-label .fm-wa-button__icon {
		flex-basis: var(--fm-wa-size);
	}

	.fm-wa-button--has-label .fm-wa-button__label {
		position: static;
		width: auto;
		height: auto;
		margin: 0;
		overflow: visible;
		clip: auto;
		clip-path: none;
	}
}

@media (max-width: 767px) {
	.fm-wa-button {
		--fm-wa-size: 52px;
	}

	.fm-wa-button--desktop-only {
		display: none;
	}
}

@media (min-width: 768px) {
	.fm-wa-button--mobile-only {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fm-wa-button {
		transition: none;
	}

	.fm-wa-button:hover,
	.fm-wa-button:focus {
		transform: none;
	}
}

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