// Simple stroke icons — Lucide-style, drawn inline. Single source of truth.
const Icon = ({ name, size = 20, className = '', strokeWidth = 1.8 }) => {
  const common = {
    width: size,
    height: size,
    viewBox: '0 0 24 24',
    fill: 'none',
    stroke: 'currentColor',
    strokeWidth,
    strokeLinecap: 'round',
    strokeLinejoin: 'round',
    className,
  };
  const paths = {
    cart: (
      <>
        <path d="M3 4h2l2.5 11.5a2 2 0 0 0 2 1.5h7.5a2 2 0 0 0 2-1.6L21 8H6" />
        <circle cx="9" cy="20" r="1.4" />
        <circle cx="18" cy="20" r="1.4" />
      </>
    ),
    bag: (
      <>
        <path d="M6 8h12l-1 12a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2L6 8Z" />
        <path d="M9 8V6a3 3 0 0 1 6 0v2" />
      </>
    ),
    pin: (
      <>
        <path d="M12 22s7-6.5 7-12a7 7 0 1 0-14 0c0 5.5 7 12 7 12Z" />
        <circle cx="12" cy="10" r="2.5" />
      </>
    ),
    users: (
      <>
        <circle cx="9" cy="9" r="3.5" />
        <path d="M2.5 20a6.5 6.5 0 0 1 13 0" />
        <path d="M16 11a3 3 0 0 0 0-6" />
        <path d="M17.5 20a5 5 0 0 0-2-4" />
      </>
    ),
    search: (
      <>
        <circle cx="11" cy="11" r="7" />
        <path d="m20 20-3.5-3.5" />
      </>
    ),
    filter: (
      <>
        <path d="M3 5h18" />
        <path d="M6 12h12" />
        <path d="M10 19h4" />
      </>
    ),
    chevronRight: <path d="m9 6 6 6-6 6" />,
    chevronLeft: <path d="m15 6-6 6 6 6" />,
    chevronDown: <path d="m6 9 6 6 6-6" />,
    arrowRight: (
      <>
        <path d="M5 12h14" />
        <path d="m13 5 7 7-7 7" />
      </>
    ),
    arrowLeft: (
      <>
        <path d="M19 12H5" />
        <path d="m11 5-7 7 7 7" />
      </>
    ),
    close: (
      <>
        <path d="M18 6 6 18" />
        <path d="m6 6 12 12" />
      </>
    ),
    plus: (
      <>
        <path d="M12 5v14" />
        <path d="M5 12h14" />
      </>
    ),
    minus: <path d="M5 12h14" />,
    trash: (
      <>
        <path d="M4 7h16" />
        <path d="M10 11v6" />
        <path d="M14 11v6" />
        <path d="M6 7l1 13a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-13" />
        <path d="M9 7V4h6v3" />
      </>
    ),
    check: <path d="m5 12 5 5L20 7" />,
    checkCircle: (
      <>
        <circle cx="12" cy="12" r="9" />
        <path d="m8 12 3 3 5-6" />
      </>
    ),
    sparkle: (
      <>
        <path d="M12 3v4" />
        <path d="M12 17v4" />
        <path d="M3 12h4" />
        <path d="M17 12h4" />
        <path d="m6 6 2.5 2.5" />
        <path d="m15.5 15.5 2.5 2.5" />
        <path d="m6 18 2.5-2.5" />
        <path d="m15.5 8.5 18 6" />
      </>
    ),
    star: <path d="M12 3.5 14.6 9l6 .9-4.3 4.2 1 6L12 17l-5.3 3.1 1-6L3.4 9.9 9.4 9 12 3.5Z" />,
    heart: <path d="M12 20s-7-4.5-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.5-7 10-7 10Z" />,
    menu: (
      <>
        <path d="M4 6h16" />
        <path d="M4 12h16" />
        <path d="M4 18h16" />
      </>
    ),
    phone: <path d="M5 4h3l2 5-2.5 1.5a11 11 0 0 0 6 6L15 14l5 2v3a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2Z" />,
    mail: (
      <>
        <rect x="3" y="5" width="18" height="14" rx="2" />
        <path d="m3 7 9 7 9-7" />
      </>
    ),
    gift: (
      <>
        <rect x="3" y="8" width="18" height="5" rx="1" />
        <path d="M5 13v8h14v-8" />
        <path d="M12 8v13" />
        <path d="M12 8s-3-5-5-3 2 3 5 3Z" />
        <path d="M12 8s3-5 5-3-2 3-5 3Z" />
      </>
    ),
    sparkles: (
      <>
        <path d="M12 4v3" />
        <path d="M12 17v3" />
        <path d="M4 12h3" />
        <path d="M17 12h3" />
        <path d="m6.5 6.5 2 2" />
        <path d="m15.5 15.5 2 2" />
        <path d="m6.5 17.5 2-2" />
        <path d="m15.5 8.5 2-2" />
      </>
    ),
    spool: (
      <>
        <circle cx="12" cy="12" r="9" />
        <circle cx="12" cy="12" r="3" />
        <path d="M12 3v6" />
        <path d="M12 15v6" />
        <path d="M3 12h6" />
        <path d="M15 12h6" />
      </>
    ),
    clipboard: (
      <>
        <rect x="6" y="4" width="12" height="17" rx="2" />
        <path d="M9 4h6v3H9z" />
        <path d="M9 11h6" />
        <path d="M9 15h6" />
      </>
    ),
    truck: (
      <>
        <path d="M3 7h11v10H3z" />
        <path d="M14 10h4l3 3v4h-7z" />
        <circle cx="7" cy="18" r="2" />
        <circle cx="17" cy="18" r="2" />
      </>
    ),
    handshake: (
      <>
        <path d="M11 17 7 13l3-3 2 2 4-4 4 4-6 6a2 2 0 0 1-3 0Z" />
        <path d="M3 11l4-4" />
        <path d="m17 7 4 4" />
      </>
    ),
    flame: (
      <>
        <path d="M12 3s5 4 5 9a5 5 0 1 1-10 0c0-2 1-3 2-4 0 2 1 3 2 3 0-3 1-5 1-8Z" />
      </>
    ),
    spark: <path d="m12 2 1.5 5 5 1.5-5 1.5L12 15l-1.5-5-5-1.5 5-1.5L12 2Z" />,
  };
  return <svg {...common}>{paths[name] || null}</svg>;
};

window.Icon = Icon;
