/**
 * WhatsApp Pulse Button — Front-end styles
 */

.wapb-button {
	position: fixed;
	bottom: 25px;
	z-index: 99999;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background-color: var(--wapb-color, #25D366);
	color: #ffffff;
	text-decoration: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	cursor: pointer;
}

.wapb-pos-right { right: 25px; }
.wapb-pos-left  { left: 25px; }

.wapb-button:hover,
.wapb-button:focus {
	transform: scale(1.08);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	color: #ffffff;
	text-decoration: none;
}

.wapb-button:focus-visible {
	outline: 3px solid rgba(37, 211, 102, 0.5);
	outline-offset: 3px;
}

.wapb-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	line-height: 0;
}

.wapb-icon svg {
	width: 32px;
	height: 32px;
	display: block;
}

/* ---------- Pulsing animation ---------- */

.wapb-pulse::before,
.wapb-pulse::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background-color: var(--wapb-color, #25D366);
	transform: translate(-50%, -50%) scale(1);
	opacity: 0.6;
	z-index: -1;
	pointer-events: none;
	animation: wapb-pulse-anim 2s infinite ease-out;
}

.wapb-pulse::after {
	animation-delay: 1s;
}

@keyframes wapb-pulse-anim {
	0% {
		transform: translate(-50%, -50%) scale(1);
		opacity: 0.6;
	}
	100% {
		transform: translate(-50%, -50%) scale(1.8);
		opacity: 0;
	}
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
	.wapb-pulse::before,
	.wapb-pulse::after {
		animation: none;
		display: none;
	}
}

/* ---------- Tooltip ---------- */

.wapb-tooltip {
	position: absolute;
	bottom: 50%;
	transform: translateY(50%);
	background: #333;
	color: #fff;
	padding: 7px 12px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	pointer-events: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wapb-pos-right .wapb-tooltip {
	right: calc(100% + 12px);
}

.wapb-pos-left .wapb-tooltip {
	left: calc(100% + 12px);
}

.wapb-tooltip::after {
	content: "";
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	border: 6px solid transparent;
}

.wapb-pos-right .wapb-tooltip::after {
	left: 100%;
	border-left-color: #333;
}

.wapb-pos-left .wapb-tooltip::after {
	right: 100%;
	border-right-color: #333;
}

.wapb-button:hover .wapb-tooltip,
.wapb-button:focus .wapb-tooltip {
	opacity: 1;
	visibility: visible;
}

/* ---------- Mobile tweaks ---------- */

@media (max-width: 480px) {
	.wapb-button {
		width: 54px;
		height: 54px;
		bottom: 18px;
	}
	.wapb-pos-right { right: 18px; }
	.wapb-pos-left  { left: 18px; }

	.wapb-icon,
	.wapb-icon svg {
		width: 28px;
		height: 28px;
	}

	/* Tooltip can be awkward on touch devices */
	.wapb-tooltip { display: none; }
}
