<?php

use Elementor\Widget_Base;
use Elementor\Controls_Manager;

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


class productsrandomoffersecondstkaveh extends Widget_Base
{

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

  public function get_title()
  {
    return esc_html__('Instant Offer 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(
      'content01productsrandomoffersecondstkaveh',
      [
        'label' => esc_html__('General', 'kavehTheme'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
      ]
    );


    $this->add_control(
      'stylegeneralproductsrandomoffersecondstkaveh',
      [
        'label' => esc_html__('Element Layout', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SELECT,
        'default' => 'one',
        'options' => [
          'one' => esc_html__('Layout One', 'kavehTheme'),
          'two' => esc_html__('Layout Two', 'kavehTheme'),
        ],
      ]
    );
    $this->add_control(
      'imgtopproductsrandomoffersecondstkaveh',
      [
        'label' => esc_html__( 'Image Before Title', 'kavehTheme' ),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'condition' => [
          'stylegeneralproductsrandomoffersecondstkaveh' => 'one',
        ],
      ]
    );

    $this->add_control(
      'title1productsrandomoffersecondstkaveh',
      [
          'label' => esc_html__( 'First Title', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::TEXT,
          'default' => esc_html__( 'Delivery', 'kavehTheme' ),
          'condition' => [
            'stylegeneralproductsrandomoffersecondstkaveh' => 'one',
          ],
  
      ]
  );
  $this->add_control(
    'title2productsrandomoffersecondstkaveh',
    [
        'label' => esc_html__( 'Second Title', 'kavehTheme' ),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => esc_html__( 'Express', 'kavehTheme' ),
        'condition' => [
          'stylegeneralproductsrandomoffersecondstkaveh' => 'one',
        ],

    ]
);
  $this->add_control(
    'tagheading1productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Title Tag', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SELECT,
      'condition' => [
        'stylegeneralproductsrandomoffersecondstkaveh' => 'one',
      ],
      '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(
    'iconiconboxkavehproductsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Icon', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::ICONS,
      'skin' => 'inline',
      'exclude_inline_options' => [ 'svg' ],
      'default' => [
        'value' => 'icon-box-alt',
      ],
    ]
  ); 


    $this->end_controls_section();




/////////////////////////////////////// style one ///////////////////////////////////////



$this->start_controls_section(
    'style_product_title_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Product Title Style', 'kavehTheme' ),
      'tab' => \Elementor\Controls_Manager::TAB_STYLE,
      'condition' => [
        'stylegeneralproductsrandomoffersecondstkaveh' => 'one',
      ],
    ]
  );
  
  $this->start_controls_tabs( 'tabs_title_style_productsrandomoffersecondstkaveh' );
  
  $this->start_controls_tab(
    'tab_title_normal_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Normal', 'kavehTheme' ),
    ]
  );
  
  $this->add_control(
    'product_title_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Title Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .title-product' => 'color: {{VALUE}};',
      ],
    ]
  );
  
  $this->end_controls_tab();
  
  $this->start_controls_tab(
    'tab_title_hover_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Hover', 'kavehTheme' ),
    ]
  );
  
  $this->add_control(
    'product_title_hover_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Title Hover Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .title-product:hover' => 'color: {{VALUE}};',
      ],
    ]
  );
  
  $this->end_controls_tab();
  $this->end_controls_tabs();
  
  $this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
      'name' => 'product_title_typography_productsrandomoffersecondstkaveh',
      'label' => esc_html__( 'Title Typography', 'kavehTheme' ),
      'selector' => '{{WRAPPER}} .box-products-fast-sending .title-product',
    ]
  );

  $this->add_group_control(
    \Elementor\Group_Control_Text_Shadow::get_type(),
    [
      'name' => 'product_title_shadow_productsrandomoffersecondstkaveh',
      'label' => esc_html__( 'Title Text Shadow', 'kavehTheme' ),
      'selector' => '{{WRAPPER}} .box-products-fast-sending .title-product',
    ]
  );
  
$this->end_controls_section();
$this->start_controls_section(
    'style_heading_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Heading Section Style', 'kavehTheme' ),
      'tab' => \Elementor\Controls_Manager::TAB_STYLE,
      'condition' => [
        'stylegeneralproductsrandomoffersecondstkaveh' => 'one',
      ],
    ]
  );
  
  $this->add_control(
    'heading_title_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Title Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .heading .title' => 'color: {{VALUE}};',
      ],
    ]
  );

  $this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
      'name' => 'heading_title_typography_productsrandomoffersecondstkaveh',
      'label' => esc_html__( 'Title Typography', 'kavehTheme' ),
      'selector' => '{{WRAPPER}} .box-products-fast-sending .heading .title',
    ]
  );
  
  $this->add_control(
    'heading_title_span_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Second Title Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .heading .title span' => 'color: {{VALUE}};',
      ],
    ]
  );
  
  $this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
      'name' => 'heading_span_typography_productsrandomoffersecondstkaveh',
      'label' => esc_html__( 'Second Title Typography', 'kavehTheme' ),
      'selector' => '{{WRAPPER}} .box-products-fast-sending .heading .title span',
    ]
  );

$this->add_control(
    'heading_icon_bg_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Icon Background Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .heading .fast-send .icon' => 'background: {{VALUE}};',
      ],
    ]
  );

  $this->add_control(
    'heading_icon_width_productsrandomoffersecondstkaveh',
    [
      '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}} .box-products-fast-sending .heading .fast-send .icon' => 'width: {{SIZE}}{{UNIT}};',
      ],
    ]
  );

  $this->add_control(
    'heading_icon_height_productsrandomoffersecondstkaveh',
    [
      '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}} .box-products-fast-sending .heading .fast-send .icon' => 'height: {{SIZE}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_control(
    'heading_icon_radius_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Icon Corners', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::DIMENSIONS,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .heading .fast-send .icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
      ],
    ]
  );
  
  $this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
      'name' => 'heading_icon_shadow_productsrandomoffersecondstkaveh',
      'label' => esc_html__( 'Icon Shadow', 'kavehTheme' ),
      'selector' => '{{WRAPPER}} .box-products-fast-sending .heading .fast-send .icon',
    ]
  );

