// Main App — routing between home and service detail pages

// Fotos del sitio. Dejá '' para usar los placeholders, o pegá una URL.
const CONFIG = {
  heroPhotoUrl: "/suyai.jpg",
  aboutPhotoUrl: "",
};

function App() {
  const [currentService, setCurrentService] = React.useState(null);

  const navigate = (serviceId) => {
    setCurrentService(serviceId);
    setTimeout(() => window.scrollTo({ top: 0, behavior: 'smooth' }), 50);
  };

  const service = currentService ? SERVICES.find(s => s.id === currentService) : null;

  return (
    <div>
      <Header onNavigate={navigate} currentService={currentService} />

      {service ? (
        <ServicePage service={service} onBack={() => setCurrentService(null)} onNavigate={navigate} />
      ) : (
        <main>
          <Hero photoUrl={CONFIG.heroPhotoUrl} />
          <About photoUrl={CONFIG.aboutPhotoUrl} />
          <ServicesGrid onSelectService={navigate} />
          <Booking />
          <GeneralFAQ />
          <ContactForm />
        </main>
      )}

      <Footer onNavigate={navigate} />
      <WhatsAppFAB phone={CONTACT.phoneIntl} message="Hola Suyai, me gustaría hacer una consulta." />
    </div>
  );
}

ReactDOM.createRoot(document.getElementById('app')).render(<App />);
