-- Tabela para gerenciar templates da página de vendas
CREATE TABLE IF NOT EXISTS sales_page_templates (
    id INT AUTO_INCREMENT PRIMARY KEY,
    store_id BIGINT(20) UNSIGNED NOT NULL,
    template_name VARCHAR(50) NOT NULL DEFAULT 'modern',
    custom_css TEXT DEFAULT NULL,
    custom_js TEXT DEFAULT NULL,
    hero_title VARCHAR(255) DEFAULT NULL,
    hero_subtitle TEXT DEFAULT NULL,
    hero_image VARCHAR(255) DEFAULT NULL,
    primary_color VARCHAR(7) DEFAULT '#CCA43B',
    secondary_color VARCHAR(7) DEFAULT '#1A1A1A',
    features JSON DEFAULT NULL,
    testimonials JSON DEFAULT NULL,
    cta_text VARCHAR(100) DEFAULT 'Começar Agora',
    cta_url VARCHAR(255) DEFAULT NULL,
    is_active BOOLEAN DEFAULT TRUE,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    UNIQUE KEY unique_store_template (store_id),
    KEY idx_template_name (template_name),
    KEY idx_is_active (is_active)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
