/* OAIRSIS Lifestyle Store — catalog, icons, theme. Exported to window.
   Palette override (per brief): deep green + beige (米色). Light green/cyan
   only as small accents. No large light-color blocks. */

/* ---- Icons (Lucide, outline 1.8px round) ---- */
const LIco = ({ size = 22, sw = 1.8, 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 LSearch = (p) => <LIco {...p}><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></LIco>;
const LUser = (p) => <LIco {...p}><circle cx="12" cy="8" r="4"/><path d="M5.5 21a7.5 7.5 0 0 1 13 0"/></LIco>;
const LCart = (p) => <LIco {...p}><circle cx="9" cy="21" r="1.4"/><circle cx="18" cy="21" r="1.4"/><path d="M2.5 3h2l2.3 12.4a2 2 0 0 0 2 1.6h8.7a2 2 0 0 0 2-1.6L21 7H6"/></LIco>;
const LArrow = (p) => <LIco {...p}><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></LIco>;
const LArrowUR = (p) => <LIco {...p}><path d="M7 17 17 7M7 7h10v10"/></LIco>;
const LStar = (p) => <LIco {...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"/></LIco>;
const LClose = (p) => <LIco {...p}><path d="M18 6 6 18M6 6l12 12"/></LIco>;
const LPlus = (p) => <LIco {...p}><path d="M12 5v14M5 12h14"/></LIco>;
const LMinus = (p) => <LIco {...p}><path d="M5 12h14"/></LIco>;
const LMenu = (p) => <LIco {...p}><path d="M3 6h18M3 12h18M3 18h18"/></LIco>;
const LTruck = (p) => <LIco {...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"/></LIco>;
const LShield = (p) => <LIco {...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"/></LIco>;
const LLeaf = (p) => <LIco {...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"/></LIco>;
const LSparkle = (p) => <LIco {...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"/></LIco>;
const LHeart = (p) => <LIco {...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"/></LIco>;
const LRefresh = (p) => <LIco {...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"/></LIco>;
const LCheck = (p) => <LIco {...p}><path d="M20 6 9 17l-5-5"/></LIco>;

/* ---- Catalog ---- */
const LCATEGORIES = ['All', 'Espresso', 'Juicers', 'Frozen Dessert', 'Mixers'];
const LPRODUCTS = [
  { id: 'aria', name: 'Aria Espresso Machine', cat: 'Espresso', price: 499, was: 579,
    img: '../assets/products/p-coffee.jpg', rating: 4.9, reviews: 218, tag: 'Bestseller',
    blurb: 'One-touch barista coffee, freshly ground.' },
  { 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 juice, smoothies and soups.' },
  { id: 'frost', name: 'Frozen Dessert Maker', cat: 'Frozen Dessert', price: 159,
    img: '../assets/products/p-frozen.jpg', rating: 4.7, reviews: 96,
    blurb: 'Creamy gelato and sorbet in minutes.' },
  { id: 'deluxe', name: 'Stand Mixer Deluxe', cat: 'Mixers', price: 299, was: 349,
    img: '../assets/products/p-standmixer.jpg', rating: 4.9, reviews: 312, tag: 'Bestseller',
    blurb: '6.5L tilt-head planetary mixing.' },
  { id: 'hand', name: 'Hand Mixer Pro', cat: 'Mixers', price: 79,
    img: '../assets/products/p-handmixer.jpg', rating: 4.6, reviews: 88,
    blurb: 'Lightweight 5-speed everyday mixing.' },
  { id: 'grind', name: 'Meat Grinder Pro', cat: 'Mixers', price: 129,
    img: '../assets/products/p-grinder.jpg', rating: 4.7, reviews: 74,
    blurb: 'Stainless steel grinding, built to last.' },
];
const lmoney = (n) => '$' + n.toFixed(0);

Object.assign(window, {
  LIco, LSearch, LUser, LCart, LArrow, LArrowUR, LStar, LClose, LPlus, LMinus, LMenu,
  LTruck, LShield, LLeaf, LSparkle, LHeart, LRefresh, LCheck,
  LCATEGORIES, LPRODUCTS, lmoney,
});