$this->add_control(
    'heading_icon_img_label',
    [
      'type' => \Elementor\Controls_Manager::HEADING,
      'label' => esc_html__( 'Image Next to Title', 'kavehTheme' ),
      'separator' => 'before',
    ]
  );
  
  $this->add_responsive_control(
    'heading_icon_img_width_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Image Width', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [ 'px' => [ 'min' => 10, 'max' => 100 ] ],
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .fast-send .icon img' => 'width: {{SIZE}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_responsive_control(
    'heading_icon_img_height_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Image Height', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [ 'px' => [ 'min' => 10, 'max' => 100 ] ],
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .fast-send .icon img' => 'height: {{SIZE}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_control(
    'heading_icon_img_radius_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Image Corners', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::DIMENSIONS,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .fast-send .icon img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
      'name' => 'heading_icon_img_shadow_productsrandomoffersecondstkaveh',
      'label' => esc_html__( 'Image Shadow', 'kavehTheme' ),
      'selector' => '{{WRAPPER}} .box-products-fast-sending .fast-send .icon img',
    ]
  );

$this->end_controls_section();
$this->start_controls_section(
    'style_discount_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Discount Title Style', 'kavehTheme' ),
      'tab' => \Elementor\Controls_Manager::TAB_STYLE,
      'condition' => [
        'stylegeneralproductsrandomoffersecondstkaveh' => 'one',
      ],
    ]
  );
  
  $this->add_control(
    'discount_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Discount Text Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending del.off' => 'color: {{VALUE}};',
      ],
    ]
  );
  
  $this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
      'name' => 'discount_typography_productsrandomoffersecondstkaveh',
      'label' => esc_html__( 'Discount Typography', 'kavehTheme' ),
      'selector' => '{{WRAPPER}} .box-products-fast-sending del.off',
    ]
  );
  
  $this->add_control(
    'price_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Current Price Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .price' => 'color: {{VALUE}};',
      ],
    ]
  );
  
  $this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
      'name' => 'price_typography_productsrandomoffersecondstkaveh',
      'label' => esc_html__( 'Current Price Typography', 'kavehTheme' ),
      'selector' => '{{WRAPPER}} .box-products-fast-sending .price',
    ]
  );

  $this->add_control(
    'discount_line_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Line Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending del.off' => 'text-decoration-color: {{VALUE}};',
      ],
    ]
  );

  $this->add_control(
    'discount_line_thickness_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Line Thickness', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [ 'px' => [ 'min' => 1, 'max' => 10 ] ],
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending del.off' => 'text-decoration-thickness: {{SIZE}}{{UNIT}};',
      ],
    ]
  );
  
  $this->end_controls_section();
  $this->start_controls_section(
    'style_product_image_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Product Image Style', 'kavehTheme' ),
      'tab' => \Elementor\Controls_Manager::TAB_STYLE,
      'condition' => [
        'stylegeneralproductsrandomoffersecondstkaveh' => 'one',
      ],
    ]
  );
  
  $this->add_responsive_control(
    'product_image_width_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Image Width', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [
        'px' => [ 'min' => 0, 'max' => 500 ],
      ],
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .product-box-fast-sending .image img' => 'width: {{SIZE}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_responsive_control(
    'product_image_height_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Image Height', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [
        'px' => [ 'min' => 0, 'max' => 500 ],
      ],
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .product-box-fast-sending .image img' => 'height: {{SIZE}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_control(
    'product_image_radius_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Image Corners', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::DIMENSIONS,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .product-box-fast-sending .image img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
      'name' => 'product_image_shadow_productsrandomoffersecondstkaveh',
      'label' => esc_html__( 'Image Shadow', 'kavehTheme' ),
      'selector' => '{{WRAPPER}} .box-products-fast-sending .product-box-fast-sending .image img',
    ]
  );
  
  $this->end_controls_section();
  $this->start_controls_section(
    'style_button_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Button Style', 'kavehTheme' ),
      'tab' => \Elementor\Controls_Manager::TAB_STYLE,
      'condition' => [
        'stylegeneralproductsrandomoffersecondstkaveh' => 'one',
      ],
    ]
  );
  
  $this->start_controls_tabs( 'tabs_button_productsrandomoffersecondstkaveh' );
  
  $this->start_controls_tab(
    'tab_button_normal_productsrandomoffersecondstkaveh',
    [ 'label' => esc_html__( 'Normal', 'kavehTheme' ) ]
  );
  
  $this->add_control(
    'btn_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Button Icon Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .btn-add-to-cart i' => 'color: {{VALUE}};',
      ],
    ]
  );
  
  $this->add_control(
    'btn_bg_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Button Background Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .btn-add-to-cart' => 'background: {{VALUE}};',
      ],
    ]
  );
  
  $this->end_controls_tab();
  
  $this->start_controls_tab(
    'tab_button_hover_productsrandomoffersecondstkaveh',
    [ 'label' => esc_html__( 'Hover', 'kavehTheme' ) ]
  );
  
  $this->add_control(
    'btn_hover_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Icon Color on Hover', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .btn-add-to-cart:hover i' => 'color: {{VALUE}};',
      ],
    ]
  );
  
  $this->add_control(
    'btn_hover_bg_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Background Color on Hover', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .btn-add-to-cart:hover' => 'background: {{VALUE}};',
      ],
    ]
  );
  
  $this->end_controls_tab();
  $this->end_controls_tabs();

  $this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
      'name' => 'btn_border_productsrandomoffersecondstkaveh',
      'label' => esc_html__( 'Button Border', 'kavehTheme' ),
      'selector' => '{{WRAPPER}} .box-products-fast-sending .btn-add-to-cart',
    ]
  );
  
  $this->add_responsive_control(
    'btn_icon_size_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Icon Size', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [
        'px' => [
          'min' => 8,
          'max' => 60,
        ],
      ],
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .btn-add-to-cart i' => 'font-size: {{SIZE}}{{UNIT}};',
      ],
    ]
  );  

  $this->add_responsive_control(
    'btn_width_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Button Width', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [ 'px' => [ 'min' => 20, 'max' => 300 ] ],
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .btn-add-to-cart' => 'width: {{SIZE}}{{UNIT}};',
      ],
    ]
  );

  $this->add_responsive_control(
    'btn_height_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Button Height', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [ 'px' => [ 'min' => 20, 'max' => 150 ] ],
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .btn-add-to-cart' => 'height: {{SIZE}}{{UNIT}};',
      ],
    ]
  );

  $this->add_control(
    'btn_radius_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Button Corners', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::DIMENSIONS,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .btn-add-to-cart' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
      'name' => 'btn_shadow_productsrandomoffersecondstkaveh',
      'label' => esc_html__( 'Button Shadow', 'kavehTheme' ),
      'selector' => '{{WRAPPER}} .box-products-fast-sending .btn-add-to-cart',
    ]
  );
  
  $this->end_controls_section();
  $this->start_controls_section(
    'style_product_wrapper_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Product Box Style', 'kavehTheme' ),
      'tab' => \Elementor\Controls_Manager::TAB_STYLE,
      'condition' => [
        'stylegeneralproductsrandomoffersecondstkaveh' => 'one',
      ],
    ]
  );
  
  $this->add_control(
    'product_wrapper_bg_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Background Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending' => 'background-color: {{VALUE}};',
      ],
    ]
  );

  $this->add_control(
    'product_wrapper_bg_border1_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'First Border Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .line-left' => 'background: {{VALUE}};',
      ],
    ]
  );

  $this->add_control(
    'product_wrapper_bg_border2_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Second Border Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .line-right' => 'background: {{VALUE}};',
      ],
    ]
  );

  $this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
      'name' => 'product_wrapper_border_productsrandomoffersecondstkaveh',
      'selector' => '{{WRAPPER}} .box-products-fast-sending::before',
    ]
  );
  
  $this->add_control(
    'product_wrapper_radius_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Box Corners', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::DIMENSIONS,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_control(
    'product_wrapper_padding_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Inner Spacing', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::DIMENSIONS,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_control(
    'product_wrapper_margin_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Outer Spacing', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::DIMENSIONS,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
      'name' => 'product_wrapper_shadow_productsrandomoffersecondstkaveh',
      'label' => esc_html__( 'Box Shadow', 'kavehTheme' ),
      'selector' => '{{WRAPPER}} .box-products-fast-sending',
    ]
  );
  
  $this->end_controls_section();
  $this->start_controls_section(
    'style_pagination_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Pagination Style', 'kavehTheme' ),
      'tab' => \Elementor\Controls_Manager::TAB_STYLE,
      'condition' => [
        'stylegeneralproductsrandomoffersecondstkaveh' => 'one',
      ],
    ]
  );
  
  $this->add_control(
    'pagination_bullet_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Inactive Dots Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .swiper-pagination .swiper-pagination-bullet' => 'background-color: {{VALUE}};',
      ],
    ]
  );
  
  $this->add_control(
    'pagination_active_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Active Dot Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .swiper-pagination .swiper-pagination-bullet-active' => 'background-color: {{VALUE}};',
      ],
    ]
  );
  
  $this->add_responsive_control(
    'pagination_bullet_size_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Dots Size', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [
        'px' => [ 'min' => 4, 'max' => 30 ],
      ],
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .swiper-pagination .swiper-pagination-bullet' =>
          'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_responsive_control(
    'pagination_bullet_gap_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Spacing Between Dots', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [
        'px' => [ 'min' => 0, 'max' => 50 ],
      ],
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .swiper-pagination' => 'gap: {{SIZE}}{{UNIT}};',
      ],
    ]
  );

  $this->add_control(
    'pagination_bullet_radius_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Box Corners', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::DIMENSIONS,
      'selectors' => [
        '{{WRAPPER}} .box-products-fast-sending .swiper-pagination .swiper-pagination-bullet' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
      ],
    ]
  );

  $this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
      'name' => 'pagination_bullet_shadow_productsrandomoffersecondstkaveh',
      'label' => esc_html__( 'Dots Shadow', 'kavehTheme' ),
      'selector' => '{{WRAPPER}} .box-products-fast-sending .swiper-pagination .swiper-pagination-bullet',
    ]
  );
  
  $this->end_controls_section();
  
  
  
  
  
