// Eu Faço Parte — Catálogo da loja solidária
// Compartilhado entre o site institucional (eufacoparte.com) e a loja (loja.eufacoparte.org).
// Campos `name` e `cat` são objetos { pt, en, it, de } resolvidos via window.L().

window.LOJA_CAT_DECO = { pt: 'Decoração',     en: 'Decoration',        it: 'Decorazione',     de: 'Dekoration' };
window.LOJA_CAT_MODA = { pt: 'Moda Circular', en: 'Circular Fashion',  it: 'Moda Circolare',  de: 'Kreislaufmode' };
window.LOJA_CAT_ACES = { pt: 'Acessório',     en: 'Accessory',         it: 'Accessorio',      de: 'Accessoire' };
window.LOJA_CAT_CALC = { pt: 'Calçado',       en: 'Footwear',          it: 'Calzature',       de: 'Schuhe' };

const _CD = window.LOJA_CAT_DECO;
const _CM = window.LOJA_CAT_MODA;
const _CA = window.LOJA_CAT_ACES;
const _CC = window.LOJA_CAT_CALC;

window.LOJA_ALL = [
  // Decoração natalina
  { name: { pt: '3 Bolas natalinas douradas',          en: '3 Golden Christmas baubles',         it: '3 Palline di Natale dorate',       de: '3 Goldene Weihnachtskugeln' },         price: 'CHF 107',  oldPrice: null,      cat: _CD, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-125-35-min-433x516.jpg' },
  { name: { pt: 'Anjinho decorativo natalino',         en: 'Decorative Christmas angel',         it: 'Angioletto natalizio decorativo',  de: 'Dekorativer Weihnachtsengel' },       price: 'CHF 54',   oldPrice: null,      cat: _CD, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-153-Edit-43-min-433x516.jpg' },
  { name: { pt: 'Bolas decorativas de natal – Luxo',   en: 'Luxury Christmas baubles',           it: 'Palline decorative di Natale – Lusso', de: 'Luxus-Weihnachtskugeln' },         price: 'CHF 129',  oldPrice: null,      cat: _CD, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/produto_natal_01_bolas-433x516.png' },
  { name: { pt: 'Bolas natalinas exclusivas',          en: 'Exclusive Christmas baubles',        it: 'Palline di Natale esclusive',      de: 'Exklusive Weihnachtskugeln' },         price: 'CHF 214',  oldPrice: null,      cat: _CD, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-146-Edit-41-min-433x516.jpg' },
  { name: { pt: 'Botas decorativas natal azul',        en: 'Blue decorative Christmas boots',    it: 'Stivaletti decorativi blu di Natale', de: 'Blaue Weihnachtsstiefel-Deko' },     price: 'CHF 54',   oldPrice: null,      cat: _CD, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-139-39-min-433x516.jpg' },
  { name: { pt: 'Conjunto 3 bolas natalinas',          en: 'Set of 3 Christmas baubles',         it: 'Set 3 palline di Natale',          de: 'Set mit 3 Weihnachtskugeln' },         price: 'CHF 107',  oldPrice: null,      cat: _CD, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-131-38-min-433x516.jpg' },
  { name: { pt: 'Conjunto 6 bolas natalinas história', en: 'Set of 6 Christmas story baubles',   it: 'Set 6 palline storia di Natale',   de: '6er-Set Weihnachtsgeschichte-Kugeln' }, price: 'CHF 161',  oldPrice: 'CHF 214', cat: _CD, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-128-37-min-433x516.jpg' },
  { name: { pt: 'Conjunto dourado natalino exclusivo', en: 'Exclusive golden Christmas set',     it: 'Set dorato natalizio esclusivo',   de: 'Exklusives goldenes Weihnachtsset' }, price: 'CHF 214',  oldPrice: null,      cat: _CD, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-123-Edit-34-min-433x516.jpg' },
  { name: { pt: 'Conjunto exclusivo natal dourado',    en: 'Exclusive Christmas golden set',     it: 'Set esclusivo Natale dorato',      de: 'Exklusives Weihnachtsset in Gold' },  price: 'CHF 75',   oldPrice: 'CHF 107', cat: _CD, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-125-35-min-433x516.jpg' },
  { name: { pt: 'Conjunto natalino premium',           en: 'Premium Christmas set',              it: 'Set natalizio premium',            de: 'Premium-Weihnachtsset' },             price: 'CHF 321',  oldPrice: null,      cat: _CD, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-144-40-min-433x516.jpg' },
  { name: { pt: 'Conjunto premium natal histórias',    en: 'Premium Christmas stories set',      it: 'Set premium storie di Natale',     de: 'Premium-Set Weihnachtsgeschichten' }, price: 'CHF 321',  oldPrice: null,      cat: _CD, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-118-Edit-33-min-433x516.jpg' },
  { name: { pt: 'Decoração premium rainha',            en: 'Premium queen decoration',           it: 'Decorazione premium regina',       de: 'Premium-Königin-Dekoration' },         price: 'CHF 171',  oldPrice: 'CHF 214', cat: _CD, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-127-36-min-433x516.jpg' },
  { name: { pt: 'Enfeite natalino anjinho',            en: 'Christmas angel ornament',           it: 'Decorazione natalizia angioletto', de: 'Weihnachts-Engelanhänger' },          price: null,        oldPrice: null,      cat: _CD, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-159-Edit-45-min-433x516.jpg' },

  // Moda Circular
  { name: { pt: 'Blazer couro legítimo',               en: 'Genuine leather blazer',             it: 'Blazer in vera pelle',             de: 'Blazer aus Echtleder' },               price: 'CHF 482',  oldPrice: 'CHF 535', cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-221-Edit-64-433x516.jpg' },
  { name: { pt: 'Blazer elegante Modeco',              en: 'Elegant Modeco blazer',              it: 'Blazer elegante Modeco',           de: 'Eleganter Modeco-Blazer' },           price: 'CHF 535',  oldPrice: null,      cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-254-Edit-73-433x516.jpg' },
  { name: { pt: 'Blazer marrom xadrez interno',        en: 'Brown blazer with check lining',     it: 'Blazer marrone fodera scozzese',   de: 'Brauner Blazer mit Karofutter' },     price: 'CHF 535',  oldPrice: null,      cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-247-Edit-70-433x516.jpg' },
  { name: { pt: 'Blazer preto',                        en: 'Black blazer',                       it: 'Blazer nero',                      de: 'Schwarzer Blazer' },                  price: 'CHF 535',  oldPrice: null,      cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-261-Edit-75-433x516.jpg' },
  { name: { pt: 'Blazer único de marca elegante',      en: 'Unique elegant branded blazer',      it: 'Blazer di marca esclusivo',        de: 'Einzigartiger Designer-Blazer' },     price: 'CHF 1.605',oldPrice: null,      cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-231-Edit-66-433x516.jpg' },
  { name: { pt: 'Calça preta elegante MODECO',         en: 'Elegant black MODECO trousers',      it: 'Pantaloni neri eleganti MODECO',   de: 'Elegante schwarze MODECO-Hose' },     price: 'CHF 535',  oldPrice: null,      cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-253-Edit-72-433x516.jpg' },
  { name: { pt: 'Casaco de Marca M',                   en: 'Branded coat M',                     it: 'Cappotto di marca M',              de: 'Marken-Mantel M' },                   price: 'CHF 129',  oldPrice: null,      cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/produto_casaco_01-433x516.png' },
  { name: { pt: 'Casaco de Marca M Textura',           en: 'Textured branded coat M',            it: 'Cappotto di marca M con texture',  de: 'Marken-Mantel M mit Struktur' },      price: 'CHF 96',   oldPrice: null,      cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/produto_casaco_02-433x516.png' },
  { name: { pt: 'Casaco marrom elegante',              en: 'Elegant brown coat',                 it: 'Cappotto marrone elegante',        de: 'Eleganter brauner Mantel' },          price: 'CHF 535',  oldPrice: null,      cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-250-Edit-71-433x516.jpg' },
  { name: { pt: 'Saia conjunto',                       en: 'Skirt set',                          it: 'Completo gonna',                   de: 'Rock-Set' },                          price: 'CHF 166',  oldPrice: 'CHF 209', cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/produto_saia_02-433x516.png' },
  { name: { pt: 'Saia preta elegante',                 en: 'Elegant black skirt',                it: 'Gonna nera elegante',              de: 'Eleganter schwarzer Rock' },          price: 'CHF 535',  oldPrice: null,      cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-256-Edit-74-433x516.jpg' },
  { name: { pt: 'Sobretudo elegante',                  en: 'Elegant overcoat',                   it: 'Soprabito elegante',               de: 'Eleganter Mantel' },                  price: 'CHF 482',  oldPrice: 'CHF 535', cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-244-Edit-69-433x516.jpg' },
  { name: { pt: 'Sobretudo marrom',                    en: 'Brown overcoat',                     it: 'Soprabito marrone',                de: 'Brauner Mantel' },                    price: 'CHF 482',  oldPrice: 'CHF 535', cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-242-Edit-68-433x516.jpg' },
  { name: { pt: 'Sobretudo marrom c/ manga bordada',   en: 'Brown overcoat with embroidered sleeve', it: 'Soprabito marrone con manica ricamata', de: 'Brauner Mantel mit besticktem Ärmel' }, price: 'CHF 482', oldPrice: 'CHF 535', cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-239-Edit-67-433x516.jpg' },
  { name: { pt: 'Sobretudo modelo chinês',             en: 'Chinese-style overcoat',             it: 'Soprabito modello cinese',         de: 'Mantel im chinesischen Stil' },       price: 'CHF 1.605',oldPrice: null,      cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-228-Edit-65-433x516.jpg' },
  { name: { pt: 'Stripe Sweater',                      en: 'Stripe sweater',                     it: 'Maglione a righe',                 de: 'Streifen-Pullover' },                 price: 'CHF 214',  oldPrice: null,      cat: _CM, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/1-33-433x516.jpg' },

  // Acessórios
  { name: { pt: 'Bolsa em couro legítimo',             en: 'Genuine leather bag',                it: 'Borsa in vera pelle',              de: 'Tasche aus Echtleder' },              price: 'CHF 642',  oldPrice: null,      cat: _CA, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-064-Edit-18-min-433x516.jpg' },
  { name: { pt: 'Chapéu beje LOEVENICH',               en: 'Beige LOEVENICH hat',                it: 'Cappello beige LOEVENICH',         de: 'Beiger LOEVENICH-Hut' },              price: 'CHF 321',  oldPrice: null,      cat: _CA, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-071-Edit-20-min-433x516.jpg' },
  { name: { pt: 'Chapéu de cor natural',               en: 'Natural-colour hat',                 it: 'Cappello color naturale',          de: 'Hut in Naturfarbe' },                 price: 'CHF 54',   oldPrice: 'CHF 75',  cat: _CA, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/produto_chapeu_01-433x516.png' },
  { name: { pt: 'Chapéu de Marca',                     en: 'Branded hat',                        it: 'Cappello di marca',                de: 'Marken-Hut' },                        price: 'CHF 155',  oldPrice: null,      cat: _CA, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/produto_chapeu_02-433x516.png' },
  { name: { pt: 'Chapéu Golfino',                      en: 'Golfino hat',                        it: 'Cappello Golfino',                 de: 'Golfino-Hut' },                       price: 'CHF 321',  oldPrice: null,      cat: _CA, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-033-Edit-8-min-433x516.jpg' },
  { name: { pt: 'Chapéu lembert com laço',             en: 'Lembert hat with bow',               it: 'Cappello Lembert con fiocco',      de: 'Lembert-Hut mit Schleife' },          price: 'CHF 321',  oldPrice: null,      cat: _CA, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-100-Edit-28-min-433x516.jpg' },
  { name: { pt: 'Chapeu Luielle',                      en: 'Luielle hat',                        it: 'Cappello Luielle',                 de: 'Luielle-Hut' },                       price: 'CHF 428',  oldPrice: null,      cat: _CA, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-039-Edit-10-min-433x516.jpg' },
  { name: { pt: 'Chapeu Montegallo',                   en: 'Montegallo hat',                     it: 'Cappello Montegallo',              de: 'Montegallo-Hut' },                    price: 'CHF 428',  oldPrice: null,      cat: _CA, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-044-Edit-2-12-min-433x516.jpg' },
  { name: { pt: 'Chapeu Montegallo premium',           en: 'Premium Montegallo hat',             it: 'Cappello Montegallo premium',      de: 'Premium Montegallo-Hut' },            price: null,        oldPrice: null,      cat: _CA, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-031-Edit-6-min-433x516.jpg' },
  { name: { pt: 'Chapéu natural premium',              en: 'Premium natural hat',                it: 'Cappello naturale premium',        de: 'Premium-Hut in Naturfarbe' },         price: 'CHF 257',  oldPrice: null,      cat: _CA, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-021-Edit-3-min-433x516.jpg' },
  { name: { pt: 'Chapéu preto LOEVENICH',              en: 'Black LOEVENICH hat',                it: 'Cappello nero LOEVENICH',          de: 'Schwarzer LOEVENICH-Hut' },           price: 'CHF 268',  oldPrice: null,      cat: _CA, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-086-Edit-23-min-433x516.jpg' },
  { name: { pt: 'Chapéu preto Seeberger',              en: 'Black Seeberger hat',                it: 'Cappello nero Seeberger',          de: 'Schwarzer Seeberger-Hut' },           price: 'CHF 428',  oldPrice: null,      cat: _CA, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-023-Edit-4-min-433x516.jpg' },
  { name: { pt: 'Chapéu tradicional de marca',         en: 'Traditional branded hat',            it: 'Cappello tradizionale di marca',   de: 'Traditioneller Marken-Hut' },         price: 'CHF 535',  oldPrice: null,      cat: _CA, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-054-Edit-16-min-433x516.jpg' },
  { name: { pt: 'Chapéu verde LOEVENICH',              en: 'Green LOEVENICH hat',                it: 'Cappello verde LOEVENICH',         de: 'Grüner LOEVENICH-Hut' },              price: 'CHF 321',  oldPrice: null,      cat: _CA, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-094-Edit-26-min-433x516.jpg' },

  // Calçados
  { name: { pt: 'Sandália Gucci',                      en: 'Gucci sandals',                      it: 'Sandali Gucci',                    de: 'Gucci-Sandalen' },                    price: 'CHF 1.605',oldPrice: null,      cat: _CC, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-218-Edit-58-433x516.jpg' },
  { name: { pt: 'Sapato branco em couro',              en: 'White leather shoe',                 it: 'Scarpa bianca in pelle',           de: 'Weißer Lederschuh' },                 price: null,        oldPrice: null,      cat: _CC, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-193-Edit-53-433x516.jpg' },
  { name: { pt: 'Sapato branco c/ detalhes',           en: 'White shoe with details',            it: 'Scarpa bianca con dettagli',       de: 'Weißer Schuh mit Details' },          price: 'CHF 696',  oldPrice: 'CHF 1.070',cat: _CC, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-189-Edit-52-433x516.jpg' },
  { name: { pt: 'Sapato casual de marca preto',        en: 'Black branded casual shoe',          it: 'Scarpa casual di marca nera',      de: 'Schwarzer Marken-Freizeitschuh' },    price: 'CHF 535',  oldPrice: 'CHF 696', cat: _CC, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-177-Edit-49-433x516.jpg' },
  { name: { pt: 'Sapato casual de marca branco',       en: 'White branded casual shoe',          it: 'Scarpa casual di marca bianca',    de: 'Weißer Marken-Freizeitschuh' },       price: null,        oldPrice: null,      cat: _CC, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-167-Edit-47-433x516.jpg' },
  { name: { pt: 'Sapato com detalhes xadrez',          en: 'Shoe with check details',            it: 'Scarpa con dettagli scozzesi',     de: 'Schuh mit Karo-Details' },            price: null,        oldPrice: null,      cat: _CC, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-213-Edit-57-433x516.jpg' },
  { name: { pt: 'Sapato elegante c/ detalhes em couro',en: 'Elegant shoe with leather details',  it: 'Scarpa elegante con dettagli in pelle', de: 'Eleganter Schuh mit Lederdetails' }, price: 'CHF 482', oldPrice: 'CHF 535', cat: _CC, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-205-Edit-56-433x516.jpg' },
  { name: { pt: 'Sapato elegante único feito a mão',   en: 'Unique handmade elegant shoe',       it: 'Scarpa elegante unica fatta a mano', de: 'Einzigartiger handgefertigter eleganter Schuh' }, price: 'CHF 963', oldPrice: 'CHF 1.070', cat: _CC, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-201-Edit-55-433x516.jpg' },
  { name: { pt: 'Sapato Gucci',                        en: 'Gucci shoe',                         it: 'Scarpa Gucci',                     de: 'Gucci-Schuh' },                       price: 'CHF 450',  oldPrice: null,      cat: _CC, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/produto_sapato_03-433x516.png' },
  { name: { pt: 'Sapato para golf elegante',           en: 'Elegant golf shoe',                  it: 'Scarpa elegante da golf',          de: 'Eleganter Golfschuh' },               price: 'CHF 749',  oldPrice: 'CHF 1.070',cat: _CC, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-185-Edit-51-433x516.jpg' },
  { name: { pt: 'Sapato preto e marrom legítimo',      en: 'Genuine black and brown shoe',       it: 'Scarpa nera e marrone vera',       de: 'Echter schwarz-brauner Schuh' },      price: 'CHF 535',  oldPrice: null,      cat: _CC, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-197-Edit-54-433x516.jpg' },
  { name: { pt: 'Sapato em couro',                     en: 'Leather shoe',                       it: 'Scarpa in pelle',                  de: 'Lederschuh' },                        price: 'CHF 535',  oldPrice: null,      cat: _CC, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-201-Edit-55-433x516.jpg' },
  { name: { pt: 'Sapato preto em couro',               en: 'Black leather shoe',                 it: 'Scarpa nera in pelle',             de: 'Schwarzer Lederschuh' },              price: 'CHF 589',  oldPrice: 'CHF 642', cat: _CC, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/FacoParte-184-Edit-50-433x516.jpg' },
  { name: { pt: 'Tênis Rosa',                          en: 'Pink sneakers',                      it: 'Sneakers rosa',                    de: 'Rosa Sneaker' },                      price: 'CHF 236',  oldPrice: 'CHF 289', cat: _CC, img: 'https://loja.eufacoparte.org/wp-content/uploads/2016/07/produto_tennis_01-433x516.png' },
];

// Helper de moeda: converte "CHF 535" → "R$ 3.210" (taxa fixa 1 CHF ≈ 6 BRL)
// Persistência via localStorage: window.lojaCurrency()
window.LOJA_RATE_CHF_TO_BRL = 6.0;

window.lojaCurrency = function () {
  return localStorage.getItem('loja-currency') || 'BRL';
};

window.setLojaCurrency = function (c) {
  localStorage.setItem('loja-currency', c);
};

window.formatPrice = function (chfStr) {
  if (!chfStr) return null;
  const cur = window.lojaCurrency();
  if (cur === 'CHF') return chfStr;
  // chfStr ex.: "CHF 1.605" (BR-style) → numero 1605
  const num = parseFloat(chfStr.replace(/[^\d,.-]/g, '').replace(/\./g, '').replace(',', '.'));
  if (isNaN(num)) return chfStr;
  const brl = num * window.LOJA_RATE_CHF_TO_BRL;
  // formato BRL com ponto de milhar
  const intPart = Math.round(brl).toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
  return 'R$ ' + intPart;
};
