<?php

namespace Layerdrops\Ostech\Widgets;


class Pricing extends \Elementor\Widget_Base
{
    public function get_name()
    {
        return 'ostech-pricing';
    }

    public function get_title()
    {
        return __('Membership', 'ostech-addon');
    }

    public function get_icon()
    {
        return 'eicon-cogs';
    }

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

    protected function register_controls()
    {
        $this->start_controls_section(
            'layout_section',
            [
                'label' => __('Layout', 'ostech-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'layout_type',
            [
                'label' => __('Select Layout', 'ostech-addon'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'default' => 'layout_one',
                'options' => [
                    'layout_one' => __('Layout One', 'ostech-addon'),
                    'layout_two' => __('Layout Two', 'ostech-addon'),
                    'layout_three' => __('Layout Three', 'ostech-addon'),
                ]
            ]
        );


        $this->end_controls_section();

        include ostech_get_elementor_option('pricing-one-option.php');
        include ostech_get_elementor_option('pricing-two-option.php');

        //General style
        $this->start_controls_section(
            'general_style',
            [
                'label' => esc_html__('Content Style', 'ostech-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );

        ostech_elementor_general_style_options($this, 'Section Title', '{{WRAPPER}} .sec-title__title', ['layout_one', 'layout_two', 'layout_three']);
        ostech_elementor_general_style_options($this, 'Section Sub Title', '{{WRAPPER}} .sec-title__tagline', ['layout_one', 'layout_two', 'layout_three']);

        ostech_elementor_general_style_options($this, 'Heading', '{{WRAPPER}} .package-card__head__title', ['layout_one', 'layout_two', 'layout_three']);

        ostech_elementor_general_style_options($this, 'Active Heading', '{{WRAPPER}} .package-card__head__top', ['layout_one', 'layout_two', 'layout_three']);

        ostech_elementor_general_style_options($this, 'Plan Title', '{{WRAPPER}} .package-card__head__title', ['layout_one', 'layout_two', 'layout_three']);
        ostech_elementor_general_style_options($this, 'Plan list', '{{WRAPPER}} .package-card__content__list__item', ['layout_two']);
        ostech_elementor_general_style_options($this, 'Plan Type', '{{WRAPPER}} .package-card__head__month', ['layout_one', 'layout_two', 'layout_three']);
        ostech_elementor_general_style_options($this, 'Price', '{{WRAPPER}} .package-card__head__price,{{WRAPPER}} .package-card__head .sub', ['layout_one', 'layout_two', 'layout_three']);



        $this->end_controls_section();

        //button style
        $this->start_controls_section(
            'button_style',
            [
                'label' => esc_html__('Button Style', 'ostech-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );

        ostech_elementor_button_style_options($this, 'Button', '{{WRAPPER}} .ostech-btn', '{{WRAPPER}} .ostech-btn:before,{{WRAPPER}} .ostech-btn:after', ['layout_one', 'layout_two', 'layout_three']);

        $this->end_controls_section();

        ostech_get_elementor_carousel_options($this, ['layout_three']);
        ostech_elementor_column_count_options($this, ['layout_one', 'layout_two']);
    }

    protected function render()
    {
        $settings = $this->get_settings_for_display();
        include ostech_get_template('pricing-one.php');
        include ostech_get_template('pricing-two.php');
        include ostech_get_template('pricing-three.php');
    }
}
