// Shared components for Recovery TRT site
// Nav, Footer, Logo, Icons, common building blocks

const { useState, useEffect, useRef, useMemo, useCallback } = React;

// ── useIsMobile — single matchMedia listener, drives layout switches across components ──
function useIsMobile(breakpoint = 768) {
  const [mobile, setMobile] = useState(() => typeof window !== "undefined" && window.matchMedia(`(max-width: ${breakpoint}px)`).matches);
  useEffect(() => {
    const mql = window.matchMedia(`(max-width: ${breakpoint}px)`);
    const onChange = (e) => setMobile(e.matches);
    if (mql.addEventListener) mql.addEventListener("change", onChange);
    else mql.addListener(onChange);
    setMobile(mql.matches);
    return () => {
      if (mql.removeEventListener) mql.removeEventListener("change", onChange);
      else mql.removeListener(onChange);
    };
  }, [breakpoint]);
  return mobile;
}

// ── i18n — Spanish dictionary keyed by the English string ──
const I18N_ES = {
  "Treatments": "Tratamientos",
  "How it works": "Cómo funciona",
  "Your doctor": "Su médico",
  "Pricing": "Precios",
  "Join now": "Únase hoy",
  "Patient log in": "Portal del paciente",
  "Log in": "Iniciar sesión",
  "Our Treatments": "Nuestros tratamientos",
  "Comprehensive care, ": "Atención integral, ",
  "built around you": "diseñada para usted",
  "Every protocol is designed and overseen by a urologist with more than 35 years in practice — not a nurse practitioner with a script pad.": "Cada protocolo está diseñado y supervisado por un urólogo con más de 35 años de práctica, no por un asistente con recetario.",
  "See if you qualify": "Vea si califica",
  "Starting at ": "Desde ",
  "/mo": "/mes",
  "/month": "/mes",
  "Learn more": "Más información",
  "Benefits of Hormone Therapy": "Beneficios de la terapia hormonal",
  "Discover a ": "Descubra una ",
  "new lease on life": "nueva etapa de vida",
  "Our physician-led programs are designed to help you regain vitality, improve your overall well-being, and restore balance in your life. With a tailored approach, you can experience:": "Nuestros programas dirigidos por médicos están diseñados para ayudarle a recuperar su vitalidad, mejorar su bienestar y devolver el equilibrio a su vida. Con un enfoque personalizado, usted puede experimentar:",
  "Increased Energy": "Más energía",
  "Enhanced Mood": "Mejor estado de ánimo",
  "Improved Libido": "Mejor libido",
  "Increased Lean Muscle": "Más masa muscular",
  "Decreased Visceral Fat": "Menos grasa visceral",
  "Better Sleep": "Mejor sueño",
  "Cognitive Clarity": "Claridad mental",
  "Resilient to Stress": "Resistencia al estrés",
  "Why GTX": "Por qué GTX",
  "The difference is the ": "La diferencia es el ",
  "physician": "médico",
  "A physician, not a script mill": "Un médico, no una fábrica de recetas",
  "Every protocol is designed and overseen by {doc} — a urologist in continuous practice since 1989. Every patient. Every refill.": "Cada protocolo está diseñado y supervisado por {doc}, un urólogo en práctica continua desde 1989. Cada paciente. Cada resurtido.",
  "The full picture, together": "El panorama completo, junto",
  "We don't treat T in isolation. Full HPG axis labs, body-composition markers, sleep and recovery data — one complete protocol built for your goals.": "No tratamos la testosterona de forma aislada. Análisis hormonales completos, indicadores de composición corporal, datos de sueño y recuperación: un protocolo completo diseñado para sus metas.",
  "Your data, transparent": "Sus datos, transparentes",
  "See your trends, side-effect notes, and protocol changes in your dashboard. Message your physician between visits. No phone trees.": "Vea sus tendencias, notas de efectos secundarios y cambios de protocolo en su panel. Escríbale a su médico entre visitas. Sin menús telefónicos interminables.",
  "Pharmacy-direct, no middleman": "Directo de la farmacia, sin intermediarios",
  "We partner with licensed pharmacies. Quality-tested medication, cold-chain shipping where required, refills on autopilot.": "Trabajamos con farmacias licenciadas. Medicamentos con control de calidad, envío refrigerado cuando se requiere y resurtidos automáticos.",
  "Your journey to comprehensive wellness": "Su camino hacia el bienestar integral",
  "We've made it ": "Lo hicimos ",
  "simple to start": "fácil de empezar",
  "From assessment to your first dose in days. Here is what you can expect:": "De la evaluación a su primera dosis en días. Esto es lo que puede esperar:",
  "Step": "Paso",
  "Tell us about you": "Cuéntenos sobre usted",
  "A 5-minute online assessment. Symptoms, history, what you're trying to get back.": "Una evaluación en línea de 5 minutos. Síntomas, historial y lo que quiere recuperar.",
  "Get bloodwork": "Hágase los análisis",
  "Get labs through any provider you prefer — we recommend [Function Health](https://my.functionhealth.com/signup?code=JDIAZ22&_saasquatch=JDIAZ22&d=FHREF25) ($25 off through our link) — or send us results from the last 90 days.": "Consiga sus análisis con el proveedor que prefiera. Recomendamos [Function Health](https://my.functionhealth.com/signup?code=JDIAZ22&_saasquatch=JDIAZ22&d=FHREF25) ($25 de descuento con nuestro enlace), o envíenos resultados de los últimos 90 días.",
  "Meet your doctor": "Conozca a su médico",
  "A video consultation. Your urologist reviews your labs, builds your protocol, answers everything.": "Una consulta por video. Su urólogo revisa sus análisis, crea su protocolo y responde todas sus preguntas.",
  "Treatment ships": "Su tratamiento llega a casa",
  "Discreet, climate-controlled shipping. Auto-refill, cancel anytime.": "Envío discreto y con control de temperatura. Resurtido automático, cancele cuando quiera.",
  "Start your assessment": "Comience su evaluación",
  "Free · 5 minutes · No credit card required": "Gratis · 5 minutos · No se requiere tarjeta",
  "Your physician": "Su médico",
  "Medical Director": "Director médico",
  "Membership pricing": "Precios de membresía",
  "Honest pricing. ": "Precios honestos. ",
  "No surprises.": "Sin sorpresas.",
  "Choose ": "Elegir ",
  "Become a member": "Hágase miembro",
  "Testimonials": "Testimonios",
  "Patients get ": "Los pacientes recuperan ",
  "their lives back": "su vida",
  "Frequently asked questions": "Preguntas frecuentes",
  "Questions, ": "Preguntas, ",
  "answered honestly": "respondidas con honestidad",
  "You don't have to feel like this forever.": "No tiene que sentirse así para siempre.",
  "Take the assessment. Get bloodwork. Talk to a real urologist. Find out what's actually going on.": "Haga la evaluación. Hágase los análisis. Hable con un urólogo de verdad. Descubra qué está pasando realmente.",
  "Start your membership today!": "¡Comience su membresía hoy!",
  "Talk to support": "Hable con nosotros",
  "Company": "Compañía",
  "Resources": "Recursos",
  "Medical release (PDF)": "Autorización médica (PDF)",
  "Pay my bill": "Pagar mi factura",
  "Pay bill": "Pagar factura",
  "Privacy": "Privacidad",
  "Terms": "Términos",
  "Membership": "Membresía",
  "Choose your membership": "Elija su membresía",
  "Referral code (optional)": "Código de referido (opcional)",
  "Were you referred by a GTX member? Enter their code so they receive credit.": "¿Le refirió un miembro de GTX? Ingrese su código para que esa persona reciba su crédito.",
  "Apply": "Aplicar",
  "Checking…": "Verificando…",
  "✓ Code accepted — {name} will receive referral credit.": "✓ Código aceptado, {name} recibirá su crédito de referido.",
  "✓ Code accepted — your referrer will receive credit.": "✓ Código aceptado, la persona que le refirió recibirá su crédito.",
  "That code was not recognized. Check the spelling, or continue without one.": "No reconocimos ese código. Revise la escritura o continúe sin código.",
  "We couldn't verify the code right now. You can continue without it, or try again in a moment.": "No pudimos verificar el código en este momento. Puede continuar sin él o intentar de nuevo en un momento.",
  "Your name": "Su nombre",
  "First and last name": "Nombre y apellido",
  "Email": "Correo electrónico",
  "Continue to enrollment": "Continuar a la inscripción",
  "Continue to discounted enrollment": "Continuar a la inscripción con descuento",
  "Select a membership above to continue.": "Seleccione una membresía arriba para continuar.",
  "Online enrollment for this plan is opening soon — call {phone} to join today.": "La inscripción en línea para este plan estará disponible pronto. Llame al {phone} para inscribirse hoy.",
  "← Back to site": "← Volver al sitio",
  "Enrollment and payment are handled securely by Elation Health, our HIPAA-compliant patient platform.": "La inscripción y el pago se procesan de forma segura a través de Elation Health, nuestra plataforma de pacientes que cumple con HIPAA.",
};
function t(s) {
  return (window.SITE_LANG === "es" && I18N_ES[s]) || s;
}

