<?php

use Elementor\Widget_Base;
use Elementor\Controls_Manager;

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

class Productscarouselkaveh extends Widget_Base
{

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

  public function get_title()
  {
    return esc_html__('Products Carousel', 'kavehTheme');
  }

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

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

  protected function register_controls()
  {

    $this->start_controls_section(
      'contentproductscarouselkaveh',
      [
        'label' => esc_html__('Title Settings', 'kavehTheme'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
      ]
    );
    $this->add_control(
      'styleheadingproductscarouselkaveh',
      [
        'label' => esc_html__('Title Layout', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SELECT,
        'default' => 'one',
        'options' => [
          'one' => esc_html__('Layout One', 'kavehTheme'),
          'two' => esc_html__('Layout Two', 'kavehTheme'),
          'three' => esc_html__('Layout Three', 'kavehTheme'),
          'four' => esc_html__('Layout Four', 'kavehTheme'),
          'five' => esc_html__('Layout Five', 'kavehTheme'),
          'six' => esc_html__('Layout Six', 'kavehTheme'),
          'seven' => esc_html__('Layout Seven', 'kavehTheme'),
          'eight' => esc_html__('Layout Eight', 'kavehTheme'),
          'nine' => esc_html__('Layout Nine', 'kavehTheme'),
        ],
      ]
    );

    $this->add_control(
      'show_heading_productscarouselkaveh',
      [
        'label' => __('Show Section Title', 'plugin-name'),
				'type' => \Elementor\Controls_Manager::SWITCHER,
				'label_on' => __('Show', 'plugin-name'),
				'label_off' => __('Hide', 'plugin-name'),
        'return_value' => 'yes',
        'default' => 'yes',
      ]
    );

    
    $this->add_control(
      'iconproductscarouselkaveh',
      [
        'label' => esc_html__('Icon', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'skin' => 'inline',
        'exclude_inline_options' => ['svg'],
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'two',
        ],
        'default' => [
          'value' => 'icon icon-footbal',
        ],
      ]
    );
    $this->add_control(
      'imgtitleproductscarouselkaveh',
      [
        'label' => esc_html__('Image Next to Title', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'selectors' => [
          '{{WRAPPER}} .best-selling-fiveteen .section-heading .detail::before' => 'background: url({{URL}})',
          '{{WRAPPER}} .new-products-fourteen .section-heading .detail::after' => 'background: url({{URL}})',

        ],
        'condition' => [
          'styleheadingproductscarouselkaveh' => ['eight', 'seven'],
        ],
      ]
    );

    $this->add_control(
      'titleproductscarouselkaveh',
      [
        'label' => esc_html__('Title', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => esc_html__('Best Sellers', 'kavehTheme'),

      ]
    );
    $this->add_control(
      'tagheading1productscarouselkaveh',
      [
        '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(
      'title2productscarouselkaveh',
      [
        'label' => esc_html__('Subtitle', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => esc_html__('Mobile Phones', 'kavehTheme'),

      ]
    );
    $this->add_control(
      'tagheading2productscarouselkaveh',
      [
        '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(
      'moreproductscarouselkaveh',
      [
        'label' => esc_html__('Show More Button?', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
        'condition' => [
          'styleheadingproductscarouselkaveh!' => 'seven',
        ],
      ]
    );
    $this->add_control(
      'buttonproductscarouselkaveh',
      [
        'label' => esc_html__('Button', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => esc_html__('View All', 'kavehTheme'),
        'condition' => [
          'moreproductscarouselkaveh' => 'yes',
        ],
        'condition' => [
          'styleheadingproductscarouselkaveh!' => 'seven',
        ],

      ]
    );
    $this->add_control(
      'buttonlinkproductscarouselkaveh',
      [
        'label' => esc_html__('Button Link', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => esc_html__('#', 'kavehTheme'),
        'condition' => [
          'moreproductscarouselkaveh' => 'yes',
        ],
        'condition' => [
          'styleheadingproductscarouselkaveh!' => 'seven',
        ],
      ]
    );
    $this->end_controls_section();

    $this->start_controls_section(
      'content2productscarouselkaveh',
      [
          'label' => esc_html__('Product Settings', 'kavehTheme'),
          'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
      ]
  );
  
  // 1. Post Type Selection
  $post_types = get_post_types(['public' => true], 'objects');
  $post_type_options = [];
  foreach ($post_types as $post_type) {
      $post_type_options[$post_type->name] = $post_type->label;
  }
  $this->add_control(
      'post_type_productscarouselkaveh',
      [
          'label' => esc_html__('Content Type', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::SELECT,
          'default' => 'product',
          'options' => $post_type_options,
      ]
  );
  
  // 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',
          'condition' => [
              'post_type_productscarouselkaveh' => 'product',
          ],
      ]
  );
  
  // 3. Show Only Onsale Products
  $this->add_control(
      'show_onsale_products_productscarouselkaveh',
      [
          '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',
          'condition' => [
              'post_type_productscarouselkaveh' => 'product', // Only show for products
          ],
      ]
  );
  
  // 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_productscarouselkaveh',
      [
          '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_productscarouselkaveh',
  [
      'label' => esc_html__('Select Taxonomy Terms', 'kavehTheme'),
      'type' => \Elementor\Controls_Manager::SELECT2,
      'multiple' => true,
      'options' => [], // Initially empty, populated dynamically
      'condition' => [
          'taxonomy_filter_productscarouselkaveh!' => '', // Show only if a taxonomy is selected
      ],
  ]
);
  
  // 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_productscarouselkaveh',
      [
          'label' => esc_html__('Filter by Product Attribute', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::SELECT2,
          'multiple' => true,
          'options' => $attribute_options,
          'condition' => [
              'post_type_productscarouselkaveh' => 'product', // Only show for products
          ],
      ]
  );
  // Add a control for selecting product attribute terms
$this->add_control(
  'product_attribute_terms_productscarouselkaveh',
  [
      'label' => esc_html__('Select Attribute Values', 'kavehTheme'),
      'type' => \Elementor\Controls_Manager::SELECT2,
      'multiple' => true,
      'options' => [], // Initially empty, populated dynamically
      'condition' => [
          'product_attributes_productscarouselkaveh!' => '', // Show only if an attribute is selected
      ],
  ]
);
  
  // 6. Advanced Sorting
  $this->add_control(
      'psortproductscarouselkaveh',
      [
          '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 Amount', 'kavehTheme'),
          ],
      ]
  );
  
  // 7. Sort Order
  $this->add_control(
      'psortiproductscarouselkaveh',
      [
          '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_productscarouselkaveh',
      [
          'label' => esc_html__('Number of Products', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::NUMBER,
          'default' => 10,
          'min' => 1,
          'max' => 100,
      ]
  );
  
  $this->add_control(
      'pagination_productscarouselkaveh',
      [
          'label' => esc_html__('Enable Pagination', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
          'return_value' => 'yes',
          'default' => 'no',
      ]
  );
  
  // 9. Meta Query (Custom Fields)
  $this->add_control(
      'meta_key_productscarouselkaveh',
      [
          '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_productscarouselkaveh',
      [
          '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_productscarouselkaveh',
      [
          '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_productscarouselkaveh',
      [
          '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_productscarouselkaveh',
      [
          '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(
      'content3productscarouselkaveh',
      [
        'label' => esc_html__('Carousel Settings', 'kavehTheme'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
      ]
    );
    $this->add_control(
      'stylecartproductscarouselkaveh',
      [
        'label' => esc_html__( 'Product Box Layout', 'kavehTheme' ),
        'type' => \Elementor\Controls_Manager::SELECT,
        'default' => 'one',
        'options' => [
          'one'  => esc_html__( 'First Layout', 'kavehTheme' ),
          'two'  => esc_html__( 'Second Layout', 'kavehTheme' ),
          'three'  => esc_html__( 'Third Layout', 'kavehTheme' ),
          'four'  => esc_html__( 'Fourth Layout', 'kavehTheme' ),
          'five'  => esc_html__( 'Fifth Layout', 'kavehTheme' ),
          'six'  => esc_html__( 'Sixth Layout', 'kavehTheme' ),
          'seven'  => esc_html__( 'Seventh Layout', 'kavehTheme' ),
          'eight'  => esc_html__( 'Eighth Layout', 'kavehTheme' ),
          'nine'  => esc_html__( 'Ninth Layout', 'kavehTheme' ),
          'ten'  => esc_html__( 'Tenth Layout', 'kavehTheme' ),
          'eleven'  => esc_html__( 'Eleventh Layout', 'kavehTheme' ),
          'twelve'  => esc_html__( 'Twelfth Layout', 'kavehTheme' ),
          'thirteen'  => esc_html__( 'Thirteenth Layout', 'kavehTheme' ),
          'fourteen'  => esc_html__( 'Fourteenth Layout', 'kavehTheme' ),
          'fifteen'  => esc_html__( 'Fifteenth Layout', 'kavehTheme' ),
          'sixteen'  => esc_html__( 'Sixteenth Layout', 'kavehTheme' ),
          'seventeen'  => esc_html__( 'Seventeenth Layout', 'kavehTheme' ),
          'eighteen'  => esc_html__( 'Eighteenth Layout', 'kavehTheme' ),
          'nineteen'  => esc_html__( 'Nineteenth Layout', 'kavehTheme' ),
          'twenty'  => esc_html__( 'Twentieth Layout', 'kavehTheme' ),
          'twenty-one'  => esc_html__( 'Twenty-First Layout', 'kavehTheme' ),
          'twenty-two'  => esc_html__( 'Twenty-Second Layout', 'kavehTheme' ),
          'twenty-three'  => esc_html__( 'Twenty-Third Layout', 'kavehTheme' ),
          'twenty-four'  => esc_html__( 'Twenty-Fourth Layout', 'kavehTheme' ),
          'twenty-five'  => esc_html__( 'Twenty-Fifth Layout', 'kavehTheme' ),
          'twenty-six'  => esc_html__( 'Twenty-Sixth Layout', 'kavehTheme' ),
          'twenty-seven'  => esc_html__( 'Twenty-Seventh Layout', 'kavehTheme' ),
          'twenty-eight'  => esc_html__( 'Twenty-Eighth Layout', 'kavehTheme' ),
        ],
      ]
      );
      $this->add_control(
        'barproductscarouselkaveh',
        [
          'label' => esc_html__( 'Show Colored Background Bar', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SWITCHER,
          'yes' => esc_html__( 'Yes', 'kavehTheme' ),
          'no' => esc_html__( 'No', 'kavehTheme' ),
          'return_value' => 'yes',
          'default' => 'no',
          'condition' => [
            'styleheadingproductscarouselkaveh' => 'one',
          ],
        ]
      );
    $this->add_control(
      'overflow2productscarouselkaveh',
      [
        'label' => esc_html__('Show Full Width Carousel', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
      ]
    );
    $this->add_control(
      'productnumberproductscarouselkaveh',
      [
        'label' => esc_html__('Number of Products Displayed', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::NUMBER,
        'min' => 0,
        'max' => 50,
        'step' => 1,
        'default' => 5,
      ]
    );
    $this->add_control(
      'productcolumnproductscarouselkaveh',
      [
        'label' => esc_html__('Number of Product Columns on Desktop', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::NUMBER,
        'min' => 0,
        'max' => 8,
        'step' => 1,
        'default' => 4,

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

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

      ]
    );

    // Advanced Swiper Controls
    $this->add_control(
      'autoplayproductscarouselkaveh',
      [
        'label' => esc_html__('Autoplay', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'no',
      ]
    );

    $this->add_control(
      'autoplaydelayproductscarouselkaveh',
      [
        'label' => esc_html__('Autoplay Delay (milliseconds)', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::NUMBER,
        'min' => 1000,
        'max' => 10000,
        'step' => 100,
        'default' => 3000,
        'condition' => [
          'autoplayproductscarouselkaveh' => 'yes',
        ],
      ]
    );

    $this->add_control(
      'loopproductscarouselkaveh',
      [
        'label' => esc_html__('Infinite Loop', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
      ]
    );

    $this->add_control(
      'speedproductscarouselkaveh',
      [
        'label' => esc_html__('Transition Speed (milliseconds)', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::NUMBER,
        'min' => 100,
        'max' => 2000,
        'step' => 50,
        'default' => 300,
      ]
    );

    $this->add_control(
      'effectproductscarouselkaveh',
      [
        'label' => esc_html__('Transition Effect', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SELECT,
        'default' => 'slide',
        'options' => [
          'slide' => esc_html__('Slide', 'kavehTheme'),
          'fade' => esc_html__('Fade', 'kavehTheme'),
          'cube' => esc_html__('Cube', 'kavehTheme'),
          'coverflow' => esc_html__('Coverflow', 'kavehTheme'),
          'flip' => esc_html__('Flip', 'kavehTheme'),
          'cards' => esc_html__('Cards', 'kavehTheme'),
          'creative' => esc_html__('Creative', 'kavehTheme'),
        ],
      ]
    );

    $this->add_control(
      'centeredSlidesproductscarouselkaveh',
      [
        'label' => esc_html__('Centered Slides', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'no',
      ]
    );

    $this->add_control(
      'freeMode_productscarouselkaveh',
      [
        'label' => esc_html__('Free Mode', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'no',
      ]
    );

    $this->add_control(
      'grabCursorproductscarouselkaveh',
      [
        'label' => esc_html__('Hand Cursor', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
      ]
    );

    $this->add_control(
      'mousewheel_productscarouselkaveh',
      [
        'label' => esc_html__('Mouse Wheel Control', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'no',
      ]
    );

    $this->add_control(
      'keyboard_productscarouselkaveh',
      [
        'label' => esc_html__('Keyboard Control', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'no',
      ]
    );

    $this->add_control(
      'simulateTouch_productscarouselkaveh',
      [
        'label' => esc_html__('Touch Simulation', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
      ]
    );

    $this->add_control(
      'allowTouchMove_productscarouselkaveh',
      [
        'label' => esc_html__('Allow Touch Movement', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
      ]
    );

    $this->add_control(
      'resistanceRatio_productscarouselkaveh',
      [
        'label' => esc_html__('Resistance Ratio', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
          'px' => [
            'min' => 0,
            'max' => 1,
            'step' => 0.1,
          ],
        ],
        'default' => [
          'unit' => 'px',
          'size' => 0.85,
        ],
      ]
    );

    $this->add_control(
      'threshold_productscarouselkaveh',
      [
        'label' => esc_html__('Movement Threshold', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::NUMBER,
        'min' => 0,
        'max' => 50,
        'step' => 1,
        'default' => 5,
      ]
    );

    $this->add_control(
      'followFinger_productscarouselkaveh',
      [
        'label' => esc_html__('Follow Finger', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
      ]
    );

    $this->add_control(
      'shortSwipes_productscarouselkaveh',
      [
        'label' => esc_html__('Short Swipes', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
      ]
    );

    $this->add_control(
      'longSwipes_productscarouselkaveh',
      [
        'label' => esc_html__('Long Swipes', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
      ]
    );

    $this->add_control(
      'longSwipesRatio_productscarouselkaveh',
      [
        'label' => esc_html__('Long Swipes Ratio', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
          'px' => [
            'min' => 0,
            'max' => 1,
            'step' => 0.1,
          ],
        ],
        'default' => [
          'unit' => 'px',
          'size' => 0.5,
        ],
        'condition' => [
          'longSwipes_productscarouselkaveh' => 'yes',
        ],
      ]
    );

    $this->add_control(
      'longSwipesMs_productscarouselkaveh',
      [
        'label' => esc_html__('Long Swipes Time (milliseconds)', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::NUMBER,
        'min' => 100,
        'max' => 1000,
        'step' => 50,
        'default' => 300,
        'condition' => [
          'longSwipes_productscarouselkaveh' => 'yes',
        ],
      ]
    );

    $this->add_control(
      'watchSlidesProgress_productscarouselkaveh',
      [
        'label' => esc_html__('Watch Slides Progress', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'no',
      ]
    );

    $this->add_control(
      'watchSlidesVisibility_productscarouselkaveh',
      [
        'label' => esc_html__('Watch Slides Visibility', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'no',
      ]
    );

    $this->add_control(
      'preloadImages_productscarouselkaveh',
      [
        'label' => esc_html__('Preload Images', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
      ]
    );

    $this->add_control(
      'updateOnImagesReady_productscarouselkaveh',
      [
        'label' => esc_html__('Update On Images Ready', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
        'condition' => [
          'preloadImages_productscarouselkaveh' => 'yes',
        ],
      ]
    );

    $this->add_control(
      'lazy_productscarouselkaveh',
      [
        'label' => esc_html__('Lazy Loading', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'no',
      ]
    );

    $this->add_control(
      'lazyPreloaderClass_productscarouselkaveh',
      [
        'label' => esc_html__('Lazy Preloader Class', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => 'swiper-lazy-preloader',
        'condition' => [
          'lazy_productscarouselkaveh' => 'yes',
        ],
      ]
    );

    $this->add_control(
      'lazyLoadingInPrevNext_productscarouselkaveh',
      [
        'label' => esc_html__('Lazy Loading in Prev/Next', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'no',
        'condition' => [
          'lazy_productscarouselkaveh' => 'yes',
        ],
      ]
    );

    $this->add_control(
      'lazyLoadingInPrevNextAmount_productscarouselkaveh',
      [
        'label' => esc_html__('Lazy Loading Amount in Prev/Next', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::NUMBER,
        'min' => 1,
        'max' => 10,
        'step' => 1,
        'default' => 1,
        'condition' => [
          'lazy_productscarouselkaveh' => 'yes',
          'lazyLoadingInPrevNext_productscarouselkaveh' => 'yes',
        ],
      ]
    );

    $this->end_controls_section();

    // Pagination Controls Section
    $this->start_controls_section(
      'pagination_productscarouselkaveh',
      [
        'label' => esc_html__('Pagination Settings', 'kavehTheme'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
      ]
    );

    $this->add_control(
      'pagination_productscarouselkaveh',
      [
        'label' => esc_html__('Show Pagination', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'no',
      ]
    );

    $this->add_control(
      'paginationType_productscarouselkaveh',
      [
        'label' => esc_html__('Pagination Type', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SELECT,
        'default' => 'bullets',
        'options' => [
          'bullets' => esc_html__('Bullets', 'kavehTheme'),
          'fraction' => esc_html__('Fraction', 'kavehTheme'),
          'progressbar' => esc_html__('Progress Bar', 'kavehTheme'),
          'custom' => esc_html__('Custom', 'kavehTheme'),
        ],
        'condition' => [
          'pagination_productscarouselkaveh' => 'yes',
        ],
      ]
    );

    $this->add_control(
      'paginationClickable_productscarouselkaveh',
      [
        'label' => esc_html__('Clickable Pagination', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
        'condition' => [
          'pagination_productscarouselkaveh' => 'yes',
          'paginationType_productscarouselkaveh' => 'bullets',
        ],
      ]
    );

    $this->add_control(
      'paginationDynamicBullets_productscarouselkaveh',
      [
        'label' => esc_html__('Dynamic Bullets', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'no',
        'condition' => [
          'pagination_productscarouselkaveh' => 'yes',
          'paginationType_productscarouselkaveh' => 'bullets',
        ],
      ]
    );

    $this->add_control(
      'paginationDynamicMainBullets_productscarouselkaveh',
      [
        'label' => esc_html__('Number of Dynamic Main Bullets', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::NUMBER,
        'min' => 1,
        'max' => 10,
        'step' => 1,
        'default' => 1,
        'condition' => [
          'pagination_productscarouselkaveh' => 'yes',
          'paginationType_productscarouselkaveh' => 'bullets',
          'paginationDynamicBullets_productscarouselkaveh' => 'yes',
        ],
      ]
    );

    $this->add_control(
      'paginationHideOnClick_productscarouselkaveh',
      [
        'label' => esc_html__('Hide On Click', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'no',
        'condition' => [
          'pagination_productscarouselkaveh' => 'yes',
        ],
      ]
    );

    $this->end_controls_section();

    // Scrollbar Controls Section
    $this->start_controls_section(
      'scrollbar_productscarouselkaveh',
      [
        'label' => esc_html__('Scrollbar Settings', 'kavehTheme'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
      ]
    );

    $this->add_control(
      'scrollbar_productscarouselkaveh',
      [
        'label' => esc_html__('Show Scrollbar', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'no',
      ]
    );

    $this->add_control(
      'scrollbarHide_productscarouselkaveh',
      [
        'label' => esc_html__('Hide Scrollbar', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
        'condition' => [
          'scrollbar_productscarouselkaveh' => 'yes',
        ],
      ]
    );

    $this->add_control(
      'scrollbarDraggable_productscarouselkaveh',
      [
        'label' => esc_html__('Draggable Scrollbar', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
        'condition' => [
          'scrollbar_productscarouselkaveh' => 'yes',
        ],
      ]
    );

    $this->add_control(
      'scrollbarSnapOnRelease_productscarouselkaveh',
      [
        'label' => esc_html__('Snap After Release', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'yes' => esc_html__('Yes', 'kavehTheme'),
        'no' => esc_html__('No', 'kavehTheme'),
        'return_value' => 'yes',
        'default' => 'yes',
        'condition' => [
          'scrollbar_productscarouselkaveh' => 'yes',
          'scrollbarDraggable_productscarouselkaveh' => 'yes',
        ],
      ]
    );

    $this->end_controls_section();
    $this->start_controls_section(
      'style_productscarouselkaveh',
      [
        'label' => esc_html__('Title Styles', 'kavehTheme'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
      ]
    );
    $this->add_control(
      'textcolor2productscarouselkaveh',
      [
        'label' => esc_html__('Title Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
          '{{WRAPPER}} .section-heading-title' => 'color: {{VALUE}}',
        ],
      ]
    );
    $this->add_group_control(
      \Elementor\Group_Control_Typography::get_type(),
      [
        'name' => 'title_productscarouselkaveh',
        'label' => esc_html__('Title Typography', 'kavehTheme'),
        'selector' => '{{WRAPPER}} .section-heading-title',
      ]
    );
    $this->add_control(
      'textcolor3productscarouselkaveh',
      [
        'label' => esc_html__('Subtitle Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
          '{{WRAPPER}} .section-heading-sub-title' => 'color: {{VALUE}}',
        ],
      ]
    );
    $this->add_group_control(
      \Elementor\Group_Control_Typography::get_type(),
      [
        'name' => 'title2_productscarouselkaveh',
        'label' => esc_html__('Subtitle Typography', 'kavehTheme'),
        'selector' => '{{WRAPPER}} .section-heading-sub-title',
      ]
    );
    $this->add_control(
      'prtitleproductscarouselkave',
      [
        'label' => esc_html__('Distance from Right', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px', '%'],
        'range' => [
          'px' => [
            'min' => 0,
            'max' => 1000,
            'step' => 5,
          ],
          '%' => [
            'min' => 0,
            'max' => 100,
          ],
        ],
        'default' => [
          'unit' => 'px',
          'size' => 0,
        ],
        'selectors' => [
          '{{WRAPPER}} .section-heading .detail' => 'padding-right: {{SIZE}}{{UNIT}};',
        ],
      ]
    );
    $this->add_control(
      'hr1productscarouselkaveh',
      [
        'type' => \Elementor\Controls_Manager::DIVIDER,
        'condition' => [
          'styleheadingproductscarouselkaveh!' => 'nine',
        ],
      ]
    );
    $this->add_control(
      'iconcolorproductscarouselkaveh',
      [
        'label' => esc_html__('Icon Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'two',
        ],
        'selectors' => [
          '{{WRAPPER}} .section-heading-two .detail i' => 'color: {{VALUE}}',
        ],
      ]
    );
    $this->add_control(
      'iconsizeproductscarouselkaveh',
      [
        'label' => esc_html__('Icon Size', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'two',
        ],
        'size_units' => ['px'],
        'range' => [
          'px' => [
            'min' => 0,
            'max' => 1000,
            'step' => 1,
          ],
        ],
        'default' => [
          'unit' => 'px',
          'size' => 31,
        ],
        'selectors' => [
          '{{WRAPPER}} .section-heading-two .detail i' => 'font-size: {{SIZE}}{{UNIT}};',
        ],
      ]
    );
    $this->add_control(
      'shapecolorproductscarouselkaveh',
      [
        'label' => esc_html__('Shape Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'four',
        ],
        'selectors' => [
          '{{WRAPPER}} .consol-game .section-heading .detail::before' => 'background-color: {{VALUE}}',
        ],
      ]
    );
    $this->add_control(
      'shapest51colorproductscarouselkaveh',
      [
        'label' => esc_html__('First Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'default' => esc_html__('#b3bbc7', 'kavehTheme'),
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'five',
        ],
      ]
    );
    $this->add_control(
      'shapest52colorproductscarouselkaveh',
      [
        'label' => esc_html__('Second Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'default' => esc_html__('#FFFFFF00', 'kavehTheme'),
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'five',
        ],
      ]
    );
    $this->add_control(
      'shapest61colorproductscarouselkaveh',
      [
        'label' => esc_html__('First Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'default' => esc_html__('#00ff93', 'kavehTheme'),
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'six',
        ],
      ]
    );
    $this->add_control(
      'shapest62colorproductscarouselkaveh',
      [
        'label' => esc_html__('Second Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'default' => esc_html__('#FFFFFF00', 'kavehTheme'),
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'six',
        ],
      ]
    );
    $this->add_control(
      'shapest71colorproductscarouselkaveh',
      [
        'label' => esc_html__('First Background Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'default' => esc_html__('#fff3f0', 'kavehTheme'),
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'seven',
        ],
      ]
    );
    $this->add_control(
      'shapest72colorproductscarouselkaveh',
      [
        'label' => esc_html__('Second Background Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'default' => esc_html__('#ecfcfc', 'kavehTheme'),
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'seven',
        ],
      ]
    );
    $this->add_control(
      'width7productscarouselkaveh',
      [
        'label' => esc_html__('Image Width', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'condition' => [
          'styleheadingproductscarouselkaveh' => ['eight', 'seven'],
        ],
        'size_units' => ['px', '%'],
        'range' => [
          'px' => [
            'min' => 0,
            'max' => 1000,
            'step' => 5,
          ],
          '%' => [
            'min' => 0,
            'max' => 100,
          ],
        ],
        'default' => [
          'unit' => 'px',
          'size' => 20,
        ],
      ]
    );
    $this->add_control(
      'widthbg7productscarouselkaveh',
      [
        'label' => esc_html__('Background Image Width', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'seven',
        ],
        'size_units' => ['px', '%'],
        'range' => [
          'px' => [
            'min' => 0,
            'max' => 2000,
            'step' => 5,
          ],
          '%' => [
            'min' => 0,
            'max' => 100,
          ],
        ],
        'default' => [
          'unit' => 'px',
          'size' => 53,
        ],
        'selectors' => [
          '{{WRAPPER}} .new-products-fourteen .section-heading .detail::before' => 'width: {{SIZE}}{{UNIT}};',
        ],
      ]
    );
    $this->add_control(
      'heigthbg7productscarouselkaveh',
      [
        'label' => esc_html__('Background Image Height', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'seven',
        ],
        'size_units' => ['px', '%'],
        'range' => [
          'px' => [
            'min' => 0,
            'max' => 2000,
            'step' => 5,
          ],
          '%' => [
            'min' => 0,
            'max' => 100,
          ],
        ],
        'default' => [
          'unit' => 'px',
          'size' => 106,
        ],
        'selectors' => [
          '{{WRAPPER}} .new-products-fourteen .section-heading .detail::before' => 'height: {{SIZE}}{{UNIT}};',
        ],
      ]
    );
    $this->add_control(
      'hr2productscarouselkaveh',
      [
        'type' => \Elementor\Controls_Manager::DIVIDER,
        'condition' => [
          'styleheadingproductscarouselkaveh!' => 'nine',
        ],
      ]
    );
    $this->add_control(
      'textcolorback1productscarouselkaveh',
      [
        'label' => esc_html__('First Background Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'two',
        ],
        'default' => '#fff9eb',

      ]
    );
    $this->add_control(
      'textcolorback2productscarouselkaveh',
      [
        'label' => esc_html__('Second Background Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'two',
        ],
        'default' => '#fff',

      ]
    );
    $this->add_control(
      'buttonradiusst5productscarouselkaveh',
      [
        'label' => esc_html__('Background Border Radius', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px'],
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'five',
        ],
        'selectors' => [
          '{{WRAPPER}} .best-sellers-eleven .section-heading .detail::before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
      ]
    );
    $this->add_control(
      'buttonradiusst6productscarouselkaveh',
      [
        'label' => esc_html__('Background Border Radius', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px'],
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'six',
        ],
        'selectors' => [
          '{{WRAPPER}} .best-seller-products .section-heading .detail::before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
          '{{WRAPPER}} .category-products-four .section-heading .detail::before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',

        ],
      ]
    );
    $this->add_control(
      'buttonradiusst7productscarouselkaveh',
      [
        'label' => esc_html__('Background Border Radius', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px'],
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'seven',
        ],
        'selectors' => [
          '{{WRAPPER}} .new-products-fourteen .section-heading .detail::before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
      ]
    );
    $this->end_controls_section();
    $this->start_controls_section(
      'style2_productscarouselkaveh',
      [
        'label' => esc_html__('Button Style', 'kavehTheme'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
          'styleheadingproductscarouselkaveh!' => 'seven',
        ],
      ]
    );
    $this->add_group_control(
      \Elementor\Group_Control_Typography::get_type(),
      [
        'name' => 'button_productscarouselkaveh',
        'label' => esc_html__('Button Text Typography', 'kavehTheme'),
        'selector' => '{{WRAPPER}} .section-heading-link',
      ]
    );
    $this->add_group_control(
      \Elementor\Group_Control_Text_Shadow::get_type(),
      [
        'name' => 'text_shadowproductscarouselkaveh',
        'label' => esc_html__('Text Shadow', 'kavehTheme'),
        'selector' => '{{WRAPPER}} .section-heading-link',
      ]
    );
    $this->start_controls_tabs(
      'style_tabsproductscarouselkaveh'
    );

    $this->start_controls_tab(
      'style_normal_tabproductscarouselkaveh',
      [
        'label' => esc_html__('Normal', 'kavehTheme'),
      ]
    );
    $this->add_control(
      'textbuttoncolorproductscarouselkaveh',
      [
        'label' => esc_html__('Button Text Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
          '{{WRAPPER}} .section-heading-link' => 'color: {{VALUE}}',
        ],
      ]
    );
    $this->add_control(
      'buttoncolorproductscarouselkaveh',
      [
        'label' => esc_html__('Button Background Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
          '{{WRAPPER}} .section-heading-link' => 'background-color: {{VALUE}}',
        ],
      ]
    );
    $this->add_control(
      'buttonradiusproductscarouselkaveh',
      [
        'label' => esc_html__('More Button Border Radius', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px'],
        'selectors' => [
          '{{WRAPPER}} .section-heading-link' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
      ]
    );
    $this->add_group_control(
      \Elementor\Group_Control_Border::get_type(),
      [
        'name' => 'borderproductscarouselkaveh',
        'label' => esc_html__('Border', 'kavehTheme'),
        'selector' => '{{WRAPPER}} .section-heading-link',
      ]
    );
    $this->add_control(
      'buttonbordersproductscarouselkaveh',
      [
        'label' => esc_html__('Border Width', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px'],
        'condition' => [
          'borderbrandscarouselkaveh!' => '',
        ],
        'selectors' => [
          '{{WRAPPER}} .section-heading-link' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
        ],
      ]
    );
    $this->end_controls_tab();
    $this->start_controls_tab(
      'style_hove_tabproductscarouselkaveh',
      [
        'label' => esc_html__('Hover', 'kavehTheme'),
      ]
    );
    $this->add_control(
      'textbuttoncolorhoverproductscarouselkaveh',
      [
        'label' => esc_html__('Button Text Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
          '{{WRAPPER}} .section-heading-link:hover' => 'color: {{VALUE}}',
        ],
      ]
    );
    $this->add_control(
      'buttoncolorhoverproductscarouselkaveh',
      [
        'label' => esc_html__('Button Background Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
          '{{WRAPPER}} .section-heading-link:hover' => 'background-color: {{VALUE}}',
        ],
      ]
    );
    $this->add_control(
      'buttonradiushoverproductscarouselkaveh',
      [
        'label' => esc_html__('More Button Border Radius', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px'],
        'selectors' => [
          '{{WRAPPER}} .section-heading-link:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
      ]
    );
    $this->add_group_control(
      \Elementor\Group_Control_Border::get_type(),
      [
        'name' => 'borderhoverproductscarouselkaveh',
        'label' => esc_html__('Border', 'kavehTheme'),
        'selector' => '{{WRAPPER}} .section-heading-link:hover',
      ]
    );
    $this->add_control(
      'buttonbordershoverproductscarouselkaveh',
      [
        'label' => esc_html__('Border Width', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px'],
        'condition' => [
          'borderbrandscarouselkaveh!' => '',
        ],
        'selectors' => [
          '{{WRAPPER}} .section-heading-link:hover' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
        ],
      ]
    );
    $this->end_controls_tab();
    $this->end_controls_tabs();
    $this->add_group_control(
      \Elementor\Group_Control_Box_Shadow::get_type(),
      [
        'name' => 'box_shadowproductscarouselkavehh',
        'label' => esc_html__('Button Shadow', 'kavehTheme'),
        'selector' => '{{WRAPPER}} .section-heading-link',
      ]
    );
    $this->add_control(
      'hr22productscarouselkaveh',
      [
        'type' => \Elementor\Controls_Manager::DIVIDER,
      ]
    );
    $this->add_control(
      'buttonpaddingproductscarouselkaveh',
      [
        'label' => esc_html__('Padding', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px'],
        'condition' => [
          'styleheadingproductscarouselkaveh!' => 'three',
        ],
        'selectors' => [
          '{{WRAPPER}} .section-heading-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
      ]
    );
    $this->end_controls_section();
    $this->start_controls_section(
      'style3_productscarouselkaveh',
      [
        'label' => esc_html__('Background Style', 'kavehTheme'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
          'styleheadingproductscarouselkaveh' => 'nine',
        ],
      ]
    );
    $this->add_control(
      'bgcolor9productscarouselkaveh',
      [
        'label' => esc_html__('Background Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
          '{{WRAPPER}} .best-selling-sixteen::before' => 'background: {{VALUE}}',
          '{{WRAPPER}} .best-selling-sixteen::after' => 'background: {{VALUE}}',

        ],
      ]
    );

    $this->end_controls_section();

  }



  protected function render()
  {
    $settings = $this->get_settings_for_display();
    $clsid = $this->get_id();
    ?>
    <?php if (\Elementor\Plugin::$instance->editor->is_edit_mode()): ?>
      <section
        class="top-seller-home <?php if ("yes" === $settings['barproductscarouselkaveh']) { ?>top-sellers-two<?php } ?><?php if ('two' === $settings['styleheadingproductscarouselkaveh']) { ?>top-seller-home-five<?php } elseif ('three' === $settings['styleheadingproductscarouselkaveh']) { ?>products-category-two<?php } elseif ('four' === $settings['styleheadingproductscarouselkaveh']) { ?>consol-game<?php } elseif ('five' === $settings['styleheadingproductscarouselkaveh']) { ?>best-sellers-eleven<?php } elseif ('six' === $settings['styleheadingproductscarouselkaveh']) { ?>best-seller-products<?php } elseif ('seven' === $settings['styleheadingproductscarouselkaveh']) { ?>new-products-fourteen<?php } elseif ('eight' === $settings['styleheadingproductscarouselkaveh']) { ?>best-selling-fiveteen<?php } elseif ('nine' === $settings['styleheadingproductscarouselkaveh']) { ?>best-selling-sixteen<?php } ?>">
        <div class="container position-relative">
          <!-- Start Heading -->
          <?php if ('yes' === $settings['show_heading_productscarouselkaveh']) : ?>
          <?php if ('one' === $settings['styleheadingproductscarouselkaveh']) { ?>
            <div
              class="section-heading position-relative d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
              <div class="detail">
                <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                  class="section-heading-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                  class="section-heading-sub-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
              </div>
              <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                  class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
              <?php } ?>
            </div>
          <?php } elseif ('two' === $settings['styleheadingproductscarouselkaveh']) { ?>
            <div
              class="section-heading section-heading-two position-relative d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
              <div class="detail position-relative">
                <i
                  class="<?php echo esc_html($settings['iconproductscarouselkaveh']['value']); ?> position-absolute top-50 translate-middle-y start-0"></i>
                <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?> class="section-heading-title">
                  <?php echo esc_html($settings['titleproductscarouselkaveh']); ?> </<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?> class="section-heading-sub-title">
                  <?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
              </div>
              <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                  class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                <style>
                  <?php echo '.elementor-element-' . $clsid . ''; ?>
                  .section-heading-two::after {

                    background-image: -webkit-linear-gradient(right,
                        <?php echo esc_attr($settings['textcolorback1productscarouselkaveh']); ?>
                        ,
                        <?php echo esc_attr($settings['textcolorback2productscarouselkaveh']); ?>
                      ) !important;
                    background-image: -moz-linear-gradient(right,
                        <?php echo esc_attr($settings['textcolorback1productscarouselkaveh']); ?>
                        ,
                        <?php echo esc_attr($settings['textcolorback2productscarouselkaveh']); ?>
                      ) !important;
                    background-image: -o-linear-gradient(right,
                        <?php echo esc_attr($settings['textcolorback1productscarouselkaveh']); ?>
                        ,
                        <?php echo esc_attr($settings['textcolorback2productscarouselkaveh']); ?>
                      ) !important;
                    background-image: linear-gradient(to left,
                        <?php echo esc_attr($settings['textcolorback1productscarouselkaveh']); ?>
                        ,
                        <?php echo esc_attr($settings['textcolorback2productscarouselkaveh']); ?>
                      ) !important;

                  }
                </style>
              <?php } ?>
            </div>
          <?php } elseif ('three' === $settings['styleheadingproductscarouselkaveh']) { ?>
            <div class="section-heading d-flex justify-content-between">
              <div class="detail position-relative">
                <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                  class="section-heading-sub-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                  class="section-heading-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
              </div>
              <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                  class="section-heading-link btn rounded-0 p-0"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
              <?php } ?>

            </div>
          <?php } elseif ('four' === $settings['styleheadingproductscarouselkaveh']) { ?>
            <div
              class="section-heading section-heading-three d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
              <div class="detail position-relative">
                <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                  class="section-heading-sub-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                  class="section-heading-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
              </div>
              <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                  class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
              <?php } ?>
            </div>
          <?php } elseif ('five' === $settings['styleheadingproductscarouselkaveh']) { ?>
            <div class="section-heading d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
              <div class="detail position-relative">
                <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                  class="section-heading-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                  class="section-heading-sub-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
              </div>
              <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                  class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
              <?php } ?>
              <style>
                <?php echo '.elementor-element-' . $clsid . ''; ?>
                .best-sellers-eleven .section-heading .detail::before {
                  background: -webkit-linear-gradient(186.43deg,
                      <?php echo esc_html($settings['shapest51colorproductscarouselkaveh']); ?>
                      17.81%,
                      <?php echo esc_html($settings['shapest52colorproductscarouselkaveh']); ?>
                      66.22%) !important;
                  background: -moz-linear-gradient(186.43deg,
                      <?php echo esc_html($settings['shapest51colorproductscarouselkaveh']); ?>
                      17.81%,
                      <?php echo esc_html($settings['shapest52colorproductscarouselkaveh']); ?>
                      66.22%) !important;
                  background: -o-linear-gradient(186.43deg,
                      <?php echo esc_html($settings['shapest51colorproductscarouselkaveh']); ?>
                      17.81%,
                      <?php echo esc_html($settings['shapest52colorproductscarouselkaveh']); ?>
                      66.22%) !important;
                  background: linear-gradient(263.57deg,
                      <?php echo esc_html($settings['shapest51colorproductscarouselkaveh']); ?>
                      17.81%,
                      <?php echo esc_html($settings['shapest52colorproductscarouselkaveh']); ?>
                      66.22%) !important;
                }
              </style>
            </div>
          <?php } elseif ('six' === $settings['styleheadingproductscarouselkaveh']) { ?>
            <div class="section-heading d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
              <div class="detail position-relative">
                <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                  class="section-heading-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                  class="section-heading-sub-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
              </div>
              <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                  class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
              <?php } ?>
              <style>
                <?php echo '.elementor-element-' . $clsid . ''; ?>
                .best-seller - products .section-heading .detail::before,
                .category-products-four .section-heading .detail::before {
                  background: -webkit-linear-gradient(225deg,
                      <?php echo esc_html($settings['shapest61colorproductscarouselkaveh']); ?>
                      -20%,
                      <?php echo esc_html($settings['shapest62colorproductscarouselkaveh']); ?>
                      64%);
                  background: -moz-linear-gradient(225deg,
                      <?php echo esc_html($settings['shapest61colorproductscarouselkaveh']); ?>
                      -20%,
                      <?php echo esc_html($settings['shapest62colorproductscarouselkaveh']); ?>
                      64%);
                  background: -o-linear-gradient(225deg,
                      <?php echo esc_html($settings['shapest61colorproductscarouselkaveh']); ?>
                      -20%,
                      <?php echo esc_html($settings['shapest62colorproductscarouselkaveh']); ?>
                      64%);
                  background: linear-gradient(-135deg,
                      <?php echo esc_html($settings['shapest61colorproductscarouselkaveh']); ?>
                      -20%,
                      <?php echo esc_html($settings['shapest62colorproductscarouselkaveh']); ?>
                      64%);
                }
              </style>
            </div>
          <?php } elseif ('seven' === $settings['styleheadingproductscarouselkaveh']) { ?>
            <div class="section-heading">
              <div class="detail position-relative">
                <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                  class="section-heading-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                  class="section-heading-sub-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
              </div>
            </div>
            <style>
              <?php echo '.elementor-element-' . $clsid . ''; ?>
              .new-products-fourteen .section-heading .detail::after {
                background-repeat: no-repeat !important;
                background-size: contain;
                width:
                  <?php echo esc_html($settings['width7productscarouselkaveh']['size']); ?>
                  px !important;
                height:
                  <?php echo esc_html($settings['width7productscarouselkaveh']['size']); ?>
                  px !important;
              }

              <?php echo '.elementor-element-' . $clsid . ''; ?>
              .new-products-fourteen .section-heading .detail::before {
                background: -webkit-linear-gradient(top,
                    <?php echo esc_html($settings['shapest71colorproductscarouselkaveh']); ?>
                    ,
                    <?php echo esc_html($settings['shapest72colorproductscarouselkaveh']); ?>
                  ) !important;
                background: -moz-linear-gradient(top,
                    <?php echo esc_html($settings['shapest71colorproductscarouselkaveh']); ?>
                    ,
                    <?php echo esc_html($settings['shapest72colorproductscarouselkaveh']); ?>
                  ) !important;
                background: -o-linear-gradient(top,
                    <?php echo esc_html($settings['shapest71colorproductscarouselkaveh']); ?>
                    ,
                    <?php echo esc_html($settings['shapest72colorproductscarouselkaveh']); ?>
                  ) !important;
                background: linear-gradient(to bottom,
                    <?php echo esc_html($settings['shapest71colorproductscarouselkaveh']); ?>
                    ,
                    <?php echo esc_html($settings['shapest72colorproductscarouselkaveh']); ?>
                  ) !important;
              }
            </style>
          <?php } elseif ('eight' === $settings['styleheadingproductscarouselkaveh']) { ?>
            <div class="section-heading d-flex align-items-sm-center justify-content-between flex-column flex-sm-row">
              <div class="detail position-relative">
                <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?> class="section-heading-sub-title">
                  <?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                  class="section-heading-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
              </div>
              <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                  class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
              <?php } ?>
            </div>
            <style>
              <?php echo '.elementor-element-' . $clsid . ''; ?>
              .best-selling-fiveteen .section-heading .detail::before {

                width:
                  <?php echo esc_html($settings['width7productscarouselkaveh']['size']); ?>
                  px;
                height:
                  <?php echo esc_html($settings['width7productscarouselkaveh']['size']); ?>
                  px;
                background-size: contain;
                background-repeat: no-repeat !important;
                -webkit-transform: unset;
                -moz-transform: unset;
                -ms-transform: unset;
                -o-transform: unset;
                transform: unset;
                top: 0 !important;


              }
            </style>
          <?php } elseif ('nine' === $settings['styleheadingproductscarouselkaveh']) { ?>
            <div
              class="section-heading d-flex align-items-sm-center justify-content-sm-between position-relative mb-0 flex-column flex-sm-row">
              <div class="detail position-relative mb-4 mb-sm-0">
                <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                  class="section-heading-sub-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                  class="section-heading-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
              </div>
              <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                  class="section-heading-link btn btn-warning"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
              <?php } else { ?>
                <style>
                  <?php echo '.elementor-element-' . $clsid . ''; ?>
                  .best-selling-sixteen .section-heading::after {
                    background-color: unset;
                  }
                </style>
                <?php
              } ?>
            </div>
          <?php } ?>
          <?php endif; ?>
          <!-- End Heading -->

          <!-- Start Products -->
          <div class="swiper <?php if ("yes" === $settings['barproductscarouselkaveh']) { ?>swiper-top-products-two<?php } else { ?> swiper-products<?php } ?> <?php if ("yes" == $settings['overflow2productscarouselkaveh']) {
                      } else { ?>overflow-hidden<?php } ?>"
            data-swiper='<?php
            $swiper_config = [
                "navigation" => ["nextEl" => ".swiper-button-next", "prevEl" => ".swiper-button-prev"]
            ];
            
            // Add pagination if enabled
            if ("yes" === $settings['pagination_productscarouselkaveh']) {
                $pagination_config = [
                    "el" => ".swiper-pagination",
                    "type" => $settings['paginationType_productscarouselkaveh']
                ];
                if ("yes" === $settings['paginationClickable_productscarouselkaveh'] && $settings['paginationType_productscarouselkaveh'] === 'bullets') {
                    $pagination_config["clickable"] = true;
                }
                if ("yes" === $settings['paginationDynamicBullets_productscarouselkaveh'] && $settings['paginationType_productscarouselkaveh'] === 'bullets') {
                    $pagination_config["dynamicBullets"] = true;
                    $pagination_config["dynamicMainBullets"] = (int)$settings['paginationDynamicMainBullets_productscarouselkaveh'];
                }
                if ("yes" === $settings['paginationHideOnClick_productscarouselkaveh']) {
                    $pagination_config["hideOnClick"] = true;
                }
                $swiper_config["pagination"] = $pagination_config;
            }
            
            // Add scrollbar if enabled
            if ("yes" === $settings['scrollbar_productscarouselkaveh']) {
                $scrollbar_config = ["el" => ".swiper-scrollbar"];
                if ("yes" === $settings['scrollbarHide_productscarouselkaveh']) {
                    $scrollbar_config["hide"] = true;
                }
                if ("yes" === $settings['scrollbarDraggable_productscarouselkaveh']) {
                    $scrollbar_config["draggable"] = true;
                }
                if ("yes" === $settings['scrollbarSnapOnRelease_productscarouselkaveh'] && "yes" === $settings['scrollbarDraggable_productscarouselkaveh']) {
                    $scrollbar_config["snapOnRelease"] = true;
                }
                $swiper_config["scrollbar"] = $scrollbar_config;
            }
            
            // Add autoplay if enabled
            if ("yes" === $settings['autoplayproductscarouselkaveh']) {
                $swiper_config["autoplay"] = [
                    "delay" => (int)$settings['autoplaydelayproductscarouselkaveh'],
                    "disableOnInteraction" => false
                ];
            }
            
            // Add basic settings
            $swiper_config["loop"] = ("yes" === $settings['loopproductscarouselkaveh']);
            $swiper_config["speed"] = (int)$settings['speedproductscarouselkaveh'];
            $swiper_config["effect"] = $settings['effectproductscarouselkaveh'];
            $swiper_config["centeredSlides"] = ("yes" === $settings['centeredSlidesproductscarouselkaveh']);
            $swiper_config["freeMode"] = ("yes" === $settings['freeMode_productscarouselkaveh']);
            $swiper_config["grabCursor"] = ("yes" === $settings['grabCursorproductscarouselkaveh']);
            
            // Add conditional settings
            if ("yes" === $settings['mousewheel_productscarouselkaveh']) {
                $swiper_config["mousewheel"] = true;
            }
            if ("yes" === $settings['keyboard_productscarouselkaveh']) {
                $swiper_config["keyboard"] = ["enabled" => true];
            }
            
            // Add touch settings
            $swiper_config["simulateTouch"] = ("yes" === $settings['simulateTouch_productscarouselkaveh']);
            $swiper_config["allowTouchMove"] = ("yes" === $settings['allowTouchMove_productscarouselkaveh']);
            $swiper_config["resistanceRatio"] = (float)$settings['resistanceRatio_productscarouselkaveh']['size'];
            $swiper_config["threshold"] = (int)$settings['threshold_productscarouselkaveh'];
            $swiper_config["followFinger"] = ("yes" === $settings['followFinger_productscarouselkaveh']);
            $swiper_config["shortSwipes"] = ("yes" === $settings['shortSwipes_productscarouselkaveh']);
            $swiper_config["longSwipes"] = ("yes" === $settings['longSwipes_productscarouselkaveh']);
            
            if ("yes" === $settings['longSwipes_productscarouselkaveh']) {
                $swiper_config["longSwipesRatio"] = (float)$settings['longSwipesRatio_productscarouselkaveh']['size'];
                $swiper_config["longSwipesMs"] = (int)$settings['longSwipesMs_productscarouselkaveh'];
            }
            
            // Add performance settings
            $swiper_config["watchSlidesProgress"] = ("yes" === $settings['watchSlidesProgress_productscarouselkaveh']);
            $swiper_config["watchSlidesVisibility"] = ("yes" === $settings['watchSlidesVisibility_productscarouselkaveh']);
            $swiper_config["preloadImages"] = ("yes" === $settings['preloadImages_productscarouselkaveh']);
            $swiper_config["updateOnImagesReady"] = ("yes" === $settings['updateOnImagesReady_productscarouselkaveh'] && "yes" === $settings['preloadImages_productscarouselkaveh']);
            
            // Add lazy loading if enabled
            if ("yes" === $settings['lazy_productscarouselkaveh']) {
                $lazy_config = ["loadPrevNext" => ("yes" === $settings['lazyLoadingInPrevNext_productscarouselkaveh'])];
                if ("yes" === $settings['lazyLoadingInPrevNext_productscarouselkaveh']) {
                    $lazy_config["loadPrevNextAmount"] = (int)$settings['lazyLoadingInPrevNextAmount_productscarouselkaveh'];
                }
                $swiper_config["lazy"] = $lazy_config;
            }
            
            // Add breakpoints
            $swiper_config["breakpoints"] = [
                "320" => ["slidesPerView" => (int)$settings['productcolumn3productscarouselkaveh'], "spaceBetween" => 4],
                "500" => ["slidesPerView" => (int)$settings['productcolumn3productscarouselkaveh'], "spaceBetween" => 14],
                "768" => ["slidesPerView" => (int)$settings['productcolumn2productscarouselkaveh'], "spaceBetween" => 14],
                "992" => ["slidesPerView" => (int)$settings['productcolumnproductscarouselkaveh'], "spaceBetween" => 20],
                "1200" => ["slidesPerView" => (int)$settings['productcolumnproductscarouselkaveh'], "spaceBetween" => 31]
            ];
            
            echo esc_attr(json_encode($swiper_config, JSON_UNESCAPED_SLASHES));
            ?>'>
            <div class="swiper-wrapper">
            <?php
// Build query arguments
    $args = [
        'post_type' => $settings['post_type_productscarouselkaveh'],
        'posts_per_page' => $settings['posts_per_page_productscarouselkaveh'],
        'orderby' => $settings['psortproductscarouselkaveh'],
        'order' => $settings['psortiproductscarouselkaveh']
    ];

    // Handle WooCommerce specific options
    if ($settings['post_type_productscarouselkaveh'] === 'product') {
        // 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_productscarouselkaveh'] === '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_productscarouselkaveh']) && !empty($settings['product_attribute_terms_productscarouselkaveh'])) {
            $tax_query = [];
            foreach ($settings['product_attributes_productscarouselkaveh'] as $attribute) {
                $tax_query[] = [
                    'taxonomy' => 'pa_' . $attribute,
                    'field' => 'term_id',
                    'terms' => $settings['product_attribute_terms_productscarouselkaveh']
                ];
            }
            if (!empty($tax_query)) {
                $args['tax_query'][] = [
                    'relation' => 'AND',
                    $tax_query
                ];
            }
        }
    }

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

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

    // Handle date query
    if ($settings['date_query_productscarouselkaveh'] !== 'none') {
        $date_query = [];
        switch ($settings['date_query_productscarouselkaveh']) {
            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_productscarouselkaveh'])) {
        $excluded_ids = array_map('trim', explode(',', $settings['exclude_posts_productscarouselkaveh']));
        $args['post__not_in'] = array_map('intval', $excluded_ids);
    }

    // Handle custom query parameters
    if (!empty($settings['custom_query_productscarouselkaveh'])) {
        $custom_args = json_decode($settings['custom_query_productscarouselkaveh'], 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()) :
                        while ($query->have_posts()) : $query->the_post();
                    ?>
                      <div class="swiper-slide h-auto">
                          <?php $styleproduct2 = $settings['stylecartproductscarouselkaveh']; ?>
                          <?php get_template_part("template-part/product-cart-$styleproduct2"); ?>
                      </div>
                      <?php 
                        endwhile;
                        wp_reset_postdata();
                    endif;
                    ?>
            </div>
            <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
              <?php if ('nine' == $settings['styleheadingproductscarouselkaveh']) { ?>
                <div class="swiper-button-next w-auto h-auto"></div>
                <div class="swiper-button-prev w-auto h-auto"></div>
              <?php } elseif ('seven' !== $settings['styleheadingproductscarouselkaveh']) { ?>
                <div class="swiper-button-next"></div>
                <div class="swiper-button-prev"></div>
              <?php }
            }
            ?>
            <?php if ("yes" === $settings['pagination_productscarouselkaveh']) { ?>
              <div class="swiper-pagination"></div>
            <?php } ?>
            <?php if ("yes" === $settings['scrollbar_productscarouselkaveh']) { ?>
              <div class="swiper-scrollbar"></div>
            <?php } ?>
          </div>
          <!-- End Products -->
      </section>
      <style>
        <?php echo '.elementor-element-' . $clsid . ''; ?>
        .top-sellers-two .swiper::before {
          content: "";
          right: 0;
          bottom: 190px;
          left: 0;
          width: 80%;
          -webkit-border-radius: 50px;
          -moz-border-radius: 50px;
          border-radius: 50px;
          background-color: #ee273a;
          height: 50px;
          margin: 0 auto;
        }

        .best-selling-fiveteen .section-heading .detail::before {
          -webkit-background-size: 100% 100% !important;
          -moz-background-size: 100% 100% !important;
          -o-background-size: 100% 100% !important;
          background-size: 100% 100% !important;
        }

        .new-products-fourteen .section-heading .detail::after {
          -webkit-background-size: 100% 100% !important;
          -moz-background-size: 100% 100% !important;
          -o-background-size: 100% 100% !important;
          background-size: 100% 100% !important;
        }
      </style>
    <?php else: ?>
      <div class="kel-widget">
        <section
          class="skeleton-display top-seller-home <?php if ("yes" === $settings['barproductscarouselkaveh']) { ?>top-sellers-two<?php } ?><?php if ('two' === $settings['styleheadingproductscarouselkaveh']) { ?>top-seller-home-five<?php } elseif ('three' === $settings['styleheadingproductscarouselkaveh']) { ?>products-category-two<?php } elseif ('four' === $settings['styleheadingproductscarouselkaveh']) { ?>consol-game<?php } elseif ('five' === $settings['styleheadingproductscarouselkaveh']) { ?>best-sellers-eleven<?php } elseif ('six' === $settings['styleheadingproductscarouselkaveh']) { ?>best-seller-products<?php } elseif ('seven' === $settings['styleheadingproductscarouselkaveh']) { ?>new-products-fourteen<?php } elseif ('eight' === $settings['styleheadingproductscarouselkaveh']) { ?>best-selling-fiveteen<?php } elseif ('nine' === $settings['styleheadingproductscarouselkaveh']) { ?>best-selling-sixteen<?php } ?>">
          <div class="container position-relative">
            <!-- Start Heading -->
            <?php if ('one' === $settings['styleheadingproductscarouselkaveh']) { ?>
              <div
                class="section-heading position-relative d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
                <div class="detail">
                  <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                    class="section-heading-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                  <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                    class="section-heading-sub-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                </div>
                <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                  <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                    class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                <?php } ?>
              </div>
            <?php } elseif ('two' === $settings['styleheadingproductscarouselkaveh']) { ?>
              <div
                class="section-heading section-heading-two position-relative d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
                <div class="detail position-relative">
                  <i
                    class="<?php echo esc_html($settings['iconproductscarouselkaveh']['value']); ?> position-absolute top-50 translate-middle-y start-0"></i>
                  <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?> class="section-heading-title">
                    <?php echo esc_html($settings['titleproductscarouselkaveh']); ?> </<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                  <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?> class="section-heading-sub-title">
                    <?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                </div>
                <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                  <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                    class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                  <style>
                    <?php echo '.elementor-element-' . $clsid . ''; ?>
                    .section-heading-two::after {

                      background-image: -webkit-linear-gradient(right,
                          <?php echo esc_attr($settings['textcolorback1productscarouselkaveh']); ?>
                          ,
                          <?php echo esc_attr($settings['textcolorback2productscarouselkaveh']); ?>
                        ) !important;
                      background-image: -moz-linear-gradient(right,
                          <?php echo esc_attr($settings['textcolorback1productscarouselkaveh']); ?>
                          ,
                          <?php echo esc_attr($settings['textcolorback2productscarouselkaveh']); ?>
                        ) !important;
                      background-image: -o-linear-gradient(right,
                          <?php echo esc_attr($settings['textcolorback1productscarouselkaveh']); ?>
                          ,
                          <?php echo esc_attr($settings['textcolorback2productscarouselkaveh']); ?>
                        ) !important;
                      background-image: linear-gradient(to left,
                          <?php echo esc_attr($settings['textcolorback1productscarouselkaveh']); ?>
                          ,
                          <?php echo esc_attr($settings['textcolorback2productscarouselkaveh']); ?>
                        ) !important;

                    }
                  </style>
                <?php } ?>
              </div>
            <?php } elseif ('three' === $settings['styleheadingproductscarouselkaveh']) { ?>
              <div class="section-heading d-flex justify-content-between">
                <div class="detail position-relative">
                  <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                    class="section-heading-sub-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                  <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                    class="section-heading-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                </div>
                <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                  <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                    class="section-heading-link btn rounded-0 p-0"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                <?php } ?>

              </div>
            <?php } elseif ('four' === $settings['styleheadingproductscarouselkaveh']) { ?>
              <div
                class="section-heading section-heading-three d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
                <div class="detail position-relative">
                  <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                    class="section-heading-sub-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                  <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                    class="section-heading-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                </div>
                <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                  <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                    class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                <?php } ?>
              </div>
            <?php } elseif ('five' === $settings['styleheadingproductscarouselkaveh']) { ?>
              <div class="section-heading d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
                <div class="detail position-relative">
                  <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                    class="section-heading-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                  <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                    class="section-heading-sub-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                </div>
                <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                  <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                    class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                <?php } ?>
                <style>
                  <?php echo '.elementor-element-' . $clsid . ''; ?>
                  .best-sellers-eleven .section-heading .detail::before {
                    background: -webkit-linear-gradient(186.43deg,
                        <?php echo esc_html($settings['shapest51colorproductscarouselkaveh']); ?>
                        17.81%,
                        <?php echo esc_html($settings['shapest52colorproductscarouselkaveh']); ?>
                        66.22%) !important;
                    background: -moz-linear-gradient(186.43deg,
                        <?php echo esc_html($settings['shapest51colorproductscarouselkaveh']); ?>
                        17.81%,
                        <?php echo esc_html($settings['shapest52colorproductscarouselkaveh']); ?>
                        66.22%) !important;
                    background: -o-linear-gradient(186.43deg,
                        <?php echo esc_html($settings['shapest51colorproductscarouselkaveh']); ?>
                        17.81%,
                        <?php echo esc_html($settings['shapest52colorproductscarouselkaveh']); ?>
                        66.22%) !important;
                    background: linear-gradient(263.57deg,
                        <?php echo esc_html($settings['shapest51colorproductscarouselkaveh']); ?>
                        17.81%,
                        <?php echo esc_html($settings['shapest52colorproductscarouselkaveh']); ?>
                        66.22%) !important;
                  }
                </style>
              </div>
            <?php } elseif ('six' === $settings['styleheadingproductscarouselkaveh']) { ?>
              <div class="section-heading d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
                <div class="detail position-relative">
                  <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                    class="section-heading-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                  <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                    class="section-heading-sub-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                </div>
                <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                  <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                    class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                <?php } ?>
                <style>
                  <?php echo '.elementor-element-' . $clsid . ''; ?>
                  .best-seller - products .section-heading .detail::before,
                  .category-products-four .section-heading .detail::before {
                    background: -webkit-linear-gradient(225deg,
                        <?php echo esc_html($settings['shapest61colorproductscarouselkaveh']); ?>
                        -20%,
                        <?php echo esc_html($settings['shapest62colorproductscarouselkaveh']); ?>
                        64%);
                    background: -moz-linear-gradient(225deg,
                        <?php echo esc_html($settings['shapest61colorproductscarouselkaveh']); ?>
                        -20%,
                        <?php echo esc_html($settings['shapest62colorproductscarouselkaveh']); ?>
                        64%);
                    background: -o-linear-gradient(225deg,
                        <?php echo esc_html($settings['shapest61colorproductscarouselkaveh']); ?>
                        -20%,
                        <?php echo esc_html($settings['shapest62colorproductscarouselkaveh']); ?>
                        64%);
                    background: linear-gradient(-135deg,
                        <?php echo esc_html($settings['shapest61colorproductscarouselkaveh']); ?>
                        -20%,
                        <?php echo esc_html($settings['shapest62colorproductscarouselkaveh']); ?>
                        64%);
                  }
                </style>
              </div>
            <?php } elseif ('seven' === $settings['styleheadingproductscarouselkaveh']) { ?>
              <div class="section-heading">
                <div class="detail position-relative">
                  <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                    class="section-heading-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                  <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                    class="section-heading-sub-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                </div>
              </div>
              <style>
                <?php echo '.elementor-element-' . $clsid . ''; ?>
                .new-products-fourteen .section-heading .detail::after {
                  background-repeat: no-repeat !important;
                  background-size: contain;
                  width:
                    <?php echo esc_html($settings['width7productscarouselkaveh']['size']); ?>
                    px !important;
                  height:
                    <?php echo esc_html($settings['width7productscarouselkaveh']['size']); ?>
                    px !important;
                }

                <?php echo '.elementor-element-' . $clsid . ''; ?>
                .new-products-fourteen .section-heading .detail::before {
                  background: -webkit-linear-gradient(top,
                      <?php echo esc_html($settings['shapest71colorproductscarouselkaveh']); ?>
                      ,
                      <?php echo esc_html($settings['shapest72colorproductscarouselkaveh']); ?>
                    ) !important;
                  background: -moz-linear-gradient(top,
                      <?php echo esc_html($settings['shapest71colorproductscarouselkaveh']); ?>
                      ,
                      <?php echo esc_html($settings['shapest72colorproductscarouselkaveh']); ?>
                    ) !important;
                  background: -o-linear-gradient(top,
                      <?php echo esc_html($settings['shapest71colorproductscarouselkaveh']); ?>
                      ,
                      <?php echo esc_html($settings['shapest72colorproductscarouselkaveh']); ?>
                    ) !important;
                  background: linear-gradient(to bottom,
                      <?php echo esc_html($settings['shapest71colorproductscarouselkaveh']); ?>
                      ,
                      <?php echo esc_html($settings['shapest72colorproductscarouselkaveh']); ?>
                    ) !important;
                }
              </style>
            <?php } elseif ('eight' === $settings['styleheadingproductscarouselkaveh']) { ?>
              <div class="section-heading d-flex align-items-sm-center justify-content-between flex-column flex-sm-row">
                <div class="detail position-relative">
                  <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?> class="section-heading-sub-title">
                    <?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                  <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                    class="section-heading-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                </div>
                <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                  <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                    class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                <?php } ?>
              </div>
              <style>
                <?php echo '.elementor-element-' . $clsid . ''; ?>
                .best-selling-fiveteen .section-heading .detail::before {

                  width:
                    <?php echo esc_html($settings['width7productscarouselkaveh']['size']); ?>
                    px;
                  height:
                    <?php echo esc_html($settings['width7productscarouselkaveh']['size']); ?>
                    px;
                  background-size: contain;
                  background-repeat: no-repeat !important;
                  -webkit-transform: unset;
                  -moz-transform: unset;
                  -ms-transform: unset;
                  -o-transform: unset;
                  transform: unset;
                  top: 0 !important;


                }
              </style>
            <?php } elseif ('nine' === $settings['styleheadingproductscarouselkaveh']) { ?>
              <div
                class="section-heading d-flex align-items-sm-center justify-content-sm-between position-relative mb-0 flex-column flex-sm-row">
                <div class="detail position-relative mb-4 mb-sm-0">
                  <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                    class="section-heading-sub-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                  <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                    class="section-heading-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                </div>
                <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                  <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                    class="section-heading-link btn btn-warning"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                <?php } else { ?>
                  <style>
                    <?php echo '.elementor-element-' . $clsid . ''; ?>
                    .best-selling-sixteen .section-heading::after {
                      background-color: unset;
                    }
                  </style>
                  <?php
                } ?>
              </div>
            <?php } ?>

            <!-- End Heading -->

            <!-- Start Products -->
            <div class="">
              <?php if (wp_is_mobile()): ?>
                <div class="skeleton-loader">
                  <div class="skeleton-header"></div>
                  <div class="skeleton-content"></div>
                  <div class="skeleton-p"></div>
                  <div class="skeleton-p"></div>
                  <div class="skeleton-footer"></div>
                </div>
              <?php else: ?>
                <div class="row">
                  <div class="col">
                    <div class="skeleton-loader">
                      <div class="skeleton-header"></div>
                      <div class="skeleton-content"></div>
                      <div class="skeleton-p"></div>
                      <div class="skeleton-p"></div>
                      <div class="skeleton-footer"></div>
                    </div>
                  </div>
                  <div class="col">
                    <div class="skeleton-loader">
                      <div class="skeleton-header"></div>
                      <div class="skeleton-content"></div>
                      <div class="skeleton-p"></div>
                      <div class="skeleton-p"></div>
                      <div class="skeleton-footer"></div>
                    </div>
                  </div>
                  <div class="col">
                    <div class="skeleton-loader">
                      <div class="skeleton-header"></div>
                      <div class="skeleton-content"></div>
                      <div class="skeleton-p"></div>
                      <div class="skeleton-p"></div>
                      <div class="skeleton-footer"></div>
                    </div>
                  </div>
                  <div class="col">
                    <div class="skeleton-loader">
                      <div class="skeleton-header"></div>
                      <div class="skeleton-content"></div>
                      <div class="skeleton-p"></div>
                      <div class="skeleton-p"></div>
                      <div class="skeleton-footer"></div>
                    </div>
                  </div>
                </div>
              <?php endif; ?>
            </div>
            <!-- End Products -->
        </section>
        <style>
          <?php echo '.elementor-element-' . $clsid . ''; ?>
          .top-sellers-two .swiper::before {
            content: "";
            right: 0;
            bottom: 190px;
            left: 0;
            width: 80%;
            -webkit-border-radius: 50px;
            -moz-border-radius: 50px;
            border-radius: 50px;
            background-color: #ee273a;
            height: 50px;
            margin: 0 auto;
          }

          .best-selling-fiveteen .section-heading .detail::before {
            -webkit-background-size: 100% 100% !important;
            -moz-background-size: 100% 100% !important;
            -o-background-size: 100% 100% !important;
            background-size: 100% 100% !important;
          }

          .new-products-fourteen .section-heading .detail::after {
            -webkit-background-size: 100% 100% !important;
            -moz-background-size: 100% 100% !important;
            -o-background-size: 100% 100% !important;
            background-size: 100% 100% !important;
          }
        </style>
        <div class="kel-content" style="display:none">
          <section
            class="top-seller-home <?php if ("yes" === $settings['barproductscarouselkaveh']) { ?>top-sellers-two<?php } ?><?php if ('two' === $settings['styleheadingproductscarouselkaveh']) { ?>top-seller-home-five<?php } elseif ('three' === $settings['styleheadingproductscarouselkaveh']) { ?>products-category-two<?php } elseif ('four' === $settings['styleheadingproductscarouselkaveh']) { ?>consol-game<?php } elseif ('five' === $settings['styleheadingproductscarouselkaveh']) { ?>best-sellers-eleven<?php } elseif ('six' === $settings['styleheadingproductscarouselkaveh']) { ?>best-seller-products<?php } elseif ('seven' === $settings['styleheadingproductscarouselkaveh']) { ?>new-products-fourteen<?php } elseif ('eight' === $settings['styleheadingproductscarouselkaveh']) { ?>best-selling-fiveteen<?php } elseif ('nine' === $settings['styleheadingproductscarouselkaveh']) { ?>best-selling-sixteen<?php } ?>">
            <div class="container position-relative">
              <!-- Start Heading -->
              <?php if ('one' === $settings['styleheadingproductscarouselkaveh']) { ?>
                <div
                  class="section-heading position-relative d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
                  <div class="detail">
                    <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                      class="section-heading-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                    <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                      class="section-heading-sub-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                  </div>
                  <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                    <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                      class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                  <?php } ?>
                </div>
              <?php } elseif ('two' === $settings['styleheadingproductscarouselkaveh']) { ?>
                <div
                  class="section-heading section-heading-two position-relative d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
                  <div class="detail position-relative">
                    <i
                      class="<?php echo esc_html($settings['iconproductscarouselkaveh']['value']); ?> position-absolute top-50 translate-middle-y start-0"></i>
                    <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?> class="section-heading-title">
                      <?php echo esc_html($settings['titleproductscarouselkaveh']); ?> </<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                    <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?> class="section-heading-sub-title">
                      <?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                  </div>
                  <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                    <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                      class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                    <style>
                      <?php echo '.elementor-element-' . $clsid . ''; ?>
                      .section-heading-two::after {

                        background-image: -webkit-linear-gradient(right,
                            <?php echo esc_attr($settings['textcolorback1productscarouselkaveh']); ?>
                            ,
                            <?php echo esc_attr($settings['textcolorback2productscarouselkaveh']); ?>
                          ) !important;
                        background-image: -moz-linear-gradient(right,
                            <?php echo esc_attr($settings['textcolorback1productscarouselkaveh']); ?>
                            ,
                            <?php echo esc_attr($settings['textcolorback2productscarouselkaveh']); ?>
                          ) !important;
                        background-image: -o-linear-gradient(right,
                            <?php echo esc_attr($settings['textcolorback1productscarouselkaveh']); ?>
                            ,
                            <?php echo esc_attr($settings['textcolorback2productscarouselkaveh']); ?>
                          ) !important;
                        background-image: linear-gradient(to left,
                            <?php echo esc_attr($settings['textcolorback1productscarouselkaveh']); ?>
                            ,
                            <?php echo esc_attr($settings['textcolorback2productscarouselkaveh']); ?>
                          ) !important;

                      }
                    </style>
                  <?php } ?>
                </div>
              <?php } elseif ('three' === $settings['styleheadingproductscarouselkaveh']) { ?>
                <div class="section-heading d-flex justify-content-between">
                  <div class="detail position-relative">
                    <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                      class="section-heading-sub-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                    <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                      class="section-heading-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                  </div>
                  <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                    <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                      class="section-heading-link btn rounded-0 p-0"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                  <?php } ?>

                </div>
              <?php } elseif ('four' === $settings['styleheadingproductscarouselkaveh']) { ?>
                <div
                  class="section-heading section-heading-three d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
                  <div class="detail position-relative">
                    <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                      class="section-heading-sub-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                    <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                      class="section-heading-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                  </div>
                  <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                    <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                      class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                  <?php } ?>
                </div>
              <?php } elseif ('five' === $settings['styleheadingproductscarouselkaveh']) { ?>
                <div class="section-heading d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
                  <div class="detail position-relative">
                    <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                      class="section-heading-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                    <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                      class="section-heading-sub-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                  </div>
                  <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                    <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                      class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                  <?php } ?>
                  <style>
                    <?php echo '.elementor-element-' . $clsid . ''; ?>
                    .best-sellers-eleven .section-heading .detail::before {
                      background: -webkit-linear-gradient(186.43deg,
                          <?php echo esc_html($settings['shapest51colorproductscarouselkaveh']); ?>
                          17.81%,
                          <?php echo esc_html($settings['shapest52colorproductscarouselkaveh']); ?>
                          66.22%) !important;
                      background: -moz-linear-gradient(186.43deg,
                          <?php echo esc_html($settings['shapest51colorproductscarouselkaveh']); ?>
                          17.81%,
                          <?php echo esc_html($settings['shapest52colorproductscarouselkaveh']); ?>
                          66.22%) !important;
                      background: -o-linear-gradient(186.43deg,
                          <?php echo esc_html($settings['shapest51colorproductscarouselkaveh']); ?>
                          17.81%,
                          <?php echo esc_html($settings['shapest52colorproductscarouselkaveh']); ?>
                          66.22%) !important;
                      background: linear-gradient(263.57deg,
                          <?php echo esc_html($settings['shapest51colorproductscarouselkaveh']); ?>
                          17.81%,
                          <?php echo esc_html($settings['shapest52colorproductscarouselkaveh']); ?>
                          66.22%) !important;
                    }
                  </style>
                </div>
              <?php } elseif ('six' === $settings['styleheadingproductscarouselkaveh']) { ?>
                <div class="section-heading d-flex align-items-sm-center justify-content-sm-between flex-column flex-sm-row">
                  <div class="detail position-relative">
                    <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                      class="section-heading-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                    <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                      class="section-heading-sub-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                  </div>
                  <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                    <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                      class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                  <?php } ?>
                  <style>
                    <?php echo '.elementor-element-' . $clsid . ''; ?>
                    .best-seller - products .section-heading .detail::before,
                    .category-products-four .section-heading .detail::before {
                      background: -webkit-linear-gradient(225deg,
                          <?php echo esc_html($settings['shapest61colorproductscarouselkaveh']); ?>
                          -20%,
                          <?php echo esc_html($settings['shapest62colorproductscarouselkaveh']); ?>
                          64%);
                      background: -moz-linear-gradient(225deg,
                          <?php echo esc_html($settings['shapest61colorproductscarouselkaveh']); ?>
                          -20%,
                          <?php echo esc_html($settings['shapest62colorproductscarouselkaveh']); ?>
                          64%);
                      background: -o-linear-gradient(225deg,
                          <?php echo esc_html($settings['shapest61colorproductscarouselkaveh']); ?>
                          -20%,
                          <?php echo esc_html($settings['shapest62colorproductscarouselkaveh']); ?>
                          64%);
                      background: linear-gradient(-135deg,
                          <?php echo esc_html($settings['shapest61colorproductscarouselkaveh']); ?>
                          -20%,
                          <?php echo esc_html($settings['shapest62colorproductscarouselkaveh']); ?>
                          64%);
                    }
                  </style>
                </div>
              <?php } elseif ('seven' === $settings['styleheadingproductscarouselkaveh']) { ?>
                <div class="section-heading">
                  <div class="detail position-relative">
                    <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                      class="section-heading-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                    <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                      class="section-heading-sub-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                  </div>
                </div>
                <style>
                  <?php echo '.elementor-element-' . $clsid . ''; ?>
                  .new-products-fourteen .section-heading .detail::after {
                    background-repeat: no-repeat !important;
                    background-size: contain;
                    width:
                      <?php echo esc_html($settings['width7productscarouselkaveh']['size']); ?>
                      px !important;
                    height:
                      <?php echo esc_html($settings['width7productscarouselkaveh']['size']); ?>
                      px !important;
                  }

                  <?php echo '.elementor-element-' . $clsid . ''; ?>
                  .new-products-fourteen .section-heading .detail::before {
                    background: -webkit-linear-gradient(top,
                        <?php echo esc_html($settings['shapest71colorproductscarouselkaveh']); ?>
                        ,
                        <?php echo esc_html($settings['shapest72colorproductscarouselkaveh']); ?>
                      ) !important;
                    background: -moz-linear-gradient(top,
                        <?php echo esc_html($settings['shapest71colorproductscarouselkaveh']); ?>
                        ,
                        <?php echo esc_html($settings['shapest72colorproductscarouselkaveh']); ?>
                      ) !important;
                    background: -o-linear-gradient(top,
                        <?php echo esc_html($settings['shapest71colorproductscarouselkaveh']); ?>
                        ,
                        <?php echo esc_html($settings['shapest72colorproductscarouselkaveh']); ?>
                      ) !important;
                    background: linear-gradient(to bottom,
                        <?php echo esc_html($settings['shapest71colorproductscarouselkaveh']); ?>
                        ,
                        <?php echo esc_html($settings['shapest72colorproductscarouselkaveh']); ?>
                      ) !important;
                  }
                </style>
              <?php } elseif ('eight' === $settings['styleheadingproductscarouselkaveh']) { ?>
                <div class="section-heading d-flex align-items-sm-center justify-content-between flex-column flex-sm-row">
                  <div class="detail position-relative">
                    <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?> class="section-heading-sub-title">
                      <?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                    <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                      class="section-heading-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                  </div>
                  <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                    <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                      class="section-heading-link btn btn-outline-dark"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                  <?php } ?>
                </div>
                <style>
                  <?php echo '.elementor-element-' . $clsid . ''; ?>
                  .best-selling-fiveteen .section-heading .detail::before {

                    width:
                      <?php echo esc_html($settings['width7productscarouselkaveh']['size']); ?>
                      px;
                    height:
                      <?php echo esc_html($settings['width7productscarouselkaveh']['size']); ?>
                      px;
                    background-size: contain;
                    background-repeat: no-repeat !important;
                    -webkit-transform: unset;
                    -moz-transform: unset;
                    -ms-transform: unset;
                    -o-transform: unset;
                    transform: unset;
                    top: 0 !important;


                  }
                </style>
              <?php } elseif ('nine' === $settings['styleheadingproductscarouselkaveh']) { ?>
                <div
                  class="section-heading d-flex align-items-sm-center justify-content-sm-between position-relative mb-0 flex-column flex-sm-row">
                  <div class="detail position-relative mb-4 mb-sm-0">
                    <<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>
                      class="section-heading-sub-title"><?php echo esc_html($settings['titleproductscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading1productscarouselkaveh']); ?>>
                    <<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>
                      class="section-heading-title"><?php echo esc_html($settings['title2productscarouselkaveh']); ?></<?php echo esc_attr($settings['tagheading2productscarouselkaveh']); ?>>
                  </div>
                  <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                    <a href="<?php echo esc_url($settings['buttonlinkproductscarouselkaveh']); ?>"
                      class="section-heading-link btn btn-warning"><?php echo esc_html($settings['buttonproductscarouselkaveh']); ?></a>
                  <?php } else { ?>
                    <style>
                      <?php echo '.elementor-element-' . $clsid . ''; ?>
                      .best-selling-sixteen .section-heading::after {
                        background-color: unset;
                      }
                    </style>
                    <?php
                  } ?>
                </div>
              <?php } ?>

              <!-- End Heading -->

              <!-- Start Products -->
              <div class="swiper <?php if ("yes" === $settings['barproductscarouselkaveh']) { ?>swiper-top-products-two<?php } else { ?> swiper-products<?php } ?> <?php if ("yes" == $settings['overflow2productscarouselkaveh']) {
                          } else { ?>overflow-hidden<?php } ?>"
                data-swiper='<?php
            $swiper_config = [
                "navigation" => ["nextEl" => ".swiper-button-next", "prevEl" => ".swiper-button-prev"]
            ];
            
            // Add pagination if enabled
            if ("yes" === $settings['pagination_productscarouselkaveh']) {
                $pagination_config = [
                    "el" => ".swiper-pagination",
                    "type" => $settings['paginationType_productscarouselkaveh']
                ];
                if ("yes" === $settings['paginationClickable_productscarouselkaveh'] && $settings['paginationType_productscarouselkaveh'] === 'bullets') {
                    $pagination_config["clickable"] = true;
                }
                if ("yes" === $settings['paginationDynamicBullets_productscarouselkaveh'] && $settings['paginationType_productscarouselkaveh'] === 'bullets') {
                    $pagination_config["dynamicBullets"] = true;
                    $pagination_config["dynamicMainBullets"] = (int)$settings['paginationDynamicMainBullets_productscarouselkaveh'];
                }
                if ("yes" === $settings['paginationHideOnClick_productscarouselkaveh']) {
                    $pagination_config["hideOnClick"] = true;
                }
                $swiper_config["pagination"] = $pagination_config;
            }
            
            // Add scrollbar if enabled
            if ("yes" === $settings['scrollbar_productscarouselkaveh']) {
                $scrollbar_config = ["el" => ".swiper-scrollbar"];
                if ("yes" === $settings['scrollbarHide_productscarouselkaveh']) {
                    $scrollbar_config["hide"] = true;
                }
                if ("yes" === $settings['scrollbarDraggable_productscarouselkaveh']) {
                    $scrollbar_config["draggable"] = true;
                }
                if ("yes" === $settings['scrollbarSnapOnRelease_productscarouselkaveh'] && "yes" === $settings['scrollbarDraggable_productscarouselkaveh']) {
                    $scrollbar_config["snapOnRelease"] = true;
                }
                $swiper_config["scrollbar"] = $scrollbar_config;
            }
            
            // Add autoplay if enabled
            if ("yes" === $settings['autoplayproductscarouselkaveh']) {
                $swiper_config["autoplay"] = [
                    "delay" => (int)$settings['autoplaydelayproductscarouselkaveh'],
                    "disableOnInteraction" => false
                ];
            }
            
            // Add basic settings
            $swiper_config["loop"] = ("yes" === $settings['loopproductscarouselkaveh']);
            $swiper_config["speed"] = (int)$settings['speedproductscarouselkaveh'];
            $swiper_config["effect"] = $settings['effectproductscarouselkaveh'];
            $swiper_config["centeredSlides"] = ("yes" === $settings['centeredSlidesproductscarouselkaveh']);
            $swiper_config["freeMode"] = ("yes" === $settings['freeMode_productscarouselkaveh']);
            $swiper_config["grabCursor"] = ("yes" === $settings['grabCursorproductscarouselkaveh']);
            
            // Add conditional settings
            if ("yes" === $settings['mousewheel_productscarouselkaveh']) {
                $swiper_config["mousewheel"] = true;
            }
            if ("yes" === $settings['keyboard_productscarouselkaveh']) {
                $swiper_config["keyboard"] = ["enabled" => true];
            }
            
            // Add touch settings
            $swiper_config["simulateTouch"] = ("yes" === $settings['simulateTouch_productscarouselkaveh']);
            $swiper_config["allowTouchMove"] = ("yes" === $settings['allowTouchMove_productscarouselkaveh']);
            $swiper_config["resistanceRatio"] = (float)$settings['resistanceRatio_productscarouselkaveh']['size'];
            $swiper_config["threshold"] = (int)$settings['threshold_productscarouselkaveh'];
            $swiper_config["followFinger"] = ("yes" === $settings['followFinger_productscarouselkaveh']);
            $swiper_config["shortSwipes"] = ("yes" === $settings['shortSwipes_productscarouselkaveh']);
            $swiper_config["longSwipes"] = ("yes" === $settings['longSwipes_productscarouselkaveh']);
            
            if ("yes" === $settings['longSwipes_productscarouselkaveh']) {
                $swiper_config["longSwipesRatio"] = (float)$settings['longSwipesRatio_productscarouselkaveh']['size'];
                $swiper_config["longSwipesMs"] = (int)$settings['longSwipesMs_productscarouselkaveh'];
            }
            
            // Add performance settings
            $swiper_config["watchSlidesProgress"] = ("yes" === $settings['watchSlidesProgress_productscarouselkaveh']);
            $swiper_config["watchSlidesVisibility"] = ("yes" === $settings['watchSlidesVisibility_productscarouselkaveh']);
            $swiper_config["preloadImages"] = ("yes" === $settings['preloadImages_productscarouselkaveh']);
            $swiper_config["updateOnImagesReady"] = ("yes" === $settings['updateOnImagesReady_productscarouselkaveh'] && "yes" === $settings['preloadImages_productscarouselkaveh']);
            
            // Add lazy loading if enabled
            if ("yes" === $settings['lazy_productscarouselkaveh']) {
                $lazy_config = ["loadPrevNext" => ("yes" === $settings['lazyLoadingInPrevNext_productscarouselkaveh'])];
                if ("yes" === $settings['lazyLoadingInPrevNext_productscarouselkaveh']) {
                    $lazy_config["loadPrevNextAmount"] = (int)$settings['lazyLoadingInPrevNextAmount_productscarouselkaveh'];
                }
                $swiper_config["lazy"] = $lazy_config;
            }
            
            // Add breakpoints
            $swiper_config["breakpoints"] = [
                "320" => ["slidesPerView" => (int)$settings['productcolumn3productscarouselkaveh'], "spaceBetween" => 4],
                "500" => ["slidesPerView" => (int)$settings['productcolumn3productscarouselkaveh'], "spaceBetween" => 14],
                "768" => ["slidesPerView" => (int)$settings['productcolumn2productscarouselkaveh'], "spaceBetween" => 14],
                "992" => ["slidesPerView" => (int)$settings['productcolumnproductscarouselkaveh'], "spaceBetween" => 20],
                "1200" => ["slidesPerView" => (int)$settings['productcolumnproductscarouselkaveh'], "spaceBetween" => 31]
            ];
            
            echo esc_attr(json_encode($swiper_config, JSON_UNESCAPED_SLASHES));
            ?>'>
                <div class="swiper-wrapper">
                <?php
// Build query arguments
    $args = [
        'post_type' => $settings['post_type_productscarouselkaveh'],
        'posts_per_page' => $settings['posts_per_page_productscarouselkaveh'],
        'orderby' => $settings['psortproductscarouselkaveh'],
        'order' => $settings['psortiproductscarouselkaveh']
    ];

    // Handle WooCommerce specific options
    if ($settings['post_type_productscarouselkaveh'] === 'product') {
        // 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_productscarouselkaveh'] === '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_productscarouselkaveh']) && !empty($settings['product_attribute_terms_productscarouselkaveh'])) {
            $tax_query = [];
            foreach ($settings['product_attributes_productscarouselkaveh'] as $attribute) {
                $tax_query[] = [
                    'taxonomy' => 'pa_' . $attribute,
                    'field' => 'term_id',
                    'terms' => $settings['product_attribute_terms_productscarouselkaveh']
                ];
            }
            if (!empty($tax_query)) {
                $args['tax_query'][] = [
                    'relation' => 'AND',
                    $tax_query
                ];
            }
        }
    }

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

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

    // Handle date query
    if ($settings['date_query_productscarouselkaveh'] !== 'none') {
        $date_query = [];
        switch ($settings['date_query_productscarouselkaveh']) {
            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_productscarouselkaveh'])) {
        $excluded_ids = array_map('trim', explode(',', $settings['exclude_posts_productscarouselkaveh']));
        $args['post__not_in'] = array_map('intval', $excluded_ids);
    }

    // Handle custom query parameters
    if (!empty($settings['custom_query_productscarouselkaveh'])) {
        $custom_args = json_decode($settings['custom_query_productscarouselkaveh'], 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()) :
                        while ($query->have_posts()) : $query->the_post();
                    ?>
                      <div class="swiper-slide h-auto">
                        <?php $styleproduct2 = $settings['stylecartproductscarouselkaveh']; ?>
                        <?php get_template_part("template-part/product-cart-$styleproduct2"); ?>
                      </div>
                      <?php 
                        endwhile;
                        wp_reset_postdata();
                    endif;
                    ?>
     
                </div>
                <?php if ("yes" === $settings['moreproductscarouselkaveh']) { ?>
                  <?php if ('nine' == $settings['styleheadingproductscarouselkaveh']) { ?>
                    <div class="swiper-button-next w-auto h-auto"></div>
                    <div class="swiper-button-prev w-auto h-auto"></div>
                  <?php } elseif ('seven' !== $settings['styleheadingproductscarouselkaveh']) { ?>
                    <div class="swiper-button-next"></div>
                    <div class="swiper-button-prev"></div>
                  <?php }
                }
                ?>
              </div>
              <!-- End Products -->
          </section>
          <style>
            <?php echo '.elementor-element-' . $clsid . ''; ?>
            .top-sellers-two .swiper::before {
              content: "";
              right: 0;
              bottom: 190px;
              left: 0;
              width: 80%;
              -webkit-border-radius: 50px;
              -moz-border-radius: 50px;
              border-radius: 50px;
              background-color: #ee273a;
              height: 50px;
              margin: 0 auto;
            }

            .best-selling-fiveteen .section-heading .detail::before {
              -webkit-background-size: 100% 100% !important;
              -moz-background-size: 100% 100% !important;
              -o-background-size: 100% 100% !important;
              background-size: 100% 100% !important;
            }

            .new-products-fourteen .section-heading .detail::after {
              -webkit-background-size: 100% 100% !important;
              -moz-background-size: 100% 100% !important;
              -o-background-size: 100% 100% !important;
              background-size: 100% 100% !important;
            }
          </style>
        </div>
      </div>
    <?php endif; ?>
  <?php
  }


}
