// Avokado Bar — Redesign data SCHEMA REFERENCE (NOT live source).
// Real ITEMS/CATEGORIES/MOD_GROUPS/REWARDS/TABLES come from Firestore at runtime.
// This file is kept only so MenuFlow/Combos/etc. resolve symbols when no live data
// is connected yet, and as a shape reference for the Firestore docs.
// Namespaced under window.AvbX to avoid colliding with the legacy customer.js globals.
(function(){
const LANG_DEFAULT = 'tr';

const CATEGORIES = [
  { id: 'cat_snacks',         tr: 'Atıştırmalıklar',     en: 'Snacks' },
  { id: 'cat_eggs',           tr: 'Yumurtalar & Fazlası', en: 'Eggs & More' },
  { id: 'cat_tartines',       tr: 'Tartinler',           en: 'Tartines' },
  { id: 'cat_bowls',          tr: 'Tüm Gün Kaseleri',    en: 'All Day Bowls' },
  { id: 'cat_desserts',       tr: 'Tatlılar',            en: 'Desserts' },
  { id: 'cat_smoothies',      tr: 'Smoothies',           en: 'Smoothies' },
  { id: 'cat_smoothie_bowls', tr: 'Smoothie Bowls',      en: 'Smoothie Bowls' },
  { id: 'cat_coffee',         tr: 'Kahveler',            en: 'Coffees' },
  { id: 'cat_cold_drinks',    tr: 'Soğuk İçecekler',     en: 'Cold Drinks' },
  { id: 'cat_hot_drinks',     tr: 'Sıcak İçecekler',     en: 'Hot Drinks' },
];

// allergen labels
const ALLERGENS = {
  gluten:  { tr: 'Gluten',   en: 'Gluten' },
  milk:    { tr: 'Süt',      en: 'Milk' },
  egg:     { tr: 'Yumurta',  en: 'Egg' },
  fish:    { tr: 'Balık',    en: 'Fish' },
  sesame:  { tr: 'Susam',    en: 'Sesame' },
  peanut:  { tr: 'Fıstık',   en: 'Peanut' },
  soy:     { tr: 'Soya',     en: 'Soy' },
  mustard: { tr: 'Hardal',   en: 'Mustard' },
};

// Short descriptions (written to match the real dishes; bilingual)
const ITEMS = [
  // ── Snacks ──
  { id:'item_pumpkin_soup', cat:'cat_snacks', price:320, photo:'p3748', tone:'yolk', allergens:['gluten','milk'], badges:['pop'],
    tr:{ n:'Balkabağı Çorbası', d:'Kremalı balkabağı · kavrulmuş çekirdek · zeytinyağı' },
    en:{ n:'Pumpkin Soup', d:'Creamy pumpkin · roasted seeds · olive oil' } },
  { id:'item_guacamole', cat:'cat_snacks', price:390, photo:null, tone:'green', allergens:['sesame'], badges:['veg'],
    tr:{ n:'Guacamole + Tohum Krakerleri', d:'Taze guacamole · ev yapımı tohum krakerleri' },
    en:{ n:'Guacamole + Seed Crackers', d:'Fresh guacamole · house seed crackers' } },
  { id:'item_hummus_crackers', cat:'cat_snacks', price:390, photo:null, tone:'cream', allergens:['sesame'], badges:['veg'],
    tr:{ n:'Humus + Tohum Krakerleri', d:'Kremalı humus · tahin · ev yapımı krakerler' },
    en:{ n:'Hummus + Seed Crackers', d:'Creamy hummus · tahini · house crackers' } },
  { id:'item_sweet_potato', cat:'cat_snacks', price:350, photo:null, tone:'tomato', allergens:['sesame'], badges:['veg','gf'],
    tr:{ n:'Fırınlanmış Tatlı Patates', d:'Fırın tatlı patates · tahin sos · susam' },
    en:{ n:'Roasted Sweet Potato', d:'Roasted sweet potato · tahini · sesame' } },
  { id:'item_rice_rolls', cat:'cat_snacks', price:460, photo:'p3485', tone:'green', allergens:['peanut','soy'], badges:['veg','new'],
    tr:{ n:'Rice Paper Rolls', d:'Pirinç kağıdı · taze sebze · fıstık sos' },
    en:{ n:'Rice Paper Rolls', d:'Rice paper · fresh veg · peanut sauce' } },

  // ── Eggs & More ──
  { id:'item_late_breakfast', cat:'cat_eggs', price:640, photo:'p3362', tone:'yolk', allergens:['egg','gluten','milk','sesame'], badges:['pop'],
    tr:{ n:'Geç Kahvaltı Tabağı', d:'Yumurta · avokado · peynir · zeytin · ekmek · reçel' },
    en:{ n:'Late Breakfast Plate', d:'Eggs · avocado · cheese · olives · bread · jam' } },
  { id:'item_herb_eggs', cat:'cat_eggs', price:560, photo:'p3675', tone:'cream', allergens:['egg','gluten','milk'], badges:[],
    tr:{ n:'Otlu Yumurta', d:'Taze otlu çırpılmış yumurta · ekşi maya ekmek' },
    en:{ n:'Herb Eggs', d:'Herbed scrambled eggs · sourdough' } },
  { id:'item_sausage_plate', cat:'cat_eggs', price:810, photo:null, tone:'smoke', allergens:['egg','gluten','mustard'], badges:['hp'],
    tr:{ n:'Sosis Tabağı', d:'Izgara sosis · yumurta · patates · hardal' },
    en:{ n:'Sausage Plate', d:'Grilled sausage · eggs · potato · mustard' } },

  // ── Tartines ──
  { id:'item_avocado_egg', cat:'cat_tartines', price:650, photo:'p3688', tone:'green', allergens:['egg'], badges:['pop','gf'],
    tr:{ n:'Avokado & Yumurta', d:'Ezilmiş avokado · kaçak yumurta · lahana · nar · dukkah' },
    en:{ n:'Avocado & Egg', d:'Smashed avocado · poached egg · kale · pomegranate · dukkah' } },
  { id:'item_hummus_truffle', cat:'cat_tartines', price:680, photo:null, tone:'cream', allergens:['gluten','milk','sesame'], badges:[],
    tr:{ n:'Humus Trüf & Mantar', d:'Humus · trüf yağı · sote mantar · arugula' },
    en:{ n:'Hummus Truffle & Mushroom', d:'Hummus · truffle oil · sautéed mushroom · arugula' } },
  { id:'item_salmon_gravlax', cat:'cat_tartines', price:840, photo:'p3643', tone:'smoke', allergens:['fish','gluten','milk'], badges:['hp','pop'],
    tr:{ n:'Somon Gravlax', d:'Ev yapımı gravlax somon · labne · dereotu · kapari' },
    en:{ n:'Salmon Gravlax', d:'House-cured salmon · labneh · dill · capers' } },
  { id:'item_beef_nuar', cat:'cat_tartines', price:780, photo:null, tone:'smoke', allergens:['egg','gluten','milk','mustard'], badges:['hp'],
    tr:{ n:'Dana Nuar', d:'Dilimlenmiş dana nuar · hardal mayo · turşu · roka' },
    en:{ n:'Beef Nuar', d:'Sliced beef · mustard mayo · pickles · rocket' } },
  { id:'item_avocado_mushroom', cat:'cat_tartines', price:670, photo:'p3273', tone:'green', allergens:['gluten','milk'], badges:['veg'],
    tr:{ n:'Avokado & Mantar', d:'Ezilmiş avokado · sote mantar · keçi peyniri · fındık' },
    en:{ n:'Avocado & Mushroom', d:'Smashed avocado · sautéed mushroom · goat cheese · hazelnut' } },

  // ── Bowls ──
  { id:'item_harvest_bowl', cat:'cat_bowls', price:720, photo:'p3341', tone:'tomato', allergens:['peanut'], badges:['pop','veg','gf'],
    tr:{ n:'Hasat Kasesi', d:'Kinoa · tatlı patates · pancar · lahana · tahin · fıstık' },
    en:{ n:'Harvest Bowl', d:'Quinoa · sweet potato · beet · kale · tahini · peanut' } },
  { id:'item_quinoa_bowl', cat:'cat_bowls', price:780, photo:null, tone:'yolk', allergens:['milk','sesame'], badges:['hp'],
    tr:{ n:'Kinoa Köfte Kasesi', d:'Kinoa köfte · yoğurt · nar · taze ot · tahin' },
    en:{ n:'Quinoa Kofta Bowl', d:'Quinoa kofta · yogurt · pomegranate · herbs · tahini' } },
  { id:'item_hummus_kale', cat:'cat_bowls', price:690, photo:null, tone:'green', allergens:['sesame'], badges:['veg','gf'],
    tr:{ n:'Humus & Kale Salatası', d:'Massaj kale · humus · kinoa · avokado · tohum' },
    en:{ n:'Hummus & Kale Salad', d:'Massaged kale · hummus · quinoa · avocado · seeds' } },
  { id:'item_salmon_bowl', cat:'cat_bowls', price:995, photo:'p3252', tone:'smoke', allergens:['fish','sesame'], badges:['hp','gf'],
    tr:{ n:'Fırın Somon Kasesi', d:'Fırın somon · kinoa · avokado · edamame · susam' },
    en:{ n:'Baked Salmon Bowl', d:'Baked salmon · quinoa · avocado · edamame · sesame' } },

  // ── Desserts ──
  { id:'item_banana_bread', cat:'cat_desserts', price:340, photo:'p3920', tone:'oat', allergens:['gluten','sesame'], badges:['pop'],
    tr:{ n:'Banana Bread', d:'Ev yapımı muzlu kek · badem · orman meyvesi' },
    en:{ n:'Banana Bread', d:'House banana bread · almond · forest berries' } },
  { id:'item_peanut_bar', cat:'cat_desserts', price:390, photo:'p3968', tone:'smoke', allergens:['peanut'], badges:['new'],
    tr:{ n:'Fıstık Ezmeli Karamel Bar', d:'Fıstık ezmesi · karamel · çikolata · deniz tuzu' },
    en:{ n:'Peanut Caramel Bar', d:'Peanut butter · caramel · chocolate · sea salt' } },
  { id:'item_berry_crumble', cat:'cat_desserts', price:390, photo:null, tone:'berry', allergens:['gluten','milk'], badges:[],
    tr:{ n:'Orman Meyveli Crumble', d:'Sıcak orman meyvesi · yulaf crumble · vanilya' },
    en:{ n:'Berry Crumble', d:'Warm forest berries · oat crumble · vanilla' } },

  // ── Smoothies ──
  { id:'item_noir_boost', cat:'cat_smoothies', price:430, photo:null, tone:'smoke', allergens:['milk'], badges:[],
    tr:{ n:'Noir Boost', d:'Kakao · muz · hurma · fıstık ezmesi · badem sütü' },
    en:{ n:'Noir Boost', d:'Cacao · banana · date · peanut butter · almond milk' } },
  { id:'item_berry_revival', cat:'cat_smoothies', price:420, photo:null, tone:'berry', allergens:['milk','peanut'], badges:['pop'],
    tr:{ n:'Berry Revival', d:'Karışık orman meyvesi · muz · yoğurt · bal' },
    en:{ n:'Berry Revival', d:'Mixed berries · banana · yogurt · honey' } },
  { id:'item_green_reset', cat:'cat_smoothies', price:420, photo:null, tone:'green', allergens:['milk'], badges:['veg'],
    tr:{ n:'Green Reset', d:'Ispanak · avokado · ananas · zencefil · hindistan cevizi' },
    en:{ n:'Green Reset', d:'Spinach · avocado · pineapple · ginger · coconut' } },

  // ── Smoothie Bowls ──
  { id:'item_acai_bowl', cat:'cat_smoothie_bowls', price:690, photo:null, tone:'berry', allergens:['gluten','milk','peanut'], badges:['pop'],
    tr:{ n:'Açaí Berry Smoothie Bowl', d:'Açaí · muz · granola · taze meyve · chia' },
    en:{ n:'Acai Berry Smoothie Bowl', d:'Açaí · banana · granola · fresh fruit · chia' } },
  { id:'item_green_reset_bowl', cat:'cat_smoothie_bowls', price:600, photo:null, tone:'green', allergens:['gluten','milk','peanut'], badges:['veg'],
    tr:{ n:'Green Reset Smoothie Bowl', d:'Yeşil smoothie tabanı · granola · meyve · tohum' },
    en:{ n:'Green Reset Smoothie Bowl', d:'Green smoothie base · granola · fruit · seeds' } },

  // ── Coffees ──
  { id:'item_double_espresso', cat:'cat_coffee', price:190, photo:null, tone:'smoke', allergens:[], badges:[],
    tr:{ n:'Double Espresso', d:'Çift shot · tek kaynak çekirdek' },
    en:{ n:'Double Espresso', d:'Double shot · single origin' } },
  { id:'item_turkish_coffee', cat:'cat_coffee', price:200, photo:null, tone:'smoke', allergens:[], badges:[],
    tr:{ n:'Türk Kahvesi', d:'Geleneksel · közde' },
    en:{ n:'Turkish Coffee', d:'Traditional · on embers' } },
  { id:'item_double_turkish', cat:'cat_coffee', price:275, photo:null, tone:'smoke', allergens:[], badges:[],
    tr:{ n:'Double Türk Kahvesi', d:'Çift Türk kahvesi' },
    en:{ n:'Double Turkish Coffee', d:'Double Turkish coffee' } },
  { id:'item_americano', cat:'cat_coffee', price:225, photo:null, tone:'smoke', allergens:[], badges:[],
    tr:{ n:'Americano', d:'Espresso · sıcak su' },
    en:{ n:'Americano', d:'Espresso · hot water' } },
  { id:'item_latte', cat:'cat_coffee', price:250, photo:'p4041', tone:'oat', allergens:['milk'], badges:['pop'], hasMods:true,
    tr:{ n:'Latte', d:'Espresso · buharla ısıtılmış süt · ince köpük' },
    en:{ n:'Latte', d:'Espresso · steamed milk · fine foam' } },
  { id:'item_cappuccino', cat:'cat_coffee', price:250, photo:'p4051', tone:'oat', allergens:['milk'], badges:[],
    tr:{ n:'Cappuccino', d:'Espresso · süt · bol köpük' },
    en:{ n:'Cappuccino', d:'Espresso · milk · rich foam' } },
  { id:'item_flatwhite', cat:'cat_coffee', price:250, photo:null, tone:'oat', allergens:['milk'], badges:[],
    tr:{ n:'Flat White', d:'Çift ristretto · mikro köpük' },
    en:{ n:'Flat White', d:'Double ristretto · micro-foam' } },
  { id:'item_cortado', cat:'cat_coffee', price:250, photo:null, tone:'oat', allergens:['milk'], badges:[],
    tr:{ n:'Cortado', d:'Espresso · az süt' },
    en:{ n:'Cortado', d:'Espresso · a little milk' } },
  { id:'item_salted_caramel_latte', cat:'cat_coffee', price:325, photo:null, tone:'oat', allergens:['milk'], badges:['new'],
    tr:{ n:'Salted Caramel Latte', d:'Espresso · süt · tuzlu karamel' },
    en:{ n:'Salted Caramel Latte', d:'Espresso · milk · salted caramel' } },
  { id:'item_mocha', cat:'cat_coffee', price:325, photo:null, tone:'smoke', allergens:['milk'], badges:[],
    tr:{ n:'Mocha', d:'Espresso · çikolata · süt' },
    en:{ n:'Mocha', d:'Espresso · chocolate · milk' } },
  { id:'item_iced_americano', cat:'cat_coffee', price:225, photo:null, tone:'smoke', allergens:[], badges:[],
    tr:{ n:'Iced Americano', d:'Espresso · su · buz' },
    en:{ n:'Ice Americano', d:'Espresso · water · ice' } },
  { id:'item_iced_latte', cat:'cat_coffee', price:250, photo:null, tone:'oat', allergens:['milk'], badges:[],
    tr:{ n:'Iced Latte', d:'Espresso · soğuk süt · buz' },
    en:{ n:'Ice Latte', d:'Espresso · cold milk · ice' } },
  { id:'item_iced_scl', cat:'cat_coffee', price:325, photo:null, tone:'oat', allergens:['milk'], badges:[],
    tr:{ n:'Iced Salted Caramel Latte', d:'Soğuk · tuzlu karamel' },
    en:{ n:'Iced Salted Caramel Latte', d:'Iced · salted caramel' } },
  { id:'item_iced_cappuccino', cat:'cat_coffee', price:250, photo:null, tone:'oat', allergens:['milk'], badges:[],
    tr:{ n:'Iced Cappuccino', d:'Soğuk cappuccino · buz' },
    en:{ n:'Ice Cappuccino', d:'Iced cappuccino · ice' } },
  { id:'item_iced_mocha', cat:'cat_coffee', price:325, photo:null, tone:'smoke', allergens:['milk'], badges:[],
    tr:{ n:'Iced Mocha', d:'Soğuk · çikolata · buz' },
    en:{ n:'Iced Mocha', d:'Iced · chocolate · ice' } },

  // ── Cold Drinks ──
  { id:'item_water', cat:'cat_cold_drinks', price:75, photo:null, tone:'cream', allergens:[], badges:[],
    tr:{ n:'Su', d:'330 ml' }, en:{ n:'Water', d:'330 ml' } },
  { id:'item_soda', cat:'cat_cold_drinks', price:125, photo:null, tone:'cream', allergens:[], badges:[],
    tr:{ n:'Soda', d:'Sade veya meyveli' }, en:{ n:'Soda', d:'Plain or fruit' } },
  { id:'item_churchill', cat:'cat_cold_drinks', price:175, photo:null, tone:'tomato', allergens:[], badges:[],
    tr:{ n:'Churchill', d:'Soda · limon · zencefil' }, en:{ n:'Churchill', d:'Soda · lemon · ginger' } },
  { id:'item_lemonade', cat:'cat_cold_drinks', price:250, photo:null, tone:'green', allergens:[], badges:['pop'],
    tr:{ n:'Reyhanlı Limonata', d:'Taze limon · reyhan · az şeker' },
    en:{ n:'Basil Lemonade', d:'Fresh lemon · basil · low sugar' } },
  { id:'item_pink_tea', cat:'cat_cold_drinks', price:250, photo:null, tone:'berry', allergens:[], badges:[],
    tr:{ n:'Pink Lemongrass Soğuk Çay', d:'Limon otu · kırmızı meyve · buz' },
    en:{ n:'Pink Lemongrass Iced Tea', d:'Lemongrass · red fruit · ice' } },
  { id:'item_satsuma_tea', cat:'cat_cold_drinks', price:250, photo:null, tone:'yolk', allergens:[], badges:[],
    tr:{ n:'Satsuma Ananaslı Soğuk Çay', d:'Mandalina · ananas · buz' },
    en:{ n:'Satsuma Pineapple Iced Tea', d:'Satsuma · pineapple · ice' } },
  { id:'item_ice_matcha_latte', cat:'cat_cold_drinks', price:250, photo:null, tone:'green', allergens:['milk'], badges:['new'],
    tr:{ n:'Ice Matcha Latte', d:'Tören matcha · soğuk süt · buz' },
    en:{ n:'Ice Matcha Latte', d:'Ceremonial matcha · cold milk · ice' } },

  // ── Hot Drinks ──
  { id:'item_black_tea', cat:'cat_hot_drinks', price:190, photo:null, tone:'smoke', allergens:[], badges:[],
    tr:{ n:'Bergamotlu Siyah Çay', d:'Demleme · bergamot' }, en:{ n:'Bergamot Black Tea', d:'Brewed · bergamot' } },
  { id:'item_melez_green', cat:'cat_hot_drinks', price:225, photo:null, tone:'green', allergens:[], badges:[],
    tr:{ n:'MELEZ Green Tea', d:'Yeşil çay harmanı' }, en:{ n:'MELEZ Green Tea', d:'Green tea blend' } },
  { id:'item_melez_winter', cat:'cat_hot_drinks', price:225, photo:null, tone:'tomato', allergens:[], badges:[],
    tr:{ n:'MELEZ Kış Çayı', d:'Baharatlı kış harmanı' }, en:{ n:'MELEZ Winter Tea', d:'Spiced winter blend' } },
  { id:'item_matcha_latte', cat:'cat_hot_drinks', price:250, photo:null, tone:'green', allergens:['milk'], badges:['new'],
    tr:{ n:'Matcha Latte', d:'Tören matcha · buharla ısıtılmış süt' },
    en:{ n:'Matcha Latte', d:'Ceremonial matcha · steamed milk' } },
  { id:'item_hot_chocolate', cat:'cat_hot_drinks', price:250, photo:null, tone:'smoke', allergens:['milk'], badges:[],
    tr:{ n:'Sıcak Çikolata', d:'Bitter çikolata · süt' }, en:{ n:'Hot Chocolate', d:'Dark chocolate · milk' } },
];

// ── Combos / "Menü Oluştur" (REAL preset combos from CustomerApp) ──
// items: menuItem id'leri. tag: rozet. mood: build-your-menu filtresi.
const COMBOS = [
  { id:'cmb_light',   items:['item_guacamole','item_hummus_crackers','item_americano'], price:780,  tag:'pop',  mood:'light',
    tr:{ n:'Hafif Atıştırmalık Set', d:'İki atıştırmalık + Americano' }, en:{ n:'Light Snack Set', d:'Two snacks + Americano' } },
  { id:'cmb_avotoast',items:['item_avocado_egg','item_latte'], price:850, tag:null, mood:'light',
    tr:{ n:'Avokado Tost Menü', d:'Avokado açık tost + Latte' }, en:{ n:'Avocado Toast Set', d:'Avocado open toast + Latte' } },
  { id:'cmb_soup',    items:['item_pumpkin_soup','item_lemonade'], price:540, tag:null, mood:'light',
    tr:{ n:'Çorba & İçecek', d:'Balkabağı çorbası + Limonata' }, en:{ n:'Soup & Drink', d:'Pumpkin soup + Lemonade' } },
  { id:'cmb_harvest', items:['item_harvest_bowl','item_americano'], price:880, tag:'top', mood:'full',
    tr:{ n:'Hasat Kasesi Menü', d:'İmza bowl + Americano' }, en:{ n:'Harvest Bowl Set', d:'Signature bowl + Americano' } },
  { id:'cmb_quinoa',  items:['item_quinoa_bowl','item_lemonade'], price:940, tag:null, mood:'healthy',
    tr:{ n:'Quinoa Protein', d:'Quinoa bowl + Reyhanlı limonata' }, en:{ n:'Quinoa Protein Set', d:'Quinoa bowl + Basil lemonade' } },
  { id:'cmb_salmon',  items:['item_salmon_bowl','item_iced_latte'], price:1180, tag:'premium', mood:'healthy',
    tr:{ n:'Premium Somon', d:'Fırın somon kasesi + Iced Latte' }, en:{ n:'Premium Salmon', d:'Baked salmon bowl + Iced Latte' } },
  { id:'cmb_coffee',  items:['item_banana_bread','item_latte'], price:560, tag:null, mood:'sweet',
    tr:{ n:'Kahve & Tatlı Duo', d:'Muz ekmeği + Latte' }, en:{ n:'Coffee & Sweet Duo', d:'Banana bread + Latte' } },
  { id:'cmb_acai',    items:['item_acai_bowl','item_flatwhite'], price:920, tag:null, mood:'sweet',
    tr:{ n:'Açaí & Kahve', d:'Açaí smoothie bowl + Flat White' }, en:{ n:'Acai & Coffee', d:'Acai bowl + Flat White' } },
  { id:'cmb_green',   items:['item_green_reset_bowl','item_melez_green'], price:780, tag:'healthy', mood:'healthy',
    tr:{ n:'Green Reset', d:'Green reset kasesi + MELEZ Yeşil Çay' }, en:{ n:'Green Reset', d:'Green reset bowl + MELEZ Green Tea' } },
  { id:'cmb_acaijoy', items:['item_acai_bowl','item_lemonade'], price:790, tag:null, mood:'sweet',
    tr:{ n:'Smoothie Bowl Keyfi', d:'Açaí bowl + Limonata' }, en:{ n:'Smoothie Bowl Joy', d:'Acai bowl + Lemonade' } },
];
const COMBO_TAGS = {
  pop:{ tr:'Popüler', en:'Popular' }, top:{ tr:'En Çok Seçilen', en:'Most Picked' },
  premium:{ tr:'Premium', en:'Premium' }, healthy:{ tr:'En Sağlıklı', en:'Healthiest' },
};
const MOODS = [
  { id:'light',   tr:{ n:'Hafif bir şeyler', d:'Atıştırmalık, tost' }, en:{ n:'Light bites', d:'Snacks, toast' } },
  { id:'full',    tr:{ n:'Güzel doymak', d:'Kaseler, dolu öğün' },     en:{ n:'Fill me up', d:'Bowls, full meals' } },
  { id:'sweet',   tr:{ n:'Tatlı + Kahve', d:'Tatlı & kahveler' },      en:{ n:'Sweet + Coffee', d:'Sweets & coffees' } },
  { id:'healthy', tr:{ n:'Sağlıklı öğün', d:'Düşük kalori, protein' }, en:{ n:'Healthy meal', d:'Low cal, protein' } },
];

// Prepaid top-up packages (load amount + bonus). Faithful-feeling defaults.
const TOPUP_PACKAGES = [
  { amount:250,  bonus:0 },
  { amount:500,  bonus:50 },
  { amount:1000, bonus:150 },
  { amount:2000, bonus:400 },
];

// Rewards (real, from rewards.js) — points cost ladder
const REWARDS = [
  { id:'rw_dessert',    cost:30,  tr:'Tatlı',                     en:'Dessert',                 photo:'p3920', tone:'oat' },
  { id:'rw_snack',      cost:50,  tr:'Atıştırmalık',              en:'Snack',                   photo:'p3748', tone:'yolk' },
  { id:'rw_bowl_toast', cost:70,  tr:'Smoothie Bowl / Açık Tost', en:'Smoothie Bowl / Toast',   photo:'p3688', tone:'green' },
  { id:'rw_bowl',       cost:90,  tr:'Tüm Gün Kasesi',            en:'All Day Bowl',            photo:'p3341', tone:'tomato' },
  { id:'rw_salmon',     cost:120, tr:'Fırın Somon Kasesi',        en:'Baked Salmon Bowl',       photo:'p3252', tone:'smoke' },
];

// Points rates by order type (real, from pointsRates.js)
const POINTS_RATES = { takeaway: 0.015, dine_in: 0.010, delivery: 0.007 };

// Tables (real, from tables.js) — indoor (ic) + outdoor (dis)
const TABLES = [
  { id:'ic1', area:'ic', cap:2 }, { id:'ic2', area:'ic', cap:2 }, { id:'ic3', area:'ic', cap:2 }, { id:'ic4', area:'ic', cap:2 },
  { id:'ic5', area:'ic', cap:1 }, { id:'ic6', area:'ic', cap:1 }, { id:'ic7', area:'ic', cap:1 }, { id:'ic8', area:'ic', cap:1 },
  { id:'dis1', area:'dis', cap:2 }, { id:'dis2', area:'dis', cap:2 }, { id:'dis3', area:'dis', cap:2 }, { id:'dis4', area:'dis', cap:2 },
  { id:'dis5', area:'dis', cap:2 }, { id:'dis6', area:'dis', cap:2 }, { id:'dis7', area:'dis', cap:2 }, { id:'dis8', area:'dis', cap:2 },
];

// Brand / venue photos for landing, home, about
const VENUE = {
  storefront: 'p3073', window: 'p3179', interior: 'p4124',
  logoSign: 'p3298', napkin: 'p3930', chef: 'p3410',
  openSign: 'p3661', lifestyle: 'p3611', soupHero: 'p3827',
};

// Badge labels
const BADGES = {
  pop: { tr:'Popüler', en:'Popular' },
  new: { tr:'Yeni', en:'New' },
  veg: { tr:'Vegan', en:'Vegan' },
  gf:  { tr:'Glutensiz', en:'Gluten-free' },
  hp:  { tr:'Yüksek protein', en:'High-protein' },
};

// food-toned gradient fallbacks for items without a photo
const TILE_TONES = {
  green:  { a:'#E9F2B8', b:'#C8DC2E' },
  cream:  { a:'#F2EAD5', b:'#E0D4B0' },
  yolk:   { a:'#F5E2A8', b:'#DCB870' },
  smoke:  { a:'#D9D4C2', b:'#938B72' },
  berry:  { a:'#E8C7D0', b:'#B06478' },
  tomato: { a:'#F0C8B0', b:'#C97A5A' },
  oat:    { a:'#F0E6CC', b:'#C9A86B' },
};

// ── Modifiers & Extras (REAL, from legacy/shared.js _DEFAULT_GLOBAL_EXTRAS + modifiers.js) ──
const MOD_GROUPS = {
  milk: {
    id:'mg_milk', tr:'Süt Seçimi', en:'Milk Option', type:'single', required:false,
    options:[
      { id:'mo_regular_milk', tr:'Normal Süt', en:'Regular Milk', delta:0 },
      { id:'mo_oat_milk',     tr:'Yulaf Sütü', en:'Oat Milk',     delta:70 },
      { id:'mo_almond_milk',  tr:'Badem Sütü', en:'Almond Milk',  delta:70 },
    ],
  },
  toppings: {
    id:'mg_extra_toppings', tr:'Ekstra Topping', en:'Extra Toppings', type:'multiple', required:false,
    options:[
      { id:'mo_egg',       tr:'Tek Göz Yumurta',        en:'Fried Egg',       delta:60 },
      { id:'mo_salmon',    tr:'Somon',                  en:'Salmon',          delta:190 },
      { id:'mo_avocado',   tr:'Avokado',                en:'Avocado',         delta:110 },
      { id:'mo_tulum',     tr:'Rende Tulum Peynir',     en:'Tulum Cheese',    delta:80 },
      { id:'mo_nuar',      tr:'Dana Nuar Jambon',       en:'Beef Nuar',       delta:180 },
      { id:'mo_mushroom',  tr:'Mantar',                 en:'Mushroom',        delta:70 },
      { id:'mo_scrambled', tr:'Çift Çırpılmış Yumurta', en:'Scrambled Eggs',  delta:120 },
      { id:'mo_kasar',     tr:'İki Dilim Eski Kaşar',   en:'Aged Kashar',     delta:80 },
      { id:'mo_sausage',   tr:'Dana Sosis',             en:'Beef Sausage',    delta:190 },
    ],
  },
};

// Which items expose which modifier groups (REAL defaults).
const ITEM_MODS = {
  item_latte:           ['milk'],
  item_avocado_egg:     ['toppings'],
  item_late_breakfast:  ['toppings'],
};

function getItemMods(item) {
  if (!item) return [];
  return (ITEM_MODS[item.id] || []).map(k => MOD_GROUPS[k]).filter(Boolean);
}
// returns flat option lookup
function findModOption(optId) {
  for (const g of Object.values(MOD_GROUPS)) {
    const o = g.options.find(x => x.id === optId);
    if (o) return o;
  }
  return null;
}

Object.assign(window.AvbX = window.AvbX || {}, {
  CATEGORIES, ALLERGENS, ITEMS, MOD_GROUPS, ITEM_MODS, getItemMods, findModOption,
  REWARDS, POINTS_RATES, TABLES, VENUE, BADGES, TILE_TONES, LANG_DEFAULT, TOPUP_PACKAGES,
  COMBOS, COMBO_TAGS, MOODS,
});
})();