// ── Inline links — renders [label](url) markdown-style links inside content text ──
function renderLinks(text) {
  if (typeof text !== "string" || text.indexOf("](") === -1) return text;
  const re = /\[([^\]]+)\]\(([^)]+)\)/g;
  const parts = [];
  let last = 0, m, i = 0;
  while ((m = re.exec(text))) {
    if (m.index > last) parts.push(text.slice(last, m.index));
    parts.push(
      <a key={i++} href={m[2]} target="_blank" rel="noopener" style={{ color: "var(--gold-600)", textDecoration: "underline" }}>{m[1]}</a>
    );
    last = m.index + m[0].length;
  }
  if (last < text.length) parts.push(text.slice(last));
  return parts;
}

// ── Language toggle ──
function LangToggle({ style = {} }) {
  const other = window.SITE_LANG === "es" ? "en" : "es";
  return (
    <button
      onClick={() => window.setSiteLang && window.setSiteLang(other)}
      aria-label={other === "es" ? "Ver en español" : "View in English"}
      style={{
        background: "transparent", border: "1px solid var(--line-strong)", color: "var(--cream-200)",
        borderRadius: 999, padding: "7px 12px", fontSize: 12, fontWeight: 700,
        fontFamily: "var(--font-display)", letterSpacing: "0.05em", ...style,
      }}
    >{other === "es" ? "ES" : "EN"}</button>
  );
}

