// mb-data.jsx — mock data for Morar Bem (Aracaju / Barra dos Coqueiros / Zona de Expansão)

const REGIONS = ["Aracaju", "Barra dos Coqueiros", "Zona de Expansão"];

// Segments are phrased as questions (configurable in the real system)
const SEGMENTS = [
  { id: "comer",  q: "Onde comer bem?",        icon: "food",   cats: ["Restaurantes", "Hamburgueria", "Açaí", "Pizzaria", "Padaria", "Cafeteria", "Frutos do mar"] },
  { id: "morar",  q: "Onde morar bem?",        icon: "home",   cats: ["Imobiliárias", "Materiais", "Móveis", "Decoração", "Reformas"] },
  { id: "saude",  q: "Onde cuidar da saúde?",  icon: "health", cats: ["Farmácias", "Clínicas", "Academias", "Laboratórios"] },
  { id: "beleza", q: "Onde se cuidar?",        icon: "beauty", cats: ["Salões", "Barbearia", "Estética", "Manicure"] },
  { id: "lazer",  q: "Onde se divertir?",      icon: "fun",    cats: ["Bares", "Passeios", "Praia", "Eventos"] },
  { id: "pet",    q: "Onde cuidar do pet?",    icon: "pet",    cats: ["Pet shops", "Veterinária", "Banho & tosa"] },
];

const segLabel = (id) => (SEGMENTS.find(s => s.id === id) || {}).q || "";

