/* ═══════════════════════════════════════
   ROMAJA — Shared Components
═══════════════════════════════════════ */

/* ─── ERROR BOUNDARY ───
   Red de seguridad global: si cualquier componente tira un error inesperado
   al renderizar, React desmonta toda la app y queda la pantalla en blanco
   (así es como funciona React, no hay forma de evitarlo salvo esto). Este
   componente atrapa ese error y muestra una pantalla con un botón para volver
   al inicio, en vez de blanco. Usa <a href> plano (no navigate()) a propósito,
   porque si el error viene de más arriba en el árbol (ej. los Context de
   Nav/Carrito) no podemos confiar en que esos hooks sigan funcionando. */
class ErrorBoundary extends React.Component {
  constructor(props) {
    super(props);
    this.state = { hasError: false };
  }
  static getDerivedStateFromError() {
    return { hasError: true };
  }
  componentDidCatch(error, info) {
    console.error("Error no capturado:", error, info);
  }
  render() {
    if (this.state.hasError) {
      return (
        <div style={{
          minHeight: "100vh", display: "flex", flexDirection: "column",
          alignItems: "center", justifyContent: "center", gap: 16, padding: 40,
          textAlign: "center", background: "#faf6ef", fontFamily: "'Lato', sans-serif",
        }}>
          <div style={{ fontFamily: "'DM Serif Display', serif", fontSize: 28, color: "#3a2c1e" }}>
            Ups, algo salió mal
          </div>
          <div style={{ fontSize: 13, color: "#7a6050", maxWidth: 360 }}>
            Ocurrió un error inesperado. Probá volver al inicio.
          </div>
          <a href="/" style={{
            background: "#c87d52", color: "#fff", textDecoration: "none",
            padding: "12px 28px", fontSize: 11, letterSpacing: "0.14em", textTransform: "uppercase",
            borderRadius: 2, marginTop: 8,
          }}>Ir al Inicio</a>
        </div>
      );
    }
    return this.props.children;
  }
}

/* ─── THEME ─── */
const T = {
  bg:        "#faf6ef",
  bgSoft:    "#f2ebe0",
  primary:   "#c87d52",
  primaryDk: "#a8623c",
  green:     "#7a9468",
  greenBg:   "#e4ecdf",
  dark:      "#3a2c1e",
  mid:       "#7a6050",
  light:     "#b89a84",
  border:    "#e5d9cc",
  card:      "#ffffff",
  topbar:    "#c87d52",
};

Object.assign(window, { T });

/* ─── LOGO ─── */
const Logo = ({ size = 26, onClick }) => {
  const { navigate } = useNav();
  return (
    <div onClick={onClick || (() => navigate("/"))}
      style={{ cursor: "pointer", display: "flex", flexDirection: "column", alignItems: "flex-start", gap: 1 }}>
      <span style={{ fontFamily: "'DM Serif Display', serif", fontSize: size, lineHeight: 1, color: T.dark, letterSpacing: "0.01em" }}>
        Romaja
      </span>
      <span style={{ fontFamily: "'Lato', sans-serif", fontSize: 9, letterSpacing: "0.22em", textTransform: "uppercase", color: T.primary }}>
        Crochet & Bisutería
      </span>
    </div>
  );
};