// ── Logo — Inline ligature: brand siteName + italic gold suffix ──
function Logo({ size = 20 }) {
  const brand = (window.RECOVERY_CONTENT && window.RECOVERY_CONTENT.brand) || {};
  const name = brand.siteName || "Recovery";
  const suffix = brand.italicSuffix || "trt";
  return (
    <div style={{ display: "inline-flex", alignItems: "baseline", lineHeight: 1, color: "var(--cream-50)" }}>
      <span className="display" style={{ fontSize: size * 1.4, letterSpacing: "-0.01em", color: "var(--gold-500)" }}>{name}</span>
      <span className="display" style={{ fontSize: size * 1.4, fontWeight: 600, letterSpacing: "-0.01em", marginLeft: 3 }}>{suffix}</span>
    </div>
  );
}

// ── Nav ──
function Nav({ active = "home", onNavigate, services = [] }) {
  const links = [
    { id: "treatments", label: "Treatments" },
    { id: "how", label: "How it works" },
    { id: "doctor", label: "Your doctor" },
    { id: "pricing", label: "Pricing" },
  ];
  const isMobile = useIsMobile();
  const [open, setOpen] = useState(false);
  useEffect(() => { if (!isMobile) setOpen(false); }, [isMobile]);
  useEffect(() => {
    document.body.style.overflow = open ? "hidden" : "";
    return () => { document.body.style.overflow = ""; };
  }, [open]);

  const navHandler = (id) => { setOpen(false); onNavigate?.(id); };

  return (
    <nav className="nav">
      <div className="nav-inner">
        <a href="#" onClick={(e) => { e.preventDefault(); navHandler("home"); }}>
          <Logo />
        </a>
        <div className="nav-links">
          {links.map((l) => (
            <a
              key={l.id}
              href={`#${l.id}`}
              className={active === l.id ? "active" : ""}
              onClick={(e) => { e.preventDefault(); navHandler(l.id); }}
            >{t(l.label)}</a>
          ))}
        </div>
        <div className="nav-cta">
          <LangToggle />
          {!isMobile && (
            <a href="https://app.elationpassport.com/passport/login/" target="_blank" rel="noopener" className="btn btn-ghost btn-sm">{t("Patient log in")}</a>
          )}
          <a href="#" onClick={(e) => { e.preventDefault(); navHandler("join"); }} className="btn btn-primary btn-sm">
            {t("Join now")} <ArrowRight />
          </a>
          {isMobile && (
            <button
              aria-label="Menu"
              aria-expanded={open}
              onClick={() => setOpen((v) => !v)}
              style={{ background: "#ffffff", border: "1px solid var(--line-strong)", color: "var(--cream-50)", width: 38, height: 38, borderRadius: 8, padding: 0, display: "inline-flex", alignItems: "center", justifyContent: "center", marginLeft: 8 }}
            >
              <svg width="18" height="18" viewBox="0 0 18 18" fill="none">
                {open ? (
                  <path d="M4 4l10 10M14 4L4 14" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
                ) : (
                  <path d="M2 5h14M2 9h14M2 13h14" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
                )}
              </svg>
            </button>
          )}
        </div>
      </div>
      {isMobile && open && (
        <div style={{ position: "fixed", inset: "60px 0 0 0", background: "rgba(255,255,255,0.98)", backdropFilter: "blur(20px)", zIndex: 49, display: "flex", flexDirection: "column", padding: "24px 20px", gap: 4 }}>
          {links.map((l) => (
            <a
              key={l.id}
              href={`#${l.id}`}
              onClick={(e) => { e.preventDefault(); navHandler(l.id); }}
              style={{ color: "var(--cream-50)", padding: "16px 12px", fontSize: 20, fontWeight: 700, fontFamily: "var(--font-display)", borderBottom: "1px solid var(--line)" }}
            >{t(l.label)}</a>
          ))}
          <a
            href="https://app.elationpassport.com/passport/login/"
            target="_blank" rel="noopener"
            style={{ color: "var(--cream-300)", padding: "16px 12px", fontSize: 16 }}
          >{t("Patient log in")}</a>
        </div>
      )}
    </nav>
  );
}

