/* Template 3 - part B: trust, offer, flow, before/after, why */
(function () {
  const e = React.createElement;
  const { useState, useRef, useEffect, useCallback } = React;
  const { fmtDate } = window;
  const Icon = window.Icon;
  const Btn = () => window.T3Btn;

  const trust = [
    ["percent", "Half price until 31st December", "Your new patient examination for \u00a347.50 instead of \u00a395."],
    ["scan", "X-rays included", "So nothing is missed, with no extra charge on the day."],
    ["clock", "Time to talk", "Unhurried appointments, with time for every question."],
    ["users", "The whole family, one practice", "Children, parents and grandparents, all under one roof."],
  ];
  const Trust = () =>
    e("section", { className: "t3-sec t3-cont", style: { paddingTop: 0 } },
      e("div", { className: "t3-trust__card t3-reveal" },
        trust.map(([ic, t, s], i) => e("div", { className: "t3-trust__item", key: i },
          e("span", { className: "t3-trust__ic" }, e(Icon, { name: ic })),
          e("div", null, e("div", { className: "t3-trust__t" }, t), e("div", { className: "t3-trust__s" }, s))))));

  /* offer ----------------------------------------------------------------- */
  const Offer = ({ cfg }) => {
    const B = window.T3Btn;
    const incl = [
      ["users", "Getting to know you", "Time to talk about what you\u2019d like from your dentist, any worries, and what\u2019s brought you to us.", "INCLUDED", true],
      ["smile", "A full examination", "A thorough check of your teeth, gums and mouth, explained as we go.", "INCLUDED", true],
      ["scan", "X-rays", "To see what can\u2019t be seen by eye, so small problems are caught early.", "INCLUDED", true],
      ["badge", "Your personal plan", "A clear, written plan with your options and costs, before anything is done.", "INCLUDED", true],
    ];
    return e("section", { className: "t3-sec t3-cont", id: "offer" },
      e("div", { className: "t3-offer__head" },
        e("span", { className: "t3-eyebrow" }, e("span", { className: "dot" }), "What\u2019s included"),
        e("h2", { className: "t3-h2" }, "Everything your first visit ", e("span", { className: "alt" }, "includes"), ".")),
      e("div", { className: "t3-offer__grid" },
        e("div", { className: "t3-card t3-reveal" },
          e("ul", { className: "t3-incl" },
            incl.map(([ic, t, s, pr, free], i) => e("li", { key: i },
              e("span", { className: "ic" }, e(Icon, { name: ic })),
              e("span", { className: "it" }, t, e("small", null, s)),
              e("span", { className: "pr" + (free ? " free" : "") }, pr))))),
        e("div", { className: "t3-pricecard t3-reveal" },
          e("img", { className: "t3-pricecard__leaf", src: "assets/logo-mark-leaves.png", alt: "" }),
          e("div", { className: "lbl" }, "Your new patient saving"),
          e("div", { className: "now" }, "\u00a347.50"),
          e("div", { className: "mo" }, "off"),
          e("div", { className: "save" }, "Usually \u00a395, now \u00a347.50, X-rays included"),
          e("div", { className: "fine" }, "Available until 31st December 2026."),
          e("div", { className: "t3-pricecard__spacer" }),
          e(B, { variant: "gold", block: true, lg: true, href: "#reserve" }, "Request my appointment"))),
    );
  };

  /* flow ------------------------------------------------------------------ */
  const Flow = ({ cfg }) => {
    const steps = [
      ["We call you back", "Fill in the form and we\u2019ll call to find a time that suits you, including later appointments on Tuesdays and Thursdays.", ""],
      ["Arrive and settle in", "A warm welcome and time to get comfortable. If you\u2019re nervous, just tell us and we\u2019ll go at your pace.", ""],
      ["Your examination", "Your dentist checks your teeth, gums and mouth, takes any X-rays needed, and talks you through what they find.", ""],
      ["Your plan", "You leave with a clear, written plan, including the options and costs for any treatment you might need.", ""],
      ["Your next step", "If you\u2019d like to go ahead, we\u2019ll book your next appointment. If not, that\u2019s fine too.", ""],
    ];
    return e("section", { className: "t3-sec t3-cont", id: "day" },
      e("div", { className: "t3-flow__head" },
        e("div", null,
          e("span", { className: "t3-kick" }, "What happens at your visit"),
          e("h2", { className: "t3-h2", style: { marginTop: 14 } }, "Your first visit, ", e("span", { className: "alt" }, "step by step"), ".")),
        e("p", { className: "t3-body", style: { maxWidth: 340 } }, "No rushing and no pressure. Here\u2019s what happens from the moment you get in touch.")),
      e("div", { className: "t3-flow__grid" },
        steps.map(([t, s, time], i) => e("div", { className: "t3-step t3-reveal", key: i },
          e("div", { className: "t3-step__n" }, i + 1),
          e("div", { className: "t3-step__t" }, t),
          e("div", { className: "t3-step__s" }, s),
          time && e("span", { className: "t3-step__time" }, time)))),
    );
  };

  /* benefits (replaces before/after) -------------------------------------- */
  const Benefits = () => {
    const cards = [
      ["shield", "Catch things early", "Small problems found now rarely become big ones later."],
      ["badge", "Know where you stand", "A clear picture of your teeth and gums, and no surprises on cost."],
      ["heart", "Feel at ease", "If it’s been a while, or the dentist makes you anxious, we’ll never rush you or judge you."],
      ["users", "A dentist for the years ahead", "A practice that knows you, and your family, for the long term."],
    ];
    return e("section", { className: "t3-sec t3-cont", id: "benefits" },
      e("div", { className: "t3-why__head" },
        e("span", { className: "t3-kick" }, "Why it matters"),
        e("h2", { className: "t3-h2", style: { marginTop: 14 } }, "Why a proper check-up ", e("span", { className: "alt" }, "is worth it"), "."),
        e("p", { className: "t3-body", style: { marginTop: 14 } }, "Most dental problems are much simpler, and much less expensive, to sort out when they’re caught early.")),
      e("div", { className: "t3-why__grid" },
        cards.map(([ic, t, s], i) => e("div", { className: "t3-whycard t3-reveal", key: i },
          e("span", { className: "t3-whycard__ic" }, e(Icon, { name: ic })),
          e("div", { className: "t3-whycard__t" }, t),
          e("div", { className: "t3-whycard__s" }, s)))));
  };

  /* why ------------------------------------------------------------------- */
  const Why = ({ cfg }) => {
    const cards = [
      ["users", "Family-run for over 25 years", "We\u2019re a family practice, and we look after the whole family together, from first check-ups to orthodontics and implants."],
      ["heart", "Time for nervous patients", "If you\u2019re anxious about the dentist, tell us when we call and we\u2019ll make sure your visit is calm and unhurried."],
      ["smile", "Everything in one place", "Hygiene, fillings, whitening, braces, aligners and implants, without being sent elsewhere."],
      ["pin", "Easy to get to", "On Finchley Road, close to Golders Green station, fully wheelchair accessible, and open until 6.30pm on Tuesdays and Thursdays."],
    ];
    return e("section", { className: "t3-sec t3-cont", id: "why" },
      e("div", { className: "t3-why__head" },
        e("span", { className: "t3-kick" }, "Why De-ientes"),
        e("h2", { className: "t3-h2", style: { marginTop: 14 } }, "Why families ", e("span", { className: "alt" }, "stay with us"), ".")),
      e("div", { className: "t3-why__grid" },
        cards.map(([ic, t, s], i) => e("div", { className: "t3-whycard t3-reveal", key: i },
          e("span", { className: "t3-whycard__ic" }, e(Icon, { name: ic })),
          e("div", { className: "t3-whycard__t" }, t),
          e("div", { className: "t3-whycard__s" }, s)))),
    );
  };

  /* gallery + video slot (after pricing) ---------------------------------- */
  const Gallery = () => {
    const shots = [
      ["photo-reception.jpg", "Our welcoming reception"],
      ["photo-consult.jpg", "Relaxed, unhurried appointments"],
      ["photo-invisalign-kit.jpg", "Modern, comfortable surgeries"],
      ["photo-team-model.jpg", "A friendly, family-run team"],
    ];
    return e("section", { className: "t3-sec t3-cont" },
      e("div", { className: "t3-why__head" },
        e("span", { className: "t3-kick" }, "Inside the practice"),
        e("h2", { className: "t3-h2", style: { marginTop: 14 } }, "A calm, modern practice ", e("span", { className: "alt" }, "on Finchley Road"), ".")),
      e("div", { className: "t3-gallery" },
        shots.map(([img, cap], i) => e("figure", { className: "t3-galfig t3-reveal", key: i },
          e("img", { src: "assets/" + img, alt: cap }),
          e("figcaption", null, cap)))));
  };

  const VideoSlot = ({ cfg }) => {
    const B = window.T3Btn;
    const vid = useRef(null);
    const [muted, setMuted] = useState(true);
    const toggle = () => {
      const v = vid.current; if (!v) return;
      v.muted = !v.muted;
      if (!v.muted) v.play();
      setMuted(v.muted);
    };
    return e("section", { className: "t3-sec t3-cont" },
      e("div", { className: "t3-video__grid" },
        e("div", { className: "t3-video__media t3-reveal" },
          e("video", {
            ref: vid, src: "assets/video-tour.mp4", poster: "assets/video-tour-poster.jpg",
            autoPlay: true, muted: true, loop: true, playsInline: true,
          }),
          e("button", { className: "t3-video__mute", type: "button", "aria-label": muted ? "Unmute video" : "Mute video", onClick: toggle },
            e(Icon, { name: muted ? "mute" : "volume" }))),
        e("div", null,
          e("span", { className: "t3-kick" }, "See for yourself"),
          e("h2", { className: "t3-h2", style: { margin: "14px 0 0" } }, "Meet the team ", e("span", { className: "alt" }, "before you arrive"), "."),
          e("p", { className: "t3-body", style: { margin: "18px 0 24px" } },
            "Sixty seconds inside De-ientes Golders Green – meet some of the team, see the practice, and know exactly what to expect from your first visit."),
          e(B, { variant: "light", href: "#reserve" }, "Request my appointment"))));
  };

  /* treatment types ------------------------------------------------------- */
  const Treatments = () => {
    const opts = [
      ["chair", "Check-ups and hygiene", "", "Regular check-ups, and gentle hygiene appointments with Airflow to lift staining and keep your gums healthy."],
      ["shield", "Fillings and repairs", "", "Tooth-coloured fillings, crowns and onlays that blend in with your natural teeth."],
      ["sparkles", "Cosmetic dentistry", "", "Teeth whitening, composite bonding and veneers, starting with a free consultation."],
      ["smile", "Straightening and implants", "", "Clear aligners and braces for children and adults, and dental implants to replace missing teeth."],
    ];
    return e("section", { className: "t3-sec t3-cont", id: "treatments" },
      e("div", { className: "t3-why__head" },
        e("span", { className: "t3-kick" }, "How we can help"),
        e("h2", { className: "t3-h2", style: { marginTop: 14 } }, "Everything your family needs, ", e("span", { className: "alt" }, "in one place"), ".")),
      e("div", { className: "t3-why__grid" },
        opts.map(([ic, t, tag, s], i) => e("div", { className: "t3-whycard t3-reveal", key: i },
          e("span", { className: "t3-whycard__ic" }, e(Icon, { name: ic })),
          e("div", { className: "t3-whycard__t" }, t, tag && e("span", { className: "t3-whycard__tag" }, tag)),
          e("div", { className: "t3-whycard__s" }, s)))));
  };

  window.T3B = { Trust, Offer, Flow, Benefits, Why, Gallery, VideoSlot, Treatments };
})();
