<?php 
// Columns Footer
$wp_customize->add_setting(
    'footer_widget_areas',
    array(
        'default'           => themesflat_customize_default('footer_widget_areas'),
        'sanitize_callback' => 'themesflat_sanitize_grid_post_related',
    )
);
$wp_customize->add_control(
    'footer_widget_areas',
    array(
        'type'      => 'select',           
        'section'   => 'section_footer',
        'priority'  => 1,
        'label'     => esc_html__('Columns Footer', 'norstar'),
        'choices'   => array(                
            1     => esc_html__( '1 Columns', 'norstar' ),
            2     => esc_html__( '2 Columns', 'norstar' ),
            3     => esc_html__( '3 Columns', 'norstar' ),
            4     => esc_html__( '4 Columns ( 4 | 2 | 2 | 4 )', 'norstar' ),
            5     => esc_html__( '5 Columns ( 3 | 2 | 2 | 2 | 3 )', 'norstar' ),                  
        )
    )
); 

// Footer Box control
$wp_customize->add_setting(
    'footer_controls',
    array(
        'default' => themesflat_customize_default('footer_controls'),
        'sanitize_callback' => 'themesflat_sanitize_text',
    )
);
$wp_customize->add_control( new themesflat_BoxControls($wp_customize,
    'footer_controls',
    array(
        'label' => esc_html__( 'Footer Box Controls (px)', 'norstar' ),
        'section' => 'section_footer',
        'type' => 'box-controls',
        'priority' => 2
    ))
);

// footer logo
$wp_customize->add_setting(
    'footer_logo',
    array(
        'default' => themesflat_customize_default('footer_logo'),
        'sanitize_callback' => 'esc_url_raw',
    )
);    
$wp_customize->add_control(
    new WP_Customize_Image_Control(
        $wp_customize,
        'footer_logo',
        array(
           'label'          => esc_html__( 'Upload Your Footer Logo ', 'norstar' ),           
           'type'           => 'image',
           'section'        => 'section_footer',
           'priority'       => 3,
        )
    )
);

 

// footer social links

$wp_customize->add_setting(
    'social_links_footer',
    array(
      'sanitize_callback' => 'esc_attr',
      'default' => themesflat_customize_default('social_links_footer'),     
    )   
  );
  $wp_customize->add_control( new themesflat_SocialIcons($wp_customize,
      'social_links_footer',
      array(
          'type' => 'social-icons',
          'label' => esc_html__('Social Media', 'norstar'),
          'section' => 'section_footer',
          'priority' => 4,
      ))
  );

  $wp_customize->add_setting (
    'footer_email',
    array(
        'default' => themesflat_customize_default('footer_email'),
        'sanitize_callback' => 'themesflat_sanitize_text'
    )
);
$wp_customize->add_control(
    'footer_email',
    array(
        'type'      => 'text',
        'label'     => esc_html__('Email Address', 'norstar'),
        'section'   => 'section_footer',
        'priority'  => 5
    )
); 

$wp_customize->add_setting (
    'footer_phone',
    array(
        'default' => themesflat_customize_default('footer_phone'),
        'sanitize_callback' => 'themesflat_sanitize_text'
    )
);
$wp_customize->add_control(
    'footer_phone',
    array(
        'type'      => 'text',
        'label'     => esc_html__('Phone Number', 'norstar'),
        'section'   => 'section_footer',
        'priority'  => 5
    )
);  

// Footer Copyright
$wp_customize->add_setting(
    'footer_copyright',
    array(
        'default' => themesflat_customize_default('footer_copyright'),
        'sanitize_callback' => 'themesflat_sanitize_text',
    )
);
$wp_customize->add_control(
    'footer_copyright',
    array(
        'label' => esc_html__( 'Copyright', 'norstar' ),
        'section' => 'section_footer',
        'type' => 'textarea',
        'priority' => 6
    )
);

// Footer Background Image
$wp_customize->add_setting(
    'footer_background_image',
    array(
        'default' => themesflat_customize_default('footer_background_image'),
        'sanitize_callback' => 'esc_url_raw',
    )
);    
$wp_customize->add_control(
    new WP_Customize_Image_Control(
        $wp_customize,
        'footer_background_image',
        array(
           'label'          => esc_html__( 'Upload Your Footer Background Image ', 'norstar' ),           
           'type'           => 'image',
           'section'        => 'section_footer',
           'priority'       => 7,
        )
    )
);