// ── Footer ──
function Footer({ doctor }) {
  const c = window.RECOVERY_CONTENT || {};
  const tagline = (c.brand && c.brand.tagline)
    || "Telehealth men's health, led by a urologist with more than 35 years in practice. Real medicine, delivered with care.";
  const company = (c.footer && c.footer.company) || "© 2026 Recovery Men's Health, PLLC.";
  const disclaimer = (c.footer && c.footer.disclaimer)
    || "This website does not provide medical advice. Treatments require an evaluation by a licensed clinician. Individual results vary. GTX Therapy partners with licensed physicians and licensed pharmacies. Not all treatments are available in all states.";
  const isMobile = useIsMobile();
  return (
    <footer className="footer">
      <div className="container">
        <div style={{ display: "grid", gridTemplateColumns: isMobile ? "1fr 1fr" : "2fr 1fr 1fr 1fr", gap: isMobile ? 32 : 40, paddingBottom: 56 }}>
          <div style={isMobile ? { gridColumn: "1 / -1" } : {}}>
            <Logo />
            <p style={{ marginTop: 20, maxWidth: 320, color: "var(--cream-300)", lineHeight: 1.6 }}>
              {tagline}
            </p>
            <div style={{ display: "flex", gap: 12, marginTop: 24 }}>
              {["LegitScript", "HIPAA", "SSL"].map((b) => (
                <span key={b} className="chip" style={{ fontSize: 11 }}>
                  <span className="chip-dot"></span>{b}
                </span>
              ))}
            </div>
            {c.contact && (
              <div style={{ marginTop: 24, fontSize: 13, color: "var(--cream-400)", lineHeight: 1.7 }}>
                {(c.contact.addressLines || []).map((l) => <div key={l}>{l}</div>)}
                {c.contact.officePhone && <div>Office: <a href={`tel:${c.contact.officePhone.replace(/[^0-9+]/g, "")}`}>{c.contact.officePhone}</a></div>}
                {c.contact.fax && <div>Fax: {c.contact.fax}</div>}
                {c.contact.note && <div style={{ marginTop: 8, maxWidth: 320 }}>{c.contact.note}</div>}
              </div>
            )}
          </div>
          <FooterCol title={t("Treatments")} links={["TRT", "ED", "Hair loss", "Weight loss", "Hormones", "Sleep"]} />
          <FooterCol title={t("Company")} links={["About", "Our doctor", "Press", "Careers", "Contact"]} />
          <FooterCol title={t("Resources")} links={["Journal", "Guides", "Lab basics", "FAQ", "Support"]} />
        </div>
        <div className="hairline"></div>
        <div style={{ display: "flex", flexDirection: isMobile ? "column" : "row", justifyContent: "space-between", paddingTop: 24, fontSize: 12, color: "var(--cream-400)", gap: isMobile ? 16 : 0 }}>
          <div>{company} {doctor?.name ? `Medical Director: ${doctor.name}.` : ""}</div>
          <div style={{ display: "flex", gap: isMobile ? 16 : 24, flexWrap: "wrap" }}>
            {c.contact && c.contact.payUrl && (
              <a href={c.contact.payUrl} target="_blank" rel="noopener" style={{ color: "var(--gold-500)", fontWeight: 700 }}>{t("Pay my bill")}</a>
            )}
            {c.contact && c.contact.releaseFormUrl && (
              <a href={c.contact.releaseFormUrl} target="_blank" rel="noopener">{t("Medical release (PDF)")}</a>
            )}
            <a href="/privacy.html">{t("Privacy")}</a>
            <a href="/terms.html">{t("Terms")}</a>
          </div>
        </div>
        <p style={{ fontSize: 11, color: "var(--cream-500)", marginTop: 20, lineHeight: 1.6, maxWidth: 980 }}>
          {disclaimer}
        </p>
      </div>
    </footer>
  );
}
function FooterCol({ title, links }) {
  return (
    <div>
      <div className="label-sm" style={{ marginBottom: 16, color: "var(--cream-300)" }}>{title}</div>
      <ul style={{ listStyle: "none", padding: 0, margin: 0, display: "flex", flexDirection: "column", gap: 10 }}>
        {links.map((l) => <li key={l}><a href="#">{l}</a></li>)}
      </ul>
    </div>
  );
}

