// CORBEX Engenharia — shared components across all pages
const { Eyebrow, Button, IconButton, Badge, Input, Select, Checkbox } = window.CorbexDesignSystem_40659e;
const CX = {
wide: "var(--container-wide)",
phone: "(31) 98430-3845",
phone2: "(31) 98230-0453",
wa: "5531984303845",
email: "contato@corbexengenharia.com.br",
site: "www.corbexengenharia.com.br",
addr: "Belo Horizonte · Minas Gerais",
};
window.CX = CX;
const I = (n, props = {}) => ;
window.I = I;
/* ---------- Section heading device ---------- */
function SectionHead({ eyebrow, title, sub, dark = false, align = "left", max = 720, accent }) {
return (
{eyebrow}
{title}
{sub &&
{sub}
}
);
}
window.SectionHead = SectionHead;
/* ---------- Datum strip (engineering caption line) ---------- */
function DatumStrip({ items, dark = true }) {
return (
{items.map((t, i) => (
{t}
))}
);
}
window.DatumStrip = DatumStrip;
/* ---------- Header (sticky, transparent over dark hero -> frosted) ---------- */
function Header({ active = "home" }) {
const [scrolled, setScrolled] = React.useState(false);
const [menu, setMenu] = React.useState(false);
React.useEffect(() => {
const onScroll = () => setScrolled(window.scrollY > 12);
onScroll();
window.addEventListener("scroll", onScroll, { passive: true });
return () => window.removeEventListener("scroll", onScroll);
}, []);
const light = !scrolled; // light text over dark hero
const links = [
["Início", "index.html", "home"],
["Serviços", "servicos.html", "servicos"],
["Especialidades", "index.html#especialidades", "esp"],
["Projetos", "index.html#projetos", "proj"],
["Contato", "contato.html", "contato"],
];
return (
);
}
window.Header = Header;
/* ---------- Reusable lead form ---------- */
function LeadForm({ variant = "panel", title = "Solicite um diagnóstico", subtitle }) {
const dark = variant === "panel";
const [sent, setSent] = React.useState(false);
const [touched, setTouched] = React.useState(false);
const [f, setF] = React.useState({ nome: "", email: "", tel: "", servico: "Proteção coletiva", msg: "" });
const set = (k) => (e) => setF((s) => ({ ...s, [k]: e.target.value }));
const emailOk = /^[^@]+@[^@]+\.[^@]+$/.test(f.email);
const emailErr = touched && !emailOk ? "Informe um e-mail válido" : null;
// Native POST to /send.php (PHP handles delivery). Block submit only when invalid.
const submit = (e) => { setTouched(true); if (!(f.nome && emailOk)) { e.preventDefault(); } };
React.useEffect(() => { window.lucide && lucide.createIcons(); });
return (
{sent ? (
Solicitação enviada
Obrigado, {f.nome.split(" ")[0] || "—"}. Nossa equipe de engenharia retorna em até 1 dia útil.
) : (
)}
);
}
window.LeadForm = LeadForm;
/* ---------- CTA band (dark, photo + scrim) ---------- */
function CTASection() {
return (
Vamos conversar
Construa o seu próximo projeto sobre uma base de segurança total.
Receba um diagnóstico técnico e um orçamento sem compromisso. Engenharia, conformidade e execução em um só parceiro.
);
}
window.CTASection = CTASection;
/* ---------- Footer ---------- */
function Footer() {
const col = (title, items) => (
{title}
{items.map(([t, href]) => (
{t}
))}
);
return (
);
}
window.Footer = Footer;
/* ---------- Floating WhatsApp ---------- */
function WhatsAppFloat() {
const [hov, setHov] = React.useState(false);
return (
setHov(true)} onMouseLeave={() => setHov(false)}
style={{
position: "fixed", right: 22, bottom: 22, zIndex: 70, display: "inline-flex", alignItems: "center", gap: 10,
height: 56, padding: hov ? "0 22px 0 16px" : "0 16px", borderRadius: 999,
background: "#1FA855", color: "#fff", textDecoration: "none",
boxShadow: "0 10px 30px rgba(31,168,85,0.45)", fontFamily: "var(--font-body)", fontWeight: 600, fontSize: "var(--text-sm)",
transition: "padding var(--dur-base) var(--ease-standard)",
}}>
{hov && Fale conosco}
);
}
window.WhatsAppFloat = WhatsAppFloat;
/* ---------- FAQ accordion ---------- */
function FAQ({ items }) {
const [open, setOpen] = React.useState(0);
return (
{items.map(([q, a], i) => {
const isOpen = open === i;
return (
{isOpen &&
{a}
}
);
})}
);
}
window.FAQ = FAQ;