/* FEDUCCE Catálogo — UI compartida: slots de foto, WhatsApp, header, footer. → window.FEDCAT_UI */ const KDS = window.FEDUCCEDesignSystem_349cd6; const { Icon: KIcon } = KDS; /* Detección de viewport móvil */ function useIsMobile(bp = 760) { const q = "(max-width:" + bp + "px)"; const [m, setM] = React.useState(() => window.matchMedia(q).matches); React.useEffect(() => { const mq = window.matchMedia(q); const on = (e) => setM(e.matches); setM(mq.matches); mq.addEventListener("change", on); return () => mq.removeEventListener("change", on); }, [q]); return m; } /* ------------------------------------------------------------- WhatsApp -- */ function WAGlyph({ size = 16, color = "currentColor" }) { return ( ); } /* Botón de WhatsApp — variantes: primary (bloque tinta), emerald, ghost, onDark */ function WAButton({ children, message, product, variant = "primary", style }) { const [hover, setHover] = React.useState(false); const url = product ? window.CAT_waProduct(product) : window.CAT_wa(message); const V = { primary: { background: hover ? "var(--ink-800)" : "var(--ink-900)", color: "var(--bone-50)", border: "1px solid var(--ink-900)" }, emerald: { background: hover ? "var(--emerald-700)" : "var(--emerald-600)", color: "var(--bone-50)", border: "1px solid transparent" }, ghost: { background: hover ? "var(--ink-900)" : "transparent", color: hover ? "var(--bone-50)" : "var(--ink-900)", border: "1px solid var(--ink-900)" }, onDark: { background: hover ? "var(--bone-50)" : "transparent", color: hover ? "var(--ink-900)" : "var(--bone-50)", border: "1px solid var(--border-on-dark)" }, }[variant]; return ( setHover(true)} onMouseLeave={() => setHover(false)} style={{ display: "inline-flex", alignItems: "center", gap: "10px", padding: "14px 22px", fontFamily: "var(--font-sans)", fontSize: "11px", fontWeight: 500, letterSpacing: "0.18em", textTransform: "uppercase", textDecoration: "none", cursor: "pointer", transition: "background var(--dur-base) var(--ease-standard), color var(--dur-base) var(--ease-standard)", ...V, ...style, }}> {children} ); } /* Burbuja fija, esquina inferior derecha */ function WAFloat() { const [hover, setHover] = React.useState(false); return ( setHover(true)} onMouseLeave={() => setHover(false)} style={{ position: "fixed", right: "18px", bottom: "calc(18px + env(safe-area-inset-bottom))", zIndex: 120, display: "flex", alignItems: "center", justifyContent: "center", gap: "10px", minWidth: "56px", minHeight: "56px", boxSizing: "border-box", background: hover ? "var(--emerald-700)" : "var(--emerald-600)", color: "var(--bone-50)", padding: "14px 16px", textDecoration: "none", boxShadow: "var(--shadow-md)", transition: "background var(--dur-base) var(--ease-standard)", }}> Escríbenos ); } /* ------------------------------------------------------------- ImageSlot -- */ function CImageSlot({ label = "Fotografía de producto", index, ratio = "3 / 4", tone = "bone", style }) { const dark = tone === "dark"; return (
{index && ( {index} )} [ {label} ]
); } function CFrame({ src, alt, index, label, ratio = "3 / 4", tone = "bone", hoverZoom = true, style }) { const [hover, setHover] = React.useState(false); if (!src) return ; return (
setHover(true)} onMouseLeave={() => setHover(false)} style={{ position: "relative", aspectRatio: ratio, overflow: "hidden", background: "var(--ink-900)", ...style }}> {alt {index && ( {index} )}
); } /* ---------------------------------------------------------------- Header -- */ function CHeader({ route, go }) { const links = [["Catálogo", "catalogo"], ["La Casa", "about"], ["Contacto", "contacto"]]; const mobile = useIsMobile(760); const shell = { position: "sticky", top: 0, zIndex: 100, background: "rgba(240,238,231,0.94)", backdropFilter: "blur(10px)", WebkitBackdropFilter: "blur(10px)", borderBottom: "1px solid var(--border-hairline)", paddingTop: "env(safe-area-inset-top)", }; if (mobile) { return (
); } const navItem = ([label, to]) => { const active = route === to; return ( ); }; return (
WhatsApp
); } /* ---------------------------------------------------------------- Footer -- */ function CFooter({ go }) { const col = (title, items) => (
{title}
{items.map(([label, fn]) => ( ))}
); return ( ); } Object.assign(window, { WAGlyph, WAButton, WAFloat, CImageSlot, CFrame, useIsMobile }); window.FEDCAT_UI = { WAGlyph, WAButton, WAFloat, CImageSlot, CFrame, CHeader, CFooter, useIsMobile };