// ====================== TRUST BAR ====================== function TrustBar() { const items = [ { icon: IconTruck, t: "Entrega Rápida", s: "" }, { icon: IconHeadset, t: "Atendimento humanizado", s: "" }, { icon: IconCard, t: "Pagamento Facilitado", s: "" }, { icon: IconShield, t: "Compra Segura", s: "" }, { icon: IconMedal, t: "Grandes Marcas", s: "" }, ]; return (
{items.map((it, k) => (
{it.t}
{it.s &&
{it.s}
}
))}
); } // ====================== COMPRE POR CATEGORIA ====================== function CategoryGrid({ onNav }) { return (

COMPRE POR CATEGORIA

{VISIBLE_CATEGORIES.map((c) => (
onNav(c.id)} style={{ background: "#fff", border: "1px solid var(--line)", borderRadius: 16, padding: "30px 22px 30px", display: "flex", flexDirection: "column", alignItems: "center", textAlign: "center", cursor: "pointer", transition: "transform .18s ease, box-shadow .18s ease, border-color .18s ease" }} onMouseEnter={(e) => { e.currentTarget.style.transform = "translateY(-6px)"; e.currentTarget.style.boxShadow = "0 16px 32px rgba(16,30,60,.14)"; e.currentTarget.style.borderColor = "transparent"; }} onMouseLeave={(e) => { e.currentTarget.style.transform = "none"; e.currentTarget.style.boxShadow = "none"; e.currentTarget.style.borderColor = "var(--line)"; }}>
{c.label}
{c.label.toUpperCase()}
))}
); } // ====================== INSTITUTIONAL CARDS ====================== function MaskIcon({ src, size = 80, style }) { return ; } function InstitutionalCards({ onContact }) { const base = { borderRadius: 14, padding: "34px 34px", minHeight: 212, display: "flex", flexDirection: "column", justifyContent: "space-between", position: "relative", overflow: "hidden" }; const text = { position: "relative", zIndex: 2, paddingRight: 88, display: "flex", flexDirection: "column", gap: 12 }; const title = (color) => ({ margin: 0, color, fontWeight: 800, fontSize: 22, lineHeight: 1.16, letterSpacing: ".005em" }); const sub = (color) => ({ margin: 0, color, fontSize: 13, fontWeight: 500, lineHeight: 1.5, maxWidth: 280 }); const outlineBtn = (color) => ({ alignSelf: "flex-start", marginTop: 22, border: `2px solid ${color}`, color, background: "transparent", fontWeight: 800, fontSize: 12.5, letterSpacing: ".04em", padding: "11px 24px", borderRadius: 26, whiteSpace: "nowrap", transition: "all .15s" }); const iconWrap = (color) => ({ position: "absolute", top: 30, right: 26, color, zIndex: 1, display: "flex" }); return (
{/* ABASTECIMENTO — yellow */}

ABASTECIMENTO
PARA SUA EMPRESA

Fale com um de nossos consultores e tenha as melhores condições.

{/* EMPRESAS — white bordered (no CTA → content vertically centered) */}

EMPRESAS QUE CONFIAM NA JGF DISTRIBUIDORA

