<?php

/**
 * Colors Settings
 *
 * @package relax_spa
 */
add_action( 'customize_register', 'relax_spa_customize_colors' );
function relax_spa_customize_colors(  $wp_customize  ) {
    $wp_customize->get_section( 'colors' )->priority = 1;
    $wp_customize->remove_control( 'header_textcolor' );
    $wp_customize->get_section( 'colors' )->title = esc_html__( 'Colors', 'relax-spa' );
    $wp_customize->get_section( 'colors' )->panel = 'relax_spa_general_panel';
    $wp_customize->add_setting( 'primary_color', array(
        'capability'        => 'edit_theme_options',
        'default'           => '#2C396B',
        'sanitize_callback' => 'relax_spa_sanitize_hex_color',
        'transport'         => 'postMessage',
    ) );
    $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'primary_color', array(
        'label'    => esc_html__( 'Primary Color', 'relax-spa' ),
        'section'  => 'colors',
        'priority' => 1,
    )) );
    $wp_customize->add_setting( 'secondary_color', array(
        'capability'        => 'edit_theme_options',
        'default'           => '#DBAE95',
        'sanitize_callback' => 'relax_spa_sanitize_hex_color',
        'transport'         => 'postMessage',
    ) );
    $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'secondary_color', array(
        'label'    => esc_html__( 'Secondary Color', 'relax-spa' ),
        'section'  => 'colors',
        'priority' => 2,
    )) );
    if ( fs_relax_spa()->is_free_plan() ) {
        $wp_customize->add_setting( 'relax_spa_colors_upgrade_to_pro', array(
            'sanitize_callback' => null,
        ) );
        $wp_customize->add_control( new Relax_Spa_Control_Upgrade_To_Pro($wp_customize, 'relax_spa_colors_upgrade_to_pro', array(
            'section'     => 'colors',
            'settings'    => 'relax_spa_colors_upgrade_to_pro',
            'title'       => __( 'Choose colors that perfectly align with your brand.', 'relax-spa' ),
            'items'       => array(
                'one' => array(
                    'title' => __( 'Additional color options for various parts of your website.', 'relax-spa' ),
                ),
            ),
            'button_url'  => esc_url( 'https://thebootstrapthemes.com/relax-spa/#free-vs-pro' ),
            'button_text' => __( 'Upgrade Now', 'relax-spa' ),
        )) );
    }
}
