// Mobile sticky CTA — floats above content on small screens, hidden until the visitor scrolls down.
// Shared across all pages (Home and content pages alike).
const StickyMobileCTA = () => {
  const [visible, setVisible] = React.useState(false);
  React.useEffect(() => {
    const onScroll = () => setVisible(window.scrollY > 400);
    onScroll();
    window.addEventListener("scroll", onScroll, { passive: true });
    return () => window.removeEventListener("scroll", onScroll);
  }, []);
  return (
    <a
      href={scWhatsAppHref()}
      target="_blank"
      rel="noopener noreferrer"
      className={"scl-sticky-cta" + (visible ? " is-visible" : "")}
    >
      {t("common.ctaPrimary")} <Icon name="arrow-right" size={16} />
    </a>
  );
};

window.StickyMobileCTA = StickyMobileCTA;