// ── Icons ──
function ArrowRight({ size = 14 }) {
  return (
    <svg width={size} height={size} viewBox="0 0 14 14" fill="none">
      <path d="M2 7h10m0 0L7 2m5 5l-5 5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
    </svg>
  );
}
function Check({ size = 14 }) {
  return (
    <svg width={size} height={size} viewBox="0 0 14 14" fill="none">
      <path d="M2 7.5L5.5 11L12 3.5" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" />
    </svg>
  );
}
function Star({ size = 14, filled = true }) {
  return (
    <svg width={size} height={size} viewBox="0 0 14 14" fill={filled ? "currentColor" : "none"} stroke="currentColor" strokeWidth="1">
      <path d="M7 1.5l1.7 3.6 3.8.4-2.9 2.6.9 3.9L7 10l-3.5 2 .9-3.9L1.5 5.5l3.8-.4L7 1.5z" />
    </svg>
  );
}

// ── Service icons (line-based) ──
function ServiceIcon({ id, size = 28, color = "currentColor" }) {
  const s = { width: size, height: size, fill: "none", stroke: color, strokeWidth: 1.25, strokeLinecap: "round", strokeLinejoin: "round" };
  switch (id) {
    case "trt":
      return <svg viewBox="0 0 28 28" {...s}><path d="M9 4h10M11 4v8a3 3 0 003 3 3 3 0 003-3V4M14 15v9M11 24h6" /><circle cx="14" cy="8" r="0.7" fill={color} stroke="none" /></svg>;
    case "ed":
      return <svg viewBox="0 0 28 28" {...s}><path d="M14 5l-3 5h2v8h2v-8h2l-3-5z" /><circle cx="14" cy="20" r="6" /></svg>;
    case "hair":
      return <svg viewBox="0 0 28 28" {...s}><path d="M14 4c-5 0-8 4-8 9v3h16v-3c0-5-3-9-8-9z" /><path d="M9 16c0 4 2 8 5 8s5-4 5-8" /></svg>;
    case "weight":
      return <svg viewBox="0 0 28 28" {...s}><path d="M5 11l3-3h12l3 3-2 12H7L5 11z" /><path d="M11 7V5a3 3 0 016 0v2" /></svg>;
    case "hormone":
      return <svg viewBox="0 0 28 28" {...s}><circle cx="14" cy="14" r="9" /><path d="M14 5v18M5 14h18" /><circle cx="14" cy="14" r="3" /></svg>;
    case "sex":
      return <svg viewBox="0 0 28 28" {...s}><path d="M9 18a4 4 0 100-8 4 4 0 000 8zM19 18a4 4 0 100-8 4 4 0 000 8z" /><path d="M14 6v4M14 18v4" /></svg>;
    case "sleep":
      return <svg viewBox="0 0 28 28" {...s}><path d="M22 15a8 8 0 11-9-9 6 6 0 009 9z" /></svg>;
    case "labs":
      return <svg viewBox="0 0 28 28" {...s}><path d="M11 3v8L6 21a3 3 0 003 4h10a3 3 0 003-4l-5-10V3M9 3h10M9 14h10" /></svg>;
    case "consult":
      return <svg viewBox="0 0 28 28" {...s}><path d="M5 7h14a2 2 0 012 2v8a2 2 0 01-2 2h-9l-5 4v-4a2 2 0 01-2-2V9a2 2 0 012-2z" /><path d="M9 12h8M9 15h5" /></svg>;
    case "gh":
      // GH stack — upward growth arrow + tabular tick marks
      return <svg viewBox="0 0 28 28" {...s}><path d="M5 22l6-9 4 5 8-12" /><path d="M19 6h4v4" /><path d="M5 25h18" /></svg>;
    case "recovery":
      // BPC / recovery — heart-on-shield healing motif
      return <svg viewBox="0 0 28 28" {...s}><path d="M14 4l8 3v6c0 6-4 10-8 11-4-1-8-5-8-11V7l8-3z" /><path d="M14 17c-2.4-1.5-4-3-4-5a2.2 2.2 0 014-1.2A2.2 2.2 0 0118 12c0 2-1.6 3.5-4 5z" /></svg>;
    case "longevity":
      // Longevity — clock + rising trend
      return <svg viewBox="0 0 28 28" {...s}><circle cx="14" cy="14" r="9" /><path d="M14 9v5l3 2" /><path d="M19 19l3-3 2 2" /></svg>;
    default:
      return <svg viewBox="0 0 28 28" {...s}><circle cx="14" cy="14" r="9" /></svg>;
  }
}