/* ─── NAV ─── */
const Navbar = () => {
  const { navigate, route } = useNav();
  const { count } = useCart();
  const [menuOpen, setMenuOpen] = React.useState(false);
  const [scrolled, setScrolled] = React.useState(false);
  const isMobile = useMobile();

  React.useEffect(() => {
    const h = () => setScrolled(window.scrollY > 40);
    window.addEventListener("scroll", h);
    return () => window.removeEventListener("scroll", h);
  }, []);

  // Close menu on route change
  React.useEffect(() => { setMenuOpen(false); }, [route]);

  const links = [
    { label: "Inicio", path: "/" },
    { label: "Tienda", path: "/tienda" },
    { label: "Sobre Mí", path: "/sobre-mi" },
    { label: "Contacto", path: "/contacto" },
    { label: "FAQ", path: "/faq" },
  ];

  const isActive = (path) => {
    if (path === "/") return route === "/" || route === "";
    return route.startsWith(path);
  };

  const WaIcon = () => (
    <svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>
  );

  return (
    <>
      {/* Top bar */}
      <div style={{ background: T.topbar, color: "#fdf6ed", fontSize: isMobile ? 10 : 11, textAlign: "center", padding: isMobile ? "7px 12px" : "9px 20px", letterSpacing: "0.08em", fontFamily: "'Lato', sans-serif" }}>
        🌿 Envíos a todo Costa Rica · Coordinamos por WhatsApp
      </div>

      {/* Main nav */}
      <nav style={{
        position: "sticky", top: 0, zIndex: 100,
        background: scrolled ? "rgba(250,246,239,0.97)" : T.bg,
        borderBottom: `1px solid ${T.border}`,
        backdropFilter: "blur(8px)",
        transition: "box-shadow 0.2s",
        boxShadow: scrolled ? "0 2px 16px rgba(58,44,30,0.08)" : "none",
      }}>
        <div style={{ maxWidth: 1200, margin: "0 auto", padding: isMobile ? "14px 20px" : "16px 32px", display: "flex", alignItems: "center", justifyContent: "space-between" }}>
          <Logo size={isMobile ? 22 : 26} />

          {/* Desktop links */}
          {!isMobile && (
            <div style={{ display: "flex", gap: 32 }}>
              {links.map(l => (
                <button key={l.path} onClick={() => navigate(l.path)} style={{
                  background: "none", border: "none", cursor: "pointer",
                  fontFamily: "'Lato', sans-serif", fontSize: 13, letterSpacing: "0.06em",
                  color: isActive(l.path) ? T.primary : T.mid,
                  borderBottom: isActive(l.path) ? `2px solid ${T.primary}` : "2px solid transparent",
                  paddingBottom: 3, transition: "color 0.15s",
                }}>{l.label}</button>
              ))}
            </div>
          )}

          {/* Icons */}
          <div style={{ display: "flex", gap: isMobile ? 16 : 20, alignItems: "center" }}>
            {!isMobile && (
              <a href={WHATSAPP_LINK} target="_blank" rel="noreferrer" style={{ color: T.mid, textDecoration: "none" }}>
                <WaIcon />
              </a>
            )}
            <button onClick={() => navigate("/carrito")} style={{ background: "none", border: "none", cursor: "pointer", position: "relative", color: T.mid, display: "flex", alignItems: "center" }}>
              <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6">
                <path d="M6 2 3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z"/>
                <line x1="3" y1="6" x2="21" y2="6"/>
                <path d="M16 10a4 4 0 01-8 0"/>
              </svg>
              {count > 0 && (
                <span style={{ position: "absolute", top: -6, right: -6, width: 17, height: 17, background: T.primary, borderRadius: "50%", display: "flex", alignItems: "center", justifyContent: "center", fontSize: 9, color: "#fff", fontWeight: 700 }}>{count}</span>
              )}
            </button>
            {/* Hamburger */}
            {isMobile && (
              <button onClick={() => setMenuOpen(o => !o)} style={{ background: "none", border: "none", cursor: "pointer", color: T.dark, display: "flex", flexDirection: "column", gap: 5, padding: 4 }}>
                <span style={{ display: "block", width: 22, height: 2, background: menuOpen ? "transparent" : T.dark, transition: "all 0.2s" }} />
                <span style={{ display: "block", width: 22, height: 2, background: T.dark, transition: "all 0.2s", transform: menuOpen ? "rotate(45deg) translate(5px, -5px)" : "none" }} />
                <span style={{ display: "block", width: 22, height: 2, background: T.dark, transition: "all 0.2s", transform: menuOpen ? "rotate(-45deg) translate(5px, 5px)" : "none" }} />
              </button>
            )}
          </div>
        </div>

        {/* Mobile menu */}
        {isMobile && menuOpen && (
          <div style={{ background: T.bg, borderTop: `1px solid ${T.border}`, padding: "8px 0 16px" }}>
            {links.map(l => (
              <button key={l.path} onClick={() => { navigate(l.path); setMenuOpen(false); }} style={{
                display: "block", width: "100%", textAlign: "left",
                background: isActive(l.path) ? T.bgSoft : "none", border: "none", cursor: "pointer",
                fontFamily: "'Lato', sans-serif", fontSize: 15, letterSpacing: "0.04em",
                color: isActive(l.path) ? T.primary : T.dark,
                padding: "13px 24px", borderLeft: isActive(l.path) ? `3px solid ${T.primary}` : "3px solid transparent",
              }}>{l.label}</button>
            ))}
            <div style={{ margin: "12px 24px 0" }}>
              <a href={WHATSAPP_LINK} target="_blank" rel="noreferrer"
                style={{ display: "inline-flex", alignItems: "center", gap: 8, background: "#25D366", color: "#fff", padding: "10px 20px", borderRadius: 4, fontSize: 13, textDecoration: "none" }}>
                <WaIcon /> WhatsApp
              </a>
            </div>
          </div>
        )}
      </nav>
    </>
  );
};

