<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

/**
 * Frontpage Service Options.
 *
 * @package pawfect
 */

if ( ! class_exists( 'Pawfect_Options_Service' ) ) :

    class Pawfect_Options_Service extends pawfect_Customize_Base_Option {

        /**
         * Arguments for options.
         *
         * @return array
         */
        public function elements() {

            return array(

                'pawfect_main_service_heading' => array(
                    'setting' => array(),
                    'control' => array(
                        'type'     => 'heading',
                        'priority' => 1,
                        'label'    => esc_html__( 'Service Options', 'pawfect' ),
                        'section'  => 'pawfect_theme_service',
                    ),
                ),

                'pawfect_service_area_enabled' => array(
                    'setting' => array(
                        'default'           => true,
                        'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_checkbox' ),
                    ),
                    'control' => array(
                        'type'     => 'toggle',
                        'priority' => 2,
                        'label'    => esc_html__( 'Enable Service Section', 'pawfect' ),
                        'description' => esc_html__('Toggle ON to show this section', 'pawfect'),
                        'section'  => 'pawfect_theme_service',
                    ),
                ),

                'pawfect_service_container_size' => array(
                    'setting' => array(
                        'default'           => 'container',
                        'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_radio' ),
                    ),
                    'control' => array(
                        'type'            => 'radio',
                        'priority'        => 25,
                        'is_default_type' => true,
                        'label'           => esc_html__( 'Service Width', 'pawfect' ),
                        'section'         => 'pawfect_theme_service',
                        'choices'         => array(
                            'container'      => esc_html__( 'Container', 'pawfect' ),
                            'container-full' => esc_html__( 'Container Full', 'pawfect' ),
                        ),
                        'active_callback' => [
                            [ $this, 'is_control_value_active' ],
                            'pawfect_service_area_enabled',
                            true
                        ],
                    ),
                ),

                'pawfect_service_column_layout' => array(
                    'setting' => array(
                        'default'           => 'col-md-4',
                        'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_radio' ),
                    ),
                    'control' => array(
                        'type'    => 'radio_image',
                        'priority' => 30,
                        'label'    => esc_html__( 'Column Layout', 'pawfect' ),
                        'section'  => 'pawfect_theme_service',
                        'choices'  => array(
                            'col-md-6' => PAWFECT_THEME_URL . '/assets/images/icons/column-2.png',
                            'col-md-4' => PAWFECT_THEME_URL . '/assets/images/icons/column-3.png',
                            'col-md-3' => PAWFECT_THEME_URL . '/assets/images/icons/column-4.png',
                        ),
                        'active_callback' => [
                            [ $this, 'is_control_value_active' ],
                            'pawfect_service_area_enabled',
                            true
                        ],
                    ),
                ),

                'pawfect_service_card_style' => array(
                    'setting' => array(
                        'default' => 'modern',
                        'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_radio'),
                    ),
                    'control' => array(
                        'type' => 'radio-switch',
                        'priority' => 52,
                        'label' => esc_html__('Card Style', 'pawfect'),
                        'section' => 'pawfect_theme_service',
                        'choices' => array(
                            'classic' => esc_html__('Classic', 'pawfect'),
                            'modern' => esc_html__('Modern', 'pawfect'),
                        ),
                        'active_callback' => [
                            [ $this, 'is_control_value_active' ],
                            'pawfect_service_area_enabled',
                            true
                        ],
                    ),
                ),

                'pawfect_service_count' => array(
                    'setting' => array(
                        'default'           => array(
                            'slider' => 3,
                            'suffix' => '',
                        ),
                        'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_slider' ),
                    ),
                    'control' => array(
                        'type' => 'pawfect-slider',
                        'priority'    => 55,
                        'label'       => esc_html__( 'HomePage Service Count', 'pawfect' ),
                        'section'     => 'pawfect_theme_service',
                        'input_attrs' => array(
                            'min'  => 2,
                            'max'  => 20,
                            'step' => 1,
                        ),
                        'active_callback' => [
                            [ $this, 'is_control_value_active' ],
                            'pawfect_service_area_enabled',
                            true
                        ],
                    ),
                ),
            );
        }
    }

    new Pawfect_Options_Service();

endif;



