<?php 
/**
 * Createing an offer pannel for customizer
 *
 */
// Product offer SECTION START HERE 
/*============ offer PANEL============*/
$wp_customize->add_section(
	'offer_section',
	array(
		'title'         => __( 'Offer Section', 'supermarket-ecommerce' ), 
		'panel'   => 'lz_fitness_premium_home_panel',
	)
);
// ENABLE/DISABLE offer SECTION
$wp_customize->add_setting(
	'offer_section_disable',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default' => 'off'
	)
);
$wp_customize->add_control(
	new lz_fitness_Switch_Control(
		$wp_customize,
		'offer_section_disable',
		array(
			'settings'      => 'offer_section_disable',
			'section'       => 'offer_section',
			'label'         => __( 'Disable Section', 'supermarket-ecommerce' ), 
			'on_off_label'  => array(
				'on' => __( 'Yes', 'supermarket-ecommerce' ),
				'off' => __( 'No', 'supermarket-ecommerce' )
			)   
		)
	)
);

backgroundManager($wp_customize, 'offer', 'offer_section', $color='#605ca8', get_template_directory_uri().'/images/default-gray.png', 'img');


lzCustomLable($wp_customize, 'offersection_padding', 'offer_section', ' Section Padding Setting:');

$wp_customize->add_setting(
    'offer_toppadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '2em', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'offer_toppadding',
    array(
        'settings'      => 'offer_toppadding',
        'section'       => 'offer_section',
        'type'          => 'text',
        'label'         => __( 'Section Top Padding', 'luzuk-premium' )
    )
);
$wp_customize->add_setting(
    'offer_bottompadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '2em', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'offer_bottompadding',
    array(
        'settings'      => 'offer_bottompadding',
        'section'       => 'offer_section',
        'type'          => 'text',
        'label'         => __( 'Section Bottom Padding', 'luzuk-premium' )
    )
);
$wp_customize->add_setting(
    'offer_leftpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '0px', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'offer_leftpadding',
    array(
        'settings'      => 'offer_leftpadding',
        'section'       => 'offer_section',
        'type'          => 'text',
        'label'         => __( 'Section Left Padding', 'luzuk-premium' )
    )
);
$wp_customize->add_setting(
    'offer_rightpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '0px', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'offer_rightpadding',
    array(
        'settings'      => 'offer_rightpadding',
        'section'       => 'offer_section',
        'type'          => 'text',
        'label'         => __( 'Section Right Padding', 'luzuk-premium' )
    )
);


  $wp_customize->add_setting(
        'lz_fitness_offer_title_heading',
        array(
            'sanitize_callback' => 'lz_fitness_sanitize_text'
        )
    );
    $wp_customize->add_control(
        new lz_fitness_Customize_Heading(
            $wp_customize,
            'lz_fitness_offer_title_heading',
            array(
                'settings'      => 'lz_fitness_offer_title_heading',
                'section'       => 'offer_section',
                'label'         => __( 'Title & Subtitle', 'supermarket-ecommerce' ),
            )
        )
    );    
    $wp_customize->add_setting(
        'lz_fitness_offer_title',
        array(
            'sanitize_callback' => 'lz_fitness_sanitize_text',
            'default'           => __( 'Recieve <strong>20&#37 Off</strong> For Your First Shopping', 'supermarket-ecommerce' )
        )
    );
    $wp_customize->add_control(
        'lz_fitness_offer_title',
        array(
            'settings'      => 'lz_fitness_offer_title',
            'section'       => 'offer_section',
            'type'          => 'textarea',
            'label'         => __( 'Title for section', 'supermarket-ecommerce' )
        )
    );

     // title color
    addColorPalatOption($wp_customize, 'lz_fitness_offer_titleColor', 'offer_section', 'Title color', '#fff');

    lzAddElement($wp_customize, 'lz_fitness_offer_subTitle', 'offer_section', 'textarea', $label="Sub Title", 'lz_fitness_sanitize_text', 'We also offer discount coupones for your permenant customers, So enjoy shoopping with us');

       //sub title color
    addColorPalatOption($wp_customize, 'lz_fitness_offer_subtitleColor', 'offer_section', 'Sub title color', '#fff');


lzCustomLable($wp_customize, 'lz_fitness_offer_lblbuttonabtdisplay', 'offer_section', 'Button Display & Text Setting:');
// to show & hide another button
$wp_customize->add_setting( 'offer_button_display' , array( 'default' => true, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'offer_button_display', array( 'label' => 'Button Display', 'section' => 'offer_section', 'settings' => 'offer_button_display', 'type' => 'radio', 'choices' => array( 'show' => 'Show Button', 'hide' => 'Hide Button', ), ) ); 
// end to show & hide button
// appointment 
$wp_customize->add_setting(
    'lz_fitness_offer_btntitle',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( 'START SHOPPING' )
    )
);
$wp_customize->add_control(
    'lz_fitness_offer_btntitle',
    array(
        'settings'      => 'lz_fitness_offer_btntitle',
        'section'       => 'offer_section',
        'type'          => 'text',
        'label'         => __( 'Button Text', 'supermarket-ecommerce' )
    )
);
$wp_customize->add_setting('lz_fitness_offer_btnlink',   array('default'=> 'add link here', 'sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control('lz_fitness_offer_btnlink',
    array(
        'settings'      => 'lz_fitness_offer_btnlink',
        'section'       => 'offer_section',
        'type'          => 'url',
        'label'         => __( 'Add "Button" link here', 'supermarket-ecommerce' )
    )
);


     //button text color
    addColorPalatOption($wp_customize, 'lz_fitness_offer_btntextColor', 'offer_section', 'Button text color', '#353849');

    //button bg color
    addColorPalatOption($wp_customize, 'lz_fitness_offer_btnbgColor', 'offer_section', 'Button background color', '#fff');

      //button text hover color
    addColorPalatOption($wp_customize, 'lz_fitness_offer_btntexthoverColor', 'offer_section', 'Button text hover color', '#fff');

    //button bg hover color
    addColorPalatOption($wp_customize, 'lz_fitness_offer_btnbghoverColor', 'offer_section', 'Button background hover color', '#605ca8');