/* ─── FOOTER ─── */
const Footer = () => {
  const { navigate } = useNav();
  const isMobile = useMobile();
  return (
    <footer style={{ background: T.dark, color: "#f0e8dc", padding: isMobile ? "40px 20px 24px" : "56px 32px 32px", marginTop: 80 }}>
      <div style={{ maxWidth: 1200, margin: "0 auto" }}>
        <div style={{ display: "grid", gridTemplateColumns: isMobile ? "1fr 1fr" : "2fr 1fr 1fr 1fr", gap: isMobile ? 32 : 48, marginBottom: 40 }}>
          <div style={{ gridColumn: isMobile ? "1 / -1" : "auto" }}>
            <div style={{ fontFamily: "'DM Serif Display', serif", fontSize: 28, color: "#f0e8dc", marginBottom: 4 }}>Romaja</div>
            <div style={{ fontSize: 9, letterSpacing: "0.22em", textTransform: "uppercase", color: T.primary, marginBottom: 16 }}>Crochet & Bisutería</div>
            <p style={{ fontSize: 13, color: "rgba(240,232,220,0.55)", lineHeight: 1.8, maxWidth: 260 }}>
              Piezas únicas hechas a mano en Costa Rica con mucho amor y dedicación.
            </p>
            <a href={WHATSAPP_LINK} target="_blank" rel="noreferrer"
              style={{ display: "inline-flex", alignItems: "center", gap: 8, marginTop: 20, background: "#25D366", color: "#fff", padding: "10px 18px", borderRadius: 4, fontSize: 12, textDecoration: "none", letterSpacing: "0.06em" }}>
              <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>
              Escríbenos
            </a>
          </div>
          <div>
            <div style={{ fontSize: 11, letterSpacing: "0.16em", textTransform: "uppercase", color: T.primary, marginBottom: 16 }}>Tienda</div>
            {[["Crochet", "/tienda/crochet"], ["Bisutería", "/tienda/bisuteria"], ["Novedades", "/tienda"]].map(([l, p]) => (
              <div key={l} onClick={() => navigate(p)} style={{ cursor: "pointer", color: "rgba(240,232,220,0.55)", fontSize: 13, marginBottom: 10 }}
                onMouseEnter={e => e.target.style.color = "#f0e8dc"} onMouseLeave={e => e.target.style.color = "rgba(240,232,220,0.55)"}>{l}</div>
            ))}
          </div>
          <div>
            <div style={{ fontSize: 11, letterSpacing: "0.16em", textTransform: "uppercase", color: T.primary, marginBottom: 16 }}>Info</div>
            {[["Sobre Mí", "/sobre-mi"], ["Contacto", "/contacto"], ["FAQ", "/faq"]].map(([l, p]) => (
              <div key={l} onClick={() => navigate(p)} style={{ cursor: "pointer", color: "rgba(240,232,220,0.55)", fontSize: 13, marginBottom: 10 }}
                onMouseEnter={e => e.target.style.color = "#f0e8dc"} onMouseLeave={e => e.target.style.color = "rgba(240,232,220,0.55)"}>{l}</div>
            ))}
          </div>
          {!isMobile && (
            <div>
              <div style={{ fontSize: 11, letterSpacing: "0.16em", textTransform: "uppercase", color: T.primary, marginBottom: 16 }}>Contacto</div>
              <div style={{ fontSize: 13, color: "rgba(240,232,220,0.55)", marginBottom: 10 }}>📱 +506 6059-8892</div>
              <div style={{ fontSize: 13, color: "rgba(240,232,220,0.55)", marginBottom: 10 }}>📍 Costa Rica</div>
              <div style={{ fontSize: 13, color: "rgba(240,232,220,0.55)", marginBottom: 10 }}>🌿 @romajacr</div>
              <a href="https://instagram.com/romajacr" target="_blank" rel="noreferrer"
                style={{ display: "inline-flex", alignItems: "center", gap: 6, marginTop: 8, color: "rgba(240,232,220,0.7)", fontSize: 12, textDecoration: "none" }}>
                <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/></svg>
                Instagram
              </a>
            </div>
          )}
        </div>
        <div style={{ borderTop: "1px solid rgba(240,232,220,0.1)", paddingTop: 20, display: "flex", flexDirection: isMobile ? "column" : "row", justifyContent: "space-between", alignItems: isMobile ? "center" : "center", gap: 8, textAlign: "center" }}>
          <div style={{ fontSize: 11, color: "rgba(240,232,220,0.35)" }}>© 2025 Romaja · Hecho con ♥ en Costa Rica</div>
          <div style={{ fontSize: 11, color: "rgba(240,232,220,0.35)" }}>Pagos por Sinpe Móvil</div>
        </div>
      </div>
    </footer>
  );
};

