// Traducciones ES/EN compartidas entre las 3 propuestas
const WISHT_I18N = {
  en: {
    nav_features: "Features",
    nav_how: "How it works",
    nav_uses: "Use cases",
    nav_support: "Support",
    nav_download: "Download",

    badge: "Gift wishlists, simplified",
    hero_title_a: "Wish it.",
    hero_title_b: "Share it.",
    hero_title_c: "Get it.",
    hero_sub: "Wisht helps you create and organize gift wishlists so friends and family always know exactly what you want.",

    cta_appstore_top: "Download on the",
    cta_appstore_bot: "App Store",
    cta_appstore_soon: "Coming soon",
    cta_android_top: "Coming soon to",
    cta_android_bot: "Google Play",

    how_eyebrow: "How it works",
    how_title: "Three simple steps",
    how_sub: "From a blank list to a shared wishlist in less than a minute.",
    step1_title: "Create a list",
    step1_body: "Name it, pick a color and theme. Birthday, baby shower, school supplies — your call.",
    step2_title: "Add wishes",
    step2_body: "Save links, prices and notes for each wish so nothing gets lost in chats or screenshots.",
    step3_title: "Share it",
    step3_body: "Send your list to family and friends so they can see exactly what you want.",

    feat_eyebrow: "Why Wisht",
    feat_title: "Built for the people who give and receive",
    feat_create_t: "Create",
    feat_create_b: "Add items you truly want, all in one place.",
    feat_org_t: "Organize",
    feat_org_b: "Keep your wishes neat and easy to browse.",
    feat_share_t: "Share",
    feat_share_b: "Send your ideas to family and friends.",

    uses_eyebrow: "Perfect for",
    uses_title: "Every occasion you can think of",
    uses_sub: "Wisht works for events, holidays and everyday lists.",
    use_birthday: "Birthdays",
    use_holiday: "Holidays",
    use_wedding: "Weddings",
    use_baby: "Baby showers",
    use_school: "School supplies",
    use_someday: "Someday lists",
    use_family: "Family lists",
    use_anniv: "Anniversaries",

    gallery_eyebrow: "Inside the app",
    gallery_title: "A clean, warm experience",
    gallery_sub: "Designed to feel calm and personal, with festive accents where it counts.",

    cta_final_title: "Ready to start your first wishlist?",
    cta_final_sub: "Free to download. No account required.",

    footer_tag: "Wish it. Share it. Get it.",
    footer_product: "Product",
    footer_company: "Company",
    footer_legal: "Legal",
    footer_support: "Support",
    footer_privacy: "Privacy",
    footer_rights: "All rights reserved.",

    support_title: "Support",
    support_sub: "We're here to help. Most questions are answered below — if not, drop us a line.",
    support_email_t: "Email us",
    support_email_b: "We typically respond within 1–2 business days.",
    support_faq: "Frequently asked questions",
    faq: [
      { q: "Is Wisht free?", a: "Yes — Wisht is free to download and use. You can create a few wishlists and add wishes without paying. Wisht Plus unlocks unlimited lists, unlimited wishes per list and premium themes." },
      { q: "Do I need an account?", a: "No. Wisht is local-first on your iPhone — your lists live on your device. No sign-up required for the current version." },
      { q: "How do I share a wishlist?", a: "Open any list, tap the share icon and send the wishlist as text through Messages, WhatsApp, email or any sharing app." },
      { q: "Can I add a link to a wish?", a: "Yes. Each wish supports an optional URL so the people you share with can find exactly what you want." },
      { q: "Will Wisht come to Android?", a: "It's on the roadmap. iOS is the focus for the first release — Android will follow." },
      { q: "How do I cancel Wisht Plus?", a: "Wisht Plus is managed through your App Store account. You can cancel anytime from Settings → Apple ID → Subscriptions." },
      { q: "Is my data private?", a: "Yes. We don't sell your data. Wishlists stay on your device unless you choose to share them. See our Privacy Policy for details." }
    ],
    support_back: "Back to home",
    privacy_title: "Privacy Policy",
    privacy_updated: "Last updated: April 2026",
    privacy_intro: "Wisht is built around a simple idea: your wishlists are yours. This page explains what data Wisht handles, what stays on your device and what (if anything) leaves it.",
    privacy_sections: [
      { h: "Data we collect", b: "Wisht is local-first. Your wishlists, wishes, notes, links and event dates are stored on your iPhone using SwiftData. We do not have a backend that stores or syncs your lists across devices." },
      { h: "Account and sign-up", b: "Wisht does not require an account. There is no login, no password and no profile. You can use the app without giving us any personal information." },
      { h: "Sharing wishlists", b: "When you share a wishlist, Wisht generates plain text on your device which you send through the share sheet of your choice (Messages, WhatsApp, email, etc). The content of that share is not sent through our servers." },
      { h: "Wisht Plus and purchases", b: "Wisht Plus is handled by Apple's App Store. Apple processes your purchase, subscription status and renewals. We only see anonymized aggregate purchase data through standard App Store analytics." },
      { h: "Analytics and tracking", b: "Wisht uses minimal, privacy-friendly analytics to understand which features are used and to detect crashes. We do not sell, share or rent your data to third parties." },
      { h: "Children", b: "Wisht is not directed to children under 13. We do not knowingly collect personal information from children." },
      { h: "Changes", b: "If this policy changes in a meaningful way, we will update this page and note it in the app's release notes." },
      { h: "Contact", b: "Questions about privacy? Email us at support@wishtapp.com." }
    ]
  },
  es: {
    nav_features: "Funciones",
    nav_how: "Cómo funciona",
    nav_uses: "Casos de uso",
    nav_support: "Soporte",
    nav_download: "Descargar",

    badge: "Listas de regalos, sin complicaciones",
    hero_title_a: "Deséalo.",
    hero_title_b: "Compártelo.",
    hero_title_c: "Recíbelo.",
    hero_sub: "Wisht te ayuda a crear y organizar listas de regalos para que tu familia y amigos siempre sepan exactamente lo que quieres.",

    cta_appstore_top: "Descárgala en",
    cta_appstore_bot: "App Store",
    cta_appstore_soon: "Muy pronto",
    cta_android_top: "Muy pronto en",
    cta_android_bot: "Google Play",

    how_eyebrow: "Cómo funciona",
    how_title: "Tres pasos simples",
    how_sub: "De una lista vacía a compartida en menos de un minuto.",
    step1_title: "Crea una lista",
    step1_body: "Ponle nombre, color y tema. Cumpleaños, baby shower, útiles escolares — tú decides.",
    step2_title: "Agrega deseos",
    step2_body: "Guarda enlaces, precios y notas en cada deseo para que nada se pierda en chats o capturas.",
    step3_title: "Compártela",
    step3_body: "Envía tu lista a familiares y amigos para que vean exactamente lo que quieres.",

    feat_eyebrow: "Por qué Wisht",
    feat_title: "Hecho para quienes regalan y reciben",
    feat_create_t: "Crea",
    feat_create_b: "Agrega lo que realmente quieres, todo en un solo lugar.",
    feat_org_t: "Organiza",
    feat_org_b: "Mantén tus deseos ordenados y fáciles de revisar.",
    feat_share_t: "Comparte",
    feat_share_b: "Envía tus ideas a tu familia y amigos.",

    uses_eyebrow: "Perfecto para",
    uses_title: "Cualquier ocasión que se te ocurra",
    uses_sub: "Wisht funciona para eventos, fechas especiales y listas del día a día.",
    use_birthday: "Cumpleaños",
    use_holiday: "Fiestas",
    use_wedding: "Bodas",
    use_baby: "Baby showers",
    use_school: "Útiles escolares",
    use_someday: "Listas «algún día»",
    use_family: "Listas familiares",
    use_anniv: "Aniversarios",

    gallery_eyebrow: "Por dentro",
    gallery_title: "Una experiencia limpia y cálida",
    gallery_sub: "Diseñada para sentirse tranquila y personal, con detalles festivos donde importan.",

    cta_final_title: "¿Listo para tu primera lista de deseos?",
    cta_final_sub: "Descarga gratis. Sin necesidad de registrarte.",

    footer_tag: "Deséalo. Compártelo. Recíbelo.",
    footer_product: "Producto",
    footer_company: "Compañía",
    footer_legal: "Legal",
    footer_support: "Soporte",
    footer_privacy: "Privacidad",
    footer_rights: "Todos los derechos reservados.",

    support_title: "Soporte",
    support_sub: "Estamos para ayudarte. La mayoría de las dudas están abajo — si no, escríbenos.",
    support_email_t: "Escríbenos",
    support_email_b: "Normalmente respondemos en 1–2 días hábiles.",
    support_faq: "Preguntas frecuentes",
    faq: [
      { q: "¿Wisht es gratis?", a: "Sí — Wisht es gratis para descargar y usar. Puedes crear algunas listas y agregar deseos sin pagar. Wisht Plus desbloquea listas y deseos ilimitados y temas premium." },
      { q: "¿Necesito una cuenta?", a: "No. Wisht funciona local-first en tu iPhone — tus listas viven en tu dispositivo. No necesitas registrarte en la versión actual." },
      { q: "¿Cómo comparto una lista?", a: "Abre cualquier lista, toca el ícono de compartir y envíala como texto por Mensajes, WhatsApp, correo o cualquier app de compartir." },
      { q: "¿Puedo agregar un enlace a un deseo?", a: "Sí. Cada deseo permite una URL opcional para que quienes reciben tu lista encuentren exactamente lo que quieres." },
      { q: "¿Wisht llegará a Android?", a: "Está en el roadmap. iOS es el foco del primer lanzamiento — Android viene después." },
      { q: "¿Cómo cancelo Wisht Plus?", a: "Wisht Plus se gestiona desde tu cuenta de App Store. Puedes cancelar cuando quieras desde Ajustes → Apple ID → Suscripciones." },
      { q: "¿Mis datos son privados?", a: "Sí. No vendemos tus datos. Tus listas viven en tu dispositivo a menos que decidas compartirlas. Consulta nuestra Política de Privacidad para más detalles." }
    ],
    support_back: "Volver al inicio",
    privacy_title: "Política de Privacidad",
    privacy_updated: "Última actualización: Abril 2026",
    privacy_intro: "Wisht se construye sobre una idea simple: tus listas son tuyas. Esta página explica qué datos maneja Wisht, qué se queda en tu dispositivo y qué (si acaso) sale de él.",
    privacy_sections: [
      { h: "Datos que recopilamos", b: "Wisht es local-first. Tus listas, deseos, notas, enlaces y fechas de eventos se guardan en tu iPhone usando SwiftData. No tenemos un servidor que almacene o sincronice tus listas entre dispositivos." },
      { h: "Cuenta y registro", b: "Wisht no requiere cuenta. No hay inicio de sesión, contraseña ni perfil. Puedes usar la app sin darnos ninguna información personal." },
      { h: "Compartir listas", b: "Cuando compartes una lista, Wisht genera texto plano en tu dispositivo que tú envías por la app que elijas (Mensajes, WhatsApp, correo, etc). El contenido de ese mensaje no pasa por nuestros servidores." },
      { h: "Wisht Plus y compras", b: "Wisht Plus se gestiona desde la App Store de Apple. Apple procesa tu compra, estado de suscripción y renovaciones. Nosotros solo vemos datos agregados y anónimos a través de las analíticas estándar de App Store." },
      { h: "Analítica y seguimiento", b: "Wisht usa analítica mínima y respetuosa con la privacidad para entender qué funciones se usan y detectar fallos. No vendemos, compartimos ni rentamos tus datos a terceros." },
      { h: "Niños", b: "Wisht no está dirigida a niños menores de 13 años. No recopilamos a sabiendas información personal de niños." },
      { h: "Cambios", b: "Si esta política cambia de forma significativa, actualizaremos esta página y lo mencionaremos en las notas de la versión." },
      { h: "Contacto", b: "¿Preguntas sobre privacidad? Escríbenos a support@wishtapp.com." }
    ]
  }
};

// Helper hook
function useI18n() {
  const [lang, setLang] = React.useState(() => {
    try { return localStorage.getItem("wisht-lang") || "en"; } catch { return "en"; }
  });
  React.useEffect(() => { try { localStorage.setItem("wisht-lang", lang); } catch {} }, [lang]);
  const t = WISHT_I18N[lang] || WISHT_I18N.en;
  return { lang, setLang, t };
}

// Theme hook (light/dark)
function useTheme() {
  const [theme, setTheme] = React.useState(() => {
    try { return localStorage.getItem("wisht-theme") || "light"; } catch { return "light"; }
  });
  React.useEffect(() => {
    try { localStorage.setItem("wisht-theme", theme); } catch {}
    document.documentElement.dataset.theme = theme;
  }, [theme]);
  return { theme, setTheme };
}

window.WISHT_I18N = WISHT_I18N;
window.useI18n = useI18n;
window.useTheme = useTheme;
