// CookieBanner.jsx — minimal cookie consent, on-brand
const CookieBanner = ({ onPrivacy }) => {
  const [dismissed, setDismissed] = React.useState(() => {
    try { return localStorage.getItem('obc_cookie_ok') === '1'; } catch { return false; }
  });

  if (dismissed) return null;

  const accept = () => {
    try { localStorage.setItem('obc_cookie_ok', '1'); } catch {}
    setDismissed(true);
  };

  return (
    <div style={{
      position: 'fixed', bottom: 0, left: 0, right: 0, zIndex: 70,
      background: '#111', borderTop: '1px solid #00FF41',
      padding: '14px 20px', display: 'flex', alignItems: 'center',
      justifyContent: 'center', gap: 16, flexWrap: 'wrap',
    }}>
      <span style={{ fontSize: 12, color: '#B8B8B8', letterSpacing: '0.04em' }}>
        <span style={{ color: '#00FF41' }}>{'>'}</span> we use 3 cookies — all functional, zero tracking.{' '}
        <span onClick={onPrivacy} style={{ color: '#00FF41', cursor: 'pointer', textDecoration: 'underline' }}>read our privacy policy</span>
      </span>
      <button onClick={accept} style={{
        background: '#00FF41', color: '#000', border: 'none',
        padding: '8px 18px', fontFamily: 'inherit', fontSize: 11,
        fontWeight: 800, letterSpacing: '0.15em', cursor: 'pointer',
        borderRadius: 2,
      }}>ACKNOWLEDGED</button>
    </div>
  );
};

window.CookieBanner = CookieBanner;
