<?php
/**
 * Fashion Outfits Trend Theme Customizer
 *
 * @package Fashion Outfits Trend
 */

// Customize Controls.
require get_template_directory() . '/inc/custom-settings-control/customize-controls.php';

// Customize Controls.
require get_template_directory() . '/inc/custom-range-controls.php';

// Sanitization For Customize Controls.
require get_template_directory() . '/inc/custom-settings-control/sanitization.php';

/**
 * Provide postMessage support for the Theme Customizer's site title and description.
 */
function fashion_outfits_trend_customize_register( $wp_customize ) {

	// General Settings Panel.
    $wp_customize->add_panel( 'fashion_outfits_trend_general_settings_panel',
        array(
            'title'      => esc_html__( 'General Settings', 'fashion-outfits-trend' ),
            'priority'   => 2,
            'capability' => 'edit_theme_options',
        )
    );

	// Header Settings Panel.
    $wp_customize->add_panel( 'fashion_outfits_trend_header_settings_panel',
        array(
            'title'      => esc_html__( 'Header Settings', 'fashion-outfits-trend' ),
            'priority'   => 2,
            'capability' => 'edit_theme_options',
        )
    );

    // Frontpage Sections Settings Panel.
    $wp_customize->add_panel( 'fashion_outfits_trend_frontpage_sections_settings_panel',
        array(
            'title'      => esc_html__( 'Frontpage Sections Settings', 'fashion-outfits-trend' ),
            'priority'   => 3,
            'capability' => 'edit_theme_options',
        )
    );

    // Footer Settings Panel.
    $wp_customize->add_panel( 'fashion_outfits_trend_footer_settings_panel',
        array(
            'title'      => esc_html__( 'Footer Settings', 'fashion-outfits-trend' ),
            'priority'   => 3,
            'capability' => 'edit_theme_options',
        )
    );

	// Site Identity

	$wp_customize->get_section( 'title_tagline' )->panel = 'fashion_outfits_trend_header_settings_panel';

	$wp_customize->add_setting(
		'fashion_outfits_trend_site_logo',
		array(
			'default'           => false,
			'sanitize_callback' => 'fashion_outfits_trend_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new Fashion_Outfits_Trend_On_Off_Custom_Control(
			$wp_customize,
			'fashion_outfits_trend_site_logo',
			array(
				'label'    => esc_html__( 'ON / OFF Site Logo', 'fashion-outfits-trend' ),
				'section'  => 'title_tagline',
				'settings' => 'fashion_outfits_trend_site_logo',
			)
		)
	);

	$wp_customize->add_setting(
		'fashion_outfits_trend_site_title_text',
		array(
			'default'           => true,
			'sanitize_callback' => 'fashion_outfits_trend_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new Fashion_Outfits_Trend_On_Off_Custom_Control(
			$wp_customize,
			'fashion_outfits_trend_site_title_text',
			array(
				'label'    => esc_html__( 'ON / OFF Site Title', 'fashion-outfits-trend' ),
				'section'  => 'title_tagline',
				'settings' => 'fashion_outfits_trend_site_title_text',
			)
		)
	);

	$wp_customize->add_setting(
		'fashion_outfits_trend_site_title_font_size',
		array(
			'default'	=> 20,
			'sanitize_callback' => 'fashion_outfits_trend_sanitize_number_range',
		)
	);

	$wp_customize->add_control(
		new fashion_outfits_trend_Slider(
			$wp_customize,
			'fashion_outfits_trend_site_title_font_size',
			array(
				'label'    => esc_html__( 'Site Title Font Size', 'fashion-outfits-trend' ),
				'section'  => 'title_tagline',
				'label' => esc_html__(' Site Title Font Size', 'fashion-outfits-trend'),
		    	'input_attrs' => array(
					'reset'			   => 20,
		            'step'             => 1,
					'min'              => 0,
					'max'              => 50,
		        ),
			)
		)
	);

	$wp_customize->add_setting(
		'fashion_outfits_trend_site_tagline_text',
		array(
			'default'           => false,
			'sanitize_callback' => 'fashion_outfits_trend_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new Fashion_Outfits_Trend_On_Off_Custom_Control(
			$wp_customize,
			'fashion_outfits_trend_site_tagline_text',
			array(
				'label'    => esc_html__( 'ON / OFF Site Tagline', 'fashion-outfits-trend' ),
				'section'  => 'title_tagline',
				'settings' => 'fashion_outfits_trend_site_tagline_text',
			)
		)
	);


$wp_customize->add_setting(
		'fashion_outfits_trend_site_tagline_font_size',
		array(
			'default'	=> 15,
			'sanitize_callback' => 'fashion_outfits_trend_sanitize_number_range',
		)
	);

	$wp_customize->add_control(
		new fashion_outfits_trend_Slider(
			$wp_customize,
			'fashion_outfits_trend_site_tagline_font_size',
			array(
				'label'    => esc_html__( 'Site Tagline Font Size', 'fashion-outfits-trend' ),
				'section'  => 'title_tagline',
				'input_attrs' => array(
					'reset'			   => 15,
		            'step'             => 1,
					'min'              => 0,
					'max'              => 50,
		        ),
			)
		)
	);

	//Woo Coomerce
    $wp_customize->add_setting('fashion_outfits_trend_per_columns',array(
        'default'=> 3,
        'sanitize_callback' => 'fashion_outfits_trend_sanitize_number_absint'
    ));
    $wp_customize->add_control('fashion_outfits_trend_per_columns',array(
        'label' => __('Product Per Row','fashion-outfits-trend'),
        'section'=> 'woocommerce_product_catalog',
        'type'=> 'number',
        'input_attrs' => array(
            'min' => 1,
            'max' => 6,
            'step' => 1,
        ),
    ));
    $wp_customize->add_setting('fashion_outfits_trend_product_per_page',array(
        'default'=> 10,
        'sanitize_callback' => 'fashion_outfits_trend_sanitize_number_absint'
    ));
    $wp_customize->add_control('fashion_outfits_trend_product_per_page',array(
        'label' => __('Product Per Page','fashion-outfits-trend'),
        'section'=> 'woocommerce_product_catalog',
        'type'=> 'number',
        'input_attrs' => array(
            'min' => 1,
            'max' => 20,
            'step' => 1,
        ),
    ));

    $wp_customize->add_section(
		'woocommerce_product_extra_section',
		array(
			'panel'      => 'woocommerce',
			'title'    => esc_html__( 'Extra WooCommerce Settings', 'fashion-outfits-trend' ),
		)
	);

    $wp_customize->add_setting( 'fashion_outfits_trend_single_product_sidebar', array(
		'default'           => true,
		'transport'         => 'refresh',
		'sanitize_callback' => 'fashion_outfits_trend_sanitize_checkbox',
	) );
	$wp_customize->add_control( new Fashion_Outfits_Trend_On_Off_Custom_Control( $wp_customize, 'fashion_outfits_trend_single_product_sidebar', array(
		'label'       => esc_html__( 'Show / Hide Product Page Sidebar', 'fashion-outfits-trend' ),
		'section'     => 'woocommerce_product_extra_section',
		'type'        => 'toggle',
		'settings'    => 'fashion_outfits_trend_single_product_sidebar',
	) ) );
    

	// Header Options

	$wp_customize->add_section(
		'fashion_outfits_trend_header_section',
		array(
			'panel'      => 'fashion_outfits_trend_header_settings_panel',
			'title'    => esc_html__( 'Header Options', 'fashion-outfits-trend' ),
		)
	);


	//MENU TYPOGRAPHY
	

	

	$wp_customize->add_setting('fashion_outfits_trend_menu_font_weight',array(
        'default' => '',
        'sanitize_callback' => 'fashion_outfits_trend_sanitize_choices'
	));
	$wp_customize->add_control('fashion_outfits_trend_menu_font_weight',array(
     'type' => 'radio',
     'label'     => __('Menu Font Weight', 'fashion-outfits-trend'),
     'section' => 'fashion_outfits_trend_header_section',
     'type' => 'select',
     'choices' => array(
         '100' => __('100','fashion-outfits-trend'),
         '200' => __('200','fashion-outfits-trend'),
         '300' => __('300','fashion-outfits-trend'),
         '400' => __('400','fashion-outfits-trend'),
         '500' => __('500','fashion-outfits-trend'),
         '600' => __('600','fashion-outfits-trend'),
         '700' => __('700','fashion-outfits-trend'),
         '800' => __('800','fashion-outfits-trend'),
         '900' => __('900','fashion-outfits-trend')
     ),
	) );
	
	$wp_customize->add_setting('fashion_outfits_trend_menu_text_tranform',array(
		'default' => 'Capitalize',
		'sanitize_callback' => 'fashion_outfits_trend_sanitize_choices'
 	));
 	$wp_customize->add_control('fashion_outfits_trend_menu_text_tranform',array(
		'type' => 'select',
		'label' => __('Menu Text Transform','fashion-outfits-trend'),
		'section' => 'fashion_outfits_trend_header_section',
		'choices' => array(
		   'Uppercase' => __('Uppercase','fashion-outfits-trend'),
		   'Lowercase' => __('Lowercase','fashion-outfits-trend'),
		   'Capitalize' => __('Capitalize','fashion-outfits-trend'),
		),
	) );
	$wp_customize->add_setting('fashion_outfits_trend_menu_font_size', array(
	    'default'	=> 14,
        'sanitize_callback' => 'fashion_outfits_trend_sanitize_number_range',
	));
	$wp_customize->add_control(new fashion_outfits_trend_Slider($wp_customize, 'fashion_outfits_trend_menu_font_size', array(
        'section' => 'fashion_outfits_trend_header_section',
        'label' => esc_html__('Menu Font Size', 'fashion-outfits-trend'),
        'input_attrs' => array(
					'reset'			   => 14,
		            'step'             => 1,
					'min'              => 0,
					'max'              => 35,
		        ),
	)));

	$wp_customize->add_setting(
		'fashion_outfits_trend_sticky_header',
		array(
			'default'           => false,
			'sanitize_callback' => 'fashion_outfits_trend_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new Fashion_Outfits_Trend_On_Off_Custom_Control(
			$wp_customize,
			'fashion_outfits_trend_sticky_header',
			array(
				'label'    => esc_html__( 'ON / OFF Sticky Header', 'fashion-outfits-trend' ),
				'section'  => 'fashion_outfits_trend_header_section',
				'settings' => 'fashion_outfits_trend_sticky_header',
			)
		)
	);

	$wp_customize->add_setting(
        'fashion_outfits_trend_phone_number',
        array(
            'default'           => '+1800-1574-1540',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

	$wp_customize->add_control(
        'fashion_outfits_trend_phone_number',
        array(
            'label'           => sprintf( esc_html__( 'Add Phone Number', 'fashion-outfits-trend' ), ),
            'section'         => 'fashion_outfits_trend_header_section',
            'settings'        => 'fashion_outfits_trend_phone_number' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
        'fashion_outfits_trend_email_address',
        array(
            'default'           => 'info@example.com',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'fashion_outfits_trend_email_address',
        array(
            'label'           => sprintf( esc_html__( 'Add Email Address', 'fashion-outfits-trend' ), ),
            'section'         => 'fashion_outfits_trend_header_section',
            'settings'        => 'fashion_outfits_trend_email_address' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
        'fashion_outfits_trend_address',
        array(
            'default'           => 'Store Location',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

	$wp_customize->add_control(
        'fashion_outfits_trend_address',
        array(
            'label'           => sprintf( esc_html__( 'Add Address', 'fashion-outfits-trend' ), ),
            'section'         => 'fashion_outfits_trend_header_section',
            'settings'        => 'fashion_outfits_trend_address' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
        'fashion_outfits_trend_timing',
        array(
            'default'           => 'Get free home delivery (Order More then $300)',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'fashion_outfits_trend_timing',
        array(
            'label'           => sprintf( esc_html__( 'Add Timing', 'fashion-outfits-trend' ), ),
            'section'         => 'fashion_outfits_trend_header_section',
            'settings'        => 'fashion_outfits_trend_timing' ,
            'type'            => 'text',
        )
    );

	$wp_customize->add_setting(
		'fashion_outfits_trend_wishlist',
		array(
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'fashion_outfits_trend_wishlist',
		array(
			'label'           => sprintf( esc_html__( 'Wishlist Link', 'fashion-outfits-trend' ), ),
			'section'         => 'fashion_outfits_trend_header_section',
			'settings'        => 'fashion_outfits_trend_wishlist',
			'type'            => 'url',
		)
	);

	// Banner Options

	$wp_customize->add_section(
		'fashion_outfits_trend_banner_section',
		array(
			'panel'      => 'fashion_outfits_trend_frontpage_sections_settings_panel',
			'title'    => esc_html__( 'Banner Options', 'fashion-outfits-trend' ),
		)
	);

	$wp_customize->add_setting(
		'fashion_outfits_trend_banner_section_on_off_setting',
		array(
			'default'           => false,
			'sanitize_callback' => 'fashion_outfits_trend_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new Fashion_Outfits_Trend_On_Off_Custom_Control(
			$wp_customize,
			'fashion_outfits_trend_banner_section_on_off_setting',
			array(
				'label'    => esc_html__( 'ON / OFF Banner Section', 'fashion-outfits-trend' ),
				'section'  => 'fashion_outfits_trend_banner_section',
				'settings' => 'fashion_outfits_trend_banner_section_on_off_setting',
			)
		)
	);

	$wp_customize->add_setting(
		'fashion_outfits_trend_discount_text',
		array(
			'default'           => 'Flat 50% Off',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'fashion_outfits_trend_discount_text',
		array(
			'label'           => sprintf( esc_html__( 'Banner Discount Text', 'fashion-outfits-trend' ), ),
			'section'         => 'fashion_outfits_trend_banner_section',
			'settings'        => 'fashion_outfits_trend_discount_text',
			'type'            => 'text',
		)
	);
	
	$wp_customize->add_setting(
		'fashion_outfits_trend_banner_heading',
		array(
			'default'           => 'Fashion That Boosts Your Confidence',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'fashion_outfits_trend_banner_heading',
		array(
			'label'           => sprintf( esc_html__( 'Banner Heading', 'fashion-outfits-trend' ), ),
			'section'         => 'fashion_outfits_trend_banner_section',
			'settings'        => 'fashion_outfits_trend_banner_heading',
			'type'            => 'text',
		)
	);

	$wp_customize->add_setting(
		'fashion_outfits_trend_banner_content',
		array(
			'default'           => 'Munere vocibus pro no. Eu meis exerci deserunt vel, est ignota dolorum consetetur id. Officiis eleifend pat',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'fashion_outfits_trend_banner_content',
		array(
			'label'           => sprintf( esc_html__( 'Banner Content', 'fashion-outfits-trend' ), ),
			'section'         => 'fashion_outfits_trend_banner_section',
			'settings'        => 'fashion_outfits_trend_banner_content',
			'type'            => 'text',
		)
	);

    $wp_customize->add_setting(
        'fashion_outfits_trend_banner_btn',
        array(
            'default'           => 'Shop Now',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'fashion_outfits_trend_banner_btn',
        array(
            'label'           => sprintf( esc_html__( 'Banner Button', 'fashion-outfits-trend' ), ),
            'section'         => 'fashion_outfits_trend_banner_section',
            'settings'        => 'fashion_outfits_trend_banner_btn',
            'type'            => 'text',
        )
    );

	$wp_customize->add_setting(
		'fashion_outfits_trend_banner_button_link',
		array(
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'fashion_outfits_trend_banner_button_link',
		array(
			'label'           => sprintf( esc_html__( 'Banner Button Link', 'fashion-outfits-trend' ), ),
			'section'         => 'fashion_outfits_trend_banner_section',
			'settings'        => 'fashion_outfits_trend_banner_button_link',
			'type'            => 'url',
		)
	);
	
	$wp_customize->add_setting(
		'fashion_outfits_trend_banner_image',
		array(
        	'default'           => '',
        	'sanitize_callback' => 'fashion_outfits_trend_sanitize_image',

    	)
    );
    
    $wp_customize->add_control(
     	new WP_Customize_Image_Control(
    		$wp_customize, 'fashion_outfits_trend_banner_image', 
    		array(
    			'label'           => sprintf( esc_html__( 'Banner Image', 'fashion-outfits-trend' ), ),
		        'settings'  => 'fashion_outfits_trend_banner_image',
		        'section'   => 'fashion_outfits_trend_banner_section'
    		) 
    	)
    );

    $wp_customize->add_setting(
		'fashion_outfits_trend_sale_heading',
		array(
			'default'           => 'BIG SALE',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'fashion_outfits_trend_sale_heading',
		array(
			'label'           => sprintf( esc_html__( 'Banner Big Sale Heading', 'fashion-outfits-trend' ), ),
			'section'         => 'fashion_outfits_trend_banner_section',
			'settings'        => 'fashion_outfits_trend_sale_heading',
			'type'            => 'text',
		)
	);

	$wp_customize->add_setting(
		'fashion_outfits_trend_sale_text',
		array(
			'default'           => 'Pick the best Fashion',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'fashion_outfits_trend_sale_text',
		array(
			'label'           => sprintf( esc_html__( 'Banner Big Sale Content', 'fashion-outfits-trend' ), ),
			'section'         => 'fashion_outfits_trend_banner_section',
			'settings'        => 'fashion_outfits_trend_sale_text',
			'type'            => 'text',
		)
	);

    $wp_customize->add_setting(
		'fashion_outfits_trend_sale_image',
		array(
        	'default'           => '',
        	'sanitize_callback' => 'fashion_outfits_trend_sanitize_image',

    	)
    );
    
    $wp_customize->add_control(
     	new WP_Customize_Image_Control(
    		$wp_customize, 'fashion_outfits_trend_sale_image', 
    		array(
    			'label'           => sprintf( esc_html__( 'Banner Big Sale Image', 'fashion-outfits-trend' ), ),
		        'settings'  => 'fashion_outfits_trend_sale_image',
		        'section'   => 'fashion_outfits_trend_banner_section'
    		) 
    	)
    );


	// Product Option

	$wp_customize->add_section(
		'fashion_outfits_trend_product_section', array(
			'panel'      => 'fashion_outfits_trend_frontpage_sections_settings_panel',
			'title'    => esc_html__( 'Product Options', 'fashion-outfits-trend' ),
		)
	);

	$wp_customize->add_setting(
		'fashion_outfits_trend_product_section_on_off_setting',
		array(
			'default'           => false,
			'sanitize_callback' => 'fashion_outfits_trend_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new Fashion_Outfits_Trend_On_Off_Custom_Control(
			$wp_customize,
			'fashion_outfits_trend_product_section_on_off_setting',
			array(
				'label'    => esc_html__( 'ON / OFF Product Section', 'fashion-outfits-trend' ),
				'section'  => 'fashion_outfits_trend_product_section',
				'settings' => 'fashion_outfits_trend_product_section_on_off_setting',
			)
		)
	);

	$wp_customize->add_setting(
        'fashion_outfits_trend_product_heading',
        array(
            'default'           => 'Limited time offer',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

	$wp_customize->add_control(
        'fashion_outfits_trend_product_heading',
        array(
            'label'           => sprintf( esc_html__( 'Product Heading', 'fashion-outfits-trend' ), ),
            'section'         => 'fashion_outfits_trend_product_section',
            'settings'        => 'fashion_outfits_trend_product_heading' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
        'fashion_outfits_trend_product_paragraph',
        array(
            'default'           => 'It\'s go time 50 off almost everything till may 21, to june 20',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

	$wp_customize->add_control(
        'fashion_outfits_trend_product_paragraph',
        array(
            'label'           => sprintf( esc_html__( 'Product Short Text', 'fashion-outfits-trend' ), ),
            'section'         => 'fashion_outfits_trend_product_section',
            'settings'        => 'fashion_outfits_trend_product_paragraph' ,
            'type'            => 'text',
        )
    );

	$wp_customize->add_setting( 'fashion_outfits_trend_countdown_target_date', array(
        'default'   => 'December 31, 2025 23:59:59',
        'sanitize_callback' => 'sanitize_text_field',
    ));

    $wp_customize->add_control( 'fashion_outfits_trend_countdown_target_date', array(
        'label'   => __( 'Target Date (e.g., December 31, 2025 23:59:59)', 'fashion-outfits-trend' ),
        'section' => 'fashion_outfits_trend_product_section',
        'settings'=> 'fashion_outfits_trend_countdown_target_date',
        'type'    => 'text',
    ));


	// Post Categories
	$categories = get_terms(array(
	    'taxonomy'   => 'product_cat',
	    'hide_empty' => false,
	));

	$cat_posts = array();
	$cat_posts[] = 'Select'; // Add a default "Select" option

	// Ensure categories are returned as objects
	if (!is_wp_error($categories) && !empty($categories)) {
	    foreach ($categories as $category) {
	        if (is_object($category)) {
	            $cat_posts[$category->slug] = $category->name;
	        }
	    }
	} else {
	    // Handle error or no categories found
	    $cat_posts[] = __('No categories available', 'fashion-outfits-trend');
	}

	// Add Customizer setting
	$wp_customize->add_setting(
	    'fashion_outfits_trend_trending_post_slider_args',
	    array(
	        'default'           => 'product_cat1',
	        'sanitize_callback' => 'fashion_outfits_trend_sanitize_choices',
	    )
	);

	// Add Customizer control
	$wp_customize->add_control(
	    'fashion_outfits_trend_trending_post_slider_args',
	    array(
	        'type'    => 'select',
	        'choices' => $cat_posts,
	        'label'   => __('Select category to display products', 'fashion-outfits-trend'),
	        'section' => 'fashion_outfits_trend_product_section',
	    )
	);

	$wp_customize->add_setting(
        'fashion_outfits_trend_shop_now_btn',
        array(
            'default'           => 'Shop Now',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'fashion_outfits_trend_shop_now_btn',
        array(
            'label'           => sprintf( esc_html__( 'Shop Button', 'fashion-outfits-trend' ), ),
            'section'         => 'fashion_outfits_trend_product_section',
            'settings'        => 'fashion_outfits_trend_shop_now_btn',
            'type'            => 'text',
        )
    );

	$wp_customize->add_setting(
		'fashion_outfits_trend_shop_now_btn_link',
		array(
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'fashion_outfits_trend_shop_now_btn_link',
		array(
			'label'           => sprintf( esc_html__( 'Shop Button Link', 'fashion-outfits-trend' ), ),
			'section'         => 'fashion_outfits_trend_product_section',
			'settings'        => 'fashion_outfits_trend_shop_now_btn_link',
			'type'            => 'url',
		)
	);

	// Global Color Options

	$wp_customize->add_section(
		'fashion_outfits_trend_global_color_section',
		array(
			'panel'      => 'fashion_outfits_trend_general_settings_panel',
			'title'    => esc_html__( 'Global Color Options', 'fashion-outfits-trend' ),
		)
	);

	$wp_customize->add_setting(
		'fashion_outfits_trend_global_color',
		array(
			'default'           => '#F47771',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);
	
	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'fashion_outfits_trend_global_color',
			array(
				'label'    => __( 'Global Color', 'fashion-outfits-trend' ),
				'section'  => 'fashion_outfits_trend_global_color_section',
			)
		)
	);

	// Global Font Family Options

	$wp_customize->add_section(
		'fashion_outfits_trend_global_font_section',
		array(
			'panel'      => 'fashion_outfits_trend_general_settings_panel',
			'title'    => esc_html__( 'Global Font Family Options', 'fashion-outfits-trend' ),
		)
	);

	$wp_customize->add_setting(
		'fashion_outfits_trend_global_font_setting',
		array(
			'default'           => '',
			'sanitize_callback' => 'fashion_outfits_trend_sanitize_google_fonts',
		)
	);
	
	$wp_customize->add_control(
		'fashion_outfits_trend_global_font_setting',
		array(
			'label'    => esc_html__( 'Global Font Family', 'fashion-outfits-trend' ),
			'section'  => 'fashion_outfits_trend_global_font_section',
			'settings' => 'fashion_outfits_trend_global_font_setting',
			'type'     => 'select',
			'choices'  => fashion_outfits_trend_get_all_google_font_families(),
		)
	);	

	// Footer Option

	$wp_customize->add_section(
		'fashion_outfits_trend_footer_widgets_section',
		array(
			'panel'      => 'fashion_outfits_trend_footer_settings_panel',
			'title'    => esc_html__( 'Footer Widgets Options', 'fashion-outfits-trend' ),
		)
	);

	$wp_customize->add_setting(
		'fashion_outfits_trend_footer_widgets_section_on_off_setting',
		array(
			'default'           => true,
			'sanitize_callback' => 'fashion_outfits_trend_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new Fashion_Outfits_Trend_On_Off_Custom_Control(
			$wp_customize,
			'fashion_outfits_trend_footer_widgets_section_on_off_setting',
			array(
				'label'    => esc_html__( 'ON / OFF Footer Widgets', 'fashion-outfits-trend' ),
				'section'  => 'fashion_outfits_trend_footer_widgets_section',
				'settings' => 'fashion_outfits_trend_footer_widgets_section_on_off_setting',
			)
		)
	);

	$wp_customize->add_setting( 'fashion_outfits_trend_footer_widget_background_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fashion_outfits_trend_footer_widget_background_color', array(
		'label'     => __('Footer Widget Background Color', 'fashion-outfits-trend'),
		'description' => __('It will change the complete footer widget background color.', 'fashion-outfits-trend'),
		'section' => 'fashion_outfits_trend_footer_widgets_section',
		'settings' => 'fashion_outfits_trend_footer_widget_background_color',
	)));

	$wp_customize->add_setting('fashion_outfits_trend_footer_widget_background_image',array(
		'default'   => '',
		'sanitize_callback' => 'esc_url_raw',
	));
	$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'fashion_outfits_trend_footer_widget_background_image',array(
		'label' => __('Footer Widget Background Image','fashion-outfits-trend'),
		'section' => 'fashion_outfits_trend_footer_widgets_section'
	)));

	$wp_customize->add_setting('fashion_outfits_trend_footer_widget_text_position',array(
        'default' => 'Left',
        'sanitize_callback' => 'fashion_outfits_trend_sanitize_choices'
    ));
    $wp_customize->add_control('fashion_outfits_trend_footer_widget_text_position',array(
        'type' => 'radio',
        'label'     => __('Footer Widget Position', 'fashion-outfits-trend'),
        'description'   => __('This option work for footer widget', 'fashion-outfits-trend'),
		'section' => 'fashion_outfits_trend_footer_widgets_section',
		'choices' => array(
            'Right' => __('Right','fashion-outfits-trend'),
            'Left' => __('Left','fashion-outfits-trend'),
            'Center' => __('Center','fashion-outfits-trend')
     ),
    ) );
	
	$wp_customize->add_section(
		'fashion_outfits_trend_copyright_section',
		array(
			'panel'      => 'fashion_outfits_trend_footer_settings_panel',
			'title'    => esc_html__( 'Copyright Options', 'fashion-outfits-trend' ),
		)
	);

	$wp_customize->add_setting(
		'fashion_outfits_trend_copyright_section_on_off_setting',
		array(
			'default'           => true,
			'sanitize_callback' => 'fashion_outfits_trend_sanitize_on_off',
		)
	);

	$wp_customize->add_control(
		new Fashion_Outfits_Trend_On_Off_Custom_Control(
			$wp_customize,
			'fashion_outfits_trend_copyright_section_on_off_setting',
			array(
				'label'    => esc_html__( 'ON / OFF Copyright', 'fashion-outfits-trend' ),
				'section'  => 'fashion_outfits_trend_copyright_section',
				'settings' => 'fashion_outfits_trend_copyright_section_on_off_setting',
			)
		)
	);

	$wp_customize->add_setting(
		'fashion_outfits_trend_footer_text',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'fashion_outfits_trend_footer_text',
		array(
			'label'           => sprintf( esc_html__( 'Edit Copyright Text', 'fashion-outfits-trend' ), ),
			'section'         => 'fashion_outfits_trend_copyright_section',
			'settings'        => 'fashion_outfits_trend_footer_text' ,
			'type'            => 'text',
		)
	);

	$wp_customize->add_setting( 'fashion_outfits_trend_footer_copyright_background_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'fashion_outfits_trend_footer_copyright_background_color', array(
		'label'     => __('Copyright Background Color', 'fashion-outfits-trend'),
		'description' => __('It will change the complete footer copyright background color.', 'fashion-outfits-trend'),
		'section' => 'fashion_outfits_trend_copyright_section',
		'settings' => 'fashion_outfits_trend_footer_copyright_background_color',
	)));

	// Add Settings and Controls for Copyright
	$wp_customize->add_setting('fashion_outfits_trend_footer_copright_text_position',array(
        'default' => 'Center',
        'sanitize_callback' => 'fashion_outfits_trend_sanitize_choices'
	));
	$wp_customize->add_control('fashion_outfits_trend_footer_copright_text_position',array(
        'type' => 'radio',
        'label'     => __('Copyright Position', 'fashion-outfits-trend'),
        'description'   => __('This option work for copyright', 'fashion-outfits-trend'),
       'section' => 'fashion_outfits_trend_copyright_section',
       'choices' => array(
            'Right' => __('Right','fashion-outfits-trend'),
            'Left' => __('Left','fashion-outfits-trend'),
            'Center' => __('Center','fashion-outfits-trend')
     ),
	) );

	// Add Settings and Controls for Scroll top
	$wp_customize->add_setting('fashion_outfits_trend_scroll_top_position',array(
        'default' => 'Right',
        'sanitize_callback' => 'fashion_outfits_trend_sanitize_choices'
	));
	$wp_customize->add_control('fashion_outfits_trend_scroll_top_position',array(
        'type' => 'radio',
        'label'     => __('Scroll to top Position', 'fashion-outfits-trend'),
        'description'   => __('This option work for scroll to top', 'fashion-outfits-trend'),
       'section' => 'fashion_outfits_trend_copyright_section',
       'choices' => array(
            'Right' => __('Right','fashion-outfits-trend'),
            'Left' => __('Left','fashion-outfits-trend'),
            'Center' => __('Center','fashion-outfits-trend')
     ),
	) );

}
add_action( 'customize_register', 'fashion_outfits_trend_customize_register' );

/**
 * Create the site title for the partial selective refresh.
 *
 * @return void
 */
function fashion_outfits_trend_customize_partial_blogname() {
	bloginfo( 'name' );
}

/**
 * Create the website's slogan for the partial selective refresh.
 *
 * @return void
 */
function fashion_outfits_trend_customize_partial_blogdescription() {
	bloginfo( 'description' );
}

/**
 * Singleton class for handling the theme's customizer integration.
 *
 * @since  1.0.0
 * @access public
 */
final class Fashion_Outfits_Trend_Customize_Buttons {
	/**
	 * Returns the instance.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return object
	 */
	public static function Fashion_Outfits_Trend_get_instance() {

		static $fashion_outfits_trend_instance = null;

		if ( is_null( $fashion_outfits_trend_instance ) ) {
			$fashion_outfits_trend_instance = new self;
			$fashion_outfits_trend_instance->Fashion_Outfits_Trend_setup_actions();
		}

		return $fashion_outfits_trend_instance;
	}

	/**
	 * Constructor method.
	 *
	 * @since  1.0.0
	 * @access private
	 * @return void
	 */
	private function __construct() {}

	/**
	 * Sets up initial actions.
	 *
	 * @since  1.0.0
	 * @access private
	 * @return void
	 */
	private function Fashion_Outfits_Trend_setup_actions() {

		// Register panels, sections, settings, controls, and partials.
		add_action( 'customize_register', array( $this, 'sections' ) );

		// Register scripts and styles for the controls.
		add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ), 0 );
	}

	/**
	 * Sets up the customizer sections.
	 *
	 * @since  1.0.0
	 * @access public
	 * @param  object  $fashion_outfits_trend_manager
	 * @return void
	*/
	public function sections( $fashion_outfits_trend_manager ) {
		load_template( trailingslashit( get_template_directory() ) . '/inc/fashion-outfits-trend-section-pro.php' );

		$fashion_outfits_trend_manager->register_section_type( 'Fashion_Outfits_Trend_Customize_Section_Pro' );

		$fashion_outfits_trend_manager->add_section( new Fashion_Outfits_Trend_Customize_Section_Pro( $fashion_outfits_trend_manager,'fashion_outfits_trend_buy_now', array(
			'priority'   => 1,
			'title'    => esc_html__( 'Buy Fashion Outfits Trend Pro', 'fashion-outfits-trend' ),
			'pro_text' => esc_html__( 'Buy Pro Theme', 'fashion-outfits-trend' ),
			'pro_url'    => esc_url( FASHION_OUTFITS_TREND_BUY_NOW ),
		) )	);

		$fashion_outfits_trend_manager->add_section( new Fashion_Outfits_Trend_Customize_Section_Pro( $fashion_outfits_trend_manager, 'fashion_outfits_trend_live_demo', array(
		    'priority'   => 1,
		    'title'      => esc_html__( 'Preview Pro Theme', 'fashion-outfits-trend' ),
		    'pro_text'   => esc_html__( 'View Live Demo', 'fashion-outfits-trend' ),
		    'pro_url'    => esc_url( FASHION_OUTFITS_TREND_LIVE_DEMO ),
		) ) );	
	}

	/**
	 * Loads theme customizer CSS.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return void
	 */
	public function enqueue_control_scripts() {

		wp_enqueue_script( 'fashion-outfits-trend-customize-controls', trailingslashit( get_template_directory_uri() ) . '/assets/js/customize-controls.js', array( 'customize-controls' ) );

		wp_enqueue_style( 'fashion-outfits-trend-customize-controls', trailingslashit( get_template_directory_uri() ) . '/assets/css/customize-controls.css' );
	}
}
Fashion_Outfits_Trend_Customize_Buttons::Fashion_Outfits_Trend_get_instance();