/**
 * Maraton — floating WhatsApp CTA.
 * Transform/opacity only, GPU-friendly, no dependencies.
 */

.mw-wa-fab {
	position: fixed;
	right: 24px;
	bottom: calc(39px + env(safe-area-inset-bottom, 0px));
	z-index: 9990;
	display: block;
	width: 60px;
	height: 60px;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
	isolation: isolate;
}

.mw-wa-fab__tile {
	position: relative;
	display: grid;
	place-items: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background:
		radial-gradient(120% 120% at 30% 12%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 52%),
		linear-gradient(165deg, #5df06d 0%, #26d24c 52%, #149a30 100%);
	box-shadow:
		0 16px 34px -12px rgba(16, 150, 45, 0.75),
		0 2px 0 rgba(255, 255, 255, 0.45) inset,
		0 0 0 1px rgba(255, 255, 255, 0.28) inset;
	color: #fff;
	transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
	will-change: transform;
}

.mw-wa-fab__icon {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	animation: mw-wa-float 3.6s ease-in-out infinite;
}

.mw-wa-fab__icon svg {
	display: block;
	width: 100%;
	height: 100%;
	filter: drop-shadow(0 1px 1px rgba(0, 80, 20, 0.25));
}

@keyframes mw-wa-float {
	0%,
	100% {
		transform: translateY(0) rotate(0deg);
	}
	50% {
		transform: translateY(-2px) rotate(-6deg);
	}
}

/* Expanding halos */
.mw-wa-fab__halo {
	position: absolute;
	left: 0;
	top: 0;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: 2px solid rgba(38, 210, 76, 0.55);
	opacity: 0;
	pointer-events: none;
	animation: mw-wa-halo 2.9s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.mw-wa-fab__halo:nth-of-type(2) {
	animation-delay: 1.45s;
}

@keyframes mw-wa-halo {
	0% {
		transform: scale(1);
		opacity: 0.65;
	}
	75% {
		transform: scale(1.75);
		opacity: 0;
	}
	100% {
		opacity: 0;
	}
}

/* Tap burst */
.mw-wa-fab__burst {
	position: absolute;
	left: 0;
	top: 0;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(88, 240, 109, 0.6), rgba(38, 210, 76, 0) 70%);
	opacity: 0;
	pointer-events: none;
}

.mw-wa-fab.is-tapped .mw-wa-fab__tile {
	animation: mw-wa-tap 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.mw-wa-fab.is-tapped .mw-wa-fab__burst {
	animation: mw-wa-burst 0.55s ease-out;
}

@keyframes mw-wa-tap {
	0% {
		transform: scale(1);
	}
	30% {
		transform: scale(0.82) rotate(-3deg);
	}
	65% {
		transform: scale(1.08) rotate(2deg);
	}
	100% {
		transform: scale(1);
	}
}

@keyframes mw-wa-burst {
	0% {
		transform: scale(0.55);
		opacity: 0.9;
	}
	100% {
		transform: scale(2.7);
		opacity: 0;
	}
}

/* Hover */
@media (hover: hover) {
	.mw-wa-fab:hover .mw-wa-fab__tile,
	.mw-wa-fab:focus-visible .mw-wa-fab__tile {
		transform: scale(1.09) translateY(-2px);
		box-shadow:
			0 22px 44px -12px rgba(16, 150, 45, 0.85),
			0 2px 0 rgba(255, 255, 255, 0.5) inset,
			0 0 0 1px rgba(255, 255, 255, 0.35) inset;
	}

	.mw-wa-fab:hover .mw-wa-fab__halo,
	.mw-wa-fab:focus-visible .mw-wa-fab__halo {
		animation-duration: 1.5s;
	}

	.mw-wa-fab:hover .mw-wa-fab__label,
	.mw-wa-fab:focus-visible .mw-wa-fab__label {
		opacity: 1;
		transform: translateY(-50%) translateX(0);
	}
}

.mw-wa-fab:focus-visible .mw-wa-fab__tile {
	outline: 3px solid rgba(38, 210, 76, 0.55);
	outline-offset: 3px;
}

/* Tooltip label */
.mw-wa-fab__label {
	position: absolute;
	top: 50%;
	right: calc(100% + 12px);
	transform: translateY(-50%) translateX(6px);
	white-space: nowrap;
	padding: 8px 12px;
	border-radius: 12px;
	background: #0f172a;
	color: #fff;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.4;
	opacity: 0;
	pointer-events: none;
	box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.55);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.mw-wa-fab__label::before {
	content: "";
	position: absolute;
	top: 50%;
	right: -4px;
	width: 8px;
	height: 8px;
	transform: translateY(-50%) rotate(45deg);
	background: #0f172a;
	border-radius: 2px;
}

/* Mobile */
@media (max-width: 767px) {
	.mw-wa-fab {
		right: 16px;
		bottom: calc(33px + env(safe-area-inset-bottom, 0px));
		width: 54px;
		height: 54px;
	}

	.mw-wa-fab__tile,
	.mw-wa-fab__halo,
	.mw-wa-fab__burst {
		width: 54px;
		height: 54px;
		border-radius: 50%;
	}

	.mw-wa-fab__icon {
		width: 27px;
		height: 27px;
	}

	.mw-wa-fab__label {
		display: none;
	}

	body.woocommerce-cart .mw-wa-fab,
	body.woocommerce-checkout .mw-wa-fab,
	body.woocommerce-order-received .mw-wa-fab {
		bottom: calc(111px + env(safe-area-inset-bottom, 0px));
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.mw-wa-fab__icon,
	.mw-wa-fab__halo {
		animation: none;
	}

	.mw-wa-fab__halo {
		opacity: 0.35;
	}

	.mw-wa-fab__tile {
		transition: none;
	}
}
