-- ============================================================
-- SEED: Categorie Supraveghere Video
-- ============================================================
-- Versiune: 1.0
-- Data: 2025-11-30
-- Descriere: Adaugă categoria Supraveghere Video cu toate subcategoriile
-- ============================================================

SET FOREIGN_KEY_CHECKS = 0;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";

-- ===============================
-- Categorie principală
-- ===============================
INSERT INTO `categories` (`parent_id`, `name`, `slug`, `icon`, `url`, `position`, `is_active`, `show_in_menu`, `has_megamenu`, `megamenu_layout`)
VALUES
(NULL, 'Supraveghere video', 'supraveghere-video', 'ci-camera', '/shop-catalog-electronics.php?category=supraveghere-video', 13, 1, 1, 1, '3-col');

-- Obținem ID-ul noii categorii
SET @parent_id = LAST_INSERT_ID();

-- Card promoțional pentru mega-menu
INSERT INTO `category_promo_cards` (`category_id`, `title`, `description`, `image_url`, `image_alt`, `button_text`, `button_url`, `position`)
VALUES
(@parent_id, 'Echipamente CCTV', 'Reduceri până la -30% - Echipamente profesionale pentru orice tip de locație', '/assets/img/mega-menu/electronics/cctv-promo.png', 'Sisteme supraveghere video', 'Shop now', '/shop-catalog-electronics.php?category=supraveghere-video', 1);

-- ===============================
-- Subcategorii (nivel 2)
-- ===============================
INSERT INTO `categories` (`parent_id`, `name`, `slug`, `url`, `position`) VALUES
(@parent_id, 'Sisteme complete', 'sisteme-complete', '/shop-catalog-electronics.php?category=sisteme-complete', 1),
(@parent_id, 'Camere de supraveghere', 'camere-supraveghere', '/shop-catalog-electronics.php?category=camere-supraveghere', 2),
(@parent_id, 'DVR / NVR', 'dvr-nvr', '/shop-catalog-electronics.php?category=dvr-nvr', 3),
(@parent_id, 'Accesorii & Cabluri', 'accesorii-cabluri', '/shop-catalog-electronics.php?category=accesorii-cabluri', 4),
(@parent_id, 'Surse alimentare & UPS', 'surse-ups', '/shop-catalog-electronics.php?category=surse-ups', 5);

-- Obținem ID-urile subcategoriilor
SET @sisteme_id = LAST_INSERT_ID() - 4;
SET @camere_id = LAST_INSERT_ID() - 3;
SET @dvr_id = LAST_INSERT_ID() - 2;
SET @acc_id = LAST_INSERT_ID() - 1;
SET @surse_id = LAST_INSERT_ID();

-- ===============================
-- Sub-subcategorii (nivel 3)
-- ===============================

-- Sisteme complete
INSERT INTO `categories` (`parent_id`, `name`, `slug`, `url`, `position`) VALUES
(@sisteme_id, 'Kit complet 4 camere', 'kit-4-camere', '/shop-catalog-electronics.php?category=kit-4-camere', 1),
(@sisteme_id, 'Kit complet 8 camere', 'kit-8-camere', '/shop-catalog-electronics.php?category=kit-8-camere', 2),
(@sisteme_id, 'Kit complet 16 camere', 'kit-16-camere', '/shop-catalog-electronics.php?category=kit-16-camere', 3),
(@sisteme_id, 'Kit IP PoE', 'kit-ip-poe', '/shop-catalog-electronics.php?category=kit-ip-poe', 4),
(@sisteme_id, 'Kit wireless Wi-Fi', 'kit-wireless', '/shop-catalog-electronics.php?category=kit-wireless', 5);

-- Camere de supraveghere
INSERT INTO `categories` (`parent_id`, `name`, `slug`, `url`, `position`) VALUES
(@camere_id, 'Camere analogice HD', 'camere-analogice-hd', '/shop-catalog-electronics.php?category=camere-analogice-hd', 1),
(@camere_id, 'Camere IP', 'camere-ip', '/shop-catalog-electronics.php?category=camere-ip', 2),
(@camere_id, 'Camere dome', 'camere-dome', '/shop-catalog-electronics.php?category=camere-dome', 3),
(@camere_id, 'Camere bullet', 'camere-bullet', '/shop-catalog-electronics.php?category=camere-bullet', 4),
(@camere_id, 'Camere PTZ', 'camere-ptz', '/shop-catalog-electronics.php?category=camere-ptz', 5),
(@camere_id, 'Camere termice', 'camere-termice', '/shop-catalog-electronics.php?category=camere-termice', 6);

-- DVR / NVR
INSERT INTO `categories` (`parent_id`, `name`, `slug`, `url`, `position`) VALUES
(@dvr_id, 'DVR analogic', 'dvr-analogic', '/shop-catalog-electronics.php?category=dvr-analogic', 1),
(@dvr_id, 'NVR IP', 'nvr-ip', '/shop-catalog-electronics.php?category=nvr-ip', 2),
(@dvr_id, 'HVR hibrid', 'hvr-hibrid', '/shop-catalog-electronics.php?category=hvr-hibrid', 3);

-- Accesorii & Cabluri
INSERT INTO `categories` (`parent_id`, `name`, `slug`, `url`, `position`) VALUES
(@acc_id, 'Mufe BNC / RCA', 'mufe-bnc-rca', '/shop-catalog-electronics.php?category=mufe-bnc-rca', 1),
(@acc_id, 'Cablu coaxial', 'cablu-coaxial', '/shop-catalog-electronics.php?category=cablu-coaxial', 2),
(@acc_id, 'Cablu UTP', 'cablu-utp', '/shop-catalog-electronics.php?category=cablu-utp', 3),
(@acc_id, 'Splittere video', 'splittere-video', '/shop-catalog-electronics.php?category=splittere-video', 4),
(@acc_id, 'Convertoare video', 'convertoare-video', '/shop-catalog-electronics.php?category=convertoare-video', 5);

-- Surse alimentare & UPS
INSERT INTO `categories` (`parent_id`, `name`, `slug`, `url`, `position`) VALUES
(@surse_id, 'Surse 12V pentru camere', 'surse-12v', '/shop-catalog-electronics.php?category=surse-12v', 1),
(@surse_id, 'Alimentatoare în carcasă', 'alimentatoare-carcase', '/shop-catalog-electronics.php?category=alimentatoare-carcase', 2),
(@surse_id, 'UPS-uri pentru DVR/NVR', 'ups-dvr', '/shop-catalog-electronics.php?category=ups-dvr', 3),
(@surse_id, 'Baterii reîncărcabile', 'baterii-reincarcabile', '/shop-catalog-electronics.php?category=baterii-reincarcabile', 4);

SET FOREIGN_KEY_CHECKS = 1;
COMMIT;

-- ============================================================
-- Finalizare Seed
-- ============================================================
-- Pentru a rula acest seed:
-- 1. Prin phpMyAdmin: Import -> Selectați fișierul
-- 2. Prin MySQL CLI: mysql -u root -p cartzilla_shop < seed_supraveghere_video.sql
-- ============================================================

