/* OAIRSIS Store — catalog data + Lucide icons. Exported to window. */

/* ---- Icons (Lucide, outline 2px round) ---- */
const SIco = ({ size = 22, sw = 2, vb = 24, fill = 'none', children, style }) => (
  <svg width={size} height={size} viewBox={`0 0 ${vb} ${vb}`} fill={fill} stroke="currentColor"
    strokeWidth={sw} strokeLinecap="round" strokeLinejoin="round" style={style}>{children}</svg>
);
const ISearch = (p) => <SIco {...p}><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></SIco>;
const IUser = (p) => <SIco {...p}><circle cx="12" cy="8" r="4"/><path d="M5.5 21a7.5 7.5 0 0 1 13 0"/></SIco>;
const ICart = (p) => <SIco {...p}><circle cx="9" cy="21" r="1.5"/><circle cx="18" cy="21" r="1.5"/><path d="M2.5 3h2l2.3 12.4a2 2 0 0 0 2 1.6h8.7a2 2 0 0 0 2-1.6L21 7H6"/></SIco>;
const IArrow = (p) => <SIco {...p}><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></SIco>;
const IStar = (p) => <SIco {...p} fill="currentColor" sw={0}><path d="M12 2.5l2.9 6 6.6.9-4.8 4.6 1.2 6.5L12 18.4 6.1 21l1.2-6.5L2.5 9.9l6.6-.9z"/></SIco>;
const IClose = (p) => <SIco {...p}><path d="M18 6 6 18M6 6l12 12"/></SIco>;
const IPlus = (p) => <SIco {...p}><path d="M12 5v14M5 12h14"/></SIco>;
const IMinus = (p) => <SIco {...p}><path d="M5 12h14"/></SIco>;
const ITruck = (p) => <SIco {...p}><path d="M14 17V5a1 1 0 0 0-1-1H2.5a1 1 0 0 0-1 1v12h12.5"/><path d="M14 9h4l3.5 3.5V17H18"/><circle cx="6" cy="18" r="2"/><circle cx="17" cy="18" r="2"/></SIco>;
const IShield = (p) => <SIco {...p}><path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/><path d="m9 12 2 2 4-4"/></SIco>;
const ILeaf = (p) => <SIco {...p}><path d="M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10z"/><path d="M2 21c0-3 1.85-5.36 5.08-6"/></SIco>;
const ISparkle = (p) => <SIco {...p}><path d="M12 3v4M12 17v4M3 12h4M17 12h4M6.3 6.3l2.4 2.4M15.3 15.3l2.4 2.4M17.7 6.3l-2.4 2.4M8.7 15.3l-2.4 2.4"/></SIco>;
const IHeart = (p) => <SIco {...p}><path d="M19 14c1.5-1.5 3-3.3 3-5.5A4.5 4.5 0 0 0 12 5 4.5 4.5 0 0 0 2 8.5c0 2.2 1.5 4 3 5.5l7 7z"/></SIco>;
const IRefresh = (p) => <SIco {...p}><path d="M3 12a9 9 0 0 1 15-6.7L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-15 6.7L3 16"/><path d="M3 21v-5h5"/></SIco>;
const ICheck = (p) => <SIco {...p}><path d="M20 6 9 17l-5-5"/></SIco>;

/* ---- Catalog ---- */
const CATEGORIES = ['All', 'Espresso', 'Stand Mixers', 'Frozen Dessert', 'Juicers'];

const PRODUCTS = [
  { id: 'aria', name: 'Aria Espresso Coffee Machine', cat: 'Espresso', price: 499, was: 579,
    img: '../assets/products/p-coffee.jpg', rating: 4.9, reviews: 218, tag: 'Bestseller',
    blurb: 'Freshly ground, one-touch espresso for the whole family.', colors: ['#2b2b2b', '#c9ccce'] },
  { id: 'fresh', name: 'Multi-Functional Juicer', cat: 'Juicers', price: 189, was: 219,
    img: '../assets/products/p-juicer.jpg', rating: 4.8, reviews: 164, tag: 'New',
    blurb: 'Cold-press power for juice, smoothies and soups.', colors: ['#2b2b2b', '#022318'] },
  { id: 'frost', name: 'Frozen Dessert Maker', cat: 'Frozen Dessert', price: 159,
    img: '../assets/products/p-frozen.jpg', rating: 4.7, reviews: 96,
    blurb: 'Creamy ice cream, gelato and sorbet in minutes.', colors: ['#2b2b2b'] },
  { id: 'deluxe', name: 'Stand Mixer Deluxe', cat: 'Stand Mixers', price: 299, was: 349,
    img: '../assets/products/p-standmixer.jpg', rating: 4.9, reviews: 312, tag: 'Bestseller',
    blurb: '6.5L tilt-head mixer with planetary action.', colors: ['#f3f4f3', '#022318'] },
  { id: 'hand', name: 'Hand Mixer Pro', cat: 'Stand Mixers', price: 79,
    img: '../assets/products/p-handmixer.jpg', rating: 4.6, reviews: 88,
    blurb: 'Lightweight 5-speed mixing, anywhere you need it.', colors: ['#f3f4f3'] },
  { id: 'grind', name: 'Meat Grinder Pro', cat: 'Stand Mixers', price: 129,
    img: '../assets/products/p-grinder.jpg', rating: 4.7, reviews: 74,
    blurb: 'Powerful grinding with stainless steel plates.', colors: ['#f3f4f3', '#2b2b2b'] },
];

const money = (n) => '$' + n.toFixed(0);

Object.assign(window, {
  SIco, ISearch, IUser, ICart, IArrow, IStar, IClose, IPlus, IMinus,
  ITruck, IShield, ILeaf, ISparkle, IHeart, IRefresh, ICheck,
  CATEGORIES, PRODUCTS, money,
});