// Partners. x/y are positions on the stylized map (0–100 %).
const PARTNERS = [
  {
    id: "mare", name: "Maré Burger", seg: "comer", cat: "Hamburgueria",
    region: "Aracaju", area: "Orla de Atalaia", rating: 4.9, reviews: 1240,
    cashback: 8, turbo: 5, dist: 1.2, fee: 6.99, free: 49, time: "30–40 min",
    delivery: true, pickup: true, price: "$$", open: true,
    tags: ["Artesanal", "Mais pedidos"], color: "#E8552D",
    x: 64, y: 41, blurb: "Hambúrgueres artesanais na brasa, do jeito da orla.",
  },
  {
    id: "acai", name: "Açaí Tropical", seg: "comer", cat: "Açaí",
    region: "Aracaju", area: "Coroa do Meio", rating: 4.8, reviews: 870,
    cashback: 10, turbo: 0, dist: 2.1, fee: 4.99, free: 35, time: "20–30 min",
    delivery: true, pickup: true, price: "$", open: true,
    tags: ["Vegano", "Energia"], color: "#7A3FB0",
    x: 58, y: 55, blurb: "Açaí cremoso com complementos da casa.",
  },
  {
    id: "caranguejo", name: "Cantinho do Caranguejo", seg: "comer", cat: "Frutos do mar",
    region: "Aracaju", area: "Mercado Thales Ferraz", rating: 4.7, reviews: 2030,
    cashback: 6, turbo: 4, dist: 3.4, fee: 9.99, free: 80, time: "45–60 min",
    delivery: true, pickup: true, price: "$$$", open: true,
    tags: ["Tradicional"], color: "#0E7C86",
    x: 47, y: 33, blurb: "O caranguejo mais famoso de Sergipe.",
  },
  {
    id: "pao", name: "Padaria Pão & Cia", seg: "comer", cat: "Padaria",
    region: "Aracaju", area: "Grageru", rating: 4.6, reviews: 540,
    cashback: 5, turbo: 0, dist: 0.8, fee: 3.99, free: 30, time: "15–25 min",
    delivery: true, pickup: true, price: "$", open: true,
    tags: ["Fresquinho"], color: "#C98A1B",
    x: 52, y: 47, blurb: "Pães quentinhos e bolos caseiros.",
  },
  {
    id: "sabor", name: "Sabor da Barra", seg: "comer", cat: "Restaurantes",
    region: "Barra dos Coqueiros", area: "Centro da Barra", rating: 4.8, reviews: 410,
    cashback: 7, turbo: 6, dist: 5.6, fee: 8.99, free: 60, time: "40–55 min",
    delivery: true, pickup: true, price: "$$", open: true,
    tags: ["Turbo"], color: "#1E7D4F",
    x: 73, y: 18, blurb: "Comida caseira com vista pra travessia.",
  },
  {
    id: "vida", name: "Farmácia Vida", seg: "saude", cat: "Farmácias",
    region: "Aracaju", area: "Jardins", rating: 4.7, reviews: 980,
    cashback: 4, turbo: 0, dist: 1.0, fee: 5.99, free: 50, time: "25–35 min",
    delivery: true, pickup: true, price: "$$", open: true,
    tags: ["24h"], color: "#1E63C8",
    x: 41, y: 52, blurb: "Medicamentos e cuidado com entrega rápida.",
  },
  {
    id: "bela", name: "Studio Bela", seg: "beleza", cat: "Salões",
    region: "Aracaju", area: "Treze de Julho", rating: 4.9, reviews: 320,
    cashback: 12, turbo: 8, dist: 1.7, fee: 0, free: 0, time: "Agendar",
    delivery: false, pickup: true, price: "$$$", open: true,
    tags: ["Turbo", "Agendamento"], color: "#C2367E",
    x: 55, y: 38, blurb: "Beleza e autocuidado com hora marcada.",
  },
  {
    id: "pet", name: "Pet Mania", seg: "pet", cat: "Pet shops",
    region: "Zona de Expansão", area: "Aruana", rating: 4.6, reviews: 260,
    cashback: 9, turbo: 0, dist: 7.2, fee: 7.99, free: 70, time: "35–50 min",
    delivery: true, pickup: true, price: "$$", open: false,
    tags: ["Delivery"], color: "#0E8F6E",
    x: 70, y: 72, blurb: "Tudo pro seu pet, da ração ao banho.",
  },
  {
    id: "casa", name: "Casa & Construção SE", seg: "morar", cat: "Materiais",
    region: "Zona de Expansão", area: "Mosqueiro", rating: 4.5, reviews: 190,
    cashback: 3, turbo: 5, dist: 9.1, fee: 0, free: 0, time: "Retirada",
    delivery: false, pickup: true, price: "$$", open: true,
    tags: ["Turbo"], color: "#8A6A3B",
    x: 60, y: 84, blurb: "Materiais de construção e acabamento.",
  },
  {
    id: "academia", name: "Onda Fit Academia", seg: "saude", cat: "Academias",
    region: "Aracaju", area: "Atalaia", rating: 4.8, reviews: 450,
    cashback: 15, turbo: 0, dist: 1.4, fee: 0, free: 0, time: "Plano",
    delivery: false, pickup: true, price: "$$", open: true,
    tags: ["Mensalidade"], color: "#0E7C86",
    x: 67, y: 47, blurb: "Treine de frente pro mar.",
  },
];

const partnerById = (id) => PARTNERS.find(p => p.id === id);