/////////////////////////// style two ///////////////////////////


$this->start_controls_section(
    'style_title_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Product Title Style', 'kavehTheme' ),
      'tab' => \Elementor\Controls_Manager::TAB_STYLE,
      'condition' => [
        'stylegeneralproductsrandomoffersecondstkaveh' => 'two',
      ],
    ]
  );
  
  $this->start_controls_tabs('tabs_two_title_style_productsrandomoffersecondstkaveh');
  
  $this->start_controls_tab('tab_two_title_normal_productsrandomoffersecondstkaveh', [
    'label' => esc_html__( 'Normal', 'kavehTheme' ),
  ]);
  
  $this->add_control(
    'title_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Title Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .title-product a' => 'color: {{VALUE}};',
      ],
    ]
  );

  $this->add_control(
    'category_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Category Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .category' => 'color: {{VALUE}};',
      ],
    ]
  );
  
  $this->end_controls_tab();
  
  $this->start_controls_tab('tab_two_title_hover_productsrandomoffersecondstkaveh', [
    'label' => esc_html__( 'Hover', 'kavehTheme' ),
  ]);
  
  $this->add_control(
    'title_color_hover_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Title Color on Hover', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .title-product a:hover' => 'color: {{VALUE}};',
      ],
    ]
  );

  $this->add_control(
    'category_hover_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Category Hover Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .category:hover' => 'color: {{VALUE}};',
      ],
    ]
  );
  
  $this->end_controls_tab();
  $this->end_controls_tabs();

  $this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
      'name' => 'title_typo_productsrandomoffersecondstkaveh',
      'selector' => '{{WRAPPER}} .discounted-products-book-item .title-product',
    ]
  );

  $this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
      'name' => 'category_typo_productsrandomoffersecondstkaveh',
      'selector' => '{{WRAPPER}} .discounted-products-book-item .category',
    ]
  );
  
  $this->end_controls_section();
  $this->start_controls_section(
    'style_price_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Price Style', 'kavehTheme' ),
      'tab' => \Elementor\Controls_Manager::TAB_STYLE,
      'condition' => [
        'stylegeneralproductsrandomoffersecondstkaveh' => 'two',
      ],
    ]
  );
  
  $this->add_control(
    'price_two_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Current Price Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .price .price' => 'color: {{VALUE}};',
      ],
    ]
  );

  $this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
      'name' => 'price_two_typo_productsrandomoffersecondstkaveh',
      'selector' => '{{WRAPPER}} .discounted-products-book-item .price .price',
    ]
  );
  
  $this->add_control(
    'price_old_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Previous Price Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .price del' => 'color: {{VALUE}};',
      ],
    ]
  );

  $this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
      'name' => 'price_old_typo_productsrandomoffersecondstkaveh',
      'selector' => '{{WRAPPER}} .discounted-products-book-item .price del',
    ]
  );
  
  $this->add_control(
    'price_old_line_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Line Color Over Previous Price', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .price del' => 'text-decoration-color: {{VALUE}};',
      ],
    ]
  );
  
  $this->add_control(
    'price_old_line_thickness_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Line Thickness Over Previous Price', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [ 'px' => [ 'min' => 1, 'max' => 10 ] ],
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .price del' => 'text-decoration-thickness: {{SIZE}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_control(
    'price_toman_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Currency Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .price .toman' => 'color: {{VALUE}};',
      ],
    ]
  );

  $this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
      'name' => 'price_toman_typo_productsrandomoffersecondstkaveh',
      'selector' => '{{WRAPPER}} .discounted-products-book-item .price .toman',
    ]
  );
  
  $this->end_controls_section();
  $this->start_controls_section(
    'style_discount_two_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Discount Style', 'kavehTheme' ),
      'tab' => \Elementor\Controls_Manager::TAB_STYLE,
      'condition' => [
        'stylegeneralproductsrandomoffersecondstkaveh' => 'two',
      ],
    ]
  );
  
  $this->add_control(
    'discount_bg_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Discount Box Background Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .discount' => 'background-color: {{VALUE}};',
      ],
    ]
  );

  $this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
      'name' => 'discount_border_productsrandomoffersecondstkaveh',
      'selector' => '{{WRAPPER}} .discounted-products-book-item .discount',
    ]
  );
  
  $this->add_control(
    'discount_percent_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Discount Number Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .discount span' => 'color: {{VALUE}} !important;',
      ],
    ]
  );
  
  $this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
      'name' => 'discount_percent_typo_productsrandomoffersecondstkaveh',
      'selector' => '{{WRAPPER}} .discounted-products-book-item .discount span',
    ]
  );

  $this->add_control(
    'discount_label_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Discount Amount Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .discount > div' => 'color: {{VALUE}} !important;',
      ],
    ]
  );
  
  $this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
      'name' => 'discount_label_typo_productsrandomoffersecondstkaveh',
      'label' => esc_html__( 'Discount Amount Typography', 'kavehTheme' ),
      'selector' => '{{WRAPPER}} .discounted-products-book-item .discount > div',
    ]
  );

  $this->add_responsive_control(
    'discount_width_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Button Width', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [ 'px' => [ 'min' => 20, 'max' => 150 ] ],
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .discount' => 'width: {{SIZE}}{{UNIT}};',
      ],
    ]
  );

  $this->add_responsive_control(
    'discount_height_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Button Height', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [ 'px' => [ 'min' => 20, 'max' => 150 ] ],
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .discount' => 'height: {{SIZE}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_control(
    'discount_radius_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Discount Box Corners', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::DIMENSIONS,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .discount' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
      'name' => 'discount_shadow_productsrandomoffersecondstkaveh',
      'selector' => '{{WRAPPER}} .discounted-products-book-item .discount',
    ]
  );
  
$this->end_controls_section();
$this->start_controls_section(
    'style_image_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Product Image Style', 'kavehTheme' ),
      'tab' => \Elementor\Controls_Manager::TAB_STYLE,
      'condition' => [
        'stylegeneralproductsrandomoffersecondstkaveh' => 'two',
      ],
    ]
  );
  
  $this->add_responsive_control(
    'image_width_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Image Width', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [ 'px' => [ 'min' => 50, 'max' => 500 ] ],
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .image img' => 'width: {{SIZE}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_responsive_control(
    'image_height_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Image Height', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [ 'px' => [ 'min' => 50, 'max' => 500 ] ],
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .image img' => 'height: {{SIZE}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_control(
    'image_radius_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Image Corners', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::DIMENSIONS,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item .image img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
      'name' => 'image_shadow_productsrandomoffersecondstkaveh',
      'selector' => '{{WRAPPER}} .discounted-products-book-item .image img',
    ]
  );
  
  $this->end_controls_section();
  $this->start_controls_section(
    'style_box_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Product Box Style', 'kavehTheme' ),
      'tab' => \Elementor\Controls_Manager::TAB_STYLE,
      'condition' => [
        'stylegeneralproductsrandomoffersecondstkaveh' => 'two',
      ],
    ]
  );
  
  $this->add_control(
    'box_bg_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Box Background Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item' => 'background-color: {{VALUE}};',
      ],
    ]
  );

  $this->add_control(
    'box_bg_border1_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'First Box Border Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
    ]
  );

  $this->add_control(
    'box_bg_border2_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Second Box Border Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
    ]
  );

  $this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
      'name' => 'box_border_productsrandomoffersecondstkaveh',
      'selector' => '{{WRAPPER}} .discounted-products-book',
    ]
  );

  $this->add_control(
    'box_padding_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Box Inner Spacing', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::DIMENSIONS,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
      ],
    ]
  );
  
  $this->add_control(
    'box_radius_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Box Corners', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::DIMENSIONS,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
      ],
    ]
  );
  
  $this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
      'name' => 'box_shadow_productsrandomoffersecondstkaveh',
      'selector' => '{{WRAPPER}} .discounted-products-book',
    ]
  );
  
  $this->end_controls_section();
  $this->start_controls_section(
    'style_two_pagination_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Pagination Style', 'kavehTheme' ),
      'tab' => \Elementor\Controls_Manager::TAB_STYLE,
      'condition' => [
        'stylegeneralproductsrandomoffersecondstkaveh' => 'two',
      ],
    ]
  );
  
  $this->add_control(
    'pagination_two_bullet_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Inactive Dots Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book .swiper-pagination-bullet' => 'background-color: {{VALUE}};',
      ],
    ]
  );
  
  $this->add_control(
    'pagination_bullet_active_color_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Active Dot Color', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::COLOR,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book .swiper-pagination-bullet-active' => 'background-color: {{VALUE}};',
      ],
    ]
  );
  
  $this->add_responsive_control(
    'pagination_two_bullet_width_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Dots Width', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [
        'px' => [ 'min' => 0, 'max' => 50 ],
      ],
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book .swiper-pagination-bullet' => 'width: {{SIZE}}{{UNIT}};',
      ],
    ]
  );

  $this->add_responsive_control(
    'pagination_two_bullet_height_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Dots Height', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [
        'px' => [ 'min' => 0, 'max' => 50 ],
      ],
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book .swiper-pagination-bullet' => 'height: {{SIZE}}{{UNIT}};',
      ],
    ]
  );

  $this->add_control(
    'pagination_two_bullet_border_radius_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Dots Corners', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::DIMENSIONS,
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book .swiper-pagination-bullet' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
      ],
    ]
  );
  
  $this->add_responsive_control(
    'pagination_two_bullet_gap_productsrandomoffersecondstkaveh',
    [
      'label' => esc_html__( 'Spacing Between Dots', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SLIDER,
      'range' => [
        'px' => [ 'min' => 0, 'max' => 50 ],
      ],
      'selectors' => [
        '{{WRAPPER}} .discounted-products-book .swiper-pagination' => 'gap: {{SIZE}}{{UNIT}};',
      ],
    ]
  );
  
  $this->end_controls_section();
  
  
  
  
  
  
  
  
  












    $this->start_controls_section(
      'content2productsrandomoffersecondstkaveh',
      [
          'label' => esc_html__('Product Settings', 'kavehTheme'),
          'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
      ]
  );
  
  // 2. Exclude Out of Stock Products (for WooCommerce only)
  $this->add_control(
      'kaveh_exclude_out_of_stock',
      [
          'label' => esc_html__('Hide Out of Stock Products', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::SWITCHER,
          'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
          'return_value' => 'yes',
          'default' => 'yes',
      ]
  );
  
  // 3. Show Only Onsale Products
  $this->add_control(
      'show_onsale_products_productsrandomoffersecondstkaveh',
      [
          'label' => esc_html__('Show Only Sale Products', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::SWITCHER,
          'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
          'return_value' => 'yes',
          'default' => 'no',
      ]
  );
  
  // 4. Taxonomy Filters
  $taxonomies = get_taxonomies(['public' => true], 'objects');
  $taxonomy_options = [];
  foreach ($taxonomies as $taxonomy) {
      $taxonomy_options[$taxonomy->name] = $taxonomy->label;
  }
  $this->add_control(
      'taxonomy_filter_productsrandomoffersecondstkaveh',
      [
          'label' => esc_html__('Filter by Taxonomy', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::SELECT2,
          'multiple' => true,
          'options' => $taxonomy_options,
      ]
  );
  // Add a control for selecting taxonomy terms
  $this->add_control(
  'taxonomy_terms_productsrandomoffersecondstkaveh',
  [
      'label' => esc_html__('Select Taxonomy Terms', 'kavehTheme'),
      'type' => \Elementor\Controls_Manager::SELECT2,
      'multiple' => true,
      'options' => [], // Initially empty, populated dynamically
  ]
  );
  
  // 5. Product Attributes Control
  $attribute_taxonomies = wc_get_attribute_taxonomies();
  $attribute_options = [];
  foreach ($attribute_taxonomies as $attribute) {
      $attribute_options[$attribute->attribute_name] = $attribute->attribute_label;
  }
  $this->add_control(
      'product_attributes_productsrandomoffersecondstkaveh',
      [
          'label' => esc_html__('Filter by Product Attribute', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::SELECT2,
          'multiple' => true,
          'options' => $attribute_options,
      ]
  );
  // Add a control for selecting product attribute terms
  $this->add_control(
  'product_attribute_terms_productsrandomoffersecondstkaveh',
  [
      'label' => esc_html__('Select Attribute Values', 'kavehTheme'),
      'type' => \Elementor\Controls_Manager::SELECT2,
      'multiple' => true,
      'options' => [], // Initially empty, populated dynamically
  ]
  );
  
  // 6. Advanced Sorting
  $this->add_control(
      'psortproductsrandomoffersecondstkaveh',
      [
          'label' => esc_html__('Sort By', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::SELECT,
          'default' => 'date',
          'options' => [
              'date' => esc_html__('Date', 'kavehTheme'),
        'title' => esc_html__('Title', 'kavehTheme'),
        'rand' => esc_html__('Random', 'kavehTheme'),
        'comment_count' => esc_html__('Comment Count', 'kavehTheme'),
        'menu_order' => esc_html__('Menu Order', 'kavehTheme'),
        '_price' => esc_html__('Price', 'kavehTheme'),
        '_wc_average_rating' => esc_html__('Most Popular', 'kavehTheme'),
        'total_sales' => esc_html__('Sales Volume', 'kavehTheme'),
          ],
      ]
  );
  
  // 7. Sort Order
  $this->add_control(
      'psortiproductsrandomoffersecondstkaveh',
      [
          'label' => esc_html__('Sort Order', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::SELECT,
          'default' => 'desc',
          'options' => [
              'asc' => esc_html__('Ascending', 'kavehTheme'),
        'desc' => esc_html__('Descending', 'kavehTheme'),
          ],
      ]
  );
  
  // 8. Pagination and Limits
  $this->add_control(
      'posts_per_page_productsrandomoffersecondstkaveh',
      [
          'label' => esc_html__('Number of Products', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::NUMBER,
          'default' => 10,
          'min' => 1,
          'max' => 100,
      ]
  );
  
  // 9. Meta Query (Custom Fields)
  $this->add_control(
      'meta_key_productsrandomoffersecondstkaveh',
      [
          'label' => esc_html__('Meta Key', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::TEXT,
          'description' => esc_html__('Meta key for filtering (optional)', 'kavehTheme'),
      ]
  );
  
  $this->add_control(
      'meta_value_productsrandomoffersecondstkaveh',
      [
          'label' => esc_html__('Meta Value', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::TEXT,
          'description' => esc_html__('Meta value for filtering (optional)', 'kavehTheme'),
      ]
  );
  
  // 10. Date Query
  $this->add_control(
      'date_query_productsrandomoffersecondstkaveh',
      [
          'label' => esc_html__('Filter by Date', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::SELECT,
          'default' => 'none',
          'options' => [
              'none' => esc_html__('None', 'kavehTheme'),
        'today' => esc_html__('Today', 'kavehTheme'),
        'last_7_days' => esc_html__('Last 7 Days', 'kavehTheme'),
        'last_30_days' => esc_html__('Last 30 Days', 'kavehTheme'),
        'custom' => esc_html__('Custom', 'kavehTheme'),
          ],
      ]
  );
  
  // 11. Exclusions
  $this->add_control(
      'exclude_posts_productsrandomoffersecondstkaveh',
      [
          'label' => esc_html__('Exclude Posts', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::TEXT,
          'description' => esc_html__('Separate post IDs with commas (optional)', 'kavehTheme'),
      ]
  );
  
  // 12. Custom Query Parameters
  $this->add_control(
      'custom_query_productsrandomoffersecondstkaveh',
      [
          'label' => esc_html__('Custom WP_Query Parameters', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::TEXTAREA,
          'description' => esc_html__('Enter custom parameters as JSON (optional)', 'kavehTheme'),
      ]
  );
  
  $this->end_controls_section();
    $this->start_controls_section(
      'content3productsrandomoffersecondstkaveh',
      [
        'label' => esc_html__('Carousel Settings', 'kavehTheme'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
      ]
    );
    $this->add_control(
      'productcolumnproductsrandomoffersecondstkaveh',
      [
        'label' => esc_html__('Number of Category Columns on Desktop', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::NUMBER,
        'min' => 0,
        'max' => 8,
        'step' => 1,
        'default' => 4,

      ]
    );
    $this->add_control(
      'productcolumn2productsrandomoffersecondstkaveh',
      [
        'label' => esc_html__('Number of Category Columns on Tablet', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::NUMBER,
        'min' => 0,
        'max' => 5,
        'step' => 1,
        'default' => 3,

      ]
    );
    $this->add_control(
      'productcolumn3productsrandomoffersecondstkaveh',
      [
        'label' => esc_html__('Number of Category Columns on Mobile', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::NUMBER,
        'min' => 0,
        'max' => 5,
        'step' => .5,
        'default' => 1.5,

      ]
    );
    $this->end_controls_section();


  }


  protected function render()
  {
    $settings = $this->get_settings_for_display();
    $clsid = $this->get_id();
    $woo_currency = get_woocommerce_currency_symbol();

    ?>

    <?php if ('one' === $settings['stylegeneralproductsrandomoffersecondstkaveh']) { ?>


      <div class="box-products-fast-sending overflow-hidden position-relative">
              <div class="line-right position-absolute start-0"></div>
              <div class="line-left position-absolute end-0"></div>
              <div class="heading d-flex align-items-center justify-content-between gap-2">
                <div class="fast-send d-flex align-items-center gap-2">
                  <div class="icon d-flex align-items-center justify-content-center rounded-circle">
                    <img src="<?php echo esc_url($settings['imgtopproductsrandomoffersecondstkaveh']['url']); ?>" alt="" width="23" height="25">
                  </div>
                  <<?php echo  esc_attr($settings['tagheading1productsrandomoffersecondstkaveh']); ?> class="title">
                  <?php echo  esc_html($settings['title1productsrandomoffersecondstkaveh']); ?>
                    <span> <?php echo  esc_html($settings['title2productsrandomoffersecondstkaveh']); ?> </span>
                  </<?php echo  esc_attr($settings['tagheading1productsrandomoffersecondstkaveh']); ?>>
                </div>

              </div>
              <div class="swiper swiper-products-fast-sending">
                <div class="swiper-wrapper">


               <?php
                  $args = [
                      'post_type' => 'product',
                      'posts_per_page' => $settings['posts_per_page_productsrandomoffersecondstkaveh'],
                      'orderby' => $settings['psortproductsrandomoffersecondstkaveh'],
                      'order' => $settings['psortiproductsrandomoffersecondstkaveh']
                  ];

                  // Handle WooCommerce specific options
                      // Exclude out of stock products
                      if ($settings['kaveh_exclude_out_of_stock'] === 'yes') {
                          $args['meta_query'][] = [
                              'key' => '_stock_status',
                              'value' => 'outofstock',
                              'compare' => '!='
                          ];
                      }

                      // Show only on-sale products
                      if ($settings['show_onsale_products_productsrandomoffersecondstkaveh'] === 'yes') {
                          $args['meta_query'][] = [
                              'relation' => 'OR',
                              [
                                  'key' => '_sale_price',
                                  'value' => '',
                                  'compare' => '!='
                              ],
                              [
                                  'key' => '_min_variation_sale_price',
                                  'value' => '',
                                  'compare' => '!='
                              ]
                          ];
                      }

                      // Handle product attributes
                      if (!empty($settings['product_attributes_productsrandomoffersecondstkaveh']) && !empty($settings['product_attribute_terms_productsrandomoffersecondstkaveh'])) {
                          $tax_query = [];
                          foreach ($settings['product_attributes_productsrandomoffersecondstkaveh'] as $attribute) {
                              $tax_query[] = [
                                  'taxonomy' => 'pa_' . $attribute,
                                  'field' => 'term_id',
                                  'terms' => $settings['product_attribute_terms_productsrandomoffersecondstkaveh']
                              ];
                          }
                          if (!empty($tax_query)) {
                              $args['tax_query'][] = [
                                  'relation' => 'AND',
                                  $tax_query
                              ];
                          }
                      }
                  

                  // Handle taxonomy filters
                  if (!empty($settings['taxonomy_filter_productsrandomoffersecondstkaveh']) && !empty($settings['taxonomy_terms_productsrandomoffersecondstkaveh'])) {
                      $tax_query = [];
                      foreach ($settings['taxonomy_filter_productsrandomoffersecondstkaveh'] as $taxonomy) {
                          $tax_query[] = [
                              'taxonomy' => $taxonomy,
                              'field' => 'term_id',
                              'terms' => $settings['taxonomy_terms_productsrandomoffersecondstkaveh']
                          ];
                      }
                      if (!empty($tax_query)) {
                          $args['tax_query'][] = [
                              'relation' => 'AND',
                              $tax_query
                          ];
                      }
                  }

                  // Handle meta query
                  if (!empty($settings['meta_key_productsrandomoffersecondstkaveh']) && !empty($settings['meta_value_productsrandomoffersecondstkaveh'])) {
                      $args['meta_query'][] = [
                          'key' => $settings['meta_key_productsrandomoffersecondstkaveh'],
                          'value' => $settings['meta_value_productsrandomoffersecondstkaveh']
                      ];
                  }

                  // Handle date query
                  if ($settings['date_query_productsrandomoffersecondstkaveh'] !== 'none') {
                      $date_query = [];
                      switch ($settings['date_query_productsrandomoffersecondstkaveh']) {
                          case 'today':
                              $date_query = [
                                  'after' => '1 day ago'
                              ];
                              break;
                          case 'last_7_days':
                              $date_query = [
                                  'after' => '1 week ago'
                              ];
                              break;
                          case 'last_30_days':
                              $date_query = [
                                  'after' => '1 month ago'
                              ];
                              break;
                      }
                      if (!empty($date_query)) {
                          $args['date_query'] = $date_query;
                      }
                  }

                  // Handle exclusions
                  if (!empty($settings['exclude_posts_productsrandomoffersecondstkaveh'])) {
                      $excluded_ids = array_map('trim', explode(',', $settings['exclude_posts_productsrandomoffersecondstkaveh']));
                      $args['post__not_in'] = array_map('intval', $excluded_ids);
                  }

                  // Handle custom query parameters
                  if (!empty($settings['custom_query_productsrandomoffersecondstkaveh'])) {
                      $custom_args = json_decode($settings['custom_query_productsrandomoffersecondstkaveh'], true);
                      if (is_array($custom_args)) {
                          $args = array_merge($args, $custom_args);
                      }
                  }

                  // Execute the query
                  $query = KavehCustomQuery::get_cached_query($args);
                  ?>

                    <?php if ($query->have_posts()) : ?>
                    <?php while ($query->have_posts()) : $query->the_post();
                        $product = wc_get_product(get_the_ID());
                        if (!$product) continue;

                        $product_link = get_permalink();
                        $price = $product->get_price();
                        $regular_price = $product->get_regular_price();
                        $sale_price = $product->get_sale_price();
                        $currency = get_woocommerce_currency_symbol();
                        $sale_end = $product->get_date_on_sale_to();
                        $end_time = $sale_end ? $sale_end->date('Y-m-d H:i:s') : '';
                        $pr_id = get_the_ID();

                        $colors = [];

                        if ($product->is_type('variable')) {
                        $variations = $product->get_available_variations();
                        foreach ($variations as $variation) {
                            $color = $variation['attributes']['attribute_pa_color'] ?? '';
                            if ($color && !in_array($color, $colors)) {
                            $term = get_term_by('slug', $color, 'pa_color');
                            if ($term && ($color_code = get_term_meta($term->term_id, 'color', true))) {
                                $colors[] = esc_attr($color_code);
                            }
                            }
                            if (count($colors) >= 4) break;
                        }
                        }
                    ?>
                        <div class="swiper-slide">
                        <?php if ($end_time) : ?>
                            <ul class="timear d-flex align-items-center" data-time="<?= esc_attr($end_time) ?>">
                            <li class="d-flex flex-column align-items-center justify-content-center"><span class="second">00</span>Seconds</li>
<li class="d-flex flex-column align-items-center justify-content-center"><span class="minute">00</span>Minutes</li>
<li class="d-flex flex-column align-items-center justify-content-center"><span class="hour">00</span>Hours</li>
<li class="d-flex flex-column align-items-center justify-content-center"><span class="day">00</span>Days</li>
                            </ul>
                        <?php endif; ?>
                        <div class="product-box-fast-sending d-flex flex-column">
                            <a href="<?= esc_url($product_link) ?>" class="image">
                            <?= $product->get_image('woocommerce_thumbnail', ['class' => 'd-block mx-auto', 'width' => 191, 'height' => 190]) ?>
                            </a>

                            <?php if (!empty($colors)) : ?>
                            <ul class="colors d-flex align-items-center justify-content-center">
                                <?php foreach ($colors as $color_code) : ?>
                                <li class="rounded-circle" style="background-color: <?= esc_attr($color_code) ?>;"></li>
                                <?php endforeach; ?>
                            </ul>
                            <?php endif; ?>

                            <div class="title-product text-center overflow-hidden"><?= esc_html(get_the_title()) ?></div>

                            <div class="d-flex align-items-center justify-content-between gap-2">



                         <?php if ( $product && $product->is_type('variable') ) { ?>
                          <a href="<?php echo  esc_url($product_link) ?>">
                            <button type="button" class="btn-add-to-cart d-flex align-items-center justify-content-center text-white position-relative overflow-hidden">
                                  <i class="icon-box-alt lh-1"></i>
                              </button>
                            </a>
                        <?php }else{ ?>

                          <a type="submit" name="add-to-cart" class="single_add_to_cart_button" value="<?php echo $pr_id ?>">
                          <button type="button" class="btn-add-to-cart d-flex align-items-center justify-content-center text-white position-relative overflow-hidden">
                                <i class="<?php echo  esc_attr($settings['iconiconboxkavehproductsrandomoffersecondstkaveh']['value']); ?> lh-1"></i>
                            </button>
                          </a>

                        <?php } ?>



                            <div>
                            <?php
                            $currency_symbol = get_woocommerce_currency_symbol();
                            ?>
                            <span class="price d-block"><?= wc_format_localized_price($price) . ' ' . $currency_symbol ?></span>
                            <?php if ($regular_price && $sale_price && $regular_price > $sale_price) : ?>
                              <del class="off d-block"><?= wc_format_localized_price($regular_price) . ' ' . $currency_symbol ?></del>
                            <?php endif; ?>


                            </div>
                            </div>
                        </div>
                        </div>
                    <?php endwhile; ?>
                    <?php wp_reset_postdata(); ?>
                    <?php endif; ?>

                </div>
                <div class="swiper-pagination d-flex align-items-center justify-content-center bottom-0 end-50"></div>
              </div>
            </div>

    <?php }elseif('two' === $settings['stylegeneralproductsrandomoffersecondstkaveh']) { ?>
      <div class="discounted-products-book position-relative bg-white overflow-hidden d-flex flex-column align-items-center justify-content-center h-100">
    <!-- Start Carousel -->
    <div class="swiper swiper-discounted-products-book w-100">
      <div class="swiper-wrapper">

      <?php
                  $args = [
                      'post_type' => 'product',
                      'posts_per_page' => $settings['posts_per_page_productsrandomoffersecondstkaveh'],
                      'orderby' => $settings['psortproductsrandomoffersecondstkaveh'],
                      'order' => $settings['psortiproductsrandomoffersecondstkaveh']
                  ];

                  // Handle WooCommerce specific options
                      // Exclude out of stock products
                      if ($settings['kaveh_exclude_out_of_stock'] === 'yes') {
                          $args['meta_query'][] = [
                              'key' => '_stock_status',
                              'value' => 'outofstock',
                              'compare' => '!='
                          ];
                      }

                      // Show only on-sale products
                      if ($settings['show_onsale_products_productsrandomoffersecondstkaveh'] === 'yes') {
                          $args['meta_query'][] = [
                              'relation' => 'OR',
                              [
                                  'key' => '_sale_price',
                                  'value' => '',
                                  'compare' => '!='
                              ],
                              [
                                  'key' => '_min_variation_sale_price',
                                  'value' => '',
                                  'compare' => '!='
                              ]
                          ];
                      }

                      // Handle product attributes
                      if (!empty($settings['product_attributes_productsrandomoffersecondstkaveh']) && !empty($settings['product_attribute_terms_productsrandomoffersecondstkaveh'])) {
                          $tax_query = [];
                          foreach ($settings['product_attributes_productsrandomoffersecondstkaveh'] as $attribute) {
                              $tax_query[] = [
                                  'taxonomy' => 'pa_' . $attribute,
                                  'field' => 'term_id',
                                  'terms' => $settings['product_attribute_terms_productsrandomoffersecondstkaveh']
                              ];
                          }
                          if (!empty($tax_query)) {
                              $args['tax_query'][] = [
                                  'relation' => 'AND',
                                  $tax_query
                              ];
                          }
                      }
                  

                  // Handle taxonomy filters
                  if (!empty($settings['taxonomy_filter_productsrandomoffersecondstkaveh']) && !empty($settings['taxonomy_terms_productsrandomoffersecondstkaveh'])) {
                      $tax_query = [];
                      foreach ($settings['taxonomy_filter_productsrandomoffersecondstkaveh'] as $taxonomy) {
                          $tax_query[] = [
                              'taxonomy' => $taxonomy,
                              'field' => 'term_id',
                              'terms' => $settings['taxonomy_terms_productsrandomoffersecondstkaveh']
                          ];
                      }
                      if (!empty($tax_query)) {
                          $args['tax_query'][] = [
                              'relation' => 'AND',
                              $tax_query
                          ];
                      }
                  }

                  // Handle meta query
                  if (!empty($settings['meta_key_productsrandomoffersecondstkaveh']) && !empty($settings['meta_value_productsrandomoffersecondstkaveh'])) {
                      $args['meta_query'][] = [
                          'key' => $settings['meta_key_productsrandomoffersecondstkaveh'],
                          'value' => $settings['meta_value_productsrandomoffersecondstkaveh']
                      ];
                  }

                  // Handle date query
                  if ($settings['date_query_productsrandomoffersecondstkaveh'] !== 'none') {
                      $date_query = [];
                      switch ($settings['date_query_productsrandomoffersecondstkaveh']) {
                          case 'today':
                              $date_query = [
                                  'after' => '1 day ago'
                              ];
                              break;
                          case 'last_7_days':
                              $date_query = [
                                  'after' => '1 week ago'
                              ];
                              break;
                          case 'last_30_days':
                              $date_query = [
                                  'after' => '1 month ago'
                              ];
                              break;
                      }
                      if (!empty($date_query)) {
                          $args['date_query'] = $date_query;
                      }
                  }

                  // Handle exclusions
                  if (!empty($settings['exclude_posts_productsrandomoffersecondstkaveh'])) {
                      $excluded_ids = array_map('trim', explode(',', $settings['exclude_posts_productsrandomoffersecondstkaveh']));
                      $args['post__not_in'] = array_map('intval', $excluded_ids);
                  }

                  // Handle custom query parameters
                  if (!empty($settings['custom_query_productsrandomoffersecondstkaveh'])) {
                      $custom_args = json_decode($settings['custom_query_productsrandomoffersecondstkaveh'], true);
                      if (is_array($custom_args)) {
                          $args = array_merge($args, $custom_args);
                      }
                  }

                  // Execute the query
                  $query = KavehCustomQuery::get_cached_query($args);
                  ?>

                    <?php if ($query->have_posts()) : ?>
                    <?php while ($query->have_posts()) : $query->the_post();

                    $product_id     = get_the_ID();
                    $product        = wc_get_product($product_id);
                    $product_link   = get_permalink($product_id);
                    $image_url      = get_the_post_thumbnail_url($product_id, 'woocommerce_thumbnail');
                    $title          = get_the_title($product_id);
                    $categories     = wc_get_product_category_list($product_id, ', ');
                    $price          = $product->get_price();
                    $regular_price  = $product->get_regular_price();
                    $sale_price     = $product->get_sale_price();
                    $currency       = get_woocommerce_currency_symbol();

                    // Discount end time (for timer)
                    $sale_end       = get_post_meta($product_id, '_sale_price_dates_to', true);
                    $sale_end_date  = $sale_end ? date('Y-m-d H:i:s', $sale_end) : '';
                    ?>
                    <div class="swiper-slide">
                    <div class="discounted-products-book-item d-flex flex-column position-relative h-100">
                        <?php if ($regular_price && $sale_price && $regular_price > $sale_price): ?>
                        <div class="discount d-flex align-items-center position-absolute start-0 text-white gap-2 px-2">
                            <i class="icon-discount-3 lh-1"></i>
                            <div class="d-flex align-items-center justify-content-center flex-column">
                            <span class="text-white"><?= round((($regular_price - $sale_price) / $regular_price) * 100) ?>%</span>
                            <?php esc_html_e('Discount', 'kavehTheme'); ?>
                            </div>
                        </div>
                        <?php endif; ?>

                        <?php if ($sale_end_date): ?>
                        <div class="timear d-flex align-items-center position-absolute" data-time="<?= esc_attr($sale_end_date) ?>">
                            <div class="d-flex align-items-center justify-content-center flex-column">
                            <span class="second">00</span> Seconds
                            </div>
                            <div class="d-flex align-items-center justify-content-center flex-column">
                            <span class="minute">00</span> Minutes
                            </div>
                            <div class="d-flex align-items-center justify-content-center flex-column">
                            <span class="hour">00</span> Hours
                            </div>
                            <div class="d-flex align-items-center justify-content-center flex-column">
                            <span class="day">00</span> Days
                            </div>
                        </div>
                        <?php endif; ?>

                        <a href="<?= esc_url($product_link) ?>" class="image d-block">
                        <img src="<?= esc_url($image_url) ?>" alt="<?= esc_attr($title) ?>" width="252" height="252" class="d-block mx-auto">
                        </a>

                        <div class="d-flex align-items-center justify-content-between gap-2">
                        <div class="text-truncate">
                            <h2 class="title-product text-truncate">
                            <a href="<?= esc_url($product_link) ?>"><?= esc_html($title) ?></a>
                            </h2>
                            <?php
                            $terms = get_the_terms($product_id, 'product_cat');
                            if (!empty($terms) && !is_wp_error($terms)) :
                                $category_links = [];
                                foreach ($terms as $term) {
                                    $term_link = get_term_link($term);
                                    if (!is_wp_error($term_link)) {
                                        $category_links[] = '<a href="' . esc_url($term_link) . '" class="category text-truncate">' . esc_html($term->name) . '</a>';
                                    }
                                }
                                if (!empty($category_links)) {
                                    echo implode(' , ', $category_links);
                                }
                            endif;
                            ?>


                        </div>

                        <div class="price position-relative d-flex align-items-end flex-column">
                            <span class="toman position-absolute top-0 start-0"><?= $currency ?></span>
                            <span class="price"><?= wc_format_localized_price($price) ?></span>
                            <?php if ($regular_price && $sale_price && $regular_price > $sale_price): ?>
                            <del><?= wc_format_localized_price($regular_price) ?></del>
                            <?php endif; ?>
                        </div>
                        </div>
                    </div>
                    </div>

                    <?php endwhile; ?>
                    <?php wp_reset_postdata(); ?>
                    <?php endif; ?>

      </div>
      <div class="swiper-pagination d-flex flex-column m-0 top-50 translate-middle-y"></div>
    </div>
    <!-- End Carousel -->
  </div>
    <?php } ?>
   
    <style>
              .box-products-fast-sending .timear li {
              width: 32px;
              height: 44px;
              background-color: rgba(0, 87, 255, 0.06);
              border-radius: 7px;
              font-size: 9px;
              line-height: 12px;
              font-weight: 700;
              color: rgba(0, 87, 255, 0.6);
          }
          .box-products-fast-sending .timear li {
              width: 32px;
              height: 44px;
              background-color: rgba(0, 87, 255, 0.06);
              border-radius: 7px;
              font-size: 9px;
              line-height: 12px;
              font-weight: 700;
              color: rgba(0, 87, 255, 0.6);
          }
          .box-products-fast-sending .timear li span {
              color: #0057ff;
              font-size: 15px;
              line-height: 19px;
          }
          .box-products-fast-sending .timear {
              gap: 6px;
          }
        .discounted-products-book::before {
        background-image: radial-gradient(18.37% 18.37% at 97.67% 9.65%, <?php echo  esc_html($settings['box_bg_border1_productsrandomoffersecondstkaveh']); ?> 0%, rgba(249, 179, 0, 0) 100%);
        }
        .discounted-products-book::after {
        background-image: radial-gradient(31.63% 31.63% at 106.28% 107.79%, <?php echo  esc_html($settings['box_bg_border2_productsrandomoffersecondstkaveh']); ?> 0%, rgba(48, 187, 137, 0) 100%);
        }
            </style>

      <?php
  }


}
