// Header — SBL site top bar. Attaches to window for cross-file use. // PT | EN | ES language switch. Stored in localStorage via window.SBL_I18N. function LangSwitch({ lang, setLang, size }) { const opts = [ { id: 'pt', label: 'PT' }, { id: 'en', label: 'EN' }, { id: 'es', label: 'ES' }, ]; const pad = size === 'lg' ? '7px 12px' : '5px 9px'; const fs = size === 'lg' ? 13 : 12; return (
{opts.map((o) => { const on = lang === o.id; return ( ); })}
); } function Header({ active, onNav, onAnnounce }) { const { Button } = window.SBLImVeisDesignSystem_08a506; const { isMobile, isTablet } = window.useResponsive(); const { t, lang, setLang } = window.useLang(); const [scrolled, setScrolled] = React.useState(false); const [menuOpen, setMenuOpen] = React.useState(false); const links = [ { id: 'home', label: 'Início' }, { id: 'listings', label: 'Imóveis' }, { id: 'season', label: 'Temporada' }, { id: 'owner', label: 'Anuncie' }, { id: 'contact', label: 'Contato' }, ]; return ( <>
{ e.preventDefault(); onNav('home'); }} style={{ display: 'flex', alignItems: 'center', gap: 12, cursor: 'pointer' }}> SBL {!isMobile && ( )}
{!isMobile && } {!isMobile && !isTablet && ( (83) 9958-5248 )} {!isMobile && ( )} {isMobile && ( )}
{/* Mobile overlay menu — rendered outside
to avoid backdrop-filter stacking context */} {isMobile && menuOpen && (
setMenuOpen(false)} style={{ position: 'fixed', inset: 0, background: 'rgba(30,20,12,0.6)', zIndex: 200 }} >
e.stopPropagation()} style={{ position: 'absolute', top: 0, right: 0, width: 280, height: '100%', background: 'var(--cream-50)', padding: '32px 24px', display: 'flex', flexDirection: 'column', gap: 8, boxShadow: '-8px 0 32px rgba(30,20,12,0.18)' }} > {links.map((l) => ( { e.preventDefault(); onNav(l.id); setMenuOpen(false); }} style={{ fontFamily: 'var(--font-body)', fontSize: 16, fontWeight: 500, padding: '14px 16px', borderRadius: 'var(--radius-pill)', color: active === l.id ? 'var(--brown-700)' : 'var(--warmgray-600)', background: active === l.id ? 'var(--rose-100)' : 'transparent', textDecoration: 'none', display: 'block', }} >{t(l.label)} ))}
(83) 9958-5248
)} ); } window.Header = Header;