Soluções completas para empresas de todos os portes.

); } // ====================== FOOTER (compact) ====================== function Footer() { const HREFS = { "Produtos de Limpeza": "Produtos de Limpeza.html", "Produtos de Copa": "Copa e Cozinha.html", "Materiais de Escritório": "Materiais de Escritorio.html", "Sobre a JGF": "Sobre a JGF.html" }; const col = (title, items) => (
{title}
{items.map((i) => ( { if (!HREFS[i]) e.preventDefault(); }} style={{ color: "#aeb9d0", fontSize: 12.5, fontWeight: 500, transition: "color .15s" }} onMouseEnter={(e) => (e.currentTarget.style.color = "var(--yellow)")} onMouseLeave={(e) => (e.currentTarget.style.color = "#aeb9d0")}>{i} ))}
); return ( ); } // ====================== CART DRAWER → ORÇAMENTO VIA WHATSAPP ====================== function fmtPhoneBR(v) { const d = (v || "").replace(/\D/g, "").slice(0, 11); if (d.length <= 2) return d.length ? "(" + d : ""; if (d.length <= 6) return "(" + d.slice(0, 2) + ") " + d.slice(2); if (d.length <= 10) return "(" + d.slice(0, 2) + ") " + d.slice(2, 6) + "-" + d.slice(6); return "(" + d.slice(0, 2) + ") " + d.slice(2, 7) + "-" + d.slice(7); } function fmtCNPJ(v) { const d = (v || "").replace(/\D/g, "").slice(0, 14); let out = d; if (d.length > 2) out = d.slice(0, 2) + "." + d.slice(2); if (d.length > 5) out = d.slice(0, 2) + "." + d.slice(2, 5) + "." + d.slice(5); if (d.length > 8) out = d.slice(0, 2) + "." + d.slice(2, 5) + "." + d.slice(5, 8) + "/" + d.slice(8); if (d.length > 12) out = d.slice(0, 2) + "." + d.slice(2, 5) + "." + d.slice(5, 8) + "/" + d.slice(8, 12) + "-" + d.slice(12); return out; } function CartDrawer({ open, onClose, items, onRemove, onClear }) { const [step, setStep] = React.useState("cart"); // cart | form | sent const [cnpj, setCnpj] = React.useState(""); const [razao, setRazao] = React.useState(""); const [email, setEmail] = React.useState(""); const [phone, setPhone] = React.useState(""); const [lookup, setLookup] = React.useState(""); // "" | loading | ok | fail const [captcha, setCaptcha] = React.useState({ a: 3, b: 4 }); const [answer, setAnswer] = React.useState(""); const [err, setErr] = React.useState(""); const newCaptcha = () => setCaptcha({ a: 2 + Math.floor(Math.random() * 7), b: 1 + Math.floor(Math.random() * 8) }); const buscarCNPJ = async (raw) => { const digits = (raw || "").replace(/\D/g, ""); if (digits.length !== 14) return; setLookup("loading"); setErr(""); try { const r = await fetch("https://brasilapi.com.br/api/cnpj/v1/" + digits); if (!r.ok) throw new Error("not found"); const d = await r.json(); setRazao(d.razao_social || d.nome_fantasia || ""); const tel = d.ddd_telefone_1 || d.ddd_telefone_2 || ""; if (tel && tel.replace(/\D/g, "").length >= 10) setPhone(fmtPhoneBR(tel)); if (d.email) setEmail((d.email || "").toLowerCase()); setLookup("ok"); } catch (_) { setLookup("fail"); } }; // reset whenever the drawer opens React.useEffect(() => { if (open) { setStep("cart"); setCnpj(""); setRazao(""); setEmail(""); setPhone(""); setLookup(""); setAnswer(""); setErr(""); newCaptcha(); } }, [open]); const total = items.reduce((a, b) => a + (b.price || 0) * b.qty, 0); const count = items.reduce((a, b) => a + b.qty, 0); // group items by category, preserving first-seen order const groups = []; const gmap = {}; items.forEach((it) => { const cat = it.cat || "Outros produtos"; if (!gmap[cat]) { gmap[cat] = []; groups.push(cat); } gmap[cat].push(it); }); const buildMessage = () => { const L = []; L.push("*Novo pedido de orçamento — JGF Distribuidora*"); L.push(""); L.push("*CNPJ:* " + cnpj.trim()); L.push("*Razão social:* " + razao.trim()); if (email.trim()) L.push("*E-mail:* " + email.trim()); L.push("*Telefone:* " + phone.trim()); L.push(""); L.push("*Itens solicitados:*"); groups.forEach((cat) => { L.push(""); L.push("*" + cat.toUpperCase() + "*"); gmap[cat].forEach((it) => L.push("• " + it.name + " — " + it.qty + "un")); }); L.push(""); L.push("Aguardo retorno com disponibilidade e condições. Obrigado!"); return L.join("\n"); }; const submit = (e) => { e.preventDefault(); if (cnpj.replace(/\D/g, "").length !== 14) { setErr("Informe um CNPJ válido com 14 dígitos."); return; } if (razao.trim().length < 2) { setErr("Informe a razão social."); return; } if (email.trim() && !email.includes("@")) { setErr("Informe um e-mail válido."); return; } if (phone.replace(/\D/g, "").length < 10) { setErr("Informe um telefone válido com DDD."); return; } if (parseInt(answer, 10) !== captcha.a + captcha.b) { setErr("Resposta da verificação incorreta."); newCaptcha(); setAnswer(""); return; } setErr(""); const url = "https://wa.me/" + WHATSAPP_NUMBER + "?text=" + encodeURIComponent(buildMessage()); window.open(url, "_blank"); setStep("sent"); onClear && onClear(); }; const inp = { width: "100%", padding: "13px 14px", border: "2px solid var(--line)", borderRadius: 9, fontSize: 14, fontWeight: 600, color: "var(--navy)", outline: "none", transition: "border-color .15s" }; const focusOn = (e) => (e.target.style.borderColor = "var(--navy)"); const focusOff = (e) => (e.target.style.borderColor = "var(--line)"); return ( <>
{/* header */}
{step === "form" ? (<>Seus dados) : (<>{step === "sent" ? "Pedido enviado" : "Meu orçamento"}{count > 0 && step === "cart" && {count}})}
{/* ---------- STEP: CART ---------- */} {step === "cart" && ( <>
{items.length === 0 ? (
Sua lista está vazia
Adicione produtos navegando pelas categorias.
) : groups.map((cat) => (
{cat}
{gmap[cat].map((it) => (
{it.name}
Qtd: {it.qty}
))}
))}
{items.length > 0 && (
Pedido de orçamento — sem compromisso de compra.
)} )} {/* ---------- STEP: FORM ---------- */} {step === "form" && (

Digite o CNPJ para preenchermos os dados da empresa automaticamente e enviarmos o pedido ({count} {count === 1 ? "item" : "itens"}) pelo WhatsApp.

{ const v = fmtCNPJ(e.target.value); setCnpj(v); if (v.replace(/\D/g, "").length === 14) buscarCNPJ(v); }} onBlur={(e) => { buscarCNPJ(e.target.value); focusOff(e); }} onFocus={focusOn} inputMode="numeric" placeholder="00.000.000/0000-00" style={{ ...inp, paddingLeft: 40, paddingRight: 44 }} /> {lookup === "loading" && buscando…} {lookup === "ok" && }
{lookup === "fail" &&
Não encontramos esse CNPJ automaticamente. Preencha os campos manualmente.
}
setRazao(e.target.value)} placeholder="Nome da empresa" style={{ ...inp, paddingLeft: 40 }} onFocus={focusOn} onBlur={focusOff} />
setEmail(e.target.value)} type="email" placeholder="contato@empresa.com.br" style={{ ...inp, paddingLeft: 40 }} onFocus={focusOn} onBlur={focusOff} />
setPhone(fmtPhoneBR(e.target.value))} inputMode="numeric" placeholder="(81) 99999-9999" style={{ ...inp, paddingLeft: 40 }} onFocus={focusOn} onBlur={focusOff} />
{/* simple anti-bot captcha */}
{captcha.a} + {captcha.b} =
setAnswer(e.target.value.replace(/\D/g, "").slice(0, 2))} inputMode="numeric" placeholder="?" style={{ ...inp, width: 72, textAlign: "center" }} onFocus={focusOn} onBlur={focusOff} />
Confirme que você não é um robô resolvendo a conta.
{err &&
{err}
}
)} {/* ---------- STEP: SENT ---------- */} {step === "sent" && (
Pedido encaminhado!

Abrimos o WhatsApp com seu pedido pronto. Toque em enviar na conversa para concluir com a JGF.

Não abriu? Falar no WhatsApp
)}
); } // ====================== LOGIN MODAL ====================== function LoginModal({ open, onClose, onLogin }) { const [name, setName] = React.useState(""); const [email, setEmail] = React.useState(""); const [err, setErr] = React.useState(""); React.useEffect(() => { if (open) { setName(""); setEmail(""); setErr(""); } }, [open]); if (!open) return null; const submit = (e) => { e.preventDefault(); if (!email.includes("@") || name.trim().length < 2) { setErr("Preencha nome e um e-mail válido."); return; } onLogin(name.trim()); }; const inp = { width: "100%", padding: "13px 14px", border: "2px solid var(--line)", borderRadius: 9, fontSize: 14, fontWeight: 500, outline: "none", transition: "border-color .15s" }; return (
e.stopPropagation()} style={{ background: "#fff", borderRadius: 16, width: 400, maxWidth: "92vw", overflow: "hidden", boxShadow: "0 24px 60px rgba(16,30,60,.35)" }}>

Entrar ou cadastrar

Acesse sua conta empresarial JGF.

setName(e.target.value)} placeholder="Seu nome" style={{ ...inp, margin: "6px 0 14px" }} onFocus={(e) => (e.target.style.borderColor = "var(--navy)")} onBlur={(e) => (e.target.style.borderColor = "var(--line)")} /> setEmail(e.target.value)} placeholder="voce@empresa.com.br" style={{ ...inp, margin: "6px 0 6px" }} onFocus={(e) => (e.target.style.borderColor = "var(--navy)")} onBlur={(e) => (e.target.style.borderColor = "var(--line)")} /> {err &&
{err}
}
); } // ====================== LOCATION MAP (full-bleed) ====================== function LocationMap() { const query = "Rua Marques de Baipendi 85 Recife PE 52040-080"; const src = `https://maps.google.com/maps?q=${encodeURIComponent(query)}&z=13&output=embed`; return (
{/* styled map fallback (shows if external embed is blocked) */}