// Subpáginas de produto — Convênios, Cartão, Capital de Giro
const PmeProductPage = ({ slug, locale, navigate }) => {
  const L = locale === 'pt';

  const data = {
    convenios: {
      eyebrow: L ? 'Produto · Convênios' : 'Product · Health plans',
      h1: L ? 'O plano paga em 60 dias. A gente paga hoje.' : 'The plan pays in 60 days. We pay today.',
      sub: L ? 'Antecipação do repasse de Unimed, Bradesco Saúde, SulAmérica, Amil, Hapvida e demais operadoras. Você fatura normalmente; a gente adianta o que já é seu.' : 'Advance reimbursements from Unimed, Bradesco Saúde, SulAmérica, Amil, Hapvida and other operators. You bill as usual; we advance what is already yours.',
      bullets: L ? [
        ['Glosa precificada antes', 'O modelo lê o seu histórico de glosa por procedimento e por operadora. Nada de surpresa depois.'],
        ['Sem trocar de operadora', 'Você mantém todos os convênios com que já trabalha. Nada muda no seu faturamento.'],
        ['Antecipe o quanto quiser', 'Escolhe a competência e o valor. Não precisa antecipar o lote inteiro.'],
        ['Registro automático', 'Recebível registrado em CERC/B3 sem você levantar um dedo.'],
      ] : [
        ['Denials priced upfront', 'The model reads your denial history by procedure and operator. No surprises later.'],
        ['Keep your operators', 'You keep every health plan you already work with. Billing does not change.'],
        ['Advance what you need', 'Pick the period and the amount. No need to advance the full batch.'],
        ['Auto registration', 'Receivable registered at CERC/B3 without lifting a finger.'],
      ],
      flow: L ? ['Conecte o sistema da clínica ou envie o demonstrativo', 'IA analisa histórico de repasse e glosa', 'Recebível registrado em CERC/B3', 'Pix na conta no mesmo dia útil'] : ['Connect your practice system or send the statement', 'AI analyzes reimbursement and denial history', 'Receivable registered at CERC/B3', 'Payout the same business day'],
    },
    cartao: {
      eyebrow: L ? 'Produto · Cartão' : 'Product · Card',
      h1: L ? 'O particular e o parcelado, na conta em minutos.' : 'Private-pay and installments, in your account in minutes.',
      sub: L ? 'Para clínicas e consultórios com volume de cartão: estética, odontologia, fisioterapia, psicologia, nutrição e procedimentos particulares.' : 'For clinics with card volume: aesthetics, dentistry, physiotherapy, psychology, nutrition and private procedures.',
      bullets: L ? [
        ['Sem aval pessoal', 'A garantia é o fluxo da maquininha, não o CPF do profissional.'],
        ['Multi-adquirente', 'Stone, Cielo, Rede, Getnet, PagSeguro, SafraPay — mantém a sua.'],
        ['Parcelado longo também', 'Tratamento em 10x ou 12x vira caixa hoje.'],
        ['Trava registrada', 'Em registradora autorizada CERC/B3, com transparência total.'],
      ] : [
        ['No personal guarantee', 'Collateral is the terminal flow, not the practitioner.'],
        ['Multi-acquirer', 'Stone, Cielo, Rede, Getnet, PagSeguro, SafraPay — keep yours.'],
        ['Long installments too', 'A 10x or 12x treatment plan becomes cash today.'],
        ['Registered lock', 'At an authorized CERC/B3 registrar, fully transparent.'],
      ],
      flow: L ? ['Conecte a sua adquirente', 'flui.cash lê o histórico de vendas da clínica', 'Trava registrada em registradora', 'Pix liberado em minutos'] : ['Connect your acquirer', 'flui.cash reads the practice sales history', 'Lock registered at registrar', 'Payout in minutes'],
    },
    giro: {
      eyebrow: L ? 'Produto · Capital de Giro' : 'Product · Working Capital',
      h1: L ? 'Para equipar a sala, contratar ou abrir a segunda unidade.' : 'To equip a room, hire, or open a second location.',
      sub: L ? 'Linha rotativa precificada por IA, garantida pelo seu próprio fluxo de convênio e cartão. Use, pague, use de novo.' : 'Revolving line priced by AI, secured by your own plan and card flow. Use, repay, reuse.',
      bullets: L ? [
        ['Rotativo real', 'Pagou, voltou para o limite na hora.'],
        ['Taxa que cai', 'Melhora conforme o seu histórico de repasse amadurece conosco.'],
        ['Garantia composta', 'Repasse de operadora + fluxo de adquirência.'],
        ['Sem aval pessoal', 'No padrão. Aval só em exceções acordadas e ditas antes.'],
      ] : [
        ['Truly revolving', 'Repay and the limit is back instantly.'],
        ['Falling rate', 'Improves as your reimbursement history matures with us.'],
        ['Composite collateral', 'Operator reimbursements + acquirer flow.'],
        ['No personal guarantee', 'By default. Only by agreed exception, stated upfront.'],
      ],
      flow: L ? ['Análise inicial em ~ 24h', 'Limite ativo para a clínica', 'Saque on-demand pelo painel', 'Pagamento volta para o limite'] : ['Initial review in ~ 24h', 'Limit active for the practice', 'On-demand drawdown', 'Repayment refills limit'],
    },
  };

  const page = data[slug];

  if (!page) return null;

  return (
    <main>
      <section className="relative pt-32 pb-16 md:pt-40 overflow-hidden">
        <Aurora />
        <div className="mx-auto max-w-7xl px-6 md:px-10">
          <button onClick={() => navigate('/pme')} className="text-sm text-muted hover:text-fg mb-6 inline-flex items-center gap-1">
            <Icon name="chevron-right" className="w-3 h-3 rotate-180" /> {L ? 'Para Sua Clínica' : 'For Your Practice'}
          </button>
          <div className="font-mono text-xs uppercase tracking-[0.18em] text-primary mb-3">{page.eyebrow}</div>
          <h1 className="font-display text-5xl md:text-7xl tracking-tightest leading-[0.95] max-w-4xl">{page.h1}</h1>
          <p className="text-muted text-lg md:text-xl mt-6 max-w-2xl">{page.sub}</p>
          <div className="flex gap-3 mt-8">
            <Button variant="accent" size="lg" onClick={() => navigate('/pme#sim')}>{L ? 'Simular' : 'Simulate'} <Icon name="arrow-right" className="w-4 h-4" /></Button>
            <Button variant="secondary" size="lg" onClick={() => navigate('/contact')}>{L ? 'Falar com especialista' : 'Talk to specialist'}</Button>
          </div>
        </div>
      </section>

      {slug === 'gestao' && (
        <section className="py-16 md:py-20">
          <div className="mx-auto max-w-7xl px-6 md:px-10"><DashboardPreview /></div>
        </section>
      )}

      <Section eyebrow={L ? 'O que entra' : 'What\'s included'} title={L ? 'Quatro coisas que importam.' : 'Four things that matter.'} className="py-20">
        <div className="grid md:grid-cols-2 gap-4">
          {page.bullets.map(([t, d], i) => (
            <Card key={i} className="p-7">
              <div className="flex items-start gap-4">
                <div className="font-mono text-xs text-muted mt-1">0{i+1}</div>
                <div>
                  <div className="font-display text-xl">{t}</div>
                  <div className="text-muted mt-2">{d}</div>
                </div>
              </div>
            </Card>
          ))}
        </div>
      </Section>

      <section className="py-20 bg-subtle border-y border-line">
        <div className="mx-auto max-w-7xl px-6 md:px-10">
          <div className="font-mono text-xs uppercase tracking-[0.18em] text-muted mb-8">{L ? 'Como funciona' : 'How it works'}</div>
          <div className="grid md:grid-cols-4 gap-4">
            {page.flow.map((step, i) => (
              <div key={i} className="relative">
                <div className="font-display text-6xl text-muted/40 tabular">0{i+1}</div>
                <div className="font-display text-lg mt-3">{step}</div>
              </div>
            ))}
          </div>
        </div>
      </section>

      <section className="py-20 text-center">
        <div className="mx-auto max-w-3xl px-6">
          <h2 className="font-display text-4xl md:text-5xl tracking-tightest">{L ? 'Pronto para simular?' : 'Ready to simulate?'}</h2>
          <Button variant="accent" size="lg" className="mt-6" onClick={() => navigate('/pme#sim')}>{L ? 'Simular agora' : 'Simulate now'} <Icon name="arrow-right" className="w-4 h-4" /></Button>
        </div>
      </section>
    </main>
  );
};

window.PmeProductPage = PmeProductPage;
