package com.brisco.meatwholesaler;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonArrayRequest;
import com.android.volley.toolbox.Volley;
import com.google.android.material.snackbar.Snackbar;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

public class CategoryActivity extends AppCompatActivity {

    private RecyclerView recyclerView;
    private ProductAdapter productAdapter;
    private List<Product> productList;
    private ProgressBar progressBar;
    private TextView textViewEmpty;
    private RequestQueue requestQueue;
    private String categoryId;
    private String categoryName;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        // Check demo status first
        DemoManager demoManager = new DemoManager(this);
        if (demoManager.isDemoExpired()) {
            // Redirect to demo expired screen
            Intent intent = new Intent(this, DemoExpiredActivity.class);
            startActivity(intent);
            finish();
            return;
        }
        
        setContentView(R.layout.activity_category);

        // Get category info from intent
        categoryId = getIntent().getStringExtra("CATEGORY_ID");
        categoryName = getIntent().getStringExtra("CATEGORY_NAME");

        // Setup toolbar
        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        if (getSupportActionBar() != null) {
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
            getSupportActionBar().setTitle(categoryName);
        }

        // Initialize views
        recyclerView = findViewById(R.id.recycler_products);
        progressBar = findViewById(R.id.progress_bar);
        textViewEmpty = findViewById(R.id.text_empty);

        // Setup RecyclerView
        recyclerView.setLayoutManager(new GridLayoutManager(this, 2));
        recyclerView.setHasFixedSize(true);

        // Initialize data
        productList = new ArrayList<>();
        productAdapter = new ProductAdapter(this, productList, product -> {
            Intent intent = new Intent(CategoryActivity.this, ProductDetailActivity.class);
            intent.putExtra("PRODUCT_ID", product.getId());
            intent.putExtra("PRODUCT_NAME", product.getName());
            intent.putExtra("PRODUCT_PRICE", product.getPrice());
            intent.putExtra("PRODUCT_DESCRIPTION", product.getDescription());
            intent.putExtra("PRODUCT_IMAGE", product.getImageUrl());
            startActivity(intent);
        });

        recyclerView.setAdapter(productAdapter);

        // Initialize Volley
        requestQueue = Volley.newRequestQueue(this);

