"use client";

import { useEffect } from "react";
import { usePathname } from "next/navigation";
import { getBodyClasses } from "@/lib/bodyClasses";

/**
 * Applies production WP/Elementor body classes per route.
 * Owns document.body.className — no other component should set it.
 */
export default function BodyClasses() {
  const pathname = usePathname();
  useEffect(() => {
    document.body.className = getBodyClasses(pathname);
  }, [pathname]);
  return null;
}
