<?php
namespace Enteraddons\Widgets\Infobox;

use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Group_Control_Typography;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Background;
use Elementor\Group_Control_Border;

// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}

/**
 *
 * Enteraddons elementor widget.
 *
 * @since 1.0
 */

class Infobox extends Widget_Base
{

    public function get_name()
    {
        return 'enteraddons-infobox';
    }

    public function get_title()
    {
        return esc_html__('Info Box', 'enteraddons');
    }

    public function get_icon()
    {
        return 'entera entera-info-box';
    }

    public function get_categories()
    {
        return ['enteraddons-elements-category'];
    }

    protected function register_controls()
    {

        $repeater = new \Elementor\Repeater();

        // ----------------------------------------  Infobox content ------------------------------
        $this->start_controls_section(
            'enteraddons_infobox_content',
            [
                'label' => esc_html__('Infobox Content', 'enteraddons'),
            ]
        );
        $this->add_control(
            'title',
            [
                'label' => esc_html__('Title', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'dynamic' => [
                    'active' => true,
                ],
                'label_block' => true,
                'default' => esc_html__('Case Investigations', 'enteraddons')
            ]
        );
        $this->add_control(
            'title_tag',
            [
                'label' => esc_html__('Set HTML Tag', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    'h1' => 'H1',
                    'h2' => 'H2',
                    'h3' => 'H3',
                    'h4' => 'H4',
                    'h5' => 'H5',
                    'h6' => 'H6',
                    'span' => 'span',
                    'p' => 'p',
                    'div' => 'div'
                ],
                'default' => 'h5'
            ]
        );
        $this->add_control(
            'description',
            [
                'label' => esc_html__('Description', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::WYSIWYG,
                'dynamic' => [
                    'active' => true,
                ],
                'label_block' => true,
                'default' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipisicing elit sed', 'enteraddons')
            ]
        );

        $this->end_controls_section(); // End Infobox content
        // ----------------------------------------  Infobox Icon ------------------------------
        $this->start_controls_section(
            'enteraddons_infobox_icon',
            [
                'label' => esc_html__('Icon', 'enteraddons'),
            ]
        );
        $this->add_control(
            'infobox_icon_position',
            [
                'label' => esc_html__('Icon Position', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'default' => 'top',
                'options' => [
                    'top' => esc_html__('Top', 'enteraddons'),
                    'left' => esc_html__('Left', 'enteraddons'),
                    'right' => esc_html__('Right', 'enteraddons'),
                ],
            ]
        );
        $this->add_responsive_control(
            'infobox_icon_vertical_position',
            [
                'label' => esc_html__('Icon Vertical Position', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'condition' => ['infobox_icon_position' => ['left', 'right']],
                'default' => 'center',
                'options' => [
                    'flex-start' => esc_html__('Top', 'enteraddons'),
                    'center' => esc_html__('Center', 'enteraddons'),
                    'flex-end' => esc_html__('Bottom', 'enteraddons'),
                ],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon' => 'align-items: {{VALUE}};'
                ],
            ]
        );
        $this->add_control(
            'icon_type',
            [
                'label' => esc_html__('Icon Type', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'default' => 'icon',
                'options' => [
                    'icon' => esc_html__('Icon', 'enteraddons'),
                    'img' => esc_html__('Image', 'enteraddons'),
                ],
            ]
        );
        $this->add_control(
            'icon',
            [
                'label' => esc_html__('Icon', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'condition' => ['icon_type' => 'icon'],
                'default' => [
                    'value' => 'fas fa-star',
                    'library' => 'solid',
                ],
            ]
        );
        $this->add_control(
            'image',
            [
                'label' => esc_html__('Normal Image', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'dynamic' => [
                    'active' => true,
                ],
                'condition' => ['icon_type' => 'img'],
                'default' => [
                    'url' => \Elementor\Utils::get_placeholder_image_src(),
                ],
            ]
        );
        $this->add_control(
            'hover_image',
            [
                'label' => esc_html__('Hover Image', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'dynamic' => [
                    'active' => true,
                ],
                'condition' => ['icon_type' => 'img'],
                'default' => [
                    'url' => \Elementor\Utils::get_placeholder_image_src(),
                ],
            ]
        );
        $this->add_control(
            'icon_divider',
            [
                'label' => esc_html__('Icon Divider', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => esc_html__('Show', 'enteraddons'),
                'label_off' => esc_html__('Hide', 'enteraddons'),
                'return_value' => 'yes',
                'default' => 'no',
            ]
        );
        $this->end_controls_section(); // End Infobox Icon
        // ----------------------------------------  Infobox Ribbon ------------------------------
        $this->start_controls_section(
            'enteraddons_infobox_ribbon',
            [
                'label' => esc_html__('Ribbon', 'enteraddons'),
            ]
        );
        $this->add_control(
            'infobox_ribbon_switch',
            [
                'label' => esc_html__('Show Ribbon', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => esc_html__('Show', 'enteraddons'),
                'label_off' => esc_html__('Hide', 'enteraddons'),
                'return_value' => 'yes',
                'default' => '',
            ]
        );
        $this->add_control(
            'infobox_ribbon_title',
            [
                'label' => esc_html__('Ribbon Title', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'dynamic' => [
                    'active' => true,
                ],
                'label_block' => true,
                'default' => esc_html__('New', 'enteraddons')
            ]
        );
        $this->end_controls_section(); // End Infobox Ribbon
        // ----------------------------------------  Infobox Button ------------------------------
        $this->start_controls_section(
            'enteraddons_infobox_btn_content',
            [
                'label' => esc_html__('Infobox Link/Button', 'enteraddons'),
            ]
        );
        $this->add_control(
            'wrapper_link',
            [
                'label' => esc_html__('Do you want to set item wrapper Link?', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => esc_html__('Yes', 'enteraddons'),
                'label_off' => esc_html__('No', 'enteraddons'),
                'return_value' => 'yes',
                'default' => '',
            ]
        );
        $this->add_control(
            'btn_text',
            [
                'label' => esc_html__('Button Text', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'dynamic' => [
                    'active' => true,
                ],
                'label_block' => true,
                'default' => esc_html__('Read More', 'enteraddons'),
                'condition' => ['wrapper_link' => '']
            ]
        );
        $this->add_control(
            'link',
            [
                'label' => esc_html__('Link', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::URL,
                'dynamic' => [
                    'active' => true,
                ],
                'placeholder' => esc_html__('https://your-link.com', 'enteraddons'),
                'show_external' => true,
                'default' => [
                    'url' => '',
                    'is_external' => true,
                    'nofollow' => true,
                ],
            ]
        );
        $this->add_control(
            'icon_position',
            [
                'label' => esc_html__('Button Icon Position', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'default' => 'right',
                'options' => [
                    'right' => esc_html__('Right', 'enteraddons'),
                    'left' => esc_html__('Left', 'enteraddons'),
                ],
                'condition' => ['wrapper_link' => '']
            ]
        );
        $this->add_control(
            'button_icon',
            [
                'label' => esc_html__('Button Normal Icon', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'fas fa-arrow-right',
                    'library' => 'solid',
                ],
                'condition' => ['wrapper_link' => '']
            ]
        );
        $this->add_control(
            'button_hover_icon',
            [
                'label' => esc_html__('Button Hover Icon', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'fas fa-arrow-right',
                    'library' => 'solid',
                ],
                'condition' => ['wrapper_link' => '']
            ]
        );
        $this->end_controls_section(); // End Infobox content

        /**
         * Style Tab
         * ------------------------------ Infobox Wrapper Style ------------------------------
         *
         */
        $this->start_controls_section(
            'enteraddons_infobox_content_settings',
            [
                'label' => esc_html__('Wrapper Settings', 'enteraddons'),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
        $this->add_responsive_control(
            'info_box_item_width',
            [
                'label' => esc_html__('Width', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['%', 'px', 'vw'],
                'range' => [
                    '%' => [
                        'min' => 1,
                        'max' => 100,
                    ],
                    'px' => [
                        'min' => 1,
                        'max' => 1000,
                    ],
                    'vw' => [
                        'min' => 1,
                        'max' => 100,
                    ],
                ],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box' => 'width: {{SIZE}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'info_box_item_height',
            [
                'label' => esc_html__('Height', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['%', 'px', 'vh'],
                'range' => [
                    '%' => [
                        'min' => 1,
                        'max' => 100,
                    ],
                    'px' => [
                        'min' => 1,
                        'max' => 1000,
                    ],
                    'vh' => [
                        'min' => 1,
                        'max' => 100,
                    ],
                ],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box' => 'height: {{SIZE}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'item_flex_alignment',
            [
                'label' => esc_html__('Flex Alignment', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::CHOOSE,
                'options' => [
                    'flex-start' => [
                        'title' => esc_html__('Left', 'enteraddons'),
                        'icon' => 'eicon-h-align-left',
                    ],
                    'center' => [
                        'title' => esc_html__('Center', 'enteraddons'),
                        'icon' => 'eicon-h-align-center',
                    ],
                    'flex-end' => [
                        'title' => esc_html__('Right', 'enteraddons'),
                        'icon' => 'eicon-h-align-right',
                    ],
                ],
                'default' => '',
                'toggle' => true,
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con' => 'display:flex;justify-content:{{VALUE}} !important',
                ],
            ]
        );
        $this->start_controls_tabs('tab_infobox');

        //  Controls tab For Normal
        $this->start_controls_tab(
            'item_normal',
            [
                'label' => esc_html__('Normal', 'enteraddons'),
            ]
        );

        $this->add_responsive_control(
            'item_alignment',
            [
                'label' => esc_html__('Content Alignment', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::CHOOSE,
                'options' => [
                    'left' => [
                        'title' => esc_html__('Left', 'enteraddons'),
                        'icon' => 'eicon-text-align-left',
                    ],
                    'center' => [
                        'title' => esc_html__('Center', 'enteraddons'),
                        'icon' => 'eicon-text-align-center',
                    ],
                    'right' => [
                        'title' => esc_html__('Right', 'enteraddons'),
                        'icon' => 'eicon-text-align-right',
                    ],
                ],
                'default' => 'center',
                'toggle' => true,
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box' => 'text-align: {{VALUE}} !important',
                ],
            ]
        );

        $this->add_responsive_control(
            'item_margin',
            [
                'label' => esc_html__('Margin', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'item_padding',
            [
                'label' => esc_html__('Padding', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Border::get_type(),
            [
                'name' => 'item_border',
                'label' => esc_html__('Border', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box',
            ]
        );
        $this->add_responsive_control(
            'item_radius',
            [
                'label' => esc_html__('Border Radius', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Box_Shadow::get_type(),
            [
                'name' => 'item_shadow',
                'label' => esc_html__('Box Shadow', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box',
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Background::get_type(),
            [
                'name' => 'item_background',
                'label' => esc_html__('Background', 'enteraddons'),
                'types' => ['classic', 'gradient'],
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box',
            ]
        );

        $this->end_controls_tab(); // End Controls tab

        //  Controls tab For Hover
        $this->start_controls_tab(
            'item_hover',
            [
                'label' => esc_html__('Hover', 'enteraddons'),
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Border::get_type(),
            [
                'name' => 'item_hover_border',
                'label' => esc_html__('Border', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box:hover',
            ]
        );
        $this->add_responsive_control(
            'item_hover_radius',
            [
                'label' => esc_html__('Border Radius', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Box_Shadow::get_type(),
            [
                'name' => 'item_hover_shadow',
                'label' => esc_html__('Box Shadow', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box:hover',
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Background::get_type(),
            [
                'name' => 'item_hover_background',
                'label' => esc_html__('Background', 'enteraddons'),
                'types' => ['classic', 'gradient'],
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box:hover',
            ]
        );
        $this->add_control(
            'infobox_hover_effect',
            [
                'label' => esc_html__('Hover Effect', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'default' => 'hover-effect-none',
                'options' => [
                    'hover-effect-none' => esc_html__('None', 'enteraddons'),
                    'hover-border-btm-effect' => esc_html__('Border Bottom Effect', 'enteraddons'),
                    'hover-saclup-effect' => esc_html__('Saclup Effect', 'enteraddons'),
                ],
            ]
        );

        $this->end_controls_tab(); // End Controls tab

        $this->end_controls_tabs(); //  end controls tabs section

        $this->end_controls_section();

        /**
         * Style Tab
         * ------------------------------ Infobox Content Area Style ------------------------------
         *
         */
        $this->start_controls_section(
            'enteraddons_infobox_content_area_settings',
            [
                'label' => esc_html__('Content Area Settings', 'enteraddons'),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
        $this->add_responsive_control(
            'item_content_area_margin',
            [
                'label' => esc_html__('Margin', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'item_content_area_padding',
            [
                'label' => esc_html__('Padding', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Border::get_type(),
            [
                'name' => 'item_content_area_border',
                'label' => esc_html__('Border', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-content',
            ]
        );
        $this->add_responsive_control(
            'item_content_area_radius',
            [
                'label' => esc_html__('Border Radius', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Box_Shadow::get_type(),
            [
                'name' => 'item_content_area_shadow',
                'label' => esc_html__('Box Shadow', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-content',
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Background::get_type(),
            [
                'name' => 'item_content_area_background',
                'label' => esc_html__('Background', 'enteraddons'),
                'types' => ['classic', 'gradient'],
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-content',
            ]
        );
        $this->end_controls_section();
        /**
         * Style Tab
         * ------------------------------ Infobox Title Style Settings ------------------------------
         *
         */
        $this->start_controls_section(
            'enteraddons_infobox_name_settings',
            [
                'label' => esc_html__('Title', 'enteraddons'),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );

        $this->start_controls_tabs('tab_infobox_title');

        //  Controls tab For Normal
        $this->start_controls_tab(
            'title_normal',
            [
                'label' => esc_html__('Normal', 'enteraddons'),
            ]
        );

        $this->add_control(
            'title_color',
            [
                'label' => esc_html__('Title Color', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-content .enteraddons-info-box-title' => 'color: {{VALUE}}',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'title_typography',
                'label' => esc_html__('Typography', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-content .enteraddons-info-box-title',
            ]
        );
        $this->add_responsive_control(
            'title_margin',
            [
                'label' => esc_html__('Margin', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-content .enteraddons-info-box-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'title_padding',
            [
                'label' => esc_html__('Padding', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-content .enteraddons-info-box-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->end_controls_tab(); // End Controls tab

        //  Controls tab For Hover
        $this->start_controls_tab(
            'title_hover',
            [
                'label' => esc_html__('Hover', 'enteraddons'),
            ]
        );
        $this->add_control(
            'title_hover_color',
            [
                'label' => esc_html__('Title Hover Color', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box:hover .enteraddons-info-box-content .enteraddons-info-box-title' => 'color: {{VALUE}}',
                ],
            ]
        );
        $this->end_controls_tab(); // End Controls tab

        $this->end_controls_tabs(); //  end controls tabs section

        $this->end_controls_section();

        /**
         * Style Tab
         * ------------------------------ Infobox Descriptions Style Settings ------------------------------
         *
         */
        $this->start_controls_section(
            'enteraddons_infobox_descriptions_settings',
            [
                'label' => esc_html__('Descriptions', 'enteraddons'),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
        $this->start_controls_tabs('tab_infobox_descriptions');
        //  Controls tab For Normal
        $this->start_controls_tab(
            'descriptions_normal',
            [
                'label' => esc_html__('Normal', 'enteraddons'),
            ]
        );

        $this->add_control(
            'descriptions_color',
            [
                'label' => esc_html__('Title Color', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-content p' => 'color: {{VALUE}}',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'descriptions_typography',
                'label' => esc_html__('Typography', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-content p',
            ]
        );
        $this->add_responsive_control(
            'descriptions_margin',
            [
                'label' => esc_html__('Margin', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-content p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'descriptions_padding',
            [
                'label' => esc_html__('Padding', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-content p' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $this->end_controls_tab(); // End Controls tab
        //  Controls tab For Hover
        $this->start_controls_tab(
            'descriptions_hover',
            [
                'label' => esc_html__('Hover', 'enteraddons'),
            ]
        );
        $this->add_control(
            'descriptions_hover_color',
            [
                'label' => esc_html__('Descriptions Hover Color', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box:hover .enteraddons-info-box-content p' => 'color: {{VALUE}}',
                ],
            ]
        );

        $this->end_controls_tab(); // End Controls tab

        $this->end_controls_tabs(); //  end controls tabs section

        $this->end_controls_section();

        /**
         * Style Tab
         * ------------------------------ Infobox Icon Style Settings ------------------------------
         *
         */
        $this->start_controls_section(
            'enteraddons_infobox_icon_settings',
            [
                'label' => esc_html__('Icon', 'enteraddons'),
                'condition' => ['icon_type' => 'icon'],
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
        $this->start_controls_tabs('tab_infobox_icon');
        //  Controls tab For Normal
        $this->start_controls_tab(
            'icon_normal',
            [
                'label' => esc_html__('Normal', 'enteraddons'),
            ]
        );
        $this->add_control(
            'icon_color',
            [
                'label' => esc_html__('Icon Color', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon i' => 'color: {{VALUE}}',
                ],
            ]
        );
        $this->add_responsive_control(
            'icon_size',
            [
                'label' => esc_html__('Icon Size', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 1000,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => '%',
                    'size' => '',
                ],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon i' => 'font-size: {{SIZE}}{{UNIT}};',
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon img' => 'width: {{SIZE}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'icon_width',
            [
                'label' => esc_html__('Icon Container Width', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 1000,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => '%',
                    'size' => '',
                ],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon' => 'width: {{SIZE}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'icon_height',
            [
                'label' => esc_html__('Icon Container Height', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 1000,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => '%',
                    'size' => '',
                ],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon' => 'height: {{SIZE}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'icon_margin',
            [
                'label' => esc_html__('Margin', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'icon_padding',
            [
                'label' => esc_html__('Padding', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Border::get_type(),
            [
                'name' => 'icon_border',
                'label' => esc_html__('Border', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon',
            ]
        );
        $this->add_responsive_control(
            'icon_border_radius',
            [
                'label' => esc_html__('Border Radius', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Box_Shadow::get_type(),
            [
                'name' => 'icon_box_shadow',
                'label' => esc_html__('Box Shadow', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon',
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Background::get_type(),
            [
                'name' => 'background',
                'label' => esc_html__('Background', 'enteraddons'),
                'types' => ['classic', 'gradient'],
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon',
            ]
        );

        $this->end_controls_tab(); // End Controls tab

        //  Controls tab For Hover
        $this->start_controls_tab(
            'icon_hover',
            [
                'label' => esc_html__('Hover', 'enteraddons'),
            ]
        );
        $this->add_control(
            'icon_hover_color',
            [
                'label' => esc_html__('Icon Color', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box:hover .enteraddons-info-box-icon i' => 'color: {{VALUE}}',
                ],
            ]
        );

        $this->end_controls_tab(); // End Controls tab

        $this->end_controls_tabs(); //  end controls tabs section
        $this->end_controls_section();

        /**
         * Style Tab
         * ------------------------------ Infobox Ribbon Style Settings ------------------------------
         *
         */
        $this->start_controls_section(
            'enteraddons_infobox_ribbon_settings',
            [
                'label' => esc_html__('Ribbon', 'enteraddons'),
                'condition' => ['infobox_ribbon_switch' => 'yes'],
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
        $this->add_control(
            'ribbon_text_color',
            [
                'label' => esc_html__('Text Color', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .infobox-card-ribbon' => 'color: {{VALUE}}',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'ribbon_typography',
                'label' => esc_html__('Typography', 'enteraddons'),
                'selector' => '{{WRAPPER}} .infobox-card-ribbon',
            ]
        );
        $this->add_responsive_control(
            'ribbon_width',
            [
                'label' => esc_html__('Width', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 1000,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => 'px',
                    'size' => '',
                ],
                'selectors' => [
                    '{{WRAPPER}} .infobox-card-ribbon' => 'width: {{SIZE}}{{UNIT}};'
                ],
            ]
        );

        $this->add_responsive_control(
            'ribbon_height',
            [
                'label' => esc_html__('Height', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 1000,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => 'px',
                    'size' => '',
                ],
                'selectors' => [
                    '{{WRAPPER}} .infobox-card-ribbon' => 'height: {{SIZE}}{{UNIT}};'
                ],
            ]
        );
        $this->add_responsive_control(
            'ribbon_top_bottom_position',
            [
                'label' => esc_html__('Top, Bottom Position', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => -80,
                        'max' => 1000,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => -80,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => 'px',
                    'size' => '',
                ],
                'selectors' => [
                    '{{WRAPPER}} .infobox-card-ribbon' => 'top: {{SIZE}}{{UNIT}};'
                ],
            ]
        );
        $this->add_responsive_control(
            'ribbon_left_right_position',
            [
                'label' => esc_html__('Left, Right Position', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => -80,
                        'max' => 1000,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => -80,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => 'px',
                    'size' => '',
                ],
                'selectors' => [
                    '{{WRAPPER}} .infobox-card-ribbon' => 'left: {{SIZE}}{{UNIT}};'
                ],
            ]
        );

        $this->add_responsive_control(
            'ribbon_padding',
            [
                'label' => esc_html__('Padding', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .infobox-card-ribbon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $this->add_responsive_control(
            'ribbon_border_radius',
            [
                'label' => esc_html__('Border Radius', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .infobox-card-ribbon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Box_Shadow::get_type(),
            [
                'name' => 'ribbon_box_shadow',
                'label' => esc_html__('Box Shadow', 'enteraddons'),
                'selector' => '{{WRAPPER}} .infobox-card-ribbon',
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Background::get_type(),
            [
                'name' => 'ribbon_background',
                'label' => esc_html__('Background', 'enteraddons'),
                'types' => ['classic', 'gradient'],
                'selector' => '{{WRAPPER}} .infobox-card-ribbon',
            ]
        );

        $this->end_controls_section();

        /**
         * Style Tab
         * ------------------------------ Infobox Icon Image Style Settings ------------------------------
         *
         */

        $this->start_controls_section(
            'enteraddons_infobox_img_icon_settings',
            [
                'label' => esc_html__('Image Icon', 'enteraddons'),
                'condition' => ['icon_type' => 'img'],
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
        $this->start_controls_tabs('tab_img_icon');

        //  Controls tab For Normal
        $this->start_controls_tab(
            'item_img_wrapper',
            [
                'label' => esc_html__('Wrapper Style', 'enteraddons'),
            ]
        );
        $this->add_responsive_control(
            'img_icon_container_width',
            [
                'label' => esc_html__('Image Container Width', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 1000,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => '%',
                    'size' => '',
                ],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon' => 'width: {{SIZE}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'img_icon_container_height',
            [
                'label' => esc_html__('Image Container Height', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 1000,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => '%',
                    'size' => '',
                ],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon' => 'height: {{SIZE}}{{UNIT}};',
                ],
            ]
        );

        $this->add_responsive_control(
            'img_icon_margin',
            [
                'label' => esc_html__('Margin', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'img_icon_padding',
            [
                'label' => esc_html__('Padding', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Border::get_type(),
            [
                'name' => 'img_icon_wrapper_border',
                'label' => esc_html__('Border', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon',
            ]
        );
        $this->add_responsive_control(
            'img_icon_wrapper_border_radius',
            [
                'label' => esc_html__('Border Radius', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Background::get_type(),
            [
                'name' => 'img_icon_box_bg',
                'label' => esc_html__('Background', 'enteraddons'),
                'types' => ['classic', 'gradient'],
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box .info-img',
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Box_Shadow::get_type(),
            [
                'name' => 'img_icon_box_shadow',
                'label' => esc_html__('Box Shadow', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon',
            ]
        );

        $this->end_controls_tab(); // End Controls tab

        //  Controls tab For image style settings
        $this->start_controls_tab(
            'img_icon_style',
            [
                'label' => esc_html__('Image Style', 'enteraddons'),
            ]
        );

        $this->add_responsive_control(
            'img_icon_width',
            [
                'label' => esc_html__('Image Width', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 1000,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => '%',
                    'size' => '100',
                ],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon img' => 'width: {{SIZE}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'img_max_icon_width',
            [
                'label' => esc_html__('Image Max Width', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 1000,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => '%',
                    'size' => '100',
                ],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon img' => 'max-width: {{SIZE}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'img_icon_height',
            [
                'label' => esc_html__('Image Height', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 1000,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => '%',
                    'size' => '',
                ],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon img' => 'height: {{SIZE}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'img_icon_border_radius',
            [
                'label' => esc_html__('Border Radius', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Border::get_type(),
            [
                'name' => 'img_icon_border',
                'label' => esc_html__('Border', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box-icon img',
            ]
        );
        $this->end_controls_tab(); // End Controls tab

        $this->end_controls_tabs(); //  end controls tabs section

        $this->end_controls_section();

        /**
         * Style Tab
         * ------------------------------ Infobox Icon Divider Settings ------------------------------
         *
         */
        $this->start_controls_section(
            'enteraddons_infobox_icon_divider_settings',
            [
                'label' => esc_html__('Icon Divider Style', 'enteraddons'),
                'condition' => ['icon_divider' => 'yes'],
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
        $this->add_responsive_control(
            'divider_width',
            [
                'label' => esc_html__('Divider Width', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 1000,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => '%',
                    'size' => '',
                ],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box .icon-divider:after' => 'width: {{SIZE}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'divider_height',
            [
                'label' => esc_html__('Divider Height', 'enteraddons'),
                'type' => Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 1000,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => '%',
                    'size' => '',
                ],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box .icon-divider:after' => 'height: {{SIZE}}{{UNIT}};',
                ],
            ]
        );
        $this->add_control(
            'top_position',
            [
                'label' => esc_html__('Top Position', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::NUMBER,

                'max' => 100,
                'step' => 1,
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box .icon-divider:after' => 'top:{{VALUE}}px;',
                ]
            ]
        );
        $this->add_control(
            'bottom_position',
            [
                'label' => esc_html__('Bottom Position', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::NUMBER,
                'max' => 100,
                'step' => 1,
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box .icon-divider:after' => 'bottom:{{VALUE}}px;',
                ]
            ]
        );
        $this->add_responsive_control(
            'divider_margin',
            [
                'label' => esc_html__('Margin', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box .icon-divider:after' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'divider_padding',
            [
                'label' => esc_html__('Padding', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box .icon-divider:after' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Background::get_type(),
            [
                'name' => 'divider_color',
                'label' => esc_html__('Divider Color', 'enteraddons'),
                'types' => ['classic', 'gradient'],
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box .icon-divider:after',
            ]
        );
        $this->end_controls_section();
        /**
         * Style Tab
         * ------------------------------ Infobox Icon Link/Button Settings ------------------------------
         *
         */
        $this->start_controls_section(
            'enteraddons_infobox_icon_btn_settings',
            [
                'label' => esc_html__('Link/Button Style', 'enteraddons'),
                'tab' => Controls_Manager::TAB_STYLE,
                'condition' => ['wrapper_link' => '']
            ]
        );

        //  Controls tab start
        $this->start_controls_tabs('btn_tabs_start');

        //  Controls tab For Normal
        $this->start_controls_tab(
            'btn_normal',
            [
                'label' => esc_html__('Normal', 'enteraddons'),
            ]
        );
        $this->add_responsive_control(
            'btn_alignment',
            [
                'label' => esc_html__('Content Alignment', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::CHOOSE,
                'options' => [
                    'left' => [
                        'title' => esc_html__('Left', 'enteraddons'),
                        'icon' => 'eicon-text-align-left',
                    ],
                    'center' => [
                        'title' => esc_html__('Center', 'enteraddons'),
                        'icon' => 'eicon-text-align-center',
                    ],
                    'right' => [
                        'title' => esc_html__('Right', 'enteraddons'),
                        'icon' => 'eicon-text-align-right',
                    ],
                ],
                'default' => 'center',
                'toggle' => true,
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box .enteraddons-button-wrapper' => 'text-align: {{VALUE}} !important',
                ],
            ]
        );
        $this->add_control(
            'btn_color',
            [
                'label' => esc_html__('Text Color', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box a' => 'color: {{VALUE}}',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'btn_text_typography',
                'label' => esc_html__('Typography', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box a',
            ]
        );
        $this->add_responsive_control(
            'btn_text_margin',
            [
                'label' => esc_html__('Text Margin', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box a .ic-btn--text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'btn_margin',
            [
                'label' => esc_html__('Button Margin', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'btn_padding',
            [
                'label' => esc_html__('Button Padding', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $this->add_group_control(
            \Elementor\Group_Control_Border::get_type(),
            [
                'name' => 'btn_border',
                'label' => esc_html__('Border', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box a',
            ]
        );
        $this->add_responsive_control(
            'btn_radius',
            [
                'label' => esc_html__('Border Radius', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Box_Shadow::get_type(),
            [
                'name' => 'btn_box_shadow',
                'label' => esc_html__('Box Shadow', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box a',
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Background::get_type(),
            [
                'name' => 'btn_bg_color',
                'label' => esc_html__('Button Background Color', 'enteraddons'),
                'types' => ['classic', 'gradient'],
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box a',
            ]
        );

        // Icon Margin
        $this->add_control(
            'infobox_cart_btn_icon',
            [
                'label' => esc_html__('Button Icon Settings', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::HEADING,
                'separator' => 'before',
            ]
        );
        $this->add_responsive_control(
            'btn_icon_margin',
            [
                'label' => esc_html__('Icon Space', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box .btn-icons' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'btn_icon_size',
            [
                'label' => esc_html__('Icon Size', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::SLIDER,
                'size_units' => ['px'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 1000,
                        'step' => 5,
                    ]
                ],
                'default' => [
                    'unit' => 'px',
                    'size' => 14,
                ],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-button-wrapper .btn-icons' => 'font-size: {{SIZE}}{{UNIT}};',
                    '{{WRAPPER}} .enteraddons-button-wrapper .btn-icons img' => 'width: {{SIZE}}{{UNIT}};',
                ],
            ]
        );
        $this->end_controls_tab(); // End Controls tab

        //  Controls tab For Hover
        $this->start_controls_tab(
            'btn_hover_normal',
            [
                'label' => esc_html__('Hover', 'enteraddons'),
            ]
        );

        $this->add_control(
            'btn_hover_color',
            [
                'label' => esc_html__('Hover Text Color', 'enteraddons'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box a:hover' => 'color: {{VALUE}}',
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box:hover a' => 'color: {{VALUE}}',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Border::get_type(),
            [
                'name' => 'btn_hover_border',
                'label' => esc_html__('Hover Border', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box a:hover',
            ]
        );
        $this->add_responsive_control(
            'btn_hover_radius',
            [
                'label' => esc_html__('Hover Border Radius', 'enteraddons'),
                'type' => Controls_Manager::DIMENSIONS,
                'devices' => ['desktop', 'tablet', 'mobile'],
                'size_units' => ['px', '%', 'em'],
                'selectors' => [
                    '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box a:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Box_Shadow::get_type(),
            [
                'name' => 'btn_hover_box_shadow',
                'label' => esc_html__('Hover Box Shadow', 'enteraddons'),
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box a:hover',
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Background::get_type(),
            [
                'name' => 'btn_hover_bg_color',
                'label' => esc_html__('Hover Button Background Color', 'enteraddons'),
                'types' => ['classic', 'gradient'],
                'selector' => '{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box a:hover,{{WRAPPER}} .enteraddons-wid-con .enteraddons-info-box:hover a',
            ]
        );

        $this->end_controls_tab(); // End Controls tab

        $this->end_controls_tabs(); //  end controls tabs section

        $this->end_controls_section();

    }

    protected function render()
    {

        // get settings
        $settings = $this->get_settings_for_display();

        // Infobox template render
        $obj = new \Enteraddons\Widgets\Infobox\Infobox_Template();
        $obj::setDisplaySettings($settings);
        $obj->renderTemplate();
    }

    public function get_script_depends()
    {
        return ['enteraddons-main'];
    }
    public function get_style_depends()
    {
        return ['enteraddons-global-style', 'fontawesome'];
    }


}