        // Load products
        loadProducts();
    }

    private void loadProducts() {
        progressBar.setVisibility(View.VISIBLE);
        textViewEmpty.setVisibility(View.GONE);

        // For demo purposes, we'll load mock data
        // In production, this would be an API call to brisco.bizvino.co.za
        loadMockProducts();
    }

    private void loadMockProducts() {
        // Mock products based on category
        List<Product> mockProducts = new ArrayList<>();
        
        switch (categoryId) {
            case "bulk_hampers":
                mockProducts = getMockHampers();
                break;
            case "master_wors":
                mockProducts = getMockMasterWorsProducts();
                break;
            case "beef":
                mockProducts = getMockBeefProducts();
                break;
            case "chicken":
                mockProducts = getMockChickenProducts();
                break;
            case "pork":
                mockProducts = getMockPorkProducts();
                break;
            case "lamb":
                mockProducts = getMockLambProducts();
                break;
            case "ostrich":
                mockProducts = getMockOstrichProducts();
                break;
            case "specials":
                mockProducts = getMockSpecialProducts();
                break;
            case "pies":
                mockProducts = getMockPieProducts();
                break;
            case "health_fitness":
                mockProducts = getMockFitnessProducts();
                break;
            case "restaurant":
                mockProducts = getMockRestaurantProducts();
                break;
            default:
                mockProducts = getMockDefaultProducts();
                break;
        }

        productList.clear();
        productList.addAll(mockProducts);
        productAdapter.notifyDataSetChanged();
        
        progressBar.setVisibility(View.GONE);
        
        if (productList.isEmpty()) {
            textViewEmpty.setVisibility(View.VISIBLE);
        }
    }

    private List<Product> getMockHampers() {
        List<Product> hampers = new ArrayList<>();
        hampers.add(new Product("jade_hamper", "JADE HAMPER", 2999.99, "23 KG Premium Quality Meat - 52% Beef | 9% Lamb | 17% Pork | 22% Chicken", "jade_hamper"));
        hampers.add(new Product("gold_hamper", "EVERYDAY Bulk Hamper (Gold)", 1799.99, "Premium Quality Meat - R100 p/kg", "gold_hamper"));
        hampers.add(new Product("silver_hamper", "EVERYDAY Bulk Hamper (Silver)", 1549.99, "Premium Quality Meat - R103 p/kg", "silver_hamper"));
        hampers.add(new Product("bronze_hamper", "EVERYDAY Bulk Hamper (Bronze)", 1399.99, "Premium Quality Meat - R104 p/kg", "bronze_hamper"));
        hampers.add(new Product("platinum_hamper", "EVERYDAY Bulk Hamper (Platinum)", 2399.99, "Premium Quality Meat - R112 p/kg", "platinum_hamper"));
        hampers.add(new Product("diamond_hamper", "EVERYDAY Bulk Hamper (Diamond)", 2899.99, "Premium Quality Meat - R118 p/kg", "diamond_hamper"));
        return hampers;
    }

    private List<Product> getMockMasterWorsProducts() {
        List<Product> wors = new ArrayList<>();
        wors.add(new Product("brisco_boerewors", "Brisco Boerewors (2kg)", 262.00, "The perfect balanced and juicy Boerewors - Vacuum Sealed - Package totals 2kg (4 x 500g packs)", "brisco_boerewors"));
        wors.add(new Product("cheese_filled_boerewors", "Cheese Filled Boerewors", 238.00, "A juicy, flavour-packed boerewors with premium cuts of beef and pork, blended with signature spices and generous pockets of real cheese - Package totals 2kg (4 x 500g Vacuum Packs)", "pork_kassegriller_wors"));
        wors.add(new Product("chutney_sosatie_wors", "Chutney Sosatie Wors", 222.00, "A fruity, sweet-and-savory boerewors inspired by classic Cape Malay flavours with apricot notes and mild tang - Package totals 2kg (4 x 500g Vacuum Packs)", "chutney_sosatie_wors"));
        wors.add(new Product("pork_kassegriller_wors", "Pork Rich Kassegriller Wors", 248.00, "A traditional German-style pork wors crafted from premium cuts, seasoned with mild, savoury spice blend and hint of smokiness - Package totals 2kg (4 x 500g Vacuum Packs)", "kassegriller_wors"));
        wors.add(new Product("ostrich_wors", "Ostrich Wors (1kg)", 170.00, "Crafted from 100% pure ground ostrich steak - 500g x 2 Packs (1kg) - Naturally low in fat, kilojoules, and cholesterol, yet packed with protein and iron", "ostrich_wors"));
        return wors;
    }

    private List<Product> getMockBeefProducts() {
        List<Product> beef = new ArrayList<>();
        // All 13 beef products in one page
        beef.add(new Product("beef_lean_mince_2kg", "Beef Lean Mince (2kg)", 286.00, "Lean Beef Minced from Grade-A Premium Beef - 95% Meat & 5% Fat - Vacuum Sealed - 2kg Package totals (4 x 500g packs)", "beef_lean_mince"));
        beef.add(new Product("beef_lean_mince_5kg", "Beef Lean Mince (5kg)", 690.00, "Lean Beef Minced from Grade-A Premium Beef - 95% Meat & 5% Fat - Vacuum Sealed - 5kg Package totals (10 x 500g packs)", "beef_lean_mince"));
        beef.add(new Product("beef_marinated_rump_kebabs", "Beef Marinated Rump Kebabs BBQ (2kg)", 338.00, "Grade-A Premium Cut directly from the Loins - Vacuum Sealed - Package totals 2kg (4x 500g Packs - Each pack has 4x Kebabs)", "beef_marinated_rump_kebabs"));
        beef.add(new Product("beef_rump_steak_2kg", "Beef Rump Steak (2kg)", 462.00, "Grade-A Premium Cut directly from the RUMP - Vacuum Sealed - Package totals 2kg (8x Steaks packed in 4 x 500g packs)", "beef_rump_steak"));
        beef.add(new Product("beef_rump_steak_5kg", "Beef Rump Steak (5kg)", 1125.00, "Grade-A Premium Cut directly from the RUMP - Vacuum Sealed - Package totals 5kg (20x Steaks packed in 10 x 500g packs)", "beef_rump_steak"));
        beef.add(new Product("beef_sirloin_roast", "Beef Sirloin Roast (1.5kg)", 216.00, "Grade-A Premium Cut directly from the Loins - Vacuum Sealed - Package totals 1.5kg (1 x 1.5kg Sirloin Roast)", "beef_sirloin_roast"));
        beef.add(new Product("beef_sirloin_steak_2kg", "Beef Sirloin Steak (2kg)", 502.00, "Grade-A Premium Cut directly from the Loins - Vacuum Sealed - Package totals 2kg (8x Steaks packed in 4 x 500g packs)", "beef_sirloin_steak"));
        beef.add(new Product("beef_sirloin_steak_5kg", "Beef Sirloin Steak (5kg)", 1220.00, "Grade-A Premium Cut directly from the Loins - Vacuum Sealed - Package totals 5kg (20x Steaks packed in 10 x 500g packs)", "beef_sirloin_steak"));
        beef.add(new Product("beef_tbone_1kg", "Beef T-Bone Steak (500g x 2)", 210.00, "Grade-A Premium Cut directly from the Loins - Vacuum Sealed - Package totals 1kg (2 x Thick cut 500g T-Bone Steaks)", "beef_tbone_1kg"));
        beef.add(new Product("beef_patties_1_2kg", "Beef Patties (1.2kg)", 142.80, "Freshly grinded Beef Patties - Vacuum Sealed - Package totals 1.2kg (12x Patties packed in 3 x 400g packs)", "beef_patties_1_2kg"));
        beef.add(new Product("beef_chuck_3kg", "Beef Chuck (3kg)", 468.00, "Beef Chuck procured from Grade-A Premium Beef - Vacuum Sealed - Package totals 3kg (3 x 1kg packs)", "beef_chuck"));
        beef.add(new Product("beef_chuck_steaks_2kg", "Beef Chuck Steaks (2kg)", 320.00, "Beef Chuck Steaks procured from Grade-A Premium Chuck Primals - Vacuum Sealed - Package totals 2kg (4 x 500g packs)", "beef_chuck"));
        beef.add(new Product("beef_stew_3kg", "Beef Stew (3kg)", 435.00, "Beef Stew procured from Grade-A Premium Chuck Primals - Vacuum Sealed - Package totals 3kg (6 x 500g packs)", "beef_stew_3kg"));
        return beef;
    }

    private List<Product> getMockChickenProducts() {
        List<Product> chicken = new ArrayList<>();
        // Updated chicken products from Brisco website
        chicken.add(new Product("chicken_fillets_500g_pack_2kg", "Chicken Fillets 500g Pack (2kg)", 184.00, "Locally produced tender Chicken Fillets (Breasts) - Product is Frozen - Vacuum Sealed - Packaged in 4 x 500g Packs", "chicken_fillets_500g_pack_2kg"));
        chicken.add(new Product("chicken_fillets_500g_pack_5kg", "Chicken Fillets 500g Pack (5kg)", 450.00, "Locally produced tender Chicken Fillets (Breasts) - Product is Frozen - Vacuum Sealed - Packaged in 10 x 500g Packs", "chicken_fillets_500g_pack_5kg"));
        chicken.add(new Product("crumbed_chicken_pops_1kg", "Crumbed Chicken Pops (1kg)", 104.00, "Locally produced Crumbed Chicken Nuggets - Product is Frozen - NOT PROCESSED - Pressed from Fillet - Packaged in a 1kg box (1 x 1kg packs)", "crumbed_chicken_pops_1kg"));
        chicken.add(new Product("chicken_schnitzel_1kg", "Chicken Schnitzel (1kg)", 132.00, "Locally produced Crumbed Chicken Schnitzels - Product is Frozen - NOT PROCESSED - Pressed from Fillet - Packaged in a 1kg pack (1 x 1kg packs)", "chicken_schnitzel_1kg"));
        chicken.add(new Product("chicken_schnitzel_6kg", "Chicken Schnitzel (6kg)", 768.00, "Locally produced Crumbed Chicken Schnitzels - Product is Frozen - NOT PROCESSED - Pressed from Fillet - Packaged in a 6kg box (6 x 1kg packs)", "chicken_schnitzel_6kg"));
        chicken.add(new Product("chicken_wings_5kg", "Chicken Wings (5kg)", 430.00, "The finest Chicken Wings sourced locally - Product is Frozen - Package totals 5kg (5 x 1kg Vacuum Sealed packs)", "chicken_wings_5kg"));
        chicken.add(new Product("chicken_drumsticks_2kg", "Chicken Drumsticks (2kg)", 170.00, "The finest Chicken Drumsticks sourced locally - Product is Frozen - Package totals 2kg (2 x 1kg Vacuum Sealed packs)", "chicken_drumsticks_2kg"));
        chicken.add(new Product("chicken_thighs_5kg", "Chicken Thighs (5kg)", 480.00, "The finest Chicken Thighs sourced locally - Product is Frozen - Package totals 5kg (5 x 1kg Vacuum Sealed packs)", "chicken_thighs_5kg"));
        chicken.add(new Product("chicken_leg_quarters_5kg", "Chicken Leg Quarters (5kg)", 330.00, "The finest Chicken Leg Quarters sourced locally - Product is Frozen - Package totals 5kg (2 x 2.5kg pack)", "chicken_leg_quarters_5kg"));
        chicken.add(new Product("chicken_fillets_12kg", "Chicken Fillets (12kg)", 936.00, "Chicken filets, sometimes called chicken breasts, are a specific cut of meat from the chicken steaks. There are two filets in a chicken, and they are each a few inches long and about 1 inch or less wide. They lie under the main portion of the breast just above the ribcage around the center of the sternum", "chicken_fillets_12kg"));
        chicken.add(new Product("chicken_whole_1_4kg", "Chicken Whole (1.4kg)", 92.40, "Fresh, farm-quality whole chicken – perfect for roasting, spatchcocking, or the braai. Juicy, tender, and packed with protein for a healthy, delicious family meal", "chicken_whole_1_4kg"));
        return chicken;
    }

    private List<Product> getMockPorkProducts() {
        List<Product> pork = new ArrayList<>();
        // Updated pork products from Brisco website
        pork.add(new Product("pork_back_bacon_1kg", "Pork Back Bacon (1kg)", 177.00, "Our Rindless Pork Back Bacon is naturally beechwood smoked - Product is Frozen - Beechwood Smoked - Vacuum Sealed - Package totals 1kg (4 x 250g packs)", "pork_back_bacon_1kg"));
        pork.add(new Product("pork_back_bacon_3kg", "Pork Back Bacon (3kg)", 516.00, "Our Rindless Pork Back Bacon is naturally beechwood smoked - Product is Frozen - Beechwood Smoked - Vacuum Sealed - Package totals 3kg (3 x 1kg packs)", "pork_back_bacon_3kg"));
        pork.add(new Product("pork_bacon_bits_1kg", "Pork Bacon Bits (1kg)", 234.00, "Our Rindless Pork Back Bacon is naturally beechwood smoked - Product is Frozen - Beechwood Smoked - Vacuum Sealed - Package totals 1kg (2 x 500g packs)", "pork_bacon_bits_1kg"));
        pork.add(new Product("pork_smoked_neck_steaks_2kg", "Pork Smoked Neck Steaks (2kg)", 286.00, "Our Rindless Pork Smoked Neck Steaks is naturally beechwood smoked - Product is Frozen - Beechwood Smoked - Vacuum Sealed - Package totals 2kg (4 x 500g packs - Each Pack has 2 Steaks)", "pork_smoked_neck_steaks_2kg"));
        pork.add(new Product("pork_loin_chops_3kg", "Pork Loin Chops (3kg)", 324.00, "The finest Pork Loin Chops sourced locally and internationally - Product is Frozen - Vacuum Sealed - Package totals 3kg (12 x Chops packed in 6 x 500g packs)", "pork_loin_chops_3kg"));
        pork.add(new Product("pork_pre_cooked_marinated_spare_rib_2kg", "Pork Pre-Cooked Marinated Narrow Spare Rib (2kg)", 296.00, "BBQ Marinted and Pre-Cooked Pork Narrow Cut Spare Ribs - Product is Frozen - Pre-cooked and BBQ Marinated - Vacuum Sealed - Package totals 2kg (1 x 2kg packs)", "pork_pre_cooked_marinated_spare_rib_2kg"));
        pork.add(new Product("pork_cheese_grillers_2kg", "Pork Cheese Grillers (2kg)", 332.00, "Old School Oak Smoked hand made Cheese Grillers - Product is Frozen - Vacuum Sealed - Package totals 2kg (Packed in 4 x 500g packs)", "pork_cheese_grillers_2kg"));
        pork.add(new Product("pork_smoked_gammon_1_7kg", "Pork Smoked Gammon (1.7kg)", 193.80, "Delicious, tender gammon perfect for roasting, glazing, or grilling. Naturally lean, rich in flavour, and packed with protein. Ideal for Sunday lunches, festive feasts, or everyday meals", "pork_smoked_gammon_1_7kg"));
        pork.add(new Product("pork_cooked_bbq_rib_party_pack_3kg", "Pork Cooked BBQ Rib Party Pack (3kg)", 465.00, "BBQ Marinted and Pre-Cooked Pork Rib pieces - Perfect for catering or snackaroo - Rib Pieces - Product is Frozen - Pre-cooked and BBQ Marinated - Vacuum Sealed - Package totals 3kg (3 x 1kg packs)", "pork_cooked_bbq_rib_party_pack_3kg"));
        return pork;
    }

    private List<Product> getMockLambProducts() {
        List<Product> lamb = new ArrayList<>();
        // Updated lamb products from Brisco website
        lamb.add(new Product("whole_grade_a_lamb_22kg", "GRADE-A Lamb Whole (+-22kg)", 4048.00, "VERY IMPORTANT! Ordering of lambs are STRICTLY accepted on EFT's only. Your order will be processed once the funds reflect in our bank account. Select one of our premium Grade-A Whole lambs and we will process and pack according to your requirement. Lambs do vary in weight and we will rectify your invoice if the weight is less then 22kg", "whole_grade_a_lamb_22kg"));
        lamb.add(new Product("lamb_shoulder_chops_2kg", "Lamb Shoulder Chops (2kg)", 378.00, "Locally farmed Grade-A Lamb Shoulder Chops - Product is Frozen - Vacuum Sealed - Package totals 2kg (+- 8 Chops in 4 x 500g packs)", "lamb_shoulder_chops_2kg"));
        lamb.add(new Product("lamb_shoulder_chops_3kg", "Lamb Shoulder Chops (3kg)", 552.00, "Locally farmed Grade-A Lamb Shoulder Chops - Product is Frozen - Vacuum Sealed - Package totals 3kg (+- 12 Chops in 6 x 500g packs)", "lamb_shoulder_chops_3kg"));
        lamb.add(new Product("lamb_stew_3kg", "Lamb Stew (3kg)", 513.00, "Locally farmed Grade-A Lamb Stew - Product is Frozen - Vacuum Sealed - Package totals 3kg (3 x 1kg packs)", "lamb_stew_3kg"));
        lamb.add(new Product("lamb_leg_roast_bone_in_2_5kg", "Lamb Leg Roast Bone in (2.5kg)", 552.50, "Succulent, bone-in leg of lamb perfect for slow roasting or the braai. Tender, flavourful, and packed with protein – ideal for family gatherings or a festive feast", "lamb_leg_roast_bone_in_2_5kg"));
        return lamb;
    }

    private List<Product> getMockSpecialProducts() {
        List<Product> specials = new ArrayList<>();
        // Updated special products from Brisco website
        specials.add(new Product("everyday_bulk_hamper_jade_23kg", "Jade – R130 p/kg", 2990.00, "The BRISCO Everyday Bulk Meat Hamper caters for the essential meat requirements of everyday household families with 2 key aspects, QUALITY and AFFORDABILITY - Total = 23kg", "everyday_bulk_hamper_jade_23kg"));
        specials.add(new Product("beef_lean_mince_5kg", "Beef Lean Mince (5kg)", 690.00, "Lean Beef Minced from Grade-A Premium Beef - Product is Frozen - 95% Meat & 5% Fat - Vacuum Sealed - 5kg Package totals (10 x 500g packs)", "beef_lean_mince_5kg"));
        specials.add(new Product("chicken_fillets_500g_pack_5kg", "Chicken Fillets 500g Pack (5kg)", 450.00, "Locally produced tender Chicken Fillets (Breasts) - Product is Frozen - Vacuum Sealed - Packaged in 10 x 500g Packs", "chicken_fillets_500g_pack_5kg"));
        specials.add(new Product("everyday_bulk_hamper_platinum_21kg", "EVERYDAY Bulk Hamper (Platinum) – R112 p/kg", 2352.00, "The BRISCO Everyday Bulk Meat Hamper caters for the essential meat requirements of everyday household families with 2 key aspects, QUALITY and AFFORDABILITY - Total = 21kg", "everyday_bulk_hamper_platinum_21kg"));
        specials.add(new Product("brisco_boerewors_5kg", "Brisco Boerewors (5kg)", 625.00, "The perfect balanced and juicy Boerewors - Product is Frozen - Vacuum Sealed - Package totals 5kg (10 x 500g packs) - Disclaimer: Our beef boerewors contains pork and spices that could contain traces of nuts, soy, gluten, or dairy. Please check with us if you have any allergies or dietary concerns", "brisco_boerewors_5kg"));
        specials.add(new Product("everyday_bulk_hamper_gold_18kg", "EVERYDAY Bulk Hamper (Gold) – R100 p/kg", 1800.00, "The BRISCO Everyday Bulk Meat Hamper caters for the essential meat requirements of everyday household families with 2 key aspects, QUALITY and AFFORDABILITY - Total = 18kg", "everyday_bulk_hamper_gold_18kg"));
        specials.add(new Product("beef_sirloin_steak_5kg", "Beef Sirloin Steak (5kg)", 1220.00, "Grade-A Premium Cut directly from the Loins - Product is Frozen - Vacuum Sealed - Package totals 5kg (20x Steaks packed in 10 x 500g packs)", "beef_sirloin_steak_5kg"));
        specials.add(new Product("beef_patties_1_2kg", "Beef Patties (1.2kg)", 142.80, "Freshly grinded Beef Patties - Product is Frozen - Vacuum Sealed - Package totals 1.2kg (12x Patties packed in 3 x 400g packs) - Disclaimer: Our beef Patties contains pork and spices that could contain traces of nuts, soy, gluten, or dairy. Please check with us if you have any allergies or dietary concerns", "beef_patties_1_2kg"));
        specials.add(new Product("pork_loin_chops_3kg", "Pork Loin Chops (3kg)", 324.00, "The finest Pork Loin Chops sourced locally and internationally - Product is Frozen - Vacuum Sealed - Package totals 3kg (12 x Chops packed in 6 x 500g packs)", "pork_loin_chops_3kg"));
        specials.add(new Product("cheese_filled_boerewors_2kg", "Cheese Filled Boerewors", 238.00, "A juicy, flavour-packed boerewors made with premium cuts of beef and pork, blended with our signature spices and generous pockets of real cheese that melt into every bite - Product is Frozen - Vacuum Sealed - Package totals 2kg (4 x 500g Vacuum Packs)", "cheese_filled_boerewors_2kg"));
        specials.add(new Product("chutney_sosatie_wors_2kg", "Chutney Sosatie Wors", 222.00, "A fruity, sweet-and-savory boerewors inspired by classic Cape Malay flavours. Made with premium cuts and a signature blend of spices, apricot notes, and mild tang; juicy, aromatic, and perfect for braais - Product is Frozen - Vacuum Sealed - Package totals 2kg (4 x 500g Vacuum Packs)", "chutney_sosatie_wors_2kg"));
        specials.add(new Product("pork_rich_kassegriller_wors_2kg", "Pork Rich Kassegriller Wors", 248.00, "A traditional German-style pork wors crafted from premium cuts, seasoned with a mild, savoury spice blend and a hint of smokiness. Juicy, flavourful, and perfect for grilling - Product is Frozen - Vacuum Sealed - Package totals 2kg (4 x 500g Vacuum Packs)", "pork_rich_kassegriller_wors_2kg"));
        return specials;
    }

    private List<Product> getMockDefaultProducts() {
        List<Product> defaults = new ArrayList<>();
        defaults.add(new Product("default1", "Premium Meat Product", 99.99, "High quality meat product", "jade_hamper"));
        defaults.add(new Product("default2", "Another Meat Product", 149.99, "Another premium product", "gold_hamper"));
        return defaults;
    }

    private List<Product> getMockOstrichProducts() {
        List<Product> ostrich = new ArrayList<>();
        // Updated ostrich products from Brisco website
        ostrich.add(new Product("ostrich_extra_lean_mince_1kg", "Ostrich Extra Lean Mince (1kg)", 170.00, "Ostrich Lean Mince – 500g x 2 Packs (1kg) - Made from 100% pure ostrich meat, it's a versatile option for everything from bolognese and meatballs to tacos and cottage pie. Naturally low in fat, kilojoules, and cholesterol – yet rich in protein and iron", "ostrich_extra_lean_mince_1kg"));
        ostrich.add(new Product("ostrich_goulash_1kg", "Ostrich Goulash (1kg)", 180.00, "Ostrich Goulash – 500g x 2 Packs (1kg) - Perfect for slow-cooked stews, curries, and casseroles, it delivers tender, succulent bites. Naturally low in fat, kilojoules, and cholesterol – yet packed with protein and iron", "ostrich_goulash_1kg"));
        ostrich.add(new Product("ostrich_kebabs_1_2kg", "Ostrich Kebabs (1.2kg)", 228.00, "Each pack contains 4x succulent kebabs (125 g each), made from 100% pure ostrich meat and marinated to perfection for a rich, mouth-watering flavour. Naturally low in fat, cholesterol, and kilojoules – while being packed with protein and iron", "ostrich_kebabs_1_2kg"));
        ostrich.add(new Product("ostrich_patties_1kg", "Ostrich Patties (1kg)", 170.00, "Ostrich Burger Patties – 500g x 2 Packs (8 x Patties) - Crafted from the finest cuts of ostrich steak and expertly seasoned for exceptional flavour. A healthier alternative to traditional beef burgers, naturally low in fat, kilojoules, and cholesterol", "ostrich_patties_1kg"));
        ostrich.add(new Product("ostrich_steaks_1kg", "Ostrich Steaks (1kg)", 170.00, "Ostrich Steaks (4 x 250 g) x 2 - Expertly cut for exceptional tenderness and flavour. Naturally low in calories, fat, and cholesterol, yet packed with protein, iron, and calcium – leaner than skinless chicken or turkey", "ostrich_steaks_1kg"));
        ostrich.add(new Product("ostrich_stir_fry_1kg", "Ostrich Stir Fry (1kg)", 180.00, "Ostrich Stir-Fry – 500g x 2 Packs (1kg) - Perfect for fast and flavourful weeknight dinners, made from 100% pure, premium ostrich meat. Naturally low in fat, kilojoules, and cholesterol, while being packed with protein and iron", "ostrich_stir_fry_1kg"));
        ostrich.add(new Product("ostrich_wors_1kg", "Ostrich Wors (1kg)", 170.00, "Ostrich Wors – 500g x 2 Packs (1kg) - Crafted from 100% pure ground ostrich steak, delivers a juicy, flavourful bite every time. Made with only the finest ingredients, naturally low in fat, kilojoules, and cholesterol, yet packed with protein and iron", "ostrich_wors_1kg"));
        return ostrich;
    }

    private List<Product> getMockPieProducts() {
        List<Product> pies = new ArrayList<>();
        // Updated pie products from Brisco website
        pies.add(new Product("piemans_assorted_pies_6x160g", "Piemans Assorted Pies (6 x 160g Pies)", 134.40, "Piemans Assorted Pies - 6 x 160g Pies - Premium quality assorted pies perfect for any occasion", "piemans_assorted_pies_6x160g"));
        return pies;
    }

    private List<Product> getMockFitnessProducts() {
        List<Product> fitness = new ArrayList<>();
        // Updated fitness products from Brisco website - removed bulk hampers
        fitness.add(new Product("beef_lean_mince_5kg", "Beef Lean Mince (5kg)", 690.00, "Lean Beef Minced from Grade-A Premium Beef - Product is Frozen - 95% Meat & 5% Fat - Vacuum Sealed - 5kg Package totals (10 x 500g packs)", "beef_lean_mince_5kg"));
        fitness.add(new Product("chicken_fillets_500g_pack_5kg", "Chicken Fillets 500g Pack (5kg)", 450.00, "Locally produced tender Chicken Fillets (Breasts) - Product is Frozen - Vacuum Sealed - Packaged in 10 x 500g Packs", "chicken_fillets_500g_pack_5kg"));
        fitness.add(new Product("brisco_boerewors_5kg", "Brisco Boerewors (5kg)", 625.00, "The perfect balanced and juicy Boerewors - Product is Frozen - Vacuum Sealed - Package totals 5kg (10 x 500g packs) - Disclaimer: Our beef boerewors contains pork and spices that could contain traces of nuts, soy, gluten, or dairy. Please check with us if you have any allergies or dietary concerns", "brisco_boerewors_5kg"));
        fitness.add(new Product("beef_sirloin_steak_5kg", "Beef Sirloin Steak (5kg)", 1220.00, "Grade-A Premium Cut directly from the Loins - Product is Frozen - Vacuum Sealed - Package totals 5kg (20x Steaks packed in 10 x 500g packs)", "beef_sirloin_steak_5kg"));
        fitness.add(new Product("beef_patties_1_2kg", "Beef Patties (1.2kg)", 142.80, "Freshly grinded Beef Patties - Product is Frozen - Vacuum Sealed - Package totals 1.2kg (12x Patties packed in 3 x 400g packs) - Disclaimer: Our beef Patties contains pork and spices that could contain traces of nuts, soy, gluten, or dairy. Please check with us if you have any allergies or dietary concerns", "beef_patties_1_2kg"));
        fitness.add(new Product("pork_loin_chops_3kg", "Pork Loin Chops (3kg)", 324.00, "The finest Pork Loin Chops sourced locally and internationally - Product is Frozen - Vacuum Sealed - Package totals 3kg (12 x Chops packed in 6 x 500g packs)", "pork_loin_chops_3kg"));
        fitness.add(new Product("cheese_filled_boerewors_2kg", "Cheese Filled Boerewors", 238.00, "A juicy, flavour-packed boerewors made with premium cuts of beef and pork, blended with our signature spices and generous pockets of real cheese that melt into every bite - Product is Frozen - Vacuum Sealed - Package totals 2kg (4 x 500g Vacuum Packs)", "cheese_filled_boerewors_2kg"));
        fitness.add(new Product("chutney_sosatie_wors_2kg", "Chutney Sosatie Wors", 222.00, "A fruity, sweet-and-savory boerewors inspired by classic Cape Malay flavours. Made with premium cuts and a signature blend of spices, apricot notes, and mild tang; juicy, aromatic, and perfect for braais - Product is Frozen - Vacuum Sealed - Package totals 2kg (4 x 500g Vacuum Packs)", "chutney_sosatie_wors_2kg"));
        fitness.add(new Product("pork_rich_kassegriller_wors_2kg", "Pork Rich Kassegriller Wors", 248.00, "A traditional German-style pork wors crafted from premium cuts, seasoned with a mild, savoury spice blend and a hint of smokiness. Juicy, flavourful, and perfect for grilling - Product is Frozen - Vacuum Sealed - Package totals 2kg (4 x 500g Vacuum Packs)", "pork_rich_kassegriller_wors_2kg"));
        return fitness;
    }

    private List<Product> getMockRestaurantProducts() {
        List<Product> restaurant = new ArrayList<>();
        // Updated restaurant products from Specials page
        restaurant.add(new Product("brisco_boerewors_5kg", "Brisco Boerewors (5kg)", 625.00, "The perfect balanced and juicy Boerewors - Product is Frozen - Vacuum Sealed - Package totals 5kg (10 x 500g packs) - Disclaimer: Our beef boerewors contains pork and spices that could contain traces of nuts, soy, gluten, or dairy. Please check with us if you have any allergies or dietary concerns", "brisco_boerewors_5kg"));
        restaurant.add(new Product("beef_sirloin_steak_5kg", "Beef Sirloin Steak (5kg)", 1220.00, "Grade-A Premium Cut directly from the Loins - Product is Frozen - Vacuum Sealed - Package totals 5kg (20x Steaks packed in 10 x 500g packs)", "beef_sirloin_steak_5kg"));
        restaurant.add(new Product("beef_mince_80_20_20kg", "Beef Mince 80/20 (20kg)", 2080.00, "80/20 Minced from Grade-A Premium Beef - Ideal for a Restaurant - 80% Meat & 20% Fat - Product is Frozen - Vacuum Sealed - Package totals 20kg (4 x 5kg packs)", "beef_mince_80_20_20kg"));
        restaurant.add(new Product("pork_pre_cooked_marinated_spare_rib_10kg", "Pork Pre-Cooked Marinated Narrow Spare Rib (10kg)", 1370.00, "BBQ Marinted and Pre-Cooked Pork Narrow Cut Spare Ribs - Product is Frozen - Pre-cooked and BBQ Marinated - Vacuum Sealed - Package totals 10kg (5 x 2kg packs)", "pork_pre_cooked_marinated_spare_rib_10kg"));
        restaurant.add(new Product("chicken_drumsticks_5kg", "Chicken Drumsticks (5kg)", 425.00, "The finest Chicken Drumsticks sourced locally - Product is Frozen - Package totals 5kg (5 x 1kg Vacuum packs)", "chicken_drumsticks_5kg"));
        restaurant.add(new Product("chicken_thighs_10kg", "Chicken Thighs (10kg)", 950.00, "The finest Chicken Thighs sourced locally - Product is Frozen - Package totals 10kg Box (2 x 5kg packs)", "chicken_thighs_10kg"));
        return restaurant;
    }

    @Override
    public boolean onSupportNavigateUp() {
        onBackPressed();
        return true;
    }
}
