/**
 * Simple Floating WhatsApp Button – Frontend Styles
 *
 * Dynamic values (background color, position) are set as CSS custom
 * properties by script.js so that we never inject inline CSS.
 *
 * @package SimpleFloatingWhatsAppButton
 * @version 1.0
 */

/* ─── Base ────────────────────────────────────── */

.sfwb-floating-button {
	--sfwb-bg: #25D366;
	--sfwb-size: 60px;
	--sfwb-offset: 24px;
	--sfwb-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	--sfwb-hover-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
	--sfwb-radius: 50px;

	position: fixed;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ─── Positions ───────────────────────────────── */

.sfwb-position-bottom-right {
	bottom: var(--sfwb-offset);
	right: var(--sfwb-offset);
}

.sfwb-position-bottom-left {
	bottom: var(--sfwb-offset);
	left: var(--sfwb-offset);
}

.sfwb-position-top-right {
	top: var(--sfwb-offset);
	right: var(--sfwb-offset);
}

.sfwb-position-top-left {
	top: var(--sfwb-offset);
	left: var(--sfwb-offset);
}

/* ─── Button Link ─────────────────────────────── */

.sfwb-button-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background-color: var(--sfwb-bg);
	color: #fff;
	text-decoration: none;
	padding: 12px 20px;
	border-radius: var(--sfwb-radius);
	box-shadow: var(--sfwb-shadow);
	transition:
		transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
		box-shadow 0.3s ease,
		background-color 0.3s ease;
	cursor: pointer;
	line-height: 1;
	white-space: nowrap;
	-webkit-tap-highlight-color: transparent;
}

.sfwb-button-link:hover,
.sfwb-button-link:focus-visible {
	transform: scale(1.08);
	box-shadow: var(--sfwb-hover-shadow);
	outline: none;
	color: #fff;
	text-decoration: none;
}

.sfwb-button-link:active {
	transform: scale(0.96);
}

/* ─── Icon ────────────────────────────────────── */

.sfwb-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
}

.sfwb-icon svg {
	display: block;
	width: 28px;
	height: 28px;
}

.sfwb-custom-icon {
	display: block;
	width: 28px;
	height: 28px;
	object-fit: contain;
	border-radius: 4px;
}

/* ─── Text ────────────────────────────────────── */

.sfwb-text {
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.2px;
}

/* ─── Pulse Animation ─────────────────────────── */

.sfwb-floating-button::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	transform: translate(-50%, -50%);
	border-radius: var(--sfwb-radius);
	background-color: var(--sfwb-bg);
	opacity: 0;
	z-index: -1;
	animation: sfwb-pulse 2s ease-in-out infinite;
	pointer-events: none;
}

@keyframes sfwb-pulse {
	0% {
		opacity: 0.5;
		transform: translate(-50%, -50%) scale(1);
	}
	100% {
		opacity: 0;
		transform: translate(-50%, -50%) scale(1.5);
	}
}

/* ─── Responsive – Mobile ─────────────────────── */

@media (max-width: 600px) {
	.sfwb-floating-button {
		--sfwb-offset: 16px;
	}

	.sfwb-button-link {
		padding: 10px 14px;
		gap: 8px;
	}

	.sfwb-text {
		font-size: 12px;
	}

	.sfwb-icon,
	.sfwb-icon svg,
	.sfwb-custom-icon {
		width: 24px;
		height: 24px;
	}
}

/* ─── Reduced-motion preference ───────────────── */

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

	.sfwb-floating-button::before {
		animation: none;
	}
}
