<?php
/**
 * lz-toy-store: Customizer
 *
 * @subpackage lz-toy-store
 * @since 1.0
 */

function lz_toy_store_customize_register( $wp_customize ) {

	$wp_customize->add_setting('lz_toy_store_logo_size',array(
		'default' => '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_logo_size',array(
		'type' => 'range',
		'description' => __('Logo Size (0-100%)','lz-toy-store'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('lz_toy_store_logo_padding',array(
		'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('lz_toy_store_logo_padding',array(
		'label' => __('Logo Padding','lz-toy-store'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('lz_toy_store_logo_top_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_logo_top_padding',array(
		'type' => 'number',
		'description' => __('Top','lz-toy-store'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('lz_toy_store_logo_bottom_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_logo_bottom_padding',array(
		'type' => 'number',
		'description' => __('Bottom','lz-toy-store'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('lz_toy_store_logo_left_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_logo_left_padding',array(
		'type' => 'number',
		'description' => __('Left','lz-toy-store'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('lz_toy_store_logo_right_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_logo_right_padding',array(
		'type' => 'number',
		'description' => __('Right','lz-toy-store'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('lz_toy_store_show_site_title',array(
      'default' => true,
      'sanitize_callback'	=> 'lz_toy_store_sanitize_checkbox'
   ));
   $wp_customize->add_control('lz_toy_store_show_site_title',array(
      'type' => 'checkbox',
      'label' => __('Show / Hide Site Title','lz-toy-store'),
      'section' => 'title_tagline'
   ));

	$wp_customize->add_setting('lz_toy_store_site_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_site_title_font_size',array(
		'type' => 'number',
		'label' => __('Site Title Font Size','lz-toy-store'),
		'section' => 'title_tagline',
	));

   $wp_customize->add_setting('lz_toy_store_show_tagline',array(
      'default' => true,
      'sanitize_callback'	=> 'lz_toy_store_sanitize_checkbox'
   ));
   $wp_customize->add_control('lz_toy_store_show_tagline',array(
      'type' => 'checkbox',
      'label' => __('Show / Hide Site Tagline','lz-toy-store'),
      'section' => 'title_tagline'
   ));

	$wp_customize->add_setting('lz_toy_store_site_tagline_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_site_tagline_font_size',array(
		'type' => 'number',
		'label' => __('Site Tagline Font Size','lz-toy-store'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_panel( 'lz_toy_store_panel_id', array(
	   'priority' => 10,
	   'capability' => 'edit_theme_options',
	   'theme_supports' => '',
	   'title' => __( 'Theme Settings', 'lz-toy-store' ),
	   'description' => __( 'Description of what this panel does.', 'lz-toy-store' ),
	) );

	$wp_customize->add_section( 'lz_toy_store_theme_options_section', array(
    	'title'      => __( 'General Settings', 'lz-toy-store' ),
		'priority'   => 30,
		'panel' => 'lz_toy_store_panel_id'
	) );

	// Add Settings and Controls for Layout
	$wp_customize->add_setting('lz_toy_store_theme_options',array(
      'default' => 'Right Sidebar',
      'sanitize_callback' => 'lz_toy_store_sanitize_choices'
	));
	$wp_customize->add_control('lz_toy_store_theme_options',array(
      'type' => 'radio',
      'label' => __('Do you want this section','lz-toy-store'),
      'section' => 'lz_toy_store_theme_options_section',
      'choices' => array(
         'Left Sidebar' => __('Left Sidebar','lz-toy-store'),
         'Right Sidebar' => __('Right Sidebar','lz-toy-store'),
         'One Column' => __('One Column','lz-toy-store'),
         'Three Columns' => __('Three Columns','lz-toy-store'),
         'Four Columns' => __('Four Columns','lz-toy-store'),
         'Grid Layout' => __('Grid Layout','lz-toy-store')
      ),
	));

	$wp_customize->add_setting( 'lz_toy_store_boxfull_width', array(
		'default'           => '',
		'sanitize_callback' => 'lz_toy_store_sanitize_choices'
	));
	
	$wp_customize->add_control( 'lz_toy_store_boxfull_width', array(
		'label'    => __( 'Section Width', 'lz-toy-store' ),
		'section'  => 'lz_toy_store_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'container'  => __('Box Width', 'lz-toy-store'),
			'container-fluid' => __('Full Width', 'lz-toy-store'),
			'none' => __('None', 'lz-toy-store')
		),
	));

	$wp_customize->add_setting( 'lz_toy_store_dropdown_anim', array(
		'default'           => 'None',
		'sanitize_callback' => 'lz_toy_store_sanitize_choices'
	));
	$wp_customize->add_control( 'lz_toy_store_dropdown_anim', array(
		'label'    => __( 'Menu Dropdown Animations', 'lz-toy-store' ),
		'section'  => 'lz_toy_store_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInUp'  => __('bounceInUp', 'lz-toy-store'),
			'fadeInUp' => __('fadeInUp', 'lz-toy-store'),
			'zoomIn'    => __('zoomIn', 'lz-toy-store'),
			'None'    => __('None', 'lz-toy-store')
		),
	));

	// Contact Details
	$wp_customize->add_section( 'lz_toy_store_contact_details', array(
    	'title'      => __( 'Header Contact Details Settins', 'lz-toy-store' ),
		'priority'   => null,
		'panel' => 'lz_toy_store_panel_id'
	) );

	$wp_customize->add_setting('lz_toy_store_hide_show_topbar',array(
    	'default' => false,
    	'sanitize_callback'	=> 'lz_toy_store_sanitize_checkbox'
	));
	$wp_customize->add_control('lz_toy_store_hide_show_topbar',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide Topbar','lz-toy-store'),
   	'section' => 'lz_toy_store_contact_details',
	));

	$wp_customize->add_setting('lz_toy_store_address',array(
		'default'=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('lz_toy_store_address',array(
		'label'	=> __('Address','lz-toy-store'),
		'section'=> 'lz_toy_store_contact_details',
		'setting'=> 'lz_toy_store_address',
		'type'=> 'text'
	));	

	$wp_customize->add_setting('lz_toy_store_call',array(
		'default'=> '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_phone_number'
	));	
	$wp_customize->add_control('lz_toy_store_call',array(
		'label'	=> __('Contact Number','lz-toy-store'),
		'section'=> 'lz_toy_store_contact_details',
		'setting'=> 'lz_toy_store_call',
		'type'=> 'text'
	));

	$wp_customize->add_setting( 'lz_toy_store_toptext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_toptext_color', array(
		'label' => 'Text Color',
		'section' => 'lz_toy_store_contact_details',
	)));

	$wp_customize->add_setting( 'lz_toy_store_topicon_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_topicon_color', array(
		'label' => 'Icon Color',
		'section' => 'lz_toy_store_contact_details',
	)));

	$wp_customize->add_setting( 'lz_toy_store_topbdr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_topbdr_color', array(
		'label' => 'Border Color',
		'section' => 'lz_toy_store_contact_details',
	)));

	$wp_customize->add_setting( 'lz_toy_store_headermenu_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_headermenu_color', array(
		'label' => 'Menu Color',
		'section' => 'lz_toy_store_contact_details',
	)));

	$wp_customize->add_setting( 'lz_toy_store_headermenuhvr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_headermenuhvr_color', array(
		'label' => 'Menu Hover Color',
		'section' => 'lz_toy_store_contact_details',
	)));

	$wp_customize->add_setting( 'lz_toy_store_headerschtext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_headerschtext_color', array(
		'label' => 'Search Field Text Color',
		'section' => 'lz_toy_store_contact_details',
	)));

	$wp_customize->add_setting( 'lz_toy_store_headerschbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_headerschbg_color', array(
		'label' => 'Search Field Bg Color',
		'section' => 'lz_toy_store_contact_details',
	)));

	$wp_customize->add_setting( 'lz_toy_store_headercarticon_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_headercarticon_color', array(
		'label' => 'Cart Icon Color',
		'section' => 'lz_toy_store_contact_details',
	)));

	$wp_customize->add_setting( 'lz_toy_store_headercarttext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_headercarttext_color', array(
		'label' => 'Cart Text Color',
		'section' => 'lz_toy_store_contact_details',
	)));

	//home page slider
	$wp_customize->add_section( 'lz_toy_store_slider_section' , array(
    	'title'      => __( 'Slider Settings', 'lz-toy-store' ),
		'priority'   => null,
		'panel' => 'lz_toy_store_panel_id'
	) );

	$wp_customize->add_setting('lz_toy_store_slider_hide_show',array(
    	'default' => false,
    	'sanitize_callback'	=> 'lz_toy_store_sanitize_checkbox'
	));
	$wp_customize->add_control('lz_toy_store_slider_hide_show',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide slider','lz-toy-store'),
		'section' => 'lz_toy_store_slider_section',
	));

	$wp_customize->add_setting( 'lz_toy_store_slider_effect', array(
		'default'           => '',
		'sanitize_callback' => 'lz_toy_store_sanitize_choices'
	));
	$wp_customize->add_control( 'lz_toy_store_slider_effect', array(
		'label'    => __( 'Onload Transactions Effects', 'lz-toy-store' ),
		'section'  => 'lz_toy_store_slider_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInLeft'  => __('bounceInLeft', 'lz-toy-store'),
			'bounceInRight' => __('bounceInRight', 'lz-toy-store'),
			'bounceInUp'    => __('bounceInUp', 'lz-toy-store'),
			'bounceInDown'    => __('bounceInDown', 'lz-toy-store'),
			'zoomIn'  => __('zoomIn', 'lz-toy-store'),
			'zoomOut' => __('zoomOut', 'lz-toy-store'),
			'fadeInDown'    => __('fadeInDown', 'lz-toy-store'),
			'fadeInUp'    => __('fadeInUp', 'lz-toy-store'),
			'fadeInLeft'  => __('fadeInLeft', 'lz-toy-store'),
			'fadeInRight' => __('fadeInRight', 'lz-toy-store'),
			'flip-up'    => __('flip-up', 'lz-toy-store'),
			'none'    => __('none', 'lz-toy-store')
		),
	));

	for ( $count = 1; $count <= 4; $count++ ) {
		$wp_customize->add_setting( 'lz_toy_store_slider' . $count, array(
			'default'           => '',
			'sanitize_callback' => 'lz_toy_store_sanitize_dropdown_pages'
		) );
		$wp_customize->add_control( 'lz_toy_store_slider' . $count, array(
			'label'    => __( 'Select Slide Image Page', 'lz-toy-store' ),
			'section'  => 'lz_toy_store_slider_section',
			'type'     => 'dropdown-pages'
		) );
	}

	$wp_customize->add_setting('lz_toy_store_slider_excerpt_length',array(
		'default' => '10',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_slider_excerpt_length',array(
		'type' => 'number',
		'label' => __('Slider Excerpt Length','lz-toy-store'),
		'section' => 'lz_toy_store_slider_section',
	));

	$wp_customize->add_setting('lz_toy_store_slider_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_slider_title_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','lz-toy-store'),
		'section' => 'lz_toy_store_slider_section',
	));

	$wp_customize->add_setting('lz_toy_store_slider_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_slider_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','lz-toy-store'),
		'section' => 'lz_toy_store_slider_section',
	));

	$wp_customize->add_setting( 'lz_toy_store_slider_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_slider_color', array(
		'label' => 'Title Color',
		'section' => 'lz_toy_store_slider_section',
	)));

	$wp_customize->add_setting( 'lz_toy_store_sliderbdr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_sliderbdr_color', array(
		'label' => 'Title Outer Color',
		'section' => 'lz_toy_store_slider_section',
	)));

	$wp_customize->add_setting( 'lz_toy_store_slider_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_slider_text_color', array(
		'label' => 'Text Color',
		'section' => 'lz_toy_store_slider_section',
	)));

	// Product on Sale
	$wp_customize->add_section( 'lz_toy_store_our_services' , array(
    	'title'      => __( 'Product on Sale', 'lz-toy-store' ),
		'priority'   => null,
		'panel' => 'lz_toy_store_panel_id'
	) );

	$wp_customize->add_setting( 'lz_toy_store_servicesettings_page', array(
      'default'           => '',
      'sanitize_callback' => 'lz_toy_store_sanitize_dropdown_pages'
    ));
    $wp_customize->add_control( 'lz_toy_store_servicesettings_page', array(
      'label'    => __( 'Select Product Page', 'lz-toy-store' ),
      'description'	=> __('Add Image of size 885 x 60','lz-toy-store'),
      'section'  => 'lz_toy_store_our_services',
      'type'     => 'dropdown-pages'
    ));

	$wp_customize->add_setting('lz_toy_store_services_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_services_title_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','lz-toy-store'),
		'section' => 'lz_toy_store_our_services',
	));

	$wp_customize->add_setting( 'lz_toy_store_services_title_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_services_title_color', array(
		'label' => 'Title Color',
		'section' => 'lz_toy_store_our_services',
	)));

	$wp_customize->add_setting( 'lz_toy_store_services_btn_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_services_btn_color', array(
		'label' => 'Button Text Color',
		'section' => 'lz_toy_store_our_services',
	)));

	$wp_customize->add_setting( 'lz_toy_store_services_btnbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_services_btnbg_color', array(
		'label' => 'Button BG Color',
		'section' => 'lz_toy_store_our_services',
	)));

	//New Arrivals
	$wp_customize->add_section( 'lz_toy_store_trending_page' , array(
    	'title'      => __( 'New Arrivals', 'lz-toy-store' ),
		'priority'   => null,
		'panel' => 'lz_toy_store_panel_id'
	) );

	$wp_customize->add_setting( 'lz_toy_store_trending_products', array(
		'default'           => '',
		'sanitize_callback' => 'lz_toy_store_sanitize_dropdown_pages'
	));
	$wp_customize->add_control( 'lz_toy_store_trending_products', array(
		'label'   => __( 'Select Page', 'lz-toy-store' ),
		'section' => 'lz_toy_store_trending_page',
		'type'    => 'dropdown-pages'
	));

	$wp_customize->add_setting('lz_toy_store_trending_products_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_trending_products_title_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','lz-toy-store'),
		'section' => 'lz_toy_store_trending_page',
	));

	$wp_customize->add_setting('lz_toy_store_product_section_padding',array(
      'default' => '',
      'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_product_section_padding',array(
		'type' => 'number',
		'label' => __('Section Top Bottom Padding','lz-toy-store'),
		'section' => 'lz_toy_store_trending_page',
	));

	$wp_customize->add_setting('lz_toy_store_img_hight',array(
		'default' => '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_img_hight',array(
		'type' => 'number',
		'label' => __('Image Hight','lz-toy-store'),
		'section' => 'lz_toy_store_trending_page',
	));

   $wp_customize->add_setting( 'lz_toy_store_trending_color', array(
	'default' => '',
	'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_trending_color', array(
		'label' => 'Text Color',
		'section' => 'lz_toy_store_trending_page',
	)));

	//Footer
    $wp_customize->add_section( 'lz_toy_store_footer', array(
    	'title'      => __( 'Footer Setting', 'lz-toy-store' ),
		'priority'   => null,
		'panel' => 'lz_toy_store_panel_id'
	) );

	$wp_customize->add_setting('lz_toy_store_show_back_totop',array(
 		'default' => true,
   	'sanitize_callback'	=> 'lz_toy_store_sanitize_checkbox'
	));
	$wp_customize->add_control('lz_toy_store_show_back_totop',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide Back to Top','lz-toy-store'),
   	'section' => 'lz_toy_store_footer'
	));
 
 	$wp_customize->add_setting('lz_toy_store_footer_copy',array(
		'default'	=> 'Toy Store WordPress Theme By Luzuk',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('lz_toy_store_footer_copy',array(
		'label'	=> __('Copyright Text','lz-toy-store'),
		'section'	=> 'lz_toy_store_footer',
		'setting'	=> 'lz_toy_store_footer_copy',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('lz_toy_store_footer_copylink',array(
		'default'	=> 'https://www.luzuk.com/products/free-toy-store-wordpress-theme/',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('lz_toy_store_footer_copylink',array(
		'label'	=> __('Copyright Link','lz-toy-store'),
		'section'	=> 'lz_toy_store_footer',
		'setting'	=> 'lz_toy_store_footer_copylink',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('lz_toy_store_footer_copy_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
	));
	$wp_customize->add_control('lz_toy_store_footer_copy_font_size',array(
		'type' => 'number',
		'label' => __('Copyright Font Size','lz-toy-store'),
		'section' => 'lz_toy_store_footer',
	));

	$wp_customize->add_setting('lz_toy_store_copyright_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'lz_toy_store_sanitize_float'
 	));
 	$wp_customize->add_control('lz_toy_store_copyright_padding',array(
		'type' => 'number',
		'label' => __('Copyright Top Bottom Padding','lz-toy-store'),
		'section' => 'lz_toy_store_footer',
	));

	$wp_customize->add_setting( 'lz_toy_store_copyright_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'lz_toy_store_copyright_color', array(
		'label' => 'Copyright Text Color',
		'section' => 'lz_toy_store_footer',
	)));

	$wp_customize->get_setting( 'blogname' )->transport          = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport   = 'postMessage';
	$wp_customize->get_setting( 'header_textcolor' )->transport  = 'postMessage';

	$wp_customize->selective_refresh->add_partial( 'blogname', array(
		'selector' => '.site-title a',
		'render_callback' => 'lz_toy_store_customize_partial_blogname',
	) );
	$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
		'selector' => '.site-description',
		'render_callback' => 'lz_toy_store_customize_partial_blogdescription',
	) );
}
add_action( 'customize_register', 'lz_toy_store_customize_register' );

function lz_toy_store_customize_partial_blogname() {
	bloginfo( 'name' );
}

function lz_toy_store_customize_partial_blogdescription() {
	bloginfo( 'description' );
}

function lz_toy_store_is_static_front_page() {
	return ( is_front_page() && ! is_home() );
}

function lz_toy_store_is_view_with_layout_option() {
	// This option is available on all pages. It's also available on archives when there isn't a sidebar.
	return ( is_page() || ( is_archive() && ! is_active_sidebar( 'sidebar-1' ) ) );
}

/**
 * Singleton class for handling the theme's customizer integration.
 *
 * @since  1.0.0
 * @access public
 */
final class LZ_Toy_Store_Customize {

	/**
	 * Returns the instance.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return object
	 */
	public static function get_instance() {

		static $instance = null;

		if ( is_null( $instance ) ) {
			$instance = new self;
			$instance->setup_actions();
		}

		return $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 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  $manager
	 * @return void
	 */
	public function sections( $manager ) {

		// Load custom sections.
		load_template( trailingslashit( get_template_directory() ) . '/inc/section-pro.php' );

		// Register custom section types.
		$manager->register_section_type( 'LZ_Toy_Store_Customize_Section_Pro' );

		// Register sections.
		$manager->add_section(
			new LZ_Toy_Store_Customize_Section_Pro(
				$manager,
				'lz_toy_store_example_1',
				array(
					'priority' => 9,
					'title'    => esc_html__( 'Toy Store Pro', 'lz-toy-store' ),
					'pro_text' => esc_html__( 'Go Pro','lz-toy-store' ),
					'pro_url'  => esc_url( 'https://www.luzuk.com/products/toy-store-wordpress-theme/' ),
				)
			)
		);
	}

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

		wp_enqueue_script( 'lz-toy-store-customize-controls', trailingslashit( esc_url(get_template_directory_uri()) ) . '/assets/js/customize-controls.js', array( 'customize-controls' ) );

		wp_enqueue_style( 'lz-toy-store-customize-controls', trailingslashit( esc_url(get_template_directory_uri()) ) . '/assets/css/customize-controls.css' );
	}
}

// Doing this customizer thang!
LZ_Toy_Store_Customize::get_instance();