/* Navigation — sticky topbar + mobile sheet */
function Nav({ onLogin, onTrial }) {
  const [open, setOpen] = React.useState(false);
  const links = [
    { href: "#producto", label: "Producto" },
    { href: "#flujo", label: "Cómo funciona" },
    { href: "#beneficios", label: "Beneficios" },
    { href: "#planes", label: "Planes" },
  ];
  return (
    <React.Fragment>
      <nav className="nav">
        <div className="container nav-inner">
          <a className="brand" href="#top" aria-label="DeltAi Suite">
            <img src={(window.__resources && window.__resources.logoMark) || "assets/logo-mark-color.png"} alt="DeltAi" />
            <span className="word">Delt<span className="ai">Ai</span> Suite</span>
          </a>
          <div className="nav-links">
            {links.map(l => <a key={l.href} href={l.href} className="nav-link">{l.label}</a>)}
          </div>
          <div className="nav-actions">
            <a href="https://app.deltaisuite.com" target="_blank" rel="noopener noreferrer" className="btn btn-ghost btn-login-desktop">
              <I.Logout style={{transform:"rotate(180deg)", width:14, height:14}}/> Acceder
            </a>
            <a href="https://app.deltaisuite.com/registro" target="_blank" rel="noopener noreferrer" className="btn btn-primary btn-pill">
              Probalo gratis
            </a>
            <button className="btn btn-ghost mobile-toggle" aria-label="Abrir menú" onClick={() => setOpen(o => !o)}>
              {open ? <I.X style={{width:18, height:18}}/> : <I.Menu style={{width:18, height:18}}/>}
            </button>
          </div>
        </div>
      </nav>
      <div className={`mobile-sheet${open ? " open" : ""}`} onClick={() => setOpen(false)}>
        {links.map(l => <a key={l.href} href={l.href}>{l.label}</a>)}
        <div className="actions">
          <a href="https://app.deltaisuite.com" target="_blank" rel="noopener noreferrer" className="btn btn-ghost btn-lg">
            <I.Logout style={{transform:"rotate(180deg)", width:14, height:14}}/> Acceder a la plataforma
          </a>
          <a href="https://app.deltaisuite.com/registro" target="_blank" rel="noopener noreferrer" className="btn btn-primary btn-pill btn-lg">Probalo gratis · 15 informes</a>
        </div>
      </div>
    </React.Fragment>
  );
}
window.Nav = Nav;
