/* Template 3 - part C: orthodontist, finance, reviews(tabs), FAQ, final CTA, footer */
(function () {
  const e = React.createElement;
  const { useState } = React;
  const { useCountdown, fmtDate } = window;
  const Icon = window.Icon;
  const B = (props, ...kids) => e(window.T3Btn, props, ...kids);

  /* orthodontist ---------------------------------------------------------- */
  const Ortho = ({ cfg }) =>
    e("section", { className: "t3-sec t3-cont" },
      e("div", { className: "t3-ortho__grid" },
        e("div", { className: "t3-ortho__visual" },
          e("div", { className: "t3-ortho__img" }, e("img", { src: "assets/photo-saroshen.png", alt: "Dr Saroshen Naidoo" })),
          e("div", { className: "t3-ortho__chip" },
            e("div", null,
              e("b", null, "De-ientes Golders Green"),
              e("span", null, "Family-run for over 25 years")),
            e("span", { className: "badge" }, "Family practice"))),
        e("div", { className: "t3-ortho__copy" },
          e("span", { className: "t3-kick" }, "The team you\u2019ll meet"),
          e("h2", { className: "t3-h2" }, "A family-run team who ", e("span", { className: "alt" }, "take their time"), "."),
          e("p", { className: "t3-body" },
            "De-ientes is a family practice, run by the Naidoo family for over 25 years across Golders Green, Bedford and Clapham. That shapes how we look after people \u2013 unhurried appointments, honest advice, and a team that gets to know you."),
          e("ul", { className: "t3-cred" },
            [["Family-run since the practice began"],
             ["Unhurried new patient appointments"],
             ["Hygiene, cosmetic, orthodontic and implant care under one roof"],
             ["Honest \u2013 we\u2019ll only ever recommend what you need"]].map(([t], i) =>
              e("li", { key: i }, e(Icon, { name: "check" }),
                e("span", null, e("b", null, t))))),
          e("div", { style: { marginTop: 24 } }, B({ variant: "light", href: "#reserve" }, "Request my appointment")))),
    );

  /* finance --------------------------------------------------------------- */
  const Finance = ({ cfg }) =>
    e("section", { className: "t3-sec t3-cont", id: "finance" },
      e("div", { className: "t3-fin__card t3-reveal" },
        e("img", { className: "t3-fin__leaf", src: "assets/logo-mark-leaves.png", alt: "" }),
        e("div", { className: "t3-fin__head" },
          e("span", { className: "t3-kick", style: { color: "var(--t3-gold)" } }, "Costs"),
          e("h2", { className: "t3-h2" }, "Clear costs, ", e("span", { className: "alt" }, "no surprises"), "."),
          e("p", { className: "t3-lead" }, "Your new patient examination is \u00a347.50 instead of \u00a395 until 31st December, with X-rays included. If you need any treatment afterwards, you\u2019ll have a clear, written plan with every cost explained before anything is done \u2013 and no pressure to go ahead."))),
    );

  /* reviews ---------------------------------------------------------------- */
  const Reviews = ({ cfg }) =>
    e("section", { className: "t3-sec t3-cont" },
      e("div", { className: "t3-rev__head" },
        e("div", null,
          e("span", { className: "t3-kick" }, "Google reviews"),
          e("h2", { className: "t3-h2", style: { marginTop: 14 } }, "Loved ", e("span", { className: "alt" }, "locally"), "."))),
      e("div", { className: "t3-rev__grid" },
        cfg.reviews.map(({ text, name }, i) => e("div", { className: "t3-revcard", key: i },
          e("div", { className: "t3-revcard__st" }, "\u2605\u2605\u2605\u2605\u2605"),
          e("p", { className: "t3-revcard__q" }, "\u201C", text, "\u201D"),
          e("div", { className: "t3-revcard__by" },
            e("div", null, e("div", { className: "t3-revcard__n" }, name), e("div", { className: "t3-revcard__m" }, "Google review")))))),
    );

  /* faq ------------------------------------------------------------------- */
  const FAQ = ({ cfg }) => {
    const [open, setOpen] = useState(0);
    const items = [
      ["How do I claim the offer?", "Fill in the form on this page and we\u2019ll call you back to arrange your appointment. The \u00a347.50 price applies to any new patient examination booked by 31st December 2026."],
      ["Who is the offer for?", "Anyone who hasn\u2019t been a patient at De-ientes Golders Green before. Children aged 6 and under can have a free check-up when a parent joins the practice too."],
      ["What does the examination include?", "A full check of your teeth, gums and mouth, any X-rays needed, time to talk through what we find, and a clear, written plan."],
      ["Will I have to pay for anything else?", "Not on the day. If you need any treatment, we\u2019ll explain your options and costs first, and you can decide in your own time."],
      ["I\u2019m nervous about the dentist. Is that OK?", "Absolutely. Just let us know when we call, and we\u2019ll make sure your visit is calm and unhurried, with everything explained before we do it."],
      ["Can my family come too?", "Yes. We look after the whole family, and we\u2019re happy to arrange appointments together wherever we can."],
      ["When are you open?", "Monday and Wednesday 9am to 5.30pm, Tuesday and Thursday 9am to 6.30pm, and Friday 9am to 2pm."],
      ["Is there parking?", cfg.parking],
    ];
    return e("section", { className: "t3-sec t3-cont", id: "faq" },
      e("div", { className: "t3-faq__grid" },
        e("div", { className: "t3-faq__head" },
          e("span", { className: "t3-kick" }, "Good to know"),
          e("h2", { className: "t3-h2" }, "Your questions, ", e("span", { className: "alt" }, "answered"), ".")),
        e("div", { className: "t3-faq__list" },
          items.map(([q, a], i) => e("div", { className: "t3-faq__item", key: i, "data-open": open === i },
            e("button", { className: "t3-faq__q", onClick: () => setOpen(open === i ? -1 : i) },
              e("span", null, q),
              e("span", { className: "t3-faq__ic" }, e(Icon, { name: "plus" }))),
            e("div", { className: "t3-faq__a", style: { maxHeight: open === i ? 260 : 0 } },
              e("div", { className: "t3-faq__a-in" }, a)))))));
  };

  /* final cta ------------------------------------------------------------- */
  const FinalCTA = ({ cfg }) => {
    const t = useCountdown(cfg.eventISO);
    const u = [["Days", t.days], ["Hrs", t.hours], ["Min", t.mins], ["Sec", t.secs]];
    return e("section", { className: "t3-sec t3-cont" },
      e("div", { className: "t3-final__card t3-ondark" },
        e("img", { className: "t3-final__leaf", src: "assets/logo-mark-leaves.png", alt: "" }),
        e("div", { className: "t3-final__inner" },
          e("span", { className: "t3-eyebrow t3-eyebrow--plain" }, "Offer ends 31st December"),
          e("h2", { className: "t3-display" }, "Your first visit, ", e("span", { className: "alt" }, "half price"), "."),
          e("div", { className: "t3-final__cd" },
            u.map(([l, v], i) => e("div", { className: "u", key: i },
              e("b", null, String(v).padStart(2, "0")), e("span", null, l)))),
          e("p", { className: "t3-lead", style: { maxWidth: 640, margin: "0 auto 28px" } }, "If it\u2019s been a while since you saw a dentist, or you\u2019re new to the area and looking for a practice to stay with, this is a good time to come and meet us."),
          e("div", { className: "t3-final__actions" },
            B({ variant: "gold", lg: true, href: "#reserve" }, "Request my appointment"),
            B({ variant: "light", lg: true, href: "tel:" + cfg.phone }, "Call " + cfg.phone)),
          e("p", { className: "t3-final__fine" }, "De-ientes ", cfg.location, " \u00b7 ", cfg.address, " \u00b7 ", cfg.email))),
    );
  };

  /* footer ---------------------------------------------------------------- */
  const Footer = ({ cfg }) =>
    e("footer", { className: "t3-footer" },
      e("div", { className: "t3-footer__card" },
        e("div", { className: "t3-footer__top" },
          e("div", null,
            e("div", { className: "t3-footer__brand" },
              e("img", { className: "t3-footer__logo", src: "assets/logo-full-color.png", alt: cfg.practice })),
            e("p", { style: { maxWidth: 340 } }, "Part of a family-run group that has looked after patients for over 25 years. We look forward to meeting you."),
            e("div", { className: "t3-footer__badges" },
              ["Family-run", "GDC registered", "CQC regulated"].map((b, i) =>
                e("span", { className: "t3-footer__badge", key: i }, b)))),
          e("div", null,
            e("h4", null, "Visit us"),
            e("p", { style: { fontWeight: 600, color: "var(--t3-ink)" } }, "De-ientes ", cfg.location),
            e("p", null, cfg.address),
            e("p", { style: { marginTop: 10 } }, e("a", { href: "tel:" + cfg.phone }, cfg.phone)),
            e("p", null, e("a", { href: "mailto:" + cfg.email }, cfg.email))),
          e("div", null,
            e("h4", null, "New patient offer"),
            e("ul", null,
              [["The offer", "#offer"], ["Your visit", "#day"], ["Why us", "#why"], ["FAQs", "#faq"], ["Request my appointment", "#reserve"]].map(([l, h], i) =>
                e("li", { key: i }, e("a", { href: h }, l)))))),
        e("div", { className: "t3-footer__bar" },
          e("span", null, "\u00A9 ", new Date().getFullYear(), " ", cfg.practice, ". All rights reserved."),
          e("span", null, "Offer for new patients only, for examinations booked by 31st December 2026. Treatment subject to clinical suitability."))),
    );

  /* sticky mobile CTA (phones only, after ~520px scroll) ----------------- */
  const StickyCTA = ({ cfg }) => {
    const [show, setShow] = useState(false);
    React.useEffect(() => {
      const onScroll = () => setShow(window.scrollY > 520);
      window.addEventListener("scroll", onScroll, { passive: true });
      onScroll();
      return () => window.removeEventListener("scroll", onScroll);
    }, []);
    return e("div", { className: "t3-stickycta" + (show ? " is-on" : ""), "aria-hidden": !show },
      e("a", { className: "t3-stickycta__call", href: "tel:" + cfg.phone, "aria-label": "Call us" },
        e(Icon, { name: "phone" }), e("span", null, "Call")),
      e("a", { className: "t3-stickycta__book", href: "#reserve" }, "Request my appointment"));
  };

  window.T3C = { Ortho, Finance, Reviews, FAQ, FinalCTA, Footer, StickyCTA };
})();
