// AppAlt.jsx + index-alt host with 3-page routing
function AppAlt() {
  const [route, setRoute] = React.useState("main");

  // Re-init icons + scroll to top whenever route changes
  React.useEffect(() => {
    if (window.lucide) window.lucide.createIcons();
    window.scrollTo({ top: 0, behavior: "auto" });
  }, [route]);

  const label =
    route === "main" ? "01 Main (Alt)" :
    route === "about" ? "02 О компании (Alt)" :
    "03 Контакты (Alt)";

  return (
    <div data-screen-label={label} className="page">
      <HeaderAlt route={route} setRoute={setRoute} />
      {route === "main" && <MainPageAlt route={route} setRoute={setRoute} />}
      {route === "about" && <AboutPageAlt />}
      {route === "contacts" && <ContactsPageAlt />}
      <FooterAlt route={route} setRoute={setRoute} />
    </div>
  );
}

function MainPageAlt({ route, setRoute }) {
  return (
    <main>
      <HeroAlt />
      <ServicesAlt />
      <TrackingAlt />
      <WhyAlt />
      <InsuranceCompactAlt />
      <RouteMapSectionAlt />
      <CtaPanelAlt />
    </main>
  );
}

window.AppAlt = AppAlt;
window.MainPageAlt = MainPageAlt;