// ── Catalog defaults — overridden by window.RECOVERY_CONTENT.services at boot ──
const SERVICES_DEFAULT = [
  { id: "trt", name: "Testosterone Replacement", short: "TRT", price: 159, blurb: "Rebuild energy, drive, and recovery with physician-managed TRT.", tag: "Most popular" },
  { id: "ed", name: "Erectile Dysfunction", short: "ED", price: 39, blurb: "Generic sildenafil & tadalafil, prescribed and shipped discreetly.", tag: null },
  { id: "hair", name: "Hair Loss", short: "Hair", price: 22, blurb: "Finasteride and minoxidil, on a schedule that actually works.", tag: null },
  { id: "weight", name: "Weight Loss", short: "Weight", price: 299, blurb: "Physician-guided medical weight loss with metabolic coaching.", tag: "New" },
  { id: "hormone", name: "Hormone Optimization", short: "Hormones", price: 189, blurb: "Cortisol, thyroid, estradiol — the full picture, not just T.", tag: null },
  { id: "sex", name: "Sexual Health", short: "Sex", price: 49, blurb: "PE, libido, and performance — without the awkward office visit.", tag: null },
  { id: "sleep", name: "Sleep & Recovery", short: "Sleep", price: 79, blurb: "Targeted protocols for sleep architecture and overnight recovery.", tag: null },
  { id: "labs", name: "Lab Testing", short: "Labs", price: 99, blurb: "Bring your own labs from any provider — we recommend Function Health — reviewed by your physician.", tag: null },
  { id: "consult", name: "Urology Consult", short: "Consult", price: 149, blurb: "One-on-one with an experienced urologist. Anything men's health.", tag: null },
];

// Resolve services dynamically each access (admin live preview reassigns RECOVERY_CONTENT)
Object.defineProperty(window, "SERVICES", {
  get() {
    const c = window.RECOVERY_CONTENT;
    return (c && Array.isArray(c.services) && c.services.length) ? c.services : SERVICES_DEFAULT;
  },
  configurable: true,
});

Object.assign(window, { Logo, Nav, Footer, ArrowRight, Check, Star, ServiceIcon, useIsMobile, t, LangToggle, renderLinks });
