<?php
/**
 * Top Bar Options
 *
 * @package Pawfect
 */

// Prevent direct access
if (!defined('ABSPATH')) {
    exit;
}

if (!class_exists('Pawfect_Options_Topbar')):

    class Pawfect_Options_Topbar extends pawfect_Customize_Base_Option
    {

        public function elements()
        {

            return array(

                // Enable/Disable Top Bar
                'pawfect_topbar_enabled' => array(
                    'setting' => array(
                        'default' => true,
                        'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_checkbox'),
                        'transport' => 'refresh',
                    ),
                    'control' => array(
                        'type'        => 'toggle',
                        'label'       => esc_html__('Enable Top Bar', 'pawfect'),
                        'section'     => 'pawfect_topbar_section',
                        'priority'    => 10,
                    ),
                ),

                // Top Bar Background Color
                'pawfect_topbar_bg_color' => array(
                    'setting' => array(
                        'default' => '#333333',
                        'sanitize_callback' => 'sanitize_hex_color',
                    ),
                    'control' => array(
                        'type'        => 'color',
                        'label'       => esc_html__('Top Bar Background Color', 'pawfect'),
                        'section'     => 'pawfect_topbar_section',
                        'priority'    => 20,
                        'active_callback' => array(array($this, 'is_control_value_active'), 'pawfect_topbar_enabled', true),
                    ),
                ),

                // Top Bar Text Color
                'pawfect_topbar_text_color' => array(
                    'setting' => array(
                        'default' => '#ffffff',
                        'sanitize_callback' => 'sanitize_hex_color',
                    ),
                    'control' => array(
                        'type'        => 'color',
                        'label'       => esc_html__('Top Bar Text Color', 'pawfect'),
                        'section'     => 'pawfect_topbar_section',
                        'priority'    => 30,
                        'active_callback' => array(array($this, 'is_control_value_active'), 'pawfect_topbar_enabled', true),
                    ),
                ),

                // Phone Number
                'pawfect_topbar_phone' => array(
                    'setting' => array(
                        'default' => '+1 (555) 123-4567',
                        'sanitize_callback' => 'sanitize_text_field',
                    ),
                    'control' => array(
                        'type'        => 'text',
                        'label'       => esc_html__('Phone Number', 'pawfect'),
                        'section'     => 'pawfect_topbar_section',
                        'priority'    => 40,
                        'active_callback' => array(array($this, 'is_control_value_active'), 'pawfect_topbar_enabled', true),
                    ),
                ),

                // Email Address
                'pawfect_topbar_email' => array(
                    'setting' => array(
                        'default' => 'example@example.com',
                        'sanitize_callback' => 'sanitize_email',
                    ),
                    'control' => array(
                        'type'        => 'text',
                        'label'       => esc_html__('Email Address', 'pawfect'),
                        'section'     => 'pawfect_topbar_section',
                        'priority'    => 50,
                        'active_callback' => array(array($this, 'is_control_value_active'), 'pawfect_topbar_enabled', true),
                    ),
                ),

            );
        }
    }

    new Pawfect_Options_Topbar();

endif;
