-- Nay Store Admin Banner Blank Text Fix - 2026-05-24
-- Purpose: allow home banner/silde to be image-only and remove old forced text.

INSERT INTO settings (setting_key, setting_value, setting_group, created_at, updated_at)
VALUES
('home_hero_pill_text', '', 'home', NOW(), NOW()),
('home_hero_title', '', 'home', NOW(), NOW()),
('home_hero_subtitle', '', 'home', NOW(), NOW()),
('home_soft_banner_enabled', '0', 'home', NOW(), NOW()),
('home_soft_banner_title', '', 'home', NOW(), NOW()),
('home_soft_banner_subtitle', '', 'home', NOW(), NOW())
ON DUPLICATE KEY UPDATE
    setting_value = CASE
        WHEN setting_key = 'home_hero_pill_text' AND TRIM(setting_value) IN ('Nay Store', 'ناي ستور') THEN ''
        WHEN setting_key = 'home_hero_title' AND TRIM(setting_value) IN ('تجربة تسوق أخف وأجمل') THEN ''
        WHEN setting_key = 'home_hero_subtitle' AND TRIM(setting_value) IN ('منتجات أصلية، عروض واضحة، وطلب أسرع') THEN ''
        WHEN setting_key = 'home_soft_banner_enabled' AND EXISTS (
            SELECT 1 FROM (SELECT setting_key FROM settings WHERE setting_key = 'home_soft_banner_title' AND TRIM(setting_value) = 'روتين عناية خفيف وسريع') AS old_soft_banner
        ) THEN '0'
        WHEN setting_key = 'home_soft_banner_title' AND TRIM(setting_value) IN ('روتين عناية خفيف وسريع') THEN ''
        WHEN setting_key = 'home_soft_banner_subtitle' AND TRIM(setting_value) IN ('اختاري منتجاتك المفضلة بخطوات قليلة') THEN ''
        ELSE setting_value
    END,
    setting_group = 'home',
    updated_at = NOW();
