<?php

namespace SparkConstructionLiteElements\Modules\PricingBlock\Widgets;

// Elementor Classes
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Image_Size;
use Elementor\Icons_Manager;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Typography;
use Elementor\Core\Schemes\Typography;
use Elementor\Core\Schemes\Color;
use Elementor\Group_Control_Background;
use Elementor\Group_Control_Text_Stroke;
use Elementor\Group_Control_Text_Shadow;
use Elementor\Group_Control_Css_Filter;
use Elementor\Utils;
use Elementor\Repeater;

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

class PricingBlock extends Widget_Base {

    /** Widget Name */
    public function get_name() {
        return 'sparkconstructionlite-pricing-module';
    }

    /** Widget Title */
    public function get_title() {
        return esc_html__('Pricing Block', 'spark-construction-lite');
    }

    /** Icon */
    public function get_icon() {
        return 'eicon-price-table';
    }

    public function get_keywords() {
		return [ 'pricing', 'table', 'price', 'block' ];
	}

	public function get_script_depends() {
		return [ 'imagesloaded' ];
	}

    /** Category */
    public function get_categories() {
        return ['sparkconstructionlite-elements'];
    }

    /** Controls */
    protected function register_controls() {

        $this->start_controls_section(
            'section_settings', [
                'label' => esc_html__('Layout', 'spark-construction-lite'),
            ]
        );

            $this->add_control(
                'layout', [
                    'label' => esc_html__('Layout', 'spark-construction-lite'),
                    'type' => Controls_Manager::SELECT,
                    'label_block' => true,
                    'default' => 'style1',
                    'options' => [
                        'style1' => esc_html__('Style 1', 'spark-construction-lite'),
                        'style2' => esc_html__('Style 2', 'spark-construction-lite'),
                        'style3' => esc_html__('Style 3', 'spark-construction-lite'),
                    ],
                ]
            );

            $this->add_control(
                'show_ribbon',[
                    'label' => esc_html__( 'Highlight', 'spark-construction-lite' ),
                    'type' => Controls_Manager::SWITCHER,
                    'default' => 'no',
                    'separator' => 'before',
                ]
            );

            $this->add_control(
                'ribbon_title',[
                    'label' => esc_html__( 'Title', 'spark-construction-lite' ),
                    'type' => Controls_Manager::TEXT,
                    'label_block' => true,
                    'default' => esc_html__( 'Popular', 'spark-construction-lite' ),
                    'condition' => [
                        'show_ribbon' => 'yes',
                    ],
                ]
            );

            $this->add_control(
                'ribbon_horizontal_position', [
                    'label' => esc_html__( 'Position', 'spark-construction-lite' ),
                    'type' => Controls_Manager::CHOOSE,
                    'options' => [
                        'left' => [
                            'title' => esc_html__( 'Left', 'spark-construction-lite' ),
                            'icon' => 'eicon-h-align-left',
                        ],
                        'right' => [
                            'title' => esc_html__( 'Right', 'spark-construction-lite' ),
                            'icon' => 'eicon-h-align-right',
                        ],
                    ],
                    'condition' => [
                        'show_ribbon' => 'yes',
                    ],
                ]
            );

        $this->end_controls_section();

        
        $this->start_controls_section(
			'section_header', [
				'label' => esc_html__( 'Header', 'spark-construction-lite' ),
			]
		);

            $this->add_control(
                'pricing_title',[
                    'label' => esc_html__( 'Title', 'spark-construction-lite' ),
                    'type' => Controls_Manager::TEXT,
                    'label_block' => true,
                    'default' => esc_html__( 'Pricing', 'spark-construction-lite' ),
                ]
            );

            $this->add_control(
                'pricing_desc', [
                    'label' => esc_html__('Description', 'spark-construction-lite'),
                    'type' => Controls_Manager::TEXTAREA,
                    'label_block' => true,
                    'default' => 'Our Premium Themes to launch your website. All themes are user-friendly and fully customizable.'
                ]
            );

            $this->add_control(
                'pricing_icon', [
                    'label' => esc_html__('Choose Icon', 'spark-construction-lite'),
                    'type' => Controls_Manager::ICONS,
                    'default' => [
                        'value' => 'fas fa-anchor',
                        'library' => 'solid',
                    ],
                ]
            );

        $this->end_controls_section();


        $this->start_controls_section(
			'section_pricing', [
				'label' => esc_html__( 'Pricing', 'spark-construction-lite' ),
			]
		);

            $this->add_control(
                'currency_symbol', [
                    'label' => esc_html__( 'Currency Symbol', 'spark-construction-lite' ),
                    'type' => Controls_Manager::SELECT,
                    'label_block' => true,
                    'options' => [
                        '' => esc_html__( 'None', 'spark-construction-lite' ),
                        'dollar' => '&#36; ' . _x( 'Dollar', 'Currency', 'spark-construction-lite' ),
                        'euro' => '&#128; ' . _x( 'Euro', 'Currency', 'spark-construction-lite' ),
                        'baht' => '&#3647; ' . _x( 'Baht', 'Currency', 'spark-construction-lite' ),
                        'franc' => '&#8355; ' . _x( 'Franc', 'Currency', 'spark-construction-lite' ),
                        'guilder' => '&fnof; ' . _x( 'Guilder', 'Currency', 'spark-construction-lite' ),
                        'krona' => 'kr ' . _x( 'Krona', 'Currency', 'spark-construction-lite' ),
                        'lira' => '&#8356; ' . _x( 'Lira', 'Currency', 'spark-construction-lite' ),
                        'peseta' => '&#8359 ' . _x( 'Peseta', 'Currency', 'spark-construction-lite' ),
                        'peso' => '&#8369; ' . _x( 'Peso', 'Currency', 'spark-construction-lite' ),
                        'pound' => '&#163; ' . _x( 'Pound Sterling', 'Currency', 'spark-construction-lite' ),
                        'real' => 'R$ ' . _x( 'Real', 'Currency', 'spark-construction-lite' ),
                        'ruble' => '&#8381; ' . _x( 'Ruble', 'Currency', 'spark-construction-lite' ),
                        'rupee' => '&#8360; ' . _x( 'Rupee', 'Currency', 'spark-construction-lite' ),
                        'indian_rupee' => '&#8377; ' . _x( 'Rupee (Indian)', 'Currency', 'spark-construction-lite' ),
                        'shekel' => '&#8362; ' . _x( 'Shekel', 'Currency', 'spark-construction-lite' ),
                        'yen' => '&#165; ' . _x( 'Yen/Yuan', 'Currency', 'spark-construction-lite' ),
                        'won' => '&#8361; ' . _x( 'Won', 'Currency', 'spark-construction-lite' ),
                        'custom' => esc_html__( 'Custom', 'spark-construction-lite' ),
                    ],
                    'default' => 'dollar',
                ]
            );

            $this->add_control(
                'currency_symbol_custom', [
                    'label' => esc_html__( 'Custom Symbol', 'spark-construction-lite' ),
                    'type' => Controls_Manager::TEXT,
                    'condition' => [
                        'currency_symbol' => 'custom',
                    ],
                ]
            );

            $this->add_control(
                'price',[
                    'label' => esc_html__( 'Price', 'spark-construction-lite' ),
                    'type' => Controls_Manager::TEXT,
                    'default' => '39.99',
                    'label_block' => true,
                ]
            );

            $this->add_control(
                'sale', [
                    'label' => esc_html__( 'Sale', 'spark-construction-lite' ),
                    'type' => Controls_Manager::SWITCHER,
                    'label_on' => esc_html__( 'On', 'spark-construction-lite' ),
                    'label_off' => esc_html__( 'Off', 'spark-construction-lite' ),
                    'default' => '',
                ]
            );

            $this->add_control(
                'original_price',[
                    'label' => esc_html__( 'Original Price', 'spark-construction-lite' ),
                    'type' => Controls_Manager::NUMBER,
                    'default' => '59',
                    'condition' => [
                        'sale' => 'yes',
                    ],
                ]
            );

            $this->add_control(
                'period',[
                    'label' => esc_html__( 'Price Per(/Monthly, /Yearly)', 'spark-construction-lite' ),
                    'type' => Controls_Manager::TEXT,
                    'label_block' => true,
                    'default' => esc_html__( 'Monthly', 'spark-construction-lite' ),
                ]
            );

        $this->end_controls_section();


        $this->start_controls_section(
            'section_content', [
                'label' => esc_html__('Content', 'spark-construction-lite'),
                'condition' => [
                    'layout' => ['style1','style2'],
                ],
            ]
        );

            $repeater = new Repeater();

            $default_icon = [
                'value' => 'far fa-check-circle',
                'library' => 'fa-regular',
            ];

            $repeater->add_control(
                'list_icon', [
                    'label' => esc_html__('Icon', 'spark-construction-lite'),
                    'type' => Controls_Manager::ICONS,
                    'default' => $default_icon,
                ]
            );

            $repeater->add_control(
                'list', [
                    'label' => esc_html__('Text', 'spark-construction-lite'),
                    'type' => Controls_Manager::TEXT,
                    'label_block' => true,
                ]
            );

            $repeater->add_control(
                'list_color', [
                    'label' => esc_html__( 'Icon Color', 'spark-construction-lite' ),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} {{CURRENT_ITEM}} i' => 'color: {{VALUE}}',
                        '{{WRAPPER}} {{CURRENT_ITEM}} svg' => 'fill: {{VALUE}}',
                    ],
                ]
            );

            $this->add_control(
                'feature_list', [
                    'label' => esc_html__('Plan Feature List', 'spark-construction-lite'),
                    'type' => Controls_Manager::REPEATER,
                    'fields' => $repeater->get_controls(),
                    'default' => [
                        [
                            'list_icon' => $default_icon,
                            'list' => esc_html__('10 GB Space Server', 'spark-construction-lite'),
                        ],
                        [
                            'list_icon' => $default_icon,
                            'list' => esc_html__('Unlimited bandwidth', 'spark-construction-lite'),
                        ],
                        [
                            'list_icon' => $default_icon,
                            'list' => esc_html__('24/7 Customer Support', 'spark-construction-lite'),
                        ],
                        [
                            'list_icon' => $default_icon,
                            'list' => esc_html__('Custom Development', 'spark-construction-lite'),
                        ],
                    ],
                    'title_field' => '{{{ list }}}',
                ]
            );

        $this->end_controls_section();


        $this->start_controls_section(
            'section_footer', [
                'label' => esc_html__( 'Footer', 'spark-construction-lite' ),
            ]
        );
            $this->add_control(
                'link_text', [
                    'label' => esc_html__('Button Text', 'spark-construction-lite'),
                    'type' => Controls_Manager::TEXT,
                    'label_block' => true,
                    'default' => esc_html__('Select Plan', 'spark-construction-lite'),
                ]
            );

            $this->add_control(
                'link', [
                    'label' => esc_html__('Button Link', 'spark-construction-lite'),
                    'type' => Controls_Manager::URL,
                    'show_external' => true,
                    'default' => [
                        'url' => '#',
                        'is_external' => false,
                        'nofollow' => false,
                    ],
                ]
            );

            $this->add_control(
                'link_info', [
                    'label' => esc_html__( 'Additional Info', 'spark-construction-lite' ),
                    'type' => Controls_Manager::TEXTAREA,
                    'default' => esc_html__( '30-Day Money Back Guarantee', 'spark-construction-lite' ),
                    'rows' => 3,
                ]
            );
    
        $this->end_controls_section();

        $this->start_controls_section(
            'general_style', [
                'label' => esc_html__('General Styles', 'spark-construction-lite'),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );

            $this->add_group_control(
                Group_Control_Border::get_type(), [
                    'name' => 'pricing_border',
                    'selector' => '{{WRAPPER}} .ikthemes-pricing-table',
                    'separator' => 'before',
                ]
            );

            $this->add_control(
                'pricing_bg_color', [
                    'label' => esc_html__('Background Color', 'spark-construction-lite'),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-table' => 'background: {{VALUE}}',
                    ],
                ]
            );

            $this->add_responsive_control(
                'pricing_padding', [
                    'label' => esc_html__('Padding', 'spark-construction-lite'),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => ['px', '%', 'em'],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-table' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                ]
            );

            $this->add_responsive_control(
                'pricing_radius', [
                    'label' => esc_html__('Radius', 'spark-construction-lite'),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => ['px', '%', 'em'],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-table' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                ]
            );

        $this->end_controls_section();


        $this->start_controls_section(
            'header_style', [
                'label' => esc_html__('Header', 'spark-construction-lite'),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );

            $this->add_control(
                'header_bg_color', [
                    'label' => esc_html__('Background Color', 'spark-construction-lite'),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-header, {{WRAPPER}} .style1 .ikthemes-pricing-header:after' => 'background-color: {{VALUE}}',
                    ],
                ]
            );

            $this->add_responsive_control(
                'header_padding', [
                    'label' => esc_html__('Padding', 'spark-construction-lite'),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => ['px', '%', 'em'],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                ]
            );

            $this->add_responsive_control(
                'header_radius', [
                    'label' => esc_html__('Radius', 'spark-construction-lite'),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => ['px', '%', 'em'],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-header' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                ]
            );

            $this->add_responsive_control(
                'header_margin', [
                    'label' => esc_html__('Margin', 'spark-construction-lite'),
                    'type' => Controls_Manager::DIMENSIONS,
                    'allowed_dimensions' => 'vertical',
                    'size_units' => ['px', '%', 'em'],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-header' => 'margin: {{TOP}}{{UNIT}} 0 {{BOTTOM}}{{UNIT}} 0;',
                    ],
                ]
            );


        $this->end_controls_section();


        $this->start_controls_section(
            'title_style', [
                'label' => esc_html__('Title & Description', 'spark-construction-lite'),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );

            $this->add_control(
                'title_heading_style',[
                    'label' => esc_html__( 'Title', 'spark-construction-lite' ),
                    'type' => Controls_Manager::HEADING,
                    'separator' => 'after',
                ]
            );

            $this->add_control(
                'title_color', [
                    'label' => esc_html__('Color', 'spark-construction-lite'),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-title' => 'color: {{VALUE}}',
                    ],
                ]
            );

            $this->add_group_control(
                Group_Control_Typography::get_type(), [
                    'name' => 'title_typography',
                    'label' => esc_html__('Typography', 'spark-construction-lite'),
                    'selector' => '{{WRAPPER}} .ikthemes-pricing-title',
                ]
            );

            $this->add_responsive_control(
                'title_margin', [
                    'label' => esc_html__('Margin', 'spark-construction-lite'),
                    'type' => Controls_Manager::DIMENSIONS,
                    'allowed_dimensions' => 'vertical',
                    'size_units' => ['px', '%', 'em'],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-title' => 'margin: {{TOP}}{{UNIT}} 0 {{BOTTOM}}{{UNIT}} 0;',
                    ],
                ]
            );


            $this->add_control(
                'desc_heading_style',[
                    'label' => esc_html__( 'Description', 'spark-construction-lite' ),
                    'type' => Controls_Manager::HEADING,
                    'separator' => 'after',
                ]
            );

            $this->add_control(
                'desc_color', [
                    'label' => esc_html__('Color', 'spark-construction-lite'),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-desc' => 'color: {{VALUE}}',
                    ],
                ]
            );

            $this->add_group_control(
                Group_Control_Typography::get_type(), [
                    'name' => 'desc_typography',
                    'label' => esc_html__('Typography', 'spark-construction-lite'),
                    'selector' => '{{WRAPPER}} .ikthemes-pricing-desc',
                ]
            );

            $this->add_responsive_control(
                'desc_margin', [
                    'label' => esc_html__('Margin', 'spark-construction-lite'),
                    'type' => Controls_Manager::DIMENSIONS,
                    'allowed_dimensions' => 'vertical',
                    'size_units' => ['px', '%', 'em'],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-desc' => 'margin: {{TOP}}{{UNIT}} 0 {{BOTTOM}}{{UNIT}} 0;',
                    ],
                ]
            );

        $this->end_controls_section();


        $this->start_controls_section(
            'icon_style', [
                'label' => esc_html__('Icon', 'spark-construction-lite'),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );

            $this->add_control(
                'icon_bg_color', [
                    'label' => esc_html__('Background Color', 'spark-construction-lite'),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-icon' => 'background-color: {{VALUE}}',
                        '{{WRAPPER}} .ikthemes-pricing-icon:after' => 'border-color: {{VALUE}}',
                    ],
                ]
            );

            $this->add_control(
                'icon_color', [
                    'label' => esc_html__('Color', 'spark-construction-lite'),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-icon' => 'color: {{VALUE}}',
                        '{{WRAPPER}} .ikthemes-pricing-icon svg' => 'fill: {{VALUE}}',
                    ],
                ]
            );

            $this->add_group_control(
                Group_Control_Border::get_type(), [
                    'name' => 'icon_border',
                    'selector' => '{{WRAPPER}} .ikthemes-pricing-icon',
                ]
            );

            $this->add_responsive_control(
                'icon_width', [
                    'label' => esc_html__('Width', 'spark-construction-lite'),
                    'type' => Controls_Manager::SLIDER,
                    'size_units' => ['px'],
                    'range' => [
                        'px' => [
                            'min' => 0,
                            'max' => 250,
                            'step' => 5
                        ],
                    ],
                    'default' => [
                        'unit' => 'px',
                        'size' => 105,
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-icon' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
                    ],
                ]
            );

            $this->add_responsive_control(
                'icon_size', [
                    'label' => esc_html__('Font Size', 'spark-construction-lite'),
                    'type' => Controls_Manager::SLIDER,
                    'size_units' => ['px'],
                    'range' => [
                        'px' => [
                            'min' => 0,
                            'max' => 150,
                            'step' => 5
                        ],
                    ],
                    'default' => [
                        'unit' => 'px',
                        'size' => 40,
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-icon' => 'font-size: {{SIZE}}{{UNIT}};',
                        '{{WRAPPER}} .ikthemes-pricing-icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
                    ],
                ]
            );

            $this->add_group_control(
                Group_Control_Border::get_type(), [
                    'name' => 'icon_inner_border',
                    'selector' => '{{WRAPPER}} .ikthemes-pricing-icon:after',
                ]
            );

            $this->add_responsive_control(
                'icon_margin', [
                    'label' => esc_html__('Margin', 'spark-construction-lite'),
                    'type' => Controls_Manager::DIMENSIONS,
                    'allowed_dimensions' => 'vertical',
                    'size_units' => ['px', '%', 'em'],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-icon' => 'margin: {{TOP}}{{UNIT}} 0 {{BOTTOM}}{{UNIT}} 0;',
                    ],
                ]
            );

        $this->end_controls_section();


        $this->start_controls_section(
            'price_style', [
                'label' => esc_html__('Pricing', 'spark-construction-lite'),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );

            $this->add_group_control(
                Group_Control_Typography::get_type(), [
                    'name' => 'pricing_typography',
                    'selector' => '{{WRAPPER}} .ikthemes-pricing-price',
                ]
            );

            $this->add_control(
                'pricing_bg_colors', [
                    'label' => esc_html__('Background Color', 'spark-construction-lite'),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-price-wrap' => 'background-color: {{VALUE}}',
                    ],
                ]
            );

            $this->add_control(
                'pricing_color', [
                    'label' => esc_html__('Color', 'spark-construction-lite'),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-price-wrap' => 'color: {{VALUE}}',
                    ],
                ]
            );

            $this->add_responsive_control(
                'pricing_margin', [
                    'label' => esc_html__('Margin', 'spark-construction-lite'),
                    'type' => Controls_Manager::DIMENSIONS,
                    'allowed_dimensions' => 'vertical',
                    'size_units' => ['px', '%', 'em'],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-price-wrap' => 'margin: {{TOP}}{{UNIT}} 0 {{BOTTOM}}{{UNIT}} 0;',
                    ],
                ]
            );

            $this->add_responsive_control(
                'price_padding', [
                    'label' => esc_html__('Padding', 'spark-construction-lite'),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => ['px', '%', 'em'],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-price-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                ]
            );

            $this->add_control(
                'heading_currency_style', [
                    'label' => esc_html__( 'Currency Symbol', 'spark-construction-lite' ),
                    'type' => Controls_Manager::HEADING,
                    'separator' => 'before',
                ]
            );

            $this->add_responsive_control(
                'currency_size',[
                    'label' => esc_html__( 'Size', 'spark-construction-lite' ),
                    'type' => Controls_Manager::SLIDER,
                    'range' => [
                        'px' => [
                            'max' => 100,
                        ],
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-current-price .ikthemes-pricing-currency' => 'font-size: {{SIZE}}{{UNIT}};',
                    ]
                ]
            );

            $this->add_control(
                'currency_position',[
                    'label' => esc_html__( 'Position', 'spark-construction-lite' ),
                    'type' => Controls_Manager::CHOOSE,
                    'default' => 'before',
                    'options' => [
                        'before' => [
                            'title' => esc_html__( 'Before', 'spark-construction-lite' ),
                            'icon' => 'eicon-h-align-left',
                        ],
                        'after' => [
                            'title' => esc_html__( 'After', 'spark-construction-lite' ),
                            'icon' => 'eicon-h-align-right',
                        ],
                    ],
                ]
            );

            $this->add_control(
                'currency_vertical_position', [
                    'label' => esc_html__( 'Vertical Position', 'spark-construction-lite' ),
                    'type' => Controls_Manager::CHOOSE,
                    'options' => [
                        'top' => [
                            'title' => esc_html__( 'Top', 'spark-construction-lite' ),
                            'icon' => 'eicon-v-align-top',
                        ],
                        'middle' => [
                            'title' => esc_html__( 'Middle', 'spark-construction-lite' ),
                            'icon' => 'eicon-v-align-middle',
                        ],
                        'bottom' => [
                            'title' => esc_html__( 'Bottom', 'spark-construction-lite' ),
                            'icon' => 'eicon-v-align-bottom',
                        ],
                    ],
                    'default' => 'top',
                    'selectors_dictionary' => [
                        'top' => 'flex-start',
                        'middle' => 'center',
                        'bottom' => 'flex-end',
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-currency' => 'align-self: {{VALUE}}',
                    ]
                ]
            );

            $this->add_control(
                'heading_original_price_style',[
                    'label' => esc_html__( 'Original Price', 'spark-construction-lite' ),
                    'type' => Controls_Manager::HEADING,
                    'separator' => 'before',
                    'condition' => [
                        'sale' => 'yes',
                        'original_price!' => '',
                    ],
                ]
            );

            $this->add_control(
                'original_price_color',[
                    'label' => esc_html__( 'Color', 'spark-construction-lite' ),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-original-price' => 'color: {{VALUE}}',
                    ],
                    'condition' => [
                        'sale' => 'yes',
                        'original_price!' => '',
                    ],
                ]
            );

            $this->add_group_control(
                Group_Control_Typography::get_type(),[
                    'name' => 'original_price_typography',
                    'selector' => '{{WRAPPER}} .ikthemes-pricing-original-price',
                    'condition' => [
                        'sale' => 'yes',
                        'original_price!' => '',
                    ],
                ]
            );

            $this->add_control(
                'original_price_vertical_position',[
                    'label' => esc_html__( 'Vertical Position', 'spark-construction-lite' ),
                    'type' => Controls_Manager::CHOOSE,
                    'options' => [
                        'top' => [
                            'title' => esc_html__( 'Top', 'spark-construction-lite' ),
                            'icon' => 'eicon-v-align-top',
                        ],
                        'middle' => [
                            'title' => esc_html__( 'Middle', 'spark-construction-lite' ),
                            'icon' => 'eicon-v-align-middle',
                        ],
                        'bottom' => [
                            'title' => esc_html__( 'Bottom', 'spark-construction-lite' ),
                            'icon' => 'eicon-v-align-bottom',
                        ],
                    ],
                    'selectors_dictionary' => [
                        'top' => 'flex-start',
                        'middle' => 'center',
                        'bottom' => 'flex-end',
                    ],
                    'default' => 'bottom',
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-original-price' => 'align-self: {{VALUE}}',
                    ],
                    'condition' => [
                        'sale' => 'yes',
                        'original_price!' => '',
                    ],
                ]
            );


            $this->add_control(
                'heading_period_style',[
                    'label' => esc_html__( 'Period', 'spark-construction-lite' ),
                    'type' => Controls_Manager::HEADING,
                    'separator' => 'before',
                    'condition' => [
                        'period!' => '',
                    ],
                ]
            );

            $this->add_control(
                'period_color', [
                    'label' => esc_html__( 'Color', 'spark-construction-lite' ),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-period' => 'color: {{VALUE}}',
                    ],
                    'condition' => [
                        'period!' => '',
                    ],
                ]
            );

            $this->add_group_control(
                Group_Control_Typography::get_type(),[
                    'name' => 'period_typography',
                    'selector' => '{{WRAPPER}} .ikthemes-pricing-period',
                ]
            );

            $this->add_control(
                'period_position',[
                    'label' => esc_html__( 'Position', 'spark-construction-lite' ),
                    'type' => Controls_Manager::SELECT,
                    'label_block' => false,
                    'options' => [
                        'below' => esc_html__( 'Below', 'spark-construction-lite' ),
                        'beside' => esc_html__( 'Beside', 'spark-construction-lite' ),
                    ],
                    'default' => 'below',
                    'condition' => [
                        'period!' => '',
                    ],
                ]
            );

        $this->end_controls_section();

        
        $this->start_controls_section(
            'feature_list_style', [
                'label' => esc_html__('Features', 'spark-construction-lite'),
                'tab' => Controls_Manager::TAB_STYLE,
                'condition' => [
                    'layout' => ['style1','style2'],
                ],
            ]
        );

            $this->add_group_control(
                Group_Control_Typography::get_type(), [
                    'name' => 'feature_typography',
                    'exclude' => [ 'font_size' ],
                    'selector' => '{{WRAPPER}} .ikthemes-pricing-list',
                ]
            );

            $this->add_control(
                'feature_bg_colors', [
                    'label' => esc_html__('Background Color', 'spark-construction-lite'),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-items' => 'background-color: {{VALUE}}',
                    ],
                ]
            );

            $this->add_control(
                'feature_color', [
                    'label' => esc_html__('Color', 'spark-construction-lite'),
                    'type' => Controls_Manager::COLOR,
                    'default' => '',
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-items' => 'color: {{VALUE}}',
                        '{{WRAPPER}} .ikthemes-pricing-items svg' => 'fill: {{VALUE}}',
                    ],
                ]
            );

             $this->add_responsive_control(
                'feature_font_size',[
                    'label' => esc_html__( 'Font Size', 'spark-construction-lite' ),
                    'type' => Controls_Manager::SLIDER,
                    'range' => [
                        'px' => [
                            'max' => 200,
                        ],
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-list' => 'font-size: {{SIZE}}{{UNIT}};',
                        '{{WRAPPER}} .ikthemes-pricing-list svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
                    ]
                ]
            );

            $this->add_responsive_control(
                'feature_alignment',[
                    'label' => esc_html__( 'Alignment', 'spark-construction-lite' ),
                    'type' => Controls_Manager::CHOOSE,
                    'options' => [
                        'flex-start' => [
                            'title' => esc_html__( 'Left', 'spark-construction-lite' ),
                            'icon' => 'eicon-text-align-left',
                        ],
                        'center' => [
                            'title' => esc_html__( 'Center', 'spark-construction-lite' ),
                            'icon' => 'eicon-text-align-center',
                        ],
                        'flex-end' => [
                            'title' => esc_html__( 'Right', 'spark-construction-lite' ),
                            'icon' => 'eicon-text-align-right',
                        ],
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-list' => 'justify-content: {{VALUE}}',
                    ],
                ]
            );

            $this->add_responsive_control(
                'feature_margin', [
                    'label' => esc_html__('Margin', 'spark-construction-lite'),
                    'type' => Controls_Manager::DIMENSIONS,
                    'allowed_dimensions' => 'vertical',
                    'size_units' => ['px', '%', 'em'],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-items' => 'margin: {{TOP}}{{UNIT}} 0 {{BOTTOM}}{{UNIT}} 0;',
                    ],
                ]
            );

            $this->add_responsive_control(
                'feature_padding', [
                    'label' => esc_html__('Padding', 'spark-construction-lite'),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => ['px', '%', 'em'],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-items' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                ]
            );

            $this->add_control(
                'feature_divider',[
                    'label' => esc_html__( 'Divider', 'spark-construction-lite' ),
                    'type' => Controls_Manager::SWITCHER,
                    'default' => 'yes',
                    'separator' => 'before',
                ]
            );

            $this->add_control(
                'divider_style', [
                    'label' => esc_html__( 'Style', 'spark-construction-lite' ),
                    'type' => Controls_Manager::SELECT,
                    'options' => [
                        'solid' => esc_html__( 'Solid', 'spark-construction-lite' ),
                        'double' => esc_html__( 'Double', 'spark-construction-lite' ),
                        'dotted' => esc_html__( 'Dotted', 'spark-construction-lite' ),
                        'dashed' => esc_html__( 'Dashed', 'spark-construction-lite' ),
                    ],
                    'default' => 'dotted',
                    'condition' => [
                        'feature_divider' => 'yes',
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-list:not(:last-child)::after' => 'border-style: {{VALUE}};',
                    ],
                ]
            );

            $this->add_control(
                'divider_color',[
                    'label' => esc_html__( 'Color', 'spark-construction-lite' ),
                    'type' => Controls_Manager::COLOR,
                    'default' => '#F2F2F28A',
                    'condition' => [
                        'feature_divider' => 'yes',
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-list:not(:last-child)::after' => 'border-color: {{VALUE}};',
                    ],
                ]
            );

            $this->add_responsive_control(
                'divider_weight',[
                    'label' => esc_html__( 'Weight', 'spark-construction-lite' ),
                    'type' => Controls_Manager::SLIDER,
                    'size_units' => [ 'px', 'em', 'rem', 'custom' ],
                    'default' => [
                        'size' => 1,
                    ],
                    'range' => [
                        'px' => [
                            'min' => 1,
                            'max' => 10,
                        ],
                        'em' => [
                            'max' => 1,
                        ],
                        'rem' => [
                            'max' => 1,
                        ],
                    ],
                    'condition' => [
                        'feature_divider' => 'yes',
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-list:not(:last-child)::after' => 'border-width: {{SIZE}}{{UNIT}};',
                    ],
                ]
            );

            $this->add_responsive_control(
                'divider_width',[
                    'label' => esc_html__( 'Width', 'spark-construction-lite' ),
                    'type' => Controls_Manager::SLIDER,
                    'condition' => [
                        'feature_divider' => 'yes',
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-list:not(:last-child)::after' => 'margin-left: calc((100% - {{SIZE}}%)/2); margin-right: calc((100% - {{SIZE}}%)/2)',
                    ],
                ]
            );

            $this->add_responsive_control(
                'divider_gap',[
                    'label' => esc_html__( 'Gap', 'spark-construction-lite' ),
                    'type' => Controls_Manager::SLIDER,
                    'size_units' => [ 'px', 'em', 'rem', 'custom' ],
                    'default' => [
                        'size' => 10,
                    ],
                    'range' => [
                        'px' => [
                            'min' => 1,
                            'max' => 50,
                        ],
                        'em' => [
                            'max' => 5,
                        ],
                        'rem' => [
                            'max' => 5,
                        ],
                    ],
                    'condition' => [
                        'feature_divider' => 'yes',
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-list:not(:last-child)::after' => 'margin-top: {{SIZE}}{{UNIT}}; margin-bottom: {{SIZE}}{{UNIT}}',
                    ],
                ]
            );


        $this->end_controls_section();


        $this->start_controls_section(
			'content_button',[
				'label' => esc_html__( 'Footer Button', 'spark-construction-lite' ),
				'tab' => Controls_Manager::TAB_STYLE,
			]
		);

            $this->add_group_control(
                Group_Control_Typography::get_type(),[
                    'name' => 'button_typography',
                    'selector' => '{{WRAPPER}} .btn.btn-primary',
                ]
            );

            $this->add_group_control(
                Group_Control_Text_Shadow::get_type(),[
                    'name' => 'button_text_shadow',
                    'selector' => '{{WRAPPER}} .btn.btn-primary',
                ]
            );

            $this->add_responsive_control(
                'button_border_radius',[
                    'label' => esc_html__( 'Border Radius', 'spark-construction-lite' ),
                    'type' => Controls_Manager::SLIDER,
                    'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
                    'range' => [
                        'px' => [
                            'max' => 100,
                        ],
                        'em' => [
                            'max' => 10,
                        ],
                        'rem' => [
                            'max' => 10,
                        ],
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .btn.btn-primary, {{WRAPPER}} .btn.btn-primary::before' => 'border-radius: {{SIZE}}{{UNIT}};',
                    ],
                ]
            );

            $this->add_responsive_control(
                'button_padding',[
                    'label' => esc_html__( 'Padding', 'spark-construction-lite' ),
                    'type' => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
                    'selectors' => [
                        '{{WRAPPER}} .pricing-button .btn.btn-primary' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                ]
            );

            $this->add_control(
                'heading_primary_button',[
                    'type' => Controls_Manager::HEADING,
                    'label' => esc_html__( 'Primary Button', 'spark-construction-lite' ),
                    'separator' => 'before',
                ]
            );

            $this->start_controls_tabs( 'primary_button_tabs' );

                $this->start_controls_tab(
                    'normal',[
                        'label' => esc_html__( 'Normal', 'spark-construction-lite' ),
                    ]
                );

                    $this->add_control(
                        'button_text_color',[
                            'label' => esc_html__( 'Text Color', 'spark-construction-lite' ),
                            'type' => Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .btn.btn-primary' => 'color: {{VALUE}};',
                                '{{WRAPPER}} .btn.btn-primary::after' => 'background-color: {{VALUE}};',
                            ],
                        ]
                    );

                    $this->add_group_control(
                        Group_Control_Background::get_type(),[
                            'name' => 'button_background',
                            'types' => [ 'classic', 'gradient' ],
                            'exclude' => [ 'image' ],
                            'selector' => '{{WRAPPER}} .btn.btn-primary',
                            'fields_options' => [
                                'background' => [
                                    'default' => 'classic',
                                ],
                            ],
                        ]
                    );

                    $this->add_group_control(
                        Group_Control_Border::get_type(),[
                            'name' => 'button_border_color',
                            'selector' => '{{WRAPPER}} .btn.btn-primary',
                            'default' => 'none',
                        ]
                    );

                $this->end_controls_tab();

                $this->start_controls_tab(
                    'hover',[
                        'label' => esc_html__( 'Hover', 'spark-construction-lite' ),
                    ]
                );

                    $this->add_control(
                        'button_hover_text_color',[
                            'label' => esc_html__( 'Text Color', 'spark-construction-lite' ),
                            'type' => Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .btn.btn-primary:hover' => 'color: {{VALUE}};',
                                '{{WRAPPER}} .btn.btn-primary:hover::after' => 'background-color: {{VALUE}};',
                            ],
                        ]
                    );

                    $this->add_group_control(
                        Group_Control_Background::get_type(),[
                            'name' => 'button_hover_background',
                            'types' => [ 'classic', 'gradient' ],
                            'exclude' => [ 'image' ],
                            'selector' => '{{WRAPPER}} .btn.btn-primary::before',
                            'fields_options' => [
                                'background' => [
                                    'default' => 'classic',
                                ],
                            ],
                        ]
                    );

                    $this->add_group_control(
                        Group_Control_Border::get_type(),[
                            'name' => 'button_hover_border_color',
                            'selector' => '{{WRAPPER}} .btn.btn-primary:hover',
                            'default' => 'none',
                        ]
                    );

                $this->end_controls_tab();

            $this->end_controls_tabs();

            $this->add_control(
                'heading_additional_info',[
                    'label' => esc_html__( 'Additional Info', 'spark-construction-lite' ),
                    'type' => Controls_Manager::HEADING,
                    'separator' => 'before',
                    'condition' => [
                        'link_info!' => '',
                    ],
                ]
            );

            $this->add_control(
                'additional_info_color',[
                    'label' => esc_html__( 'Color', 'spark-construction-lite' ),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-pricing-info' => 'color: {{VALUE}}',
                    ],
                    'condition' => [
                        'link_info!' => '',
                    ],
                ]
            );

            $this->add_group_control(
                Group_Control_Typography::get_type(),[
                    'name' => 'additional_info_typography',
                    'selector' => '{{WRAPPER}} .ikthemes-pricing-info',
                    'condition' => [
                        'link_info!' => '',
                    ],
                ]
            );

        $this->end_controls_section();


        $this->start_controls_section(
			'section_ribbon_style',[
				'label' => esc_html__( 'Ribbon', 'spark-construction-lite' ),
				'tab' => Controls_Manager::TAB_STYLE,
				'show_label' => false,
				'condition' => [
					'show_ribbon' => 'yes',
				],
			]
		);

            $ribbon_distance_transform = is_rtl() ? 'translateY(-50%) translateX({{SIZE}}{{UNIT}}) rotate(-45deg)' : 'translateY(-50%) translateX(-50%) translateX({{SIZE}}{{UNIT}}) rotate(-45deg)';

            $this->add_responsive_control(
                'ribbon_distance',[
                    'label' => esc_html__( 'Distance', 'spark-construction-lite' ),
                    'type' => Controls_Manager::SLIDER,
                    'size_units' => [ 'px', 'em', 'rem', 'custom' ],
                    'range' => [
                        'px' => [
                            'max' => 50,
                        ],
                        'em' => [
                            'max' => 5,
                        ],
                        'rem' => [
                            'max' => 5,
                        ],
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-most-popular-inner' => 'margin-top: {{SIZE}}{{UNIT}}; transform: ' . $ribbon_distance_transform,
                    ],
                ]
            );

            $this->add_control(
                'ribbon_bg_color',[
                    'label' => esc_html__( 'Background Color', 'spark-construction-lite' ),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-most-popular-inner' => 'background-color: {{VALUE}}',
                    ],
                ]
            );

            $this->add_control(
                'ribbon_text_color',[
                    'label' => esc_html__( 'Text Color', 'spark-construction-lite' ),
                    'type' => Controls_Manager::COLOR,
                    'separator' => 'before',
                    'selectors' => [
                        '{{WRAPPER}} .ikthemes-most-popular-inner' => 'color: {{VALUE}}',
                    ],
                ]
            );

            $this->add_group_control(
                Group_Control_Typography::get_type(),[
                    'name' => 'ribbon_typography',
                    'selector' => '{{WRAPPER}} .ikthemes-most-popular-inner',
                ]
            );

            $this->add_group_control(
                Group_Control_Box_Shadow::get_type(),[
                    'name' => 'box_shadow',
                    'selector' => '{{WRAPPER}} .ikthemes-most-popular-inner',
                ]
            );

		$this->end_controls_section();
    }

    private function render_currency_symbol( $symbol, $location ) {

		$currency_position = $this->get_settings( 'currency_position' );

		$location_setting = ! empty( $currency_position ) ? $currency_position : 'before';

		if ( ! empty( $symbol ) && $location === $location_setting ) {

			echo '<span class="ikthemes-pricing-currency">' . esc_html( $symbol ) . '</span>';
		}
	}

	private function get_currency_symbol( $symbol_name ) {
		$symbols = [
			'dollar' => '&#36;',
			'euro' => '&#128;',
			'franc' => '&#8355;',
			'pound' => '&#163;',
			'ruble' => '&#8381;',
			'shekel' => '&#8362;',
			'baht' => '&#3647;',
			'yen' => '&#165;',
			'won' => '&#8361;',
			'guilder' => '&fnof;',
			'peso' => '&#8369;',
			'peseta' => '&#8359',
			'lira' => '&#8356;',
			'rupee' => '&#8360;',
			'indian_rupee' => '&#8377;',
			'real' => 'R$',
			'krona' => 'kr',
		];

		return isset( $symbols[ $symbol_name ] ) ? $symbols[ $symbol_name ] : '';
	}

    /** Render Layout */
    protected function render() {

        $settings = $this->get_settings_for_display();

        $symbol = '';
        if ( ! empty( $settings['currency_symbol'] ) ) {
            if ( 'custom' !== $settings['currency_symbol'] ) {
                $symbol = $this->get_currency_symbol( $settings['currency_symbol'] );
            } else {
                $symbol = $settings['currency_symbol_custom'];
            }
        }

        $period_position = $settings['period_position'];

        $target = $settings['link']['is_external'] ? ' target="_blank"' : '';
        $nofollow = $settings['link']['nofollow'] ? ' rel="nofollow"' : '';
        
        $layout = $settings['layout'];

        $ribbon_position = $settings['ribbon_horizontal_position'];
        
        $pricing_class = array(
            'ikthemes-pricing-table',
            $layout,
            $ribbon_position
        );

        ?>

        <div class="<?php echo esc_attr(implode(' ', array_filter($pricing_class))); ?>">
            <?php if( !empty( $settings['show_ribbon'] ) && $settings['show_ribbon'] == 'yes' ){ ?>
                <div class="ikthemes-most-popular">
                    <span class="ikthemes-most-popular-inner">
                        <?php echo esc_html($settings['ribbon_title']); ?>
                    </span>
                </div>    
            <?php } ?>

            <?php if( !empty( $settings['pricing_icon']['value'] ) && ($layout == 'style3' || $layout == 'style2') ){ ?>
                <div class="ikthemes-pricing-icon">
                    <?php Icons_Manager::render_icon($settings['pricing_icon'], ['aria-hidden' => 'true']); ?>
                </div>
            <?php } ?>

            <div class="ikthemes-pricing-header">

                <h2 class="ikthemes-pricing-title">
                    <?php echo esc_html($settings['pricing_title']); ?>
                </h2>

                <?php if( !empty( $settings['pricing_desc'] ) ){  ?>
                    <p class="ikthemes-pricing-desc">
                        <?php echo esc_html( $settings['pricing_desc'] ); ?>
                    </p>
                <?php } ?>

            </div>

            <?php if( !empty( $settings['pricing_icon']['value'] ) && $layout == 'style1' ){ ?>
                <div class="ikthemes-pricing-icon">
                    <?php Icons_Manager::render_icon($settings['pricing_icon'], ['aria-hidden' => 'true']); ?>
                </div>
            <?php } ?>

            <div class="ikthemes-price-wrap">
                <div class="ikthemes-pricing-price-wrap">
                    <?php if (! empty( $settings['price'] ) ){ ?>
                        <?php if ( 'yes' === $settings['sale'] && ! empty( $settings['original_price'] ) ){ ?>
                            <div class="ikthemes-pricing-original-price">
                                <?php
                                    $this->render_currency_symbol( $symbol, 'before' );
                                    $this->print_unescaped_setting( 'original_price' );
                                    $this->render_currency_symbol( $symbol, 'after' );
                                ?>
                            </div>
                        <?php } ?>
                        
                        <div class="ikthemes-pricing-current-price">
                            <?php $this->render_currency_symbol( $symbol, 'before' ); ?>

                            <span class="ikthemes-pricing-price">
                                <?php echo floatval( $settings['price'] ); ?>
                            </span>

                            <?php $this->render_currency_symbol( $symbol, 'after' ); ?>

                            <?php if( $period_position == 'beside' ){ ?>
                                <span class="ikthemes-pricing-period">
                                    <?php echo esc_html( $settings['period'] ); ?>
                                </span>
                            <?php } ?>
                        </div>
                    <?php } ?>
                </div>
                <?php if( $period_position == 'below' ){ ?>
                    <span class="ikthemes-pricing-period">
                        <?php echo esc_html( $settings['period'] ); ?>
                    </span>
                <?php } ?>
            </div>

            <?php if ( ! empty( $settings['link_text'] ) && $layout == 'style3' ) : ?>
				<div class="ikthemes-pricing-footer pricing-button">
					<?php if ( ! empty( $settings['link_text'] ) ) : ?>
						<a class="btn btn-primary" href="<?php echo esc_url( $settings['link']['url'] ); ?>" <?php echo $target . $nofollow; ?>>
							<?php echo esc_html( $settings['link_text'] ); ?>
						</a>
					<?php endif; ?>

					<?php if ( ! empty( $settings['link_info'] ) ) : ?>
						<div class="ikthemes-pricing-info">
                            <?php echo wp_kses_post( $settings['link_info'] ); ?>
						</div>
					<?php endif; ?>
				</div>
			<?php endif; ?>

            <?php if (!empty( $settings['feature_list'] )) { ?>
                <div class="ikthemes-pricing-items">
                    <?php foreach ($settings['feature_list'] as $pricingitem) { ?>
                        <div class="ikthemes-pricing-list">
                            <?php Icons_Manager::render_icon($pricingitem['list_icon'], ['aria-hidden' => 'true']); ?>
                            <span class="ikthemes-pricing-list-text">
                                <?php echo wp_kses_post( $pricingitem['list'] ); ?>
                            </span>
                        </div>
                    <?php } ?>
                </div>
            <?php } ?>

            <?php if ( ! empty( $settings['link_text'] ) && $layout == 'style1' || $layout == 'style2' ) : ?>
				<div class="ikthemes-pricing-footer pricing-button">
					<?php if ( ! empty( $settings['link_text'] ) ) : ?>
						<a class="btn btn-primary" href="<?php echo esc_url( $settings['link']['url'] ); ?>" <?php echo $target . $nofollow; ?>>
							<?php echo esc_html( $settings['link_text'] ); ?>
						</a>
					<?php endif; ?>

					<?php if ( ! empty( $settings['link_info'] ) ) : ?>
						<div class="ikthemes-pricing-info">
                            <?php echo wp_kses_post( $settings['link_info'] ); ?>
						</div>
					<?php endif; ?>
				</div>
			<?php endif; ?>

        </div>

        <?php
    }

}
