<?php

$default = prime_interior_designer_get_default_theme_options();
/**
* Add Header Top Panel
*/
$wp_customize->add_setting('logo_width', array(
    'sanitize_callback' => 'absint', 
));
// Add a control for logo width
$wp_customize->add_control('logo_width', array(
    'label' => __('Logo Width', 'prime-interior-designer'),
    'section' => 'title_tagline',
    'type' => 'number',
    'input_attrs' => array(
        'min' => '50', 
        'max' => '500', 
        'step' => '5', 
    ),
    'default' => '100', 
));
$wp_customize->add_setting( 'prime_interior_designer_site_title_size', array(
    'default'           => 32, // Default font size in pixels
    'sanitize_callback' => 'absint', // Sanitize the input as a positive integer
) );

// Add control for site title size
$wp_customize->add_control( 'prime_interior_designer_site_title_size', array(
    'type'        => 'number',
    'section'     => 'title_tagline', // You can change this section to your preferred section
    'label'       => __( 'Site Title Font Size (px)', 'prime-interior-designer' ),
    'input_attrs' => array(
        'min'  => 10,
        'max'  => 100,
        'step' => 1,
    ),
) );
$wp_customize->add_setting('show_site_description', array(
    'default' => false, // Set default to true (show site description)
    'transport' => 'refresh',
    'sanitize_callback' => 'prime_interior_designer_sanitize_checkbox',
));

$wp_customize->add_control('show_site_description_control', array(
    'label' => __('Show Site Description', 'prime-interior-designer'),
    'section' => 'title_tagline',
    'settings' => 'show_site_description',
    'type' => 'checkbox',
));
$wp_customize->add_panel( 'header_top_panel', array(
    'title'          => __( 'Header Top', 'prime-interior-designer' ),
    'priority'       => 20,
    'capability'     => 'edit_theme_options',
) );
$wp_customize->add_panel( 'header_top_panel', array(
    'title'          => __( 'Header Top', 'prime-interior-designer' ),
    'priority'       => 20,
    'capability'     => 'edit_theme_options',
) );

/** Header contact info section */
$wp_customize->add_section(
    'header_contact_info_section',
    array(
        'title'    => __( 'Topbar Discount Text', 'prime-interior-designer' ),
        'panel'    => 'header_top_panel',
        'priority' => 10,
    )
);

/** Header contact info control */
$wp_customize->add_setting( 
    'theme_options[show_header_contact_info]', 
    array(
        'default'           => $default['show_header_contact_info'],
        'sanitize_callback' => 'prime_interior_designer_sanitize_checkbox',
    ) 
);

$wp_customize->add_control(
    'theme_options[show_header_contact_info]',
    array(
        'label'       => __( 'Show Discount Text', 'prime-interior-designer' ),
        'section'     => 'header_contact_info_section',
        'type'        => 'checkbox',
    )
);

$wp_customize->add_setting( 'theme_options[header_discount_text]', array(
    'default'           => 'FREE HEAVY SHIPPING ON ORDERS OVER $200',
    'sanitize_callback' => 'sanitize_text_field',
) );

$wp_customize->add_control(
    'theme_options[header_discount_text]',
    array(
        'label'           => __( 'Discount Text', 'prime-interior-designer' ),
        'description'     => __( 'Enter Text.', 'prime-interior-designer' ),
        'section'         => 'header_contact_info_section',
        'active_callback' => 'prime_interior_designer_contact_info_ac',
    )
);

/** Header Button section */
$wp_customize->add_section(
    'header_button_info_section',
    array(
        'title'    => __( 'Header Button', 'prime-interior-designer' ),
        'panel'    => 'header_top_panel',
        'priority' => 10,
    )
);

/** Header contact info control */
$wp_customize->add_setting( 
    'theme_options[show_header_button_info]', 
    array(
        'default'           => $default['show_header_button_info'],
        'sanitize_callback' => 'prime_interior_designer_sanitize_checkbox',
    ) 
);

$wp_customize->add_control(
    'theme_options[show_header_button_info]',
    array(
        'label'       => __( 'Show Button', 'prime-interior-designer' ),
        'section'     => 'header_button_info_section',
        'type'        => 'checkbox',
    )
);

$wp_customize->add_setting( 'theme_options[header_button_txt]', array(
    'default'           => 'SHOP ALL ART',
    'sanitize_callback' => 'sanitize_text_field',
) );

$wp_customize->add_control(
    'theme_options[header_button_txt]',
    array(
        'label'           => __( 'Button Text', 'prime-interior-designer' ),
        'description'     => __( 'Enter Text.', 'prime-interior-designer' ),
        'section'         => 'header_button_info_section',
        'active_callback' => 'prime_interior_designer_button_info_ac',
    )
);

$wp_customize->add_setting( 'theme_options[header_button_url]', array(
    'sanitize_callback' => 'esc_url_raw',
) );

$wp_customize->add_control(
    'theme_options[header_button_url]',
    array(
        'label'           => __( 'Button Link', 'prime-interior-designer' ),
        'description'     => __( 'Enter Link.', 'prime-interior-designer' ),
        'section'         => 'header_button_info_section',
        'active_callback' => 'prime_interior_designer_button_info_ac',
    )
);