// Menu data + product under customization

const MENU = [
  { id: 'margherita', name: 'Pizza Margherita',  desc: 'Tomato, mozzarella, basil',           price: 9.50,  emoji: '🍕' },
  { id: 'diavola',    name: 'Pizza Diavola',     desc: 'Spicy salami, mozzarella, chili oil', price: 12.00, emoji: '🌶️' },
  { id: 'quattro',    name: 'Quattro Formaggi',  desc: 'Mozzarella, gorgonzola, fontina, parmesan', price: 13.50, emoji: '🧀' },
  { id: 'prosciutto', name: 'Prosciutto & Funghi', desc: 'Ham, mushrooms, mozzarella',        price: 12.50, emoji: '🍄' },
  { id: 'tiramisu',   name: 'Tiramisù',          desc: 'House-made, classic recipe',           price: 6.50,  emoji: '🍰' },
  { id: 'coke',       name: 'Coca-Cola',         desc: '330ml can',                            price: 3.00,  emoji: '🥤' },
];

// Full product spec for Diavola — our drawer target
const DIAVOLA = {
  id: 'diavola',
  name: 'Pizza Diavola',
  desc: 'Spicy salami, mozzarella, chili oil, San Marzano tomato',
  price: 12.00,
  emoji: '🌶️',

  // ---- Quick Options -----------------------------------------------------
  // Fast preferences / add-ons. Some allow multiple, some carry a cost.
  quickOptions: [
    { id: 'well-done',     label: 'Well done',         price: 0,    multi: false },
    { id: 'light-bake',    label: 'Light bake',        price: 0,    multi: false },
    { id: 'cut-8',         label: 'Cut in 8 slices',   price: 0,    multi: false },
    { id: 'extra-cheese',  label: 'Extra cheese',      price: 1.50, multi: true  },
    { id: 'extra-salami',  label: 'Extra salami',      price: 2.00, multi: true  },
    { id: 'gluten-free',   label: 'Gluten-free base',  price: 3.00, multi: false },
  ],

  // ---- Extras with sub-options -----------------------------------------
  // Can add multiple. Each has a flavor/variant to pick.
  extras: [
    {
      id: 'dip',
      label: 'Dipping sauce',
      price: 0.80,
      multi: true,
      subLabel: 'Choose a sauce',
      subOptions: [
        { id: 'garlic',   label: 'Garlic',          price: 0 },
        { id: 'bbq',      label: 'BBQ',             price: 0 },
        { id: 'ranch',    label: 'Ranch',           price: 0 },
        { id: 'truffle',  label: 'Truffle mayo',    price: 0.50 },
        { id: 'spicy',    label: 'Spicy arrabbiata', price: 0 },
      ],
    },
    {
      id: 'cheese-edge',
      label: 'Stuffed crust',
      price: 2.50,
      multi: false,
      subLabel: 'Choose a filling',
      subOptions: [
        { id: 'mozz',     label: 'Mozzarella',      price: 0 },
        { id: 'gorg',     label: 'Gorgonzola',      price: 0.50 },
        { id: 'nduja',    label: "'Nduja",          price: 1.00 },
      ],
    },
    {
      id: 'oil',
      label: 'Drizzle of oil',
      price: 0.50,
      multi: true,
      subLabel: 'Choose an oil',
      subOptions: [
        { id: 'evoo',     label: 'Extra virgin',    price: 0 },
        { id: 'chili',    label: 'Chili-infused',   price: 0 },
        { id: 'truffle',  label: 'Truffle',         price: 1.20 },
        { id: 'basil',    label: 'Basil',           price: 0.30 },
      ],
    },
  ],

  // ---- Ingredients (removable only) ------------------------------------
  ingredients: [
    { id: 'salami',    label: 'Spicy salami' },
    { id: 'mozz',      label: 'Mozzarella' },
    { id: 'tomato',    label: 'Tomato sauce' },
    { id: 'chili',     label: 'Chili oil' },
    { id: 'basil',     label: 'Basil leaves' },
    { id: 'oregano',   label: 'Oregano' },
  ],

  // ---- Preferences with sub-options ------------------------------------
  preferences: [
    {
      id: 'size',
      label: 'Size',
      required: true,
      subOptions: [
        { id: 'small',   label: 'Small (26cm)',  price: -2.00, default: false },
        { id: 'medium',  label: 'Medium (32cm)', price: 0,     default: true },
        { id: 'large',   label: 'Large (40cm)',  price: 4.00,  default: false },
      ],
    },
    {
      id: 'crust',
      label: 'Crust style',
      required: false,
      subOptions: [
        { id: 'classic', label: 'Classic',       price: 0,     default: true },
        { id: 'thin',    label: 'Thin & crispy', price: 0,     default: false },
        { id: 'sourdough', label: 'Sourdough',   price: 1.50,  default: false },
      ],
    },
    {
      id: 'spice',
      label: 'Spice level',
      required: false,
      subOptions: [
        { id: 'mild',    label: 'Mild',     price: 0, default: false },
        { id: 'medium',  label: 'Medium',   price: 0, default: true },
        { id: 'hot',     label: 'Hot',      price: 0, default: false },
        { id: 'xxx',     label: 'Extra hot', price: 0, default: false },
      ],
    },
  ],
};

window.MENU = MENU;
window.DIAVOLA = DIAVOLA;
