<?php



use Elementor\Widget_Base;
use Elementor\Controls_Manager;

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


class Aboutusfourthststkaveh extends Widget_Base{

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

  public function get_title(){
    return esc_html__( 'About Us Element Style Four', 'kavehTheme' );
  }

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

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

  protected function register_controls(){
    
    $this->start_controls_section(
        'contentaboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Title Content', 'kavehTheme' ),
                  'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
        ]
      );
  
      $this->add_control(
          'title1aboutusfourthststkaveh',
          [
              'label' => esc_html__( 'Subtitle', 'kavehTheme' ),
              'type' => \Elementor\Controls_Manager::TEXT,
              'default' => esc_html__( 'Store', 'kavehTheme' ),
      
          ]
      );
      $this->add_control(
        'tagheading1aboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Subtitle Tag', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SELECT,
          'default' => 'H6',
          '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(
        'title2aboutusfourthststkaveh',
        [
            'label' => esc_html__( 'Title', 'kavehTheme' ),
            'type' => \Elementor\Controls_Manager::TEXT,
            'default' => esc_html__( 'Digikala', 'kavehTheme' ),
    
        ]
    );
    $this->add_control(
      'tagheading2aboutusfourthststkaveh',
      [
        'label' => esc_html__( 'Title Tag', 'kavehTheme' ),
        'type' => \Elementor\Controls_Manager::SELECT,
        'default' => 'H3',
        '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(
      'title3aboutusfourthststkaveh',
      [
          'label' => esc_html__( 'First Fade Title', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::TEXT,
          'default' => esc_html__( 'About us ...', 'kavehTheme' ),
  
      ]
  );
  $this->add_control(
    'descaboutusfourthststkaveh',
    [
        'label' => esc_html__( 'Description', 'kavehTheme' ),
        'type' => \Elementor\Controls_Manager::WYSIWYG,
        'default' => esc_html__( 'With more than thirty years of experience serving customers in the field of industrial and workshop tools, and by bringing together specialists in this field, we have been offering the brand specifically in the field of tools for more than ten years. Also, to provide the best service, we have launched our online tool store.', 'kavehTheme' ),

    ]
); 
  $this->add_control(
    'title4aboutusfourthststkaveh',
    [
        'label' => esc_html__( 'Second Fade Title', 'kavehTheme' ),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => esc_html__( 'Why choose us?', 'kavehTheme' ),

    ]
);
  $this->end_controls_section();
$this->start_controls_section(
  'content4aboutusfourthststkaveh',
  [
    'label' => esc_html__( 'Images', 'kavehTheme' ),
            'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
  ]
);
$this->add_control(
  'imgaboutusfourthststkaveh',
  [
    'label' => esc_html__( 'Title Top Image', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::MEDIA,
    'selectors' => [
      '{{WRAPPER}} .about-us-home-eleven-content::after' =>
          'background: url({{URL}}) 0 0 no-repeat',
          '{{WRAPPER}} .about-us-home-eleven-content .sup-title::before' =>
          'background: url({{URL}}) 0 0 no-repeat',
  ],
  ]
);
$this->add_control(
  'img2aboutusfourthststkaveh',
  [
    'label' => esc_html__( 'Main Image', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::MEDIA,
    'default' => [
      'url' => \Elementor\Utils::get_placeholder_image_src(),
    ],
  ]
);
$this->add_control(
  'img3aboutusfourthststkaveh',
  [
    'label' => esc_html__( 'Background Image', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::MEDIA,
    'selectors' => [
      '{{WRAPPER}} .about-us-home-eleven-wrapper::before' =>
          'background: url({{URL}}) 0 0 no-repeat',
  ],
  ]
);

       $this->end_controls_section();
       $this->start_controls_section(
        'style_aboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Title Styles', 'kavehTheme' ),
          'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        ]
      );
      $this->add_control(
        'textcolor3aboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Subtitle Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .about-us-home-eleven-content .sup-title' => 'color: {{VALUE}}',
          ],
        ]
      ); 
      $this->add_group_control(
        \Elementor\Group_Control_Typography::get_type(),
        [
          'name' => 'title2_aboutusfourthststkaveh',
          'label' => esc_html__( 'Subtitle Typography', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .about-us-home-eleven-content .sup-title',
        ]
      );
      $this->add_control(
        'textcolor2aboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Main Title Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .about-us-home-eleven-content .title' => 'color: {{VALUE}}',
          ],
        ]
      );
      $this->add_group_control(
        \Elementor\Group_Control_Typography::get_type(),
        [
          'name' => 'title_aboutusfourthststkaveh',
          'label' => esc_html__( 'Main Title Typography', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .about-us-home-eleven-content .title',
        ]
      );
      $this->add_control(
        'textcolor3paboutusfourthststkaveh',
        [
          'label' => esc_html__( 'First Fade Title Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .about-us-home-eleven-content .title::before' => 'color: {{VALUE}}',
          ],
        ]
      );
      $this->add_group_control(
        \Elementor\Group_Control_Typography::get_type(),
        [
          'name' => 'title3_aboutusfourthststkaveh',
          'label' => esc_html__( 'First Fade Title Typography', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .about-us-home-eleven-content .title::before',
        ]
      );
      $this->add_control(
        'textcolor2paboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Text Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .about-us-home-eleven-content p' => 'color: {{VALUE}}',
          ],
        ]
      );
      $this->add_group_control(
        \Elementor\Group_Control_Typography::get_type(),
        [
          'name' => 'titlep_aboutusfourthststkaveh',
          'label' => esc_html__( 'Text Typography', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .about-us-home-eleven-content p',
        ]
      );
      $this->add_control(
        'textcolor4paboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Second Fade Title Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .about-us-home-eleven-content .title-en' => 'color: {{VALUE}}',
          ],
        ]
      );
      $this->add_group_control(
        \Elementor\Group_Control_Typography::get_type(),
        [
          'name' => 'title4_aboutusfourthststkaveh',
          'label' => esc_html__( 'Second Fade Title Typography', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .about-us-home-eleven-content .title-en',
        ]
      );

      $this->end_controls_section();


      $this->start_controls_section(
        'style4_aboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Image Style', 'kavehTheme' ),
          'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        ]
      );

      $this->add_control(
        'imagewidthaboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Title Top Image Width', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SLIDER,
          'size_units' => [ 'px' ],
          'range' => [
            'px' => [
              'min' => 0,
              'max' => 2000,
              'step' => 5,
            ],
          ],
          'selectors' => [
            '{{WRAPPER}} .about-us-home-eleven-content::after' => 'width: {{SIZE}}{{UNIT}};',
            '{{WRAPPER}} .about-us-home-eleven-content .sup-title::before' => 'width: {{SIZE}}{{UNIT}};',

          ],
        ]
      );
      $this->add_control(
        'imageheightaboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Title Top Image Height', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SLIDER,
          'size_units' => [ 'px'],
          'range' => [
            'px' => [
              'min' => 0,
              'max' => 2000,
              'step' => 5,
            ],
          ],
          'selectors' => [
            '{{WRAPPER}} .about-us-home-eleven-content::after' => 'height: {{SIZE}}{{UNIT}};',
            '{{WRAPPER}} .about-us-home-eleven-content .sup-title::before' => 'height: {{SIZE}}{{UNIT}};',
          ],
        ]
      );
      $this->end_controls_section();
      $this->start_controls_section(
        'style5_aboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Main Box Style', 'kavehTheme' ),
          'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        ]
      );
      $this->add_control(
        'bgcolor1paboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Background Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .about-us-home-eleven-wrapper::before' => 'background-color: {{VALUE}}',
          ],
        ]
      );
      $this->add_control(
        'box1radiusaboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Border Radius', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::DIMENSIONS,
          'size_units' => [ 'px' ],
          'selectors' => [
            '{{WRAPPER}} .about-us-home-eleven-wrapper::before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
          ],
        ]
      );
      $this->end_controls_section();
      $this->start_controls_section(
        'style6_aboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Content Box Style', 'kavehTheme' ),
          'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        ]
      );
      $this->add_control(
        'bg2color1paboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Outer Border Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .about-us-home-eleven-content::before' => 'border: 3px solid {{VALUE}}',
          ],
        ]
      );
      $this->add_control(
        'borderbg2color2paboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Outer Background Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .about-us-home-eleven-content::before' => 'background-color: {{VALUE}}',
          ],
        ]
      );
      $this->add_control(
        'bg2color2paboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Inner Background Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .about-us-home-eleven-content' => 'background-color: {{VALUE}}',
          ],
        ]
      );
      $this->add_control(
        'box2radiusaboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Border Radius', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::DIMENSIONS,
          'size_units' => [ 'px' ],
          'selectors' => [
            '{{WRAPPER}} .about-us-home-eleven-content::before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
            '{{WRAPPER}} .about-us-home-eleven-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',

          ],
        ]
      );
      $this->add_control(
        'padding1boxaboutusfourthststkaveh',
        [
          'label' => esc_html__( 'Padding', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::DIMENSIONS,
          'size_units' => [ 'px' ],
          'selectors' => [
            '{{WRAPPER}} .about-us-home-eleven-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
          ],
        ]
      );
      $this->end_controls_section();

        }


  protected function render(){
    $settings = $this->get_settings_for_display();
    $clsid = $this->get_id();
    ?>
<section class="about-us-home-eleven my-100">
    <div class="container">
      <div class="about-us-home-eleven-wrapper position-relative">
        <div class="row">
          <div class="col-lg-6">
            <div class="about-us-home-eleven-content position-relative">
              <div class="title-en position-absolute top-0 start-100 text-nowrap d-none d-lg-block"><?php echo  esc_html($settings['title4aboutusfourthststkaveh']); ?>
              </div>
              <<?php echo  esc_attr($settings['tagheading1aboutusfourthststkaveh']); ?> class="sup-title"><?php echo  esc_html($settings['title1aboutusfourthststkaveh']); ?></<?php echo  esc_attr($settings['tagheading1aboutusfourthststkaveh']); ?>>
              <<?php echo  esc_attr($settings['tagheading2aboutusfourthststkaveh']); ?> class="title position-relative" data-title="<?php echo  esc_attr($settings['title3aboutusfourthststkaveh']); ?>"><?php echo  esc_html($settings['title2aboutusfourthststkaveh']); ?></<?php echo  esc_attr($settings['tagheading2aboutusfourthststkaveh']); ?>>
              <p class="mb-0"> <?php echo $settings['descaboutusfourthststkaveh']; ?></p>
            </div>
          </div>
          <div class="col-lg-6 d-none d-lg-block">
            <div class="image position-relative ms-auto">
              <img src="<?php echo esc_url($settings['img2aboutusfourthststkaveh']['url']); ?>" alt="<?php echo esc_attr(\Elementor\Control_Media::get_image_alt( $settings['img2aboutusfourthststkaveh'] )); ?>" width="420" height="461" class="w-100 h-100">
              <img src="<?php echo esc_url($settings['img2aboutusfourthststkaveh']['url']); ?>" alt="<?php echo esc_attr(\Elementor\Control_Media::get_image_alt( $settings['img2aboutusfourthststkaveh'] )); ?>" width="420" height="461"
                class="position-absolute top-0 end-0 w-100 h-100">
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
  <style>
    .about-us-home-eleven-wrapper::before {
    -webkit-background-size: cover !important ;
    -moz-background-size: cover !important;
    -o-background-size: cover !important;
    background-size: cover !important;
}
.about-us-home-eleven-content::after, .about-us-home-eleven-content .sup-title::before {
  -webkit-background-size: contain !important ;
    -moz-background-size: contain !important;
    -o-background-size: contain !important;
    background-size: contain !important;    }
  </style>
    <?php
    if(empty($settings['imgaboutusfourthststkaveh']['url'])){?>
    <style>
      .about-us-home-eleven-content::after, .about-us-home-eleven-content .sup-title::before {
        background: unset !important;
    }
    </style>
    <?php
    }

  }


}