/* ─── PRODUCT CARD ─── */
const ProductCard = ({ product }) => {
  const { navigate } = useNav();
  const { addItem } = useCart();
  const [hovered, setHovered] = React.useState(false);
  const isMobile = useMobile();

  return (
    <div
      onMouseEnter={() => setHovered(true)}
      onMouseLeave={() => setHovered(false)}
      style={{
        background: T.card, cursor: "pointer",
        transition: "transform 0.22s, box-shadow 0.22s",
        transform: hovered ? "translateY(-5px)" : "none",
        boxShadow: hovered ? "0 14px 36px rgba(58,44,30,0.13)" : "0 2px 10px rgba(58,44,30,0.06)",
        borderRadius: 2, overflow: "hidden",
      }}>
      {/* Image area */}
      <div onClick={() => navigate(`/producto/${product.id}/${slugify(product.name)}`)} style={{ position: "relative", overflow: "hidden", height: 240 }}>
        {(() => { const img = product.imagen_url || (product.imagenes && product.imagenes[0]); return img
          ? <img src={img} alt={product.name} loading="lazy"
              onError={e => { e.target.style.display = "none"; e.target.nextElementSibling.style.display = "flex"; }}
              style={{ width: "100%", height: "100%", objectFit: "cover", objectPosition: "center", display: "block", transition: "transform 0.3s", transform: hovered ? "scale(1.03)" : "scale(1)" }} />
          : null; })()}
        <div style={{
          width: "100%", height: "100%",
          background: product.bg,
          backgroundImage: `repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(0,0,0,0.025) 8px, rgba(0,0,0,0.025) 9px)`,
          display: (product.imagen_url || (product.imagenes && product.imagenes[0])) ? "none" : "flex", alignItems: "center", justifyContent: "center",
          fontFamily: "monospace", fontSize: 10, color: "rgba(58,44,30,0.35)",
          letterSpacing: "0.05em", textAlign: "center", padding: 16,
          transition: "transform 0.3s", transform: hovered ? "scale(1.03)" : "scale(1)",
        }}>
          {product.name}
        </div>
        <div style={{
          position: "absolute", top: 10, left: 10,
          background: CATEGORIES[product.category].color,
          color: "#fff", fontSize: 9, letterSpacing: "0.1em",
          textTransform: "uppercase", padding: "3px 10px", borderRadius: 2,
        }}>{CATEGORIES[product.category].label}</div>
        {product.stock <= 0 ? (
          <div style={{ position: "absolute", top: 10, right: 10, background: "#b89a84", color: "#fff", fontSize: 9, letterSpacing: "0.08em", textTransform: "uppercase", padding: "3px 10px", borderRadius: 2 }}>
            Agotado
          </div>
        ) : product.stock <= 5 && (
          <div style={{ position: "absolute", top: 10, right: 10, background: "#e8a060", color: "#fff", fontSize: 9, letterSpacing: "0.08em", textTransform: "uppercase", padding: "3px 10px", borderRadius: 2 }}>
            Últimas {product.stock}
          </div>
        )}
      </div>

      {/* Info */}
      <div style={{ padding: "14px 16px 16px" }}>
        <div style={{ fontSize: 10, letterSpacing: "0.1em", textTransform: "uppercase", color: T.light, marginBottom: 4 }}>{product.sub}</div>
        <div onClick={() => navigate(`/producto/${product.id}/${slugify(product.name)}`)}
          style={{ fontFamily: "'DM Serif Display', serif", fontSize: 15, color: T.dark, marginBottom: 8, lineHeight: 1.3 }}>{product.name}</div>
        <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
          <div style={{ fontSize: 16, fontWeight: 700, color: T.dark, fontFamily: "'DM Serif Display', serif" }}>{formatPrice(product.price)}</div>
          <button onClick={(e) => { e.stopPropagation(); if (product.stock > 0) addItem(product); }}
            disabled={product.stock <= 0}
            style={{
              background: product.stock <= 0 ? T.bgSoft : (hovered ? T.primary : T.bgSoft),
              color: product.stock <= 0 ? T.light : (hovered ? "#fff" : T.primary),
              border: `1px solid ${product.stock <= 0 ? T.border : T.primary}`,
              padding: isMobile ? "5px 8px" : "7px 14px",
              fontSize: isMobile ? 9 : 10, letterSpacing: "0.08em",
              textTransform: "uppercase", cursor: product.stock <= 0 ? "not-allowed" : "pointer",
              fontFamily: "'Lato', sans-serif", borderRadius: 2,
              transition: "background 0.2s, color 0.2s",
            }}>{product.stock <= 0 ? "Agotado" : "+ Agregar"}</button>
        </div>
      </div>
    </div>
  );
};

