<?php
namespace Database\Seeders;

use App\Models\Category;
use Illuminate\Database\Seeder;

class CategorySeeder extends Seeder
{
    public function run(): void
    {
        $categories = [
            ['name' => 'Alimentar',        'slug' => 'alimentar',        'show_in_hero' => true,  'sort_order' => 1],
            ['name' => 'Azeites e Óleos',  'slug' => 'azeites-e-oleos',  'show_in_hero' => true,  'sort_order' => 2],
            ['name' => 'Lacticínios',       'slug' => 'lacticinios',       'show_in_hero' => true,  'sort_order' => 3],
            ['name' => 'Bebidas',           'slug' => 'bebidas',           'show_in_hero' => true,  'sort_order' => 4],
            ['name' => 'Higiene',           'slug' => 'higiene',           'show_in_hero' => false, 'sort_order' => 5],
            ['name' => 'Limpeza',           'slug' => 'limpeza',           'show_in_hero' => false, 'sort_order' => 6],
            ['name' => 'Vida Saudável',     'slug' => 'vida-saudavel',     'show_in_hero' => true,  'sort_order' => 7],
            ['name' => 'Electrodomésticos', 'slug' => 'electrodomesticos', 'show_in_hero' => false, 'sort_order' => 8],
            ['name' => 'Casa/Decoração',    'slug' => 'casa-decoracao',    'show_in_hero' => false, 'sort_order' => 9],
            ['name' => 'Brinquedos',        'slug' => 'brinquedos',        'show_in_hero' => false, 'sort_order' => 10],
            ['name' => 'Frutas/ Legumes',   'slug' => 'frutas-legumes',    'show_in_hero' => true,  'sort_order' => 11],
            ['name' => 'Papelaria & Livros','slug' => 'papelaria-livros',  'show_in_hero' => false, 'sort_order' => 12],
            ['name' => 'Petshop',           'slug' => 'petshop',           'show_in_hero' => false, 'sort_order' => 13],
        ];

        foreach ($categories as $category) {
            Category::firstOrCreate(
                ['slug' => $category['slug']],
                $category
            );
        }
    }
}
