<?php

namespace Layerdrops\Ostech\Widgets;


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

    public function get_title()
    {
        return __('Header', '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 Type', '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'),
                    // 'layout_four' => __('Layout Four', 'ostech-addon'),
                    // 'layout_five' => __('Layout Five', 'ostech-addon'),
                ]
            ]
        );

        $this->end_controls_section();

        include ostech_get_elementor_option('header-option.php');

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

        ostech_elementor_general_style_options($this, 'Menu', '{{WRAPPER}} .main-menu .main-menu__list > li > a,{{WRAPPER}} .main-menu .main-menu__list > li > ul > li > a', ['layout_one', 'layout_two', 'layout_three']);
        ostech_elementor_general_style_options($this, 'Top Contact', '{{WRAPPER}} .topbar-one__info__item', ['layout_two', 'layout_three',]);
        ostech_elementor_general_style_options($this, 'Top Date', '{{WRAPPER}} .topbar-one__text', ['layout_three']);
        ostech_elementor_general_style_options($this, 'Call Number', '{{WRAPPER}} .main-header__right__number,{{WRAPPER}} .topbar-one__right__call__text,{{WRAPPER}} .main-header--three .main-header__right__call__text', ['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}} .main-header--two .main-header__btn,{{WRAPPER}} .main-header--three .main-header__btn', '{{WRAPPER}} .main-header--two .main-header__btn::after,{{WRAPPER}} .main-header--two .main-header__btn::before, {{WRAPPER}} .main-header--three .main-header__btn:before,{{WRAPPER}} .main-header--three .main-header__btn:after', ['layout_two', 'layout_three']);

        $this->end_controls_section();
    }

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