// ── Menus ────────────────────────────────────────────────────
// Rich menu for the focus store; lighter templates for others.
const MENUS = {
  mare: [
    { title: "Mais pedidos", items: [
      { id: "m1", name: "Maré Clássico", desc: "Pão brioche, blend 160g, cheddar, alface, tomate e maionese da casa", price: 28.9, tag: "Top", img: "burger" },
      { id: "m2", name: "Duplo Bacon", desc: "2 blends 160g, bacon crocante, cheddar duplo e cebola caramelizada", price: 38.9, tag: "Top", img: "burger" },
    ]},
    { title: "Burgers", items: [
      { id: "m3", name: "Maré Salada", desc: "Blend 160g, mix de folhas, picles e molho especial", price: 31.9, img: "burger" },
      { id: "m4", name: "Costela BBQ", desc: "Costela desfiada, queijo prato e barbecue artesanal", price: 36.9, img: "burger" },
      { id: "m5", name: "Veggie da Maré", desc: "Burger de grão-de-bico, rúcula e maionese vegana", price: 29.9, img: "burger" },
    ]},
    { title: "Acompanhamentos", items: [
      { id: "m6", name: "Batata rústica", desc: "Porção com alecrim e parmesão", price: 18.9, img: "fries" },
      { id: "m7", name: "Onion rings", desc: "8 anéis empanados crocantes", price: 19.9, img: "fries" },
    ]},
    { title: "Bebidas", items: [
      { id: "m8", name: "Refrigerante lata", desc: "350ml", price: 6.5, img: "drink" },
      { id: "m9", name: "Suco natural", desc: "Laranja, maracujá ou caju", price: 9.9, img: "drink" },
    ]},
  ],
};

const genericMenu = (p) => ([
  { title: "Destaques", items: [
    { id: p.id + "a", name: "Combo da casa", desc: "O mais pedido por aqui, pronto pra você.", price: 34.9, tag: "Top", img: "box" },
    { id: p.id + "b", name: "Opção individual", desc: "Porção individual feita na hora.", price: 22.9, img: "box" },
  ]},
  { title: "Cardápio", items: [
    { id: p.id + "c", name: "Item popular", desc: "Escolha favorita da clientela.", price: 18.9, img: "box" },
    { id: p.id + "d", name: "Item premium", desc: "Versão especial com adicionais.", price: 27.9, img: "box" },
    { id: p.id + "e", name: "Bebida", desc: "Para acompanhar.", price: 7.9, img: "drink" },
  ]},
]);

const menuFor = (id) => MENUS[id] || genericMenu(partnerById(id) || {});

// User's past orders
const ORDERS = [
  { id: "o1", partner: "mare", status: "Avaliar", date: "10 jun", total: 54.8, cashback: 4.38, turbo: 2.74, items: ["Maré Clássico", "Batata rústica"], mode: "Entrega", rated: false },
  { id: "o2", partner: "acai", status: "Entregue", date: "06 jun", total: 32.0, cashback: 3.20, turbo: 0, items: ["Açaí 500ml", "Granola"], mode: "Retirada", rated: true, stars: 5 },
  { id: "o3", partner: "caranguejo", status: "Entregue", date: "28 mai", total: 98.5, cashback: 5.91, turbo: 3.94, items: ["Caranguejo (dúzia)", "Pirão"], mode: "Entrega", rated: true, stars: 4 },
];

const WALLET = {
  balance: 42.17,
  pending: 9.86,
  movements: [
    { id: "w1", kind: "in", turbo: true, label: "Cashback Turbo · Maré Burger", date: "10 jun", value: 2.74 },
    { id: "w2", kind: "in", turbo: false, label: "Cashback · Maré Burger", date: "10 jun", value: 4.38 },
    { id: "w3", kind: "out", turbo: false, label: "Usado em Açaí Tropical", date: "06 jun", value: -8.00 },
    { id: "w4", kind: "in", turbo: false, label: "Cashback · Açaí Tropical", date: "06 jun", value: 3.20 },
    { id: "w5", kind: "in", turbo: true, label: "Cashback Turbo · Cantinho do Caranguejo", date: "28 mai", value: 3.94 },
    { id: "w6", kind: "in", turbo: false, label: "Cashback · Cantinho do Caranguejo", date: "28 mai", value: 5.91 },
  ],
};

const USER = { name: "Camila Andrade", first: "Camila", region: "Aracaju", since: "2024", email: "camila.andrade@email.com", phone: "(79) 9 9999-0000", cpf: "123.456.789-00", birth: "14/03/1992" };

Object.assign(window, {
  REGIONS, SEGMENTS, PARTNERS, MENUS, ORDERS, WALLET, USER,
  segLabel, partnerById, menuFor,
});
