<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class ProductSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $products = [
            [
                'slug'        => 'gt-premium-raw-makhana-pack-1',
                'name'        => 'GT Premium RAW Makhana Pack of 1',
                'category'    => 'Premium',
                'weight'      => '200g',
                'price'       => 380,
                'old_price'   => 599,
                'description' => '100% organic premium grade makhana, hand-picked and air-dried. Rich in protein and antioxidants.',
                'features'    => ['100% Organic', 'High Protein', 'Zero Chemicals', 'Airtight Pack'],
                'image'       => 'Pack.png',
                'in_stock'    => true,
                'stock_qty'   => 500,
                'sort_order'  => 1,
            ],
            [
                'slug'        => 'gt-premium-raw-makhana-pack-2',
                'name'        => 'GT Premium RAW Makhana Pack of 2',
                'category'    => 'Premium',
                'weight'      => '400g (2×200g)',
                'price'       => 740,
                'old_price'   => 1198,
                'description' => 'Double the goodness! Our bestselling premium makhana in a value pack of 2.',
                'features'    => ['38% OFF', 'Free Delivery', 'Best Value', 'Share Pack'],
                'image'       => 'Pack.png',
                'in_stock'    => true,
                'stock_qty'   => 300,
                'sort_order'  => 2,
            ],
            [
                'slug'        => 'gt-premium-raw-makhana-pack-3',
                'name'        => 'GT Premium RAW Makhana Pack of 3',
                'category'    => 'Premium',
                'weight'      => '600g (3×200g)',
                'price'       => 1080,
                'old_price'   => 1797,
                'description' => 'Stock up and save! Premium makhana pack of 3 — perfect for families.',
                'features'    => ['40% OFF', 'Family Pack', 'Free Delivery', 'Monthly Supply'],
                'image'       => 'Pack.png',
                'in_stock'    => true,
                'stock_qty'   => 200,
                'sort_order'  => 3,
            ],
            [
                'slug'        => 'gt-regular-raw-makhana-pack-1',
                'name'        => 'GT Regular RAW Makhana Pack of 1',
                'category'    => 'Regular',
                'weight'      => '250g',
                'price'       => 249,
                'old_price'   => 499,
                'description' => 'Clean, wholesome makhana for everyday snacking. Great taste, great price.',
                'features'    => ['50% OFF', 'Everyday Snack', 'Guilt-Free', 'Great Value'],
                'image'       => 'Pack 2.png',
                'in_stock'    => true,
                'stock_qty'   => 500,
                'sort_order'  => 4,
            ],
            [
                'slug'        => 'gt-regular-raw-makhana-pack-6',
                'name'        => 'GT Regular RAW Makhana Pack of 6',
                'category'    => 'Regular',
                'weight'      => '1.5kg (6×250g)',
                'price'       => 600,
                'old_price'   => 1494,
                'description' => 'Our bestselling bulk saver! 6 packs of regular makhana — save big.',
                'features'    => ['60% OFF', 'Bulk Buy', 'Free Delivery', 'Best Seller'],
                'image'       => 'Pack 2.png',
                'in_stock'    => true,
                'stock_qty'   => 200,
                'sort_order'  => 5,
            ],
            [
                'slug'        => 'gt-regular-makhana-orange-pouch',
                'name'        => 'GT Regular Makhana Orange Pouch',
                'category'    => 'Regular',
                'weight'      => '250g',
                'price'       => 280,
                'old_price'   => 599,
                'description' => 'Same great taste in our signature orange pouch. Makes for a perfect gift too.',
                'features'    => ['Gift-Ready', 'Resealable', 'Fresh Lock', 'Signature Pack'],
                'image'       => 'Pack with cup.png',
                'in_stock'    => true,
                'stock_qty'   => 300,
                'sort_order'  => 6,
            ],
            [
                'slug'        => 'gt-regular-raw-makhana-pack-3',
                'name'        => 'GT Regular RAW Makhana Pack of 3',
                'category'    => 'Regular',
                'weight'      => '750g (3×250g)',
                'price'       => 320,
                'old_price'   => 747,
                'description' => 'Regular makhana triple pack — best bang for buck in the Regular category.',
                'features'    => ['57% OFF', 'Triple Pack', 'Free Delivery', 'Great Value'],
                'image'       => 'Pack 2.png',
                'in_stock'    => true,
                'stock_qty'   => 250,
                'sort_order'  => 7,
            ],
            [
                'slug'        => 'kanha-poshak-makhana',
                'name'        => "Kanha Poshak — Divine Bhog Makhana",
                'category'    => 'Kanha Poshak',
                'weight'      => '200g',
                'price'       => 350,
                'old_price'   => 499,
                'description' => 'Premium makhana specially curated for bhog/prasad. Pure, sacred, divine.',
                'features'    => ['Temple Grade', 'Pure & Divine', 'Zero Additives', 'Sacred Snack'],
                'image'       => 'Pack.png',
                'in_stock'    => true,
                'stock_qty'   => 100,
                'sort_order'  => 8,
            ],
        ];

        foreach ($products as $p) {
            \App\Models\Product::updateOrCreate(['slug' => $p['slug']], $p);
        }
    }
}