/* ─── BREADCRUMB ─── */
const Breadcrumb = ({ items }) => {
  const { navigate } = useNav();
  return (
    <div style={{ display: "flex", alignItems: "center", gap: 8, fontSize: 12, color: T.light, marginBottom: 32, flexWrap: "wrap" }}>
      {items.map((item, i) => (
        <React.Fragment key={i}>
          {i > 0 && <span style={{ color: T.border }}>›</span>}
          {item.path ? (
            <span onClick={() => navigate(item.path)} style={{ cursor: "pointer", color: i === items.length - 1 ? T.dark : T.primary }}>{item.label}</span>
          ) : (
            <span style={{ color: T.dark }}>{item.label}</span>
          )}
        </React.Fragment>
      ))}
    </div>
  );
};

/* ─── SECTION HEADER ─── */
const SectionHeader = ({ eyebrow, title, center = false }) => (
  <div style={{ marginBottom: 40, textAlign: center ? "center" : "left" }}>
    {eyebrow && <div style={{ fontSize: 10, letterSpacing: "0.22em", textTransform: "uppercase", color: T.primary, marginBottom: 10 }}>{eyebrow}</div>}
    <h2 style={{ fontFamily: "'DM Serif Display', serif", fontSize: 32, color: T.dark, lineHeight: 1.2 }}>{title}</h2>
  </div>
);

/* ─── EXPORT ─── */
Object.assign(window, { T, Logo, Navbar, Footer, ProductCard, Breadcrumb, SectionHeader, ErrorBoundary });
