<?php



use Elementor\Widget_Base;
use Elementor\Controls_Manager;

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


class Iconboxtwothstkaveh extends Widget_Base{

  public function get_name(){
    return 'iconboxtwothstkaveh';
  }

  public function get_title(){
    return esc_html__( 'Icon Box Style Two', 'kavehTheme' );
  }

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

  public function get_categories(){
    return ['kavehelements'];
  }

  protected function register_controls(){
    
    $this->start_controls_section(
        'contenticonboxtwothstkaveh',
        [
          'label' => esc_html__( 'Element Content', 'kavehTheme' ),
                  'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
        ]
      );
      $this->add_control(
        'iconbutticonboxtwothstkaveh',
        [
          'label' => esc_html__( 'Icon', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::ICONS,
          'skin' => 'inline',

          'exclude_inline_options' => [ 'svg' ],
          'default' => [
            'value' => 'icon-direct',
          ],
        ]
      );
      $this->add_control(
        'ftagti1iconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Subtitle Tag', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SELECT,
          'default' => 'div',
          'options' => [
            'H1'  => esc_html__( 'H1', 'kavehTheme' ),
            'H2' => esc_html__( 'H2', 'kavehTheme' ),
            'H3' => esc_html__( 'H3', 'kavehTheme' ),
            'H4' => esc_html__( 'H4', 'kavehTheme' ),
            'H5' => esc_html__( 'H5', 'kavehTheme' ),
            'H6' => esc_html__( 'H6', 'kavehTheme' ),
            'p' => esc_html__( 'p', 'kavehTheme' ),
            'div' => esc_html__( 'div', 'kavehTheme' ),
            'span' => esc_html__( 'span', 'kavehTheme' ),
          ],
        ]
      );
      $this->add_control(
        'fwigti2iconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Subtitle', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::TEXT,
          'default' => 'Our product categories',
        ]
      );
      $this->add_control(
        'tagti1iconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Title Tag', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SELECT,
          'default' => 'div',
          'options' => [
            'H1'  => esc_html__( 'H1', 'kavehTheme' ),
            'H2' => esc_html__( 'H2', 'kavehTheme' ),
            'H3' => esc_html__( 'H3', 'kavehTheme' ),
            'H4' => esc_html__( 'H4', 'kavehTheme' ),
            'H5' => esc_html__( 'H5', 'kavehTheme' ),
            'H6' => esc_html__( 'H6', 'kavehTheme' ),
            'p' => esc_html__( 'p', 'kavehTheme' ),
            'div' => esc_html__( 'div', 'kavehTheme' ),
            'span' => esc_html__( 'span', 'kavehTheme' ),
          ],
        ]
      );
      $this->add_control(
        'widgtiiconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Bold Title', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::TEXT,
          'default' => 'Categories',
  
        ]
      );
      $this->add_control(
        'wigti2iconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Title', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::TEXT,
          'default' => 'Best Selling',
        ]
      );
      $this->add_control(
        'wigp2iconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Description', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::TEXTAREA,
          'default' => 'Always, being in a situation that we experience for the first time creates stress and anxiety in us;',
  
        ]
      );

       $this->end_controls_section();

       $this->start_controls_section(
        'stylet_iconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Style', 'kavehTheme' ),
          'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        ]
      );
      $this->add_control(
        'iconsizenchbiconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Icon Size', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SLIDER,
          'size_units' => [ 'px' ],
          'range' => [
            'px' => [
              'min' => 0,
              'max' => 200,
              'step' => 1,
            ],
          ],
          'selectors' => [
            '{{WRAPPER}} .section-heading-teen .icon' => 'font-size: {{SIZE}}{{UNIT}};',
          ],
        ]
      );
      $this->add_control(
        'textbutton1coloriconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Icon Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .section-heading-teen .icon' => 'color: {{VALUE}}',
          ],
        ]
      ); 
      $this->add_control(
        'catimg1widthiconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Icon Background Width', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SLIDER,
          'size_units' => [ 'px' ],
          'range' => [
            'px' => [
              'min' => 0,
              'max' => 300,
              'step' => 1,
            ],
          ],
          'selectors' => [
            '{{WRAPPER}} .section-heading-teen .icon' => 'width: {{SIZE}}{{UNIT}};',
          ],
        ]
      );
      $this->add_control(
        'catimg1height2iconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Icon Background Height', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SLIDER,
          'size_units' => [ 'px' ],
          'range' => [
            'px' => [
              'min' => 0,
              'max' => 300,
              'step' => 1,
            ],
          ],
          'selectors' => [
            '{{WRAPPER}} .section-heading-teen .icon' => 'height: {{SIZE}}{{UNIT}};',
          ],
        ]
      );
      $this->add_control(
        'textbg1coloriconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Icon Background Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .section-heading-teen .icon' => 'background-image: linear-gradient(180deg, {{VALUE}} 0%, rgb(255 255 255 / 19%) 47.7%, rgba(253, 231, 229, 0) 100%)',
          ],
        ]
      ); 
      $this->add_control(
        'buttonradiusiconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Icon Background Border Radius', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::DIMENSIONS,
          'size_units' => [ 'px' ],
          'selectors' => [
            '{{WRAPPER}} .section-heading-teen .icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
            '{{WRAPPER}} .section-heading-teen .icon::after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',

          ],
        ]
      );
      
      $this->add_control(
        'bordercolor21iconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Border Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .section-heading-teen .icon::after' => 'background: linear-gradient(180deg, {{VALUE}} 0%, {{VALUE}}02 49.83%, rgba(0, 0, 0, 0) 100%) border-box',
            
          ],
        ]
      );
      $this->add_control(
        'hr1iconboxtwothstkaveh',
        [
          'type' => \Elementor\Controls_Manager::DIVIDER,
        ]
      );
      $this->add_control(
        'ftextcolorticonboxtwothstkaveh',
        [
          'label' => esc_html__( 'Subtitle Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .section-heading-teen-title-en' => 'color: {{VALUE}}',
          ],
        ]
      );
      $this->add_group_control(
        \Elementor\Group_Control_Typography::get_type(),
        [
          'name' => 'ftitletyt_iconboxtwothstkaveh',
          'label' => esc_html__( 'Subtitle Typography', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .section-heading-teen-title-en',
        ]
      );
      $this->add_control(
        'textcolortboliconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Bold Title Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .section-heading-teen-title b' => 'color: {{VALUE}}',
          ],
        ]
      );
      $this->add_group_control(
        \Elementor\Group_Control_Typography::get_type(),
        [
          'name' => 'btitletyt_iconboxtwothstkaveh',
          'label' => esc_html__( 'Bold Title Typography', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .section-heading-teen-title b',
        ]
      );
      $this->add_control(
        'textcolorticonboxtwothstkaveh',
        [
          'label' => esc_html__( 'Title Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .section-heading-teen-title' => 'color: {{VALUE}}',
          ],
        ]
      );
      $this->add_group_control(
        \Elementor\Group_Control_Typography::get_type(),
        [
          'name' => 'titletyt_iconboxtwothstkaveh',
          'label' => esc_html__( 'Title Typography', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .section-heading-teen-title',
        ]
      );
      $this->add_control(
        'textcolortpiconboxtwothstkaveh',
        [
          'label' => esc_html__( 'Description Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .section-heading-teen p' => 'color: {{VALUE}}',
          ],
        ]
      );
      $this->add_group_control(
        \Elementor\Group_Control_Typography::get_type(),
        [
          'name' => 'titletytp_iconboxtwothstkaveh',
          'label' => esc_html__( 'Description Typography', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .section-heading-teen p',
        ]
      );
      $this->end_controls_section();


        }
 

  protected function render(){
    $settings = $this->get_settings_for_display();
    $clsid = $this->get_id();
    ?>
      <div class="section-heading-teen w-100 mx-auto text-center">
        <i class="icon <?php echo esc_attr($settings['iconbutticonboxtwothstkaveh']['value']); ?> d-flex align-items-center justify-content-center position-relative mx-auto"></i>
        <<?php echo  esc_attr($settings['ftagti1iconboxtwothstkaveh']); ?> class="section-heading-teen-title-en"> <?php echo esc_html($settings['fwigti2iconboxtwothstkaveh']); ?> </<?php echo  esc_attr($settings['ftagti1iconboxtwothstkaveh']); ?>>
        <<?php echo  esc_attr($settings['tagti1iconboxtwothstkaveh']); ?> class="section-heading-teen-title position-relative mx-auto mb-4"> <b>  <?php echo esc_html($settings['widgtiiconboxtwothstkaveh']); ?></b> <?php echo esc_html($settings['wigti2iconboxtwothstkaveh']); ?></<?php echo  esc_attr($settings['tagti1iconboxtwothstkaveh']); ?>>
        <p class="mb-0"> <?php echo esc_html($settings['wigp2iconboxtwothstkaveh']); ?></p>
      </div>
    <?php
  }


}
