// Brochure body sections: Why, How, Wallet, Stamp, CTA, Footer.

const { useState: useStM, useEffect: useEfM } = React;

// ─────────────────────────────────────────────────────────────
// WHY section — 3 pillars in dashed-border cards
// ─────────────────────────────────────────────────────────────
function WhySection({ lang, copy }) {
  const t = copy.why[lang];
  return (
    <section className="brochure-why" data-screen-label="02 Why">
      <div className="why-inner">
        <Eyebrow>{t.eyebrow}</Eyebrow>
        <h2 className="why-title">{t.title}</h2>
        <p className="why-body">{t.body}</p>

        <div className="why-pillars">
          {t.pillars.map((p, i) => (
            <div key={i} className="why-pillar">
              <div className="why-pillar-num">0{i+1}</div>
              <div className="why-pillar-k">{p.k}</div>
              <div className="why-pillar-v">{p.v}</div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ─────────────────────────────────────────────────────────────
// HOW section — 3 step journey, each with a phone mockup
// Mobile: stacked vertically. Desktop: phone-text-phone-text rhythm.
// ─────────────────────────────────────────────────────────────
function HowSection({ lang, copy }) {
  const t = copy.how[lang];

  // each step gets a different phone screen
  const screens = [HowStepScan, HowStepWhatsApp, HowStepShow];

  return (
    <section className="brochure-how" id="how" data-screen-label="03 How it works">
      <div className="how-header">
        <Eyebrow>{t.eyebrow}</Eyebrow>
        <h2 className="how-title">{t.title}</h2>
      </div>

      <div className="how-steps">
        {t.steps.map((step, i) => {
          const ScreenComp = screens[i];
          return (
            <div key={i} className={`how-step how-step-${i % 2 === 0 ? 'lr' : 'rl'}`}>
              <div className="how-step-text">
                <div className="how-step-num">{step.n}</div>
                <h3 className="how-step-title">{step.title}</h3>
                <p className="how-step-body">{step.body}</p>
              </div>
              <div className="how-step-phone">
                <MiniPhone width={260} height={540} tilt={i % 2 === 0 ? -2 : 2}>
                  <ScreenComp/>
                </MiniPhone>
                {i < t.steps.length - 1 && (
                  <div className="how-step-arrow" aria-hidden="true">
                    <svg width="24" height="48" viewBox="0 0 24 48" fill="none">
                      <path d="M 12 4 L 12 40 M 6 34 L 12 40 L 18 34" stroke="#1A2E28" strokeOpacity="0.35" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" strokeDasharray="3 3"/>
                    </svg>
                  </div>
                )}
              </div>
            </div>
          );
        })}
      </div>
    </section>
  );
}

// Step 1 — phone camera scanning a counter QR
function HowStepScan() {
  return (
    <div style={{
      height: '100%', background: '#0A0A0A', color: '#fff',
      paddingTop: 36, fontFamily: 'Plus Jakarta Sans, system-ui, sans-serif',
      display: 'flex', flexDirection: 'column', position: 'relative',
    }}>
      {/* fake camera viewfinder */}
      <div style={{
        flex: 1, position: 'relative',
        background: 'radial-gradient(ellipse at 50% 60%, #2a2a2a 0%, #0a0a0a 70%)',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
      }}>
        {/* QR target on counter */}
        <div style={{
          background: '#EDE6D6', padding: 14, borderRadius: 14,
          transform: 'perspective(400px) rotateX(18deg)',
          boxShadow: '0 18px 40px rgba(0,0,0,0.6)',
        }}>
          <div style={{ fontSize: 8, letterSpacing: 1.5, textTransform: 'uppercase', fontWeight: 700, color: '#1A2E28', textAlign: 'center', marginBottom: 6 }}>
            Carimbou · Tapioca
          </div>
          <div style={{ background: '#fff', padding: 6, borderRadius: 6 }}>
            <FakeQR size={84} fg="#1A2E28" seed="counter-tapioca"/>
          </div>
        </div>

        {/* scan brackets */}
        <div style={{
          position: 'absolute', width: 180, height: 180,
          borderRadius: 12,
          pointerEvents: 'none',
        }}>
          {[
            { top: 0, left: 0, borderTop: '2px solid #2D8A6B', borderLeft: '2px solid #2D8A6B' },
            { top: 0, right: 0, borderTop: '2px solid #2D8A6B', borderRight: '2px solid #2D8A6B' },
            { bottom: 0, left: 0, borderBottom: '2px solid #2D8A6B', borderLeft: '2px solid #2D8A6B' },
            { bottom: 0, right: 0, borderBottom: '2px solid #2D8A6B', borderRight: '2px solid #2D8A6B' },
          ].map((s, i) => (
            <div key={i} style={{ position: 'absolute', width: 24, height: 24, ...s }}/>
          ))}
        </div>
      </div>

      {/* hint */}
      <div style={{
        padding: '12px 16px 22px', textAlign: 'center',
        background: 'rgba(0,0,0,0.6)',
        backdropFilter: 'blur(8px)',
      }}>
        <div style={{ fontSize: 12, fontWeight: 600 }}>QR Code do balcão</div>
        <div style={{ fontSize: 10, opacity: 0.6, marginTop: 2 }}>Aponte a câmera</div>
      </div>
    </div>
  );
}

// Step 2 — whatsapp-style chat (more complete than hero)
function HowStepWhatsApp() {
  return (
    <div style={{
      height: '100%', background: '#E5DDD5', paddingTop: 36,
      fontFamily: 'Plus Jakarta Sans, system-ui, sans-serif',
      display: 'flex', flexDirection: 'column',
    }}>
      <div style={{
        background: '#1A2E28', color: '#fff',
        padding: '10px 14px 12px', display: 'flex', alignItems: 'center', gap: 10,
      }}>
        <div style={{
          width: 32, height: 32, borderRadius: 8, background: '#2D8A6B',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
          fontFamily: 'Fraunces, serif', fontWeight: 700, color: '#fff', fontSize: 18,
        }}>C</div>
        <div style={{ lineHeight: 1.1 }}>
          <div style={{ fontSize: 13, fontWeight: 600 }}>Carimbou</div>
          <div style={{ fontSize: 10, opacity: 0.6 }}>respondendo…</div>
        </div>
      </div>

      <div style={{ flex: 1, padding: '14px 12px', display: 'flex', flexDirection: 'column', gap: 8 }}>
        <ChatBubble2 side="out">Quero meu cartão da Padaria do Bairro</ChatBubble2>
        <ChatBubble2 side="in">Oi! Como te chamamos?</ChatBubble2>
        <ChatBubble2 side="out">Carlos</ChatBubble2>
        <ChatBubble2 side="in">Pronto, Carlos! Tá aí 👇</ChatBubble2>
        <div style={{ alignSelf: 'flex-start', fontSize: 10, color: 'rgba(0,0,0,0.45)', marginTop: 4 }}>
          🔗 carimbou.com.br/c/padaria
        </div>
      </div>

      {/* input bar */}
      <div style={{
        background: '#F0F0F0', padding: '8px 10px',
        display: 'flex', gap: 6, alignItems: 'center',
      }}>
        <div style={{
          flex: 1, background: '#fff', borderRadius: 18, padding: '8px 12px',
          fontSize: 11, color: 'rgba(0,0,0,0.4)',
        }}>Mensagem</div>
        <div style={{
          width: 32, height: 32, borderRadius: '50%', background: '#2D8A6B',
          display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff',
        }}>
          <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M2 21l21-9L2 3v7l15 2-15 2z"/></svg>
        </div>
      </div>
    </div>
  );
}

function ChatBubble2({ side, children }) {
  const isOut = side === 'out';
  return (
    <div style={{
      alignSelf: isOut ? 'flex-end' : 'flex-start',
      maxWidth: '80%',
      background: isOut ? '#DCF8C6' : '#fff',
      padding: '7px 10px', borderRadius: 10, fontSize: 12,
      color: '#1A2E28',
      boxShadow: '0 1px 1px rgba(0,0,0,0.08)',
      lineHeight: 1.35,
    }}>{children}</div>
  );
}

// Step 3 — customer showing the card to be stamped, with subtle stamp animation
function HowStepShow() {
  return (
    <div style={{
      height: '100%',
      background: BUSINESSES.padaria.cardBg, color: BUSINESSES.padaria.cardText,
      paddingTop: 36, fontFamily: 'Plus Jakarta Sans, system-ui, sans-serif',
      display: 'flex', flexDirection: 'column', position: 'relative',
    }}>
      <div style={{ padding: '12px 18px 6px' }}>
        <div style={{ fontSize: 9, letterSpacing: 1.5, textTransform: 'uppercase', fontWeight: 700, opacity: 0.55 }}>Fidelidade</div>
        <div style={{ fontFamily: 'Fraunces, serif', fontSize: 22, fontWeight: 600, marginTop: 2 }}>Padaria do Bairro</div>
        <div style={{ fontSize: 11, opacity: 0.55, marginTop: 2 }}>Carlos Pimentel</div>
      </div>

      {/* stamp grid */}
      <div style={{ padding: '14px 18px 0' }}>
        <div style={{
          padding: 12, borderRadius: 14,
          border: '1px dashed rgba(255,255,255,0.18)',
          background: 'rgba(0,0,0,0.18)',
          display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)', gap: 6,
        }}>
          {Array.from({ length: 10 }).map((_, i) => {
            const filled = i < 5; // last one will animate
            const isLast = i === 4;
            return (
              <div key={i} style={{
                aspectRatio: '1', borderRadius: 8,
                background: 'rgba(0,0,0,0.15)',
                border: '1px dashed rgba(255,255,255,0.18)',
                display: 'flex', alignItems: 'center', justifyContent: 'center',
                position: 'relative',
              }}>
                <div style={isLast ? { animation: 'stampIn 1.6s cubic-bezier(.3,1.6,.4,1) infinite alternate' } : undefined}>
                  <StampIcon icon="bread" filled={filled} style="textured" color={BUSINESSES.padaria.stampColor} size={20} seed={i+1}/>
                </div>
              </div>
            );
          })}
        </div>
      </div>

      {/* progress + reward */}
      <div style={{ padding: '14px 18px 0' }}>
        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline' }}>
          <span style={{ fontSize: 9, letterSpacing: 1.2, textTransform: 'uppercase', fontWeight: 700, opacity: 0.55 }}>Carimbos</span>
          <span style={{ fontFamily: 'Fraunces, serif', fontSize: 18, fontWeight: 600 }}>
            <span style={{ color: BUSINESSES.padaria.cardAccent }}>5</span><span style={{ opacity: 0.4 }}>/10</span>
          </span>
        </div>
        <div style={{ height: 4, borderRadius: 4, background: 'rgba(255,255,255,0.15)', marginTop: 8, overflow: 'hidden' }}>
          <div style={{ height: '100%', width: '50%', background: BUSINESSES.padaria.cardAccent }}/>
        </div>
      </div>

      {/* QR — fills the rest */}
      <div style={{ padding: '16px 18px', display: 'flex', justifyContent: 'center', flex: 1, alignItems: 'flex-end' }}>
        <div style={{ background: '#fff', padding: 10, borderRadius: 12, boxShadow: '0 6px 18px rgba(0,0,0,0.3)' }}>
          <FakeQR size={90} fg="#111" seed="padaria-carlos"/>
        </div>
      </div>
      <div style={{ padding: '0 18px 16px', textAlign: 'center', fontSize: 10, opacity: 0.55 }}>
        Mostre para o atendente carimbar
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// WALLET section — grid of mini cards with a bigger phone showing the wallet
// ─────────────────────────────────────────────────────────────
function WalletSection({ lang, copy }) {
  const t = copy.wallet[lang];
  return (
    <section className="brochure-wallet" data-screen-label="04 Wallet">
      <div className="wallet-inner">
        <div className="wallet-text">
          <Eyebrow>{t.eyebrow}</Eyebrow>
          <h2 className="wallet-title">{t.title}</h2>
          <p className="wallet-body">{t.body}</p>
          <ul className="wallet-bullets">
            {t.bullets.map((b, i) => (
              <li key={i}>
                <span className="check" aria-hidden="true">
                  <svg width="14" height="14" viewBox="0 0 14 14"><path d="M2 7l3 3 7-7" stroke="#2D8A6B" strokeWidth="2" fill="none" strokeLinecap="round" strokeLinejoin="round"/></svg>
                </span>
                {b}
              </li>
            ))}
          </ul>
        </div>

        <div className="wallet-stage">
          <MiniPhone width={300} height={620}>
            <WalletScreen/>
          </MiniPhone>
        </div>
      </div>
    </section>
  );
}

// Wallet screen — list of cards (the customer's wallet)
function WalletScreen() {
  const cards = [
    { biz: BUSINESSES.tapioca, stamps: 7, name: 'Andrea Mendes' },
    { biz: BUSINESSES.padaria, stamps: 5, name: 'Andrea Mendes' },
    { biz: BUSINESSES.esmalte, stamps: 9, name: 'Andrea Mendes' },
    { biz: BUSINESSES.cabelo,  stamps: 2, name: 'Andrea Mendes' },
  ];

  return (
    <div style={{
      height: '100%', background: '#EDE6D6', color: '#1A2E28',
      paddingTop: 36, fontFamily: 'Plus Jakarta Sans, system-ui, sans-serif',
      display: 'flex', flexDirection: 'column',
    }}>
      <div style={{ padding: '12px 18px 8px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
        <div>
          <div style={{ fontSize: 10, letterSpacing: 1.2, textTransform: 'uppercase', fontWeight: 700, opacity: 0.55 }}>Carteira</div>
          <div style={{ fontFamily: 'Fraunces, serif', fontSize: 22, fontWeight: 600, marginTop: 2 }}>Meus cartões</div>
        </div>
        <CarimbouLogo size={28}/>
      </div>

      {/* card list */}
      <div style={{ flex: 1, padding: '8px 14px 14px', display: 'flex', flexDirection: 'column', gap: 10, overflow: 'hidden' }}>
        {cards.map((c, i) => (
          <WalletCardRow key={i} {...c}/>
        ))}
      </div>
    </div>
  );
}

function WalletCardRow({ biz, stamps, name }) {
  const total = 10;
  return (
    <div style={{
      background: biz.cardBg, color: biz.cardText,
      borderRadius: 14, padding: '10px 12px',
      boxShadow: '0 6px 16px rgba(0,0,0,0.18)',
      display: 'flex', alignItems: 'center', gap: 10,
    }}>
      <div style={{
        width: 36, height: 36, borderRadius: 10,
        background: 'rgba(255,255,255,0.08)',
        border: '1px dashed rgba(255,255,255,0.2)',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        flexShrink: 0,
      }}>
        <StampIcon icon={biz.icon} filled style="flat" color={biz.cardAccent} size={22}/>
      </div>
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{ fontFamily: 'Fraunces, serif', fontSize: 14, fontWeight: 600, lineHeight: 1.1 }}>
          {biz.name}
        </div>
        <div style={{ fontSize: 9.5, opacity: 0.55, marginTop: 2 }}>{biz.tagline}</div>
        <div style={{ height: 3, borderRadius: 3, background: 'rgba(255,255,255,0.12)', marginTop: 6, overflow: 'hidden' }}>
          <div style={{ height: '100%', width: `${(stamps/total)*100}%`, background: biz.cardAccent }}/>
        </div>
      </div>
      <div style={{
        fontFamily: 'Fraunces, serif', fontSize: 14, fontWeight: 600,
        flexShrink: 0,
      }}>
        <span style={{ color: biz.cardAccent }}>{stamps}</span><span style={{ opacity: 0.4 }}>/{total}</span>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// STAMP section — counter POV: the staff stamping screen
// ─────────────────────────────────────────────────────────────
function StampSection({ lang, copy }) {
  const t = copy.stamp[lang];
  return (
    <section className="brochure-stamp" data-screen-label="05 Stamping">
      <div className="stamp-inner">
        <div className="stamp-stage">
          <MiniPhone width={300} height={620}>
            <StampScreenPreview/>
          </MiniPhone>
          {/* floating "tap" indicator */}
          <div className="stamp-tap-indicator" aria-hidden="true">
            <div className="stamp-tap-pulse"/>
            <div className="stamp-tap-dot"/>
          </div>
        </div>

        <div className="stamp-text">
          <Eyebrow>{t.eyebrow}</Eyebrow>
          <h2 className="stamp-title">{t.title}</h2>
          <p className="stamp-body">{t.body}</p>
          <div className="stamp-bullets">
            {t.bullets.map((b, i) => (
              <div key={i} className="stamp-bullet">
                <div className="stamp-bullet-k">{b[0]}</div>
                <div className="stamp-bullet-v">{b[1]}</div>
              </div>
            ))}
          </div>
        </div>
      </div>
    </section>
  );
}

// Big stamping screen shown in this section
function StampScreenPreview() {
  return (
    <div style={{
      height: '100%', background: '#F3EFE5', color: '#1A2E28',
      paddingTop: 36, fontFamily: 'Plus Jakarta Sans, system-ui, sans-serif',
      display: 'flex', flexDirection: 'column',
    }}>
      <div style={{ padding: '12px 18px 6px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
        <div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
          <CarimbouLogo size={22}/>
          <span style={{ fontFamily: 'Fraunces, serif', fontSize: 13, fontWeight: 600 }}>Carimbou</span>
        </div>
        <div style={{ fontSize: 9, letterSpacing: 1.2, textTransform: 'uppercase', opacity: 0.55, fontWeight: 700 }}>Estação Tapioca</div>
      </div>

      <div style={{ padding: '12px 18px 0' }}>
        <div style={{ fontSize: 10, opacity: 0.5, letterSpacing: 1.2, textTransform: 'uppercase', fontWeight: 700 }}>Cliente</div>
        <div style={{ fontFamily: 'Fraunces, serif', fontSize: 22, fontWeight: 600, marginTop: 2 }}>Andrea Mendes</div>
        <div style={{ fontSize: 11, opacity: 0.55, marginTop: 2 }}>+55 21 977…6932</div>
      </div>

      {/* stamp grid (bigger) */}
      <div style={{ padding: '16px 18px 0' }}>
        <div style={{
          padding: 12, borderRadius: 14,
          background: '#fff',
          border: '1px dashed rgba(26,46,40,0.18)',
          display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)', gap: 6,
        }}>
          {Array.from({ length: 10 }).map((_, i) => {
            const filled = i < 6; // 6 stamps so far
            const isJust = i === 5; // most recent: animate
            return (
              <div key={i} style={{
                aspectRatio: '1', borderRadius: 8,
                background: filled ? 'rgba(45,138,107,0.10)' : 'rgba(26,46,40,0.04)',
                border: filled ? '1px solid rgba(45,138,107,0.22)' : '1px dashed rgba(26,46,40,0.15)',
                display: 'flex', alignItems: 'center', justifyContent: 'center',
              }}>
                <div style={isJust ? { animation: 'stampIn 700ms cubic-bezier(.3,1.6,.4,1)' } : undefined}>
                  <StampIcon icon="tapioca" filled={filled} style="textured" color="#B5442A" size={22} seed={i+9}/>
                </div>
              </div>
            );
          })}
        </div>
      </div>

      <div style={{ padding: '14px 18px 0', display: 'flex', justifyContent: 'space-between', alignItems: 'baseline' }}>
        <span style={{ fontSize: 10, letterSpacing: 1.2, textTransform: 'uppercase', fontWeight: 700, opacity: 0.55 }}>Carimbos</span>
        <span style={{ fontFamily: 'Fraunces, serif', fontSize: 20, fontWeight: 600 }}>
          <span style={{ color: '#2D8A6B' }}>6</span><span style={{ opacity: 0.4 }}>/10</span>
        </span>
      </div>

      {/* big stamp button */}
      <div style={{ padding: '20px 18px 18px', flex: 1, display: 'flex', alignItems: 'flex-end' }}>
        <button style={{
          width: '100%',
          background: '#2D8A6B', color: '#fff',
          border: 'none', borderRadius: 18,
          padding: '20px 16px',
          fontFamily: 'Fraunces, serif', fontSize: 22, fontWeight: 600,
          letterSpacing: -0.3,
          boxShadow: '0 10px 26px rgba(45,138,107,0.35)',
          display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10,
        }}>
          <StampIcon icon="tapioca" filled style="flat" color="#fff" size={26}/>
          Carimbar
        </button>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// Plans section — pricing tiers
// ─────────────────────────────────────────────────────────────
function PlansSection({ lang, copy }) {
  const t = copy.plans[lang];
  return (
    <section className="brochure-plans" id="planos" data-screen-label="06 Plans">
      <div className="plans-inner">
        <div className="plans-header">
          <Eyebrow>{t.eyebrow}</Eyebrow>
          <h2 className="plans-title">{t.title}</h2>
          <p className="plans-body">{t.body}</p>
        </div>
        <div className="plans-grid">
          {t.cards.map((card, idx) => (
            <div key={idx} className={'plan-card' + (card.ctaStyle === 'primary' ? ' plan-card-featured' : '')}>
              <div className="plan-tag">{card.tag}</div>
              <div className="plan-name">{card.name}</div>
              <div className="plan-price-row">
                <span className="plan-price">{card.price}</span>
                <span className="plan-period">{card.period}</span>
              </div>
              {card.subPrice && <div className="plan-subprice">{card.subPrice}</div>}
              <ul className="plan-features">
                {card.features.map((f, i) => (
                  <li key={i}>{f}</li>
                ))}
              </ul>
              <a href={card.ctaHref} className={'btn btn-lg ' + (card.ctaStyle === 'primary' ? 'btn-primary' : 'btn-secondary')}>
                {card.cta}
              </a>
            </div>
          ))}
        </div>
        <div className="plans-footnote">{t.footnote}</div>
      </div>
    </section>
  );
}

// ─────────────────────────────────────────────────────────────
// CTA section — big block to sign up
// ─────────────────────────────────────────────────────────────
function CTASection({ lang, copy }) {
  const t = copy.cta[lang];
  return (
    <section className="brochure-cta" id="cta" data-screen-label="06 CTA">
      <div className="cta-inner">
        {/* dashed-border cta card with the brand mark */}
        <div className="cta-card">
          <div className="cta-mark"><CarimbouLogo size={64}/></div>
          <Eyebrow>{t.eyebrow}</Eyebrow>
          <h2 className="cta-title">{t.title}</h2>
          <p className="cta-body">{t.body}</p>
          <div className="cta-buttons">
            <a href="/signup" className="btn btn-primary btn-lg">{t.primary}</a>
            <a href="mailto:contato@carimbou.com.br" className="btn btn-secondary btn-lg">{t.secondary}</a>
          </div>
          <div className="cta-footnote">{t.footnote}</div>
        </div>
      </div>
    </section>
  );
}

// ─────────────────────────────────────────────────────────────
// Footer
// ─────────────────────────────────────────────────────────────
function FooterSection({ lang, copy }) {
  const t = copy.footer[lang];
  return (
    <footer className="brochure-footer" data-screen-label="07 Footer">
      <div className="footer-inner">
        <div className="footer-brand">
          <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
            <CarimbouLogo size={40}/>
            <span style={{ fontFamily: 'Fraunces, serif', fontSize: 22, fontWeight: 600, letterSpacing: -0.5 }}>Carimbou</span>
          </div>
          <div className="footer-tagline">{t.tagline}</div>
        </div>

        <div className="footer-cols">
          <div>
            <div className="footer-col-title">{t.product}</div>
            <ul>{t.links.product.map((l, i) => <li key={i}><a href="#">{l}</a></li>)}</ul>
          </div>
          <div>
            <div className="footer-col-title">{t.legal}</div>
            <ul>{t.links.legal.map((l, i) => <li key={i}><a href="#">{l}</a></li>)}</ul>
          </div>
          <div>
            <div className="footer-col-title">{t.contact}</div>
            <ul>{t.links.contact.map((l, i) => {
              let href = '#';
              if (l.startsWith('@')) href = 'https://www.instagram.com/' + l.slice(1);
              else if (l.includes('@')) href = 'mailto:' + l;
              const isExternal = href.startsWith('http');
              return (
                <li key={i}>
                  <a href={href} {...(isExternal ? { target: '_blank', rel: 'noreferrer' } : {})}>{l}</a>
                </li>
              );
            })}</ul>
          </div>
        </div>
      </div>
      <div className="footer-bottom">{t.copyright}</div>
    </footer>
  );
}

Object.assign(window, {
  WhySection, HowSection, WalletSection, StampSection, PlansSection, CTASection, FooterSection,
});
