/* Legal — generic Privacy Policy & Terms pages. Same shell, swapped copy. */
function SF_LegalPage({ kicker, title, updated, sections }) {
  const h = { fontSize: 11, fontWeight: 500, letterSpacing: '.24em', textTransform: 'uppercase', color: 'var(--sf-gold-hi)' };
  const body = { fontSize: 13.5, fontWeight: 300, color: 'var(--sf-text-muted)', lineHeight: 1.75 };
  const h2 = { fontFamily: 'var(--font-display)', fontSize: 18, fontWeight: 600, color: 'var(--sf-text)', marginBottom: 8 };

  return (
    <div className="sf-maxw" style={{ paddingTop: 56, paddingBottom: 96, display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
      <div style={h}>{kicker}</div>
      <div style={{ fontFamily: 'var(--font-display)', fontSize: 38, fontWeight: 600, color: 'var(--sf-text)', marginTop: 8, textAlign: 'center' }}>{title}</div>
      <div style={{ fontSize: 12, fontWeight: 300, color: 'var(--sf-text-faint)', marginTop: 8 }}>Last updated {updated}</div>

      <div style={{ width: 'min(680px, 100%)', marginTop: 40, display: 'flex', flexDirection: 'column', gap: 28 }}>
        {sections.map((s) => (
          <div key={s.h}>
            <div style={h2}>{s.h}</div>
            <div style={body}>{s.p}</div>
          </div>
        ))}
      </div>
    </div>
  );
}

function SF_Privacy() {
  const s = window.SS_SITE;
  return (
    <SF_LegalPage
      kicker="LEGAL"
      title="Privacy Policy"
      updated="July 2026"
      sections={[
        { h: 'Information we collect', p: `We collect the information you give us when you place an order or contact us — your name, shipping address, phone number, email and payment details. We also collect basic usage data (like pages viewed) to keep ${s.brandName} running smoothly.` },
        { h: 'How we use it', p: 'Your information is used to process orders, provide customer support, send shipping updates, and — only if you opt in — send occasional offers and updates. We never sell your personal data to third parties.' },
        { h: 'Payment & security', p: 'Payments are processed by trusted third-party payment gateways; we do not store your full card details on our servers. Reasonable technical and organisational measures are in place to protect your information.' },
        { h: 'Cookies', p: 'We use cookies to remember your cart, keep you signed in, and understand how the site is used, so we can improve it over time. You can disable cookies in your browser, though parts of the site may not work as expected.' },
        { h: 'Your rights', p: `You can ask us to access, correct or delete your personal data at any time by writing to ${s.email}.` },
        { h: 'Contact', p: `Questions about this policy? Reach us at ${s.email} or WhatsApp ${s.social.whatsapp}.` },
      ]}
    />
  );
}

function SF_Terms() {
  const s = window.SS_SITE;
  return (
    <SF_LegalPage
      kicker="LEGAL"
      title="Terms &amp; Conditions"
      updated="July 2026"
      sections={[
        { h: 'Using this site', p: `By browsing or ordering from ${s.brandName}, you agree to these terms. We may update them from time to time, and continued use of the site means you accept the current version.` },
        { h: 'Orders & pricing', p: 'All prices are listed in INR and include applicable taxes unless stated otherwise. We reserve the right to correct pricing errors and to cancel or refuse an order at our discretion, in which case any payment made will be refunded in full.' },
        { h: 'Shipping', p: 'Orders are dispatched within 1–2 working days and typically delivered in 3–6 days across India. Shipping is free above ₹999; a flat ₹79 applies below that. Delivery timelines are estimates, not guarantees.' },
        { h: 'Returns & exchanges', p: 'Unworn pieces in original packaging can be exchanged within 7 days of delivery. For hygiene reasons, earrings can only be exchanged if the hygiene seal is intact.' },
        { h: 'Product accuracy', p: 'We do our best to represent colours and finishes accurately, but slight variation is normal with plated and handcrafted jewellery, and screens may render colour differently.' },
        { h: 'Limitation of liability', p: `${s.brandName} is not liable for indirect or incidental damages arising from the use of our products or website, beyond the value of the order placed.` },
        { h: 'Contact', p: `For anything related to these terms, write to ${s.email} or WhatsApp ${s.social.whatsapp}.` },
      ]}
    />
  );
}

window.SF_Privacy = SF_Privacy;
window.SF_Terms = SF_Terms;
