function Footer() {
  const [showPrivacy, setShowPrivacy] = React.useState(false);

  return (
    <>
      <footer className="footer">
        <div className="container footer-grid">
          <div className="logo footer-logo">
            <img src="assets/bevy-logo.png" alt="Bevy Electric" className="bevy-logo-img bevy-logo-img--footer" />
          </div>
          <div style={{display:'flex', gap:24, flexWrap:'wrap', alignItems:'center'}}>
            <span>Sacramento, CA</span>
            <span>CA License #1141115</span>
            <span>© {new Date().getFullYear()} Bevy Electric</span>
            <button
              onClick={() => setShowPrivacy(true)}
              style={{background:'none', border:'none', padding:0, color:'var(--ink-3)', fontSize:13, cursor:'pointer', textDecoration:'underline', textUnderlineOffset:2}}
            >
              Privacy Policy
            </button>
          </div>
        </div>
        <div className="container" style={{marginTop:16, paddingTop:16, borderTop:'1px solid var(--line)'}}>
          <p style={{fontSize:11, color:'var(--ink-3)', lineHeight:1.6, margin:0, maxWidth:680}}>
            This site is not a part of the Facebook™ website or Facebook™ Inc. Additionally, this site is NOT endorsed by Facebook™ in any way. FACEBOOK™ is a trademark of FACEBOOK™, Inc.
          </p>
        </div>
      </footer>

      {showPrivacy && (
        <div
          style={{position:'fixed', inset:0, background:'rgba(0,0,0,0.55)', zIndex:9000, display:'flex', alignItems:'center', justifyContent:'center', padding:'20px'}}
          onClick={() => setShowPrivacy(false)}
        >
          <div
            style={{background:'#fff', borderRadius:16, maxWidth:680, width:'100%', maxHeight:'85vh', overflowY:'auto', padding:'40px 44px', position:'relative', boxShadow:'0 24px 64px rgba(0,0,0,0.18)'}}
            onClick={e => e.stopPropagation()}
          >
            <button
              onClick={() => setShowPrivacy(false)}
              aria-label="Close privacy policy"
              style={{position:'sticky', top:0, float:'right', background:'none', border:'none', cursor:'pointer', fontSize:22, lineHeight:1, color:'var(--ink-2)', padding:'0 0 8px 16px'}}
            >
              ×
            </button>
            <h2 style={{fontFamily:'var(--display)', fontWeight:800, fontSize:24, marginBottom:6, color:'var(--ink)'}}>Privacy Policy</h2>
            <p style={{fontSize:12, color:'var(--ink-3)', marginBottom:28}}>Last updated: May 5, 2026</p>

            <p style={{marginBottom:16}}>At Bevy Electric, your privacy is important to us. This Privacy Policy explains how we collect, use, and protect your information when you visit our website or contact us for electrical services, including EV charger installations and electrical panel upgrades in the Greater Sacramento area.</p>

            <h3 style={{fontSize:15, fontWeight:700, marginBottom:8, marginTop:24}}>1. Information We Collect</h3>
            <p style={{marginBottom:8}}>We may collect personal information that you voluntarily provide when you:</p>
            <ul style={{paddingLeft:20, marginBottom:8, lineHeight:1.7}}>
              <li>Fill out a contact or estimate request form</li>
              <li>Call, email, or message us</li>
              <li>Schedule a service appointment</li>
            </ul>
            <p style={{marginBottom:8}}>This information may include:</p>
            <ul style={{paddingLeft:20, marginBottom:0, lineHeight:1.7}}>
              <li>Full name</li>
              <li>Email address</li>
              <li>Phone number</li>
              <li>Home or project address</li>
              <li>Details about your home (age, electrical panel status, vehicle type)</li>
              <li>Details about your service request</li>
            </ul>

            <h3 style={{fontSize:15, fontWeight:700, marginBottom:8, marginTop:24}}>2. How We Use Your Information</h3>
            <ul style={{paddingLeft:20, marginBottom:8, lineHeight:1.7}}>
              <li>Respond to your inquiries and provide requested services</li>
              <li>Send project estimates, updates, and appointment confirmations</li>
              <li>Coordinate permits, panel inspections, and installations</li>
              <li>Improve our website and customer experience</li>
              <li>Comply with legal, licensing, and safety requirements</li>
            </ul>
            <p>We do not sell, rent, or share your personal information with third parties except when required by law or necessary to provide services (e.g., permitting authorities, utility coordination, or trusted subcontractors assisting with your project).</p>

            <h3 style={{fontSize:15, fontWeight:700, marginBottom:8, marginTop:24}}>3. Data Protection</h3>
            <p>We take appropriate security measures to protect your data against unauthorized access, alteration, or disclosure. However, please note that no online transmission or storage method is completely secure.</p>

            <h3 style={{fontSize:15, fontWeight:700, marginBottom:8, marginTop:24}}>4. Cookies and Tracking</h3>
            <p>Our website may use cookies and tracking pixels (including Meta Pixel) to improve functionality, measure ad performance, and analyze traffic. You can disable cookies in your browser settings, but this may limit certain site features.</p>

            <h3 style={{fontSize:15, fontWeight:700, marginBottom:8, marginTop:24}}>5. Third-Party Links</h3>
            <p>Our website may contain links to external websites. Bevy Electric is not responsible for the privacy practices or content of those third-party sites.</p>

            <h3 style={{fontSize:15, fontWeight:700, marginBottom:8, marginTop:24}}>6. Your Rights</h3>
            <ul style={{paddingLeft:20, marginBottom:8, lineHeight:1.7}}>
              <li>Access or update your personal information</li>
              <li>Request deletion of your data</li>
              <li>Withdraw consent for communications</li>
            </ul>
            <p>California residents have additional rights under the California Consumer Privacy Act (CCPA), including the right to know what personal information we collect and the right to opt out of the sale of personal information (note: we do not sell personal information).</p>
            <p style={{marginTop:8}}>To make a request, please contact us at the email below.</p>

            <h3 style={{fontSize:15, fontWeight:700, marginBottom:8, marginTop:24}}>7. Updates to This Policy</h3>
            <p>We may update this Privacy Policy from time to time. Any changes will be posted on this page with an updated date.</p>

            <h3 style={{fontSize:15, fontWeight:700, marginBottom:8, marginTop:24}}>8. Contact Us</h3>
            <p style={{lineHeight:1.8}}>
              Bevy Electric<br />
              Licensed CA Contractor #1141115<br />
              Lincoln, CA — serving Greater Sacramento<br />
              Phone: 916-886-1304<br />
              Email: <a href="mailto:bevyelectric@gmail.com" style={{color:'var(--primary)'}}>bevyelectric@gmail.com</a>
            </p>
          </div>
        </div>
      )}
    </>
  );
}
window.Footer = Footer;
