<?php

use Elementor\Widget_Base;
use Elementor\Controls_Manager;

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


class Productsdigistylecarouselkaveh extends Widget_Base{

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

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

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

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

  protected function register_controls(){
    
    $this->start_controls_section(
        'contentproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Element Title', 'kavehTheme' ),
                  'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
        ]
      );
      $this->add_control(
        'bottomimgproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Image', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::MEDIA,
          'default' => [
            'url' => \Elementor\Utils::get_placeholder_image_src(),
          ],
        ]
        );
    $this->add_control(
      'buttonti2productsdigistylecarouselkaveh',
      [
          'label' => esc_html__( 'Button Title', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::TEXT,
          'default' => esc_html__( 'View All', 'kavehTheme' ),
  
      ]
  );
  $this->add_control(
    'buttontilink2productsdigistylecarouselkaveh',
    [
        'label' => esc_html__( 'Button Link', 'kavehTheme' ),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => esc_html__( '#', 'kavehTheme' ),

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

      $this->start_controls_section(
        'content4productsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Product Settings', 'kavehTheme' ),
                  'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
        ]
      );
      $this->add_control(
        'offimgproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Discounted Products Image', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::MEDIA,
        ]
        );
      $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',
        ]
      );
  $this->add_control(
    'pproductsdigistylecarouselkaveh',
    [
      'label' => esc_html__( 'Show Products', 'kavehTheme' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'default' => 'all',
				'options' => [
					'all'  => esc_html__( 'All', 'kavehTheme' ),
					'cat'  => esc_html__( 'Category', 'kavehTheme' ),

      ],
    ]
    );
    $this->add_control(
      'psortproductsdigistylecarouselkaveh',
      [
        'label' => esc_html__( 'Sort Products By', 'kavehTheme' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'default' => 'date',
				'options' => [
					'date'  => esc_html__( 'Date', 'kavehTheme' ),
					'_price'  => esc_html__( 'Price', 'kavehTheme' ),
					'_wc_average_rating'  => esc_html__( 'Most Popular', 'kavehTheme' ),
					'total_sales'  => esc_html__( 'Sales Amount', 'kavehTheme' ),
  
        ],
      ]
      );
      $this->add_control(
        'psortiproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Sort Type', 'kavehTheme' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'default' => 'desc',
				'options' => [
					'asc'  => esc_html__( 'Ascending', 'kavehTheme' ),
					'desc'  => esc_html__( 'Descending', 'kavehTheme' ),
          ],
        ]
        );
  $options5 = array();
$orderby = 'name';
$order = 'asc';
$hide_empty = false ;
$cat_args = array(
    'orderby'    => $orderby,
    'order'      => $order,
    'hide_empty' => $hide_empty,
);

$product_categories = get_terms( 'product_cat', $cat_args );

foreach ( $product_categories as $key => $category ) {
    $options5[$category->term_id] = $category->name;
}
$this->add_control(
    'catproductsdigistylecarouselkaveh',
    [
      'label' => esc_html__( 'Select Category', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SELECT2, 
      'multiple' => true,
      'options' => $options5,
      'condition' => [
        'pproductsdigistylecarouselkaveh' => 'cat',
      ],
    ]
);
$this->end_controls_section();   
$this->start_controls_section(
  'content5productsdigistylecarouselkaveh',
  [
    'label' => esc_html__( 'Carousel Settings', 'kavehTheme' ),
    'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
  ]
);
$this->add_control(
  'showarrowsproductsdigistylecarouselkaveh',
  [
    'label' => esc_html__( 'Show Arrows?', 'kavehTheme' ),
		'type' => \Elementor\Controls_Manager::SWITCHER,
		'yes' => esc_html__( 'Yes', 'kavehTheme' ),
		'no' => esc_html__( 'No', 'kavehTheme' ),
    'return_value' => 'yes',
    'default' => 'yes',
  ]
);
$this->add_control(
  'productnumberproductsdigistylecarouselkaveh',
  [
    'label' => esc_html__( 'Number of Products Displayed', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::NUMBER,
    'min' => 0,
    'max' => 50,
    'step' => 1,
    'default' => 5,
  ]
);
$this->add_control(
  'productcolumnproductsdigistylecarouselkaveh',
  [
    'label' => esc_html__( 'Number of Product Columns on Desktop', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::NUMBER,
    'min' => 0,
    'max' => 5,
    'step' => 1,
    'default' => 4,
  ]
);
$this->add_control(
  'productcolumn2productsdigistylecarouselkaveh',
  [
    'label' => esc_html__( 'Number of Product Columns on Tablet', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::NUMBER,
    'min' => 0,
    'max' => 5,
    'step' => 1,
    'default' => 3,
  ]
);
$this->add_control(
  'productcolumn3productsdigistylecarouselkaveh',
  [
    'label' => esc_html__( 'Number of Product Columns on Mobile', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::NUMBER,
    'min' => 0,
    'max' => 5,
    'step' => 1,
    'default' => 1,
  ]
);
// Autoplay settings
$this->add_control(
  'autoplayproductsdigistylecarouselkaveh',
  [
    'label' => esc_html__( 'Enable 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(
  'autoplaydelayproductsdigistylecarouselkaveh',
  [
    'label' => esc_html__( 'Autoplay Delay (milliseconds)', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::NUMBER,
    'min' => 1000,
    'max' => 10000,
    'step' => 500,
    'default' => 3000,
    'condition' => [
      'autoplayproductsdigistylecarouselkaveh' => 'yes',
    ],
  ]
);
$this->add_control(
  'pauseonhoverproductsdigistylecarouselkaveh',
  [
    'label' => esc_html__( 'Pause on Hover', 'kavehTheme' ),
		'type' => \Elementor\Controls_Manager::SWITCHER,
		'yes' => esc_html__( 'Yes', 'kavehTheme' ),
		'no' => esc_html__( 'No', 'kavehTheme' ),
    'return_value' => 'yes',
    'default' => 'yes',
    'condition' => [
      'autoplayproductsdigistylecarouselkaveh' => 'yes',
    ],
  ]
);
// Loop settings
$this->add_control(
  'loopproductsdigistylecarouselkaveh',
  [
    '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',
  ]
);
// Speed settings
$this->add_control(
  'speedproductsdigistylecarouselkaveh',
  [
    'label' => esc_html__( 'Transition Speed (milliseconds)', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::NUMBER,
    'min' => 300,
    'max' => 3000,
    'step' => 100,
    'default' => 300,
  ]
);
// Centered slides
$this->add_control(
  'centeredslidesproductsdigistylecarouselkaveh',
  [
    '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',
  ]
);
// Free mode
$this->add_control(
  'freemodeproductsdigistylecarouselkaveh',
  [
    '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',
    'description' => esc_html__( 'Slides move freely', 'kavehTheme' ),
  ]
);
// Effect
$this->add_control(
  'effectproductsdigistylecarouselkaveh',
  [
    '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' ),
    ],
  ]
);
// Show arrows
$this->add_control(
  'showarrowproductsdigistylecarouselkaveh',
  [
    'label' => esc_html__( 'Show Arrows?', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::SWITCHER,
    'yes' => esc_html__( 'Yes', 'kavehTheme' ),
    'no' => esc_html__( 'No', 'kavehTheme' ),
    'return_value' => 'yes',
    'default' => 'no',
  ]
);
// Pagination dots
$this->add_control(
  'showdotsproductsdigistylecarouselkaveh',
  [
    'label' => esc_html__( 'Show Pagination Dots', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::SWITCHER,
    'yes' => esc_html__( 'Yes', 'kavehTheme' ),
    'no' => esc_html__( 'No', 'kavehTheme' ),
    'return_value' => 'yes',
    'default' => 'no',
  ]
);
$this->end_controls_section();
      $this->start_controls_section(
        'styleb_productsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Button Styles', 'kavehTheme' ),
          'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        ]
      );
      $this->add_group_control(
        \Elementor\Group_Control_Typography::get_type(),
        [
          'name' => 'button_productsdigistylecarouselkaveh',
          'label' => esc_html__( 'Button Text Typography', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .digi-amazing .btn-more, .top-selling-products-digi .btn-more',
        ]
      );
      $this->add_group_control(
        \Elementor\Group_Control_Text_Shadow::get_type(),
        [
          'name' => 'text_shadowproductsdigistylecarouselkaveh',
          'label' => esc_html__( 'Text Shadow', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .digi-amazing .btn-more, .top-selling-products-digi .btn-more',
        ]
      );
      $this->start_controls_tabs(
        'style_tabsproductsdigistylecarouselkaveh'
      );
    
      $this->start_controls_tab(
        'style_normal_tabproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Normal', 'kavehTheme' ),
        ]
      );
      $this->add_control(
        'textbuttoncolorproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Button Text Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .digi-amazing .btn-more, .top-selling-products-digi .btn-more' => 'color: {{VALUE}}',
          ],
        ]
      ); 
      $this->add_control(
        'buttoncolorproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Button Background Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .digi-amazing .btn-more, .top-selling-products-digi .btn-more' => 'background-color: {{VALUE}}',
          ],
        ]
      ); 
      $this->add_control(
        'buttonradiusproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Button Border Radius', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::DIMENSIONS,
          'size_units' => [ 'px' ],
          'selectors' => [
            '{{WRAPPER}} .digi-amazing .btn-more, .top-selling-products-digi .btn-more' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
          ],
        ]
      );
      $this->add_group_control(
        \Elementor\Group_Control_Border::get_type(),
        [
          'name' => 'borderproductsdigistylecarouselkaveh',
          'label' => esc_html__( 'Border', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .digi-amazing .btn-more, .top-selling-products-digi .btn-more',
        ]
      );
      $this->add_control(
        'buttonbordersproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Border Width', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::DIMENSIONS,
          'size_units' => [ 'px' ],
          'condition' => [
            'borderproductsdigistylecarouselkaveh!' => '',
          ],
          'selectors' => [
            '{{WRAPPER}} .digi-amazing .btn-more, .top-selling-products-digi .btn-more' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
          ],
        ]
      );
      $this->end_controls_tab();
      $this->start_controls_tab(
        'style_hove_tabproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Hover', 'kavehTheme' ),
        ]
      );
      $this->add_control(
        'textbuttoncolorhoverproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Button Text Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .digi-amazing .btn-more, .top-selling-products-digi .btn-more:hover' => 'color: {{VALUE}}',
          ],
        ]
      ); 
      $this->add_control(
        'buttoncolorhoverproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Button Background Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .digi-amazing .btn-more, .top-selling-products-digi .btn-more:hover' => 'background-color: {{VALUE}}',
          ],
        ]
      ); 
      $this->add_control(
        'buttonradiushoverproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Button Border Radius', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::DIMENSIONS,
          'size_units' => [ 'px' ],
          'selectors' => [
            '{{WRAPPER}} .digi-amazing .btn-more, .top-selling-products-digi .btn-more:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
          ],
        ]
      );
      $this->add_group_control(
        \Elementor\Group_Control_Border::get_type(),
        [
          'name' => 'borderhoverproductsdigistylecarouselkaveh',
          'label' => esc_html__( 'Border', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .digi-amazing .btn-more, .top-selling-products-digi .btn-more:hover',
        ]
      );
      $this->add_control(
        'buttonbordershoverproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Border Width', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::DIMENSIONS,
          'size_units' => [ 'px' ],
          'condition' => [
            'borderhoverproductsdigistylecarouselkaveh!' => '',
          ],
          'selectors' => [
            '{{WRAPPER}} .digi-amazing .btn-more, .top-selling-products-digi .btn-more: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_shadowproductsdigistylecarouselkaveh',
          'label' => esc_html__( 'Button Shadow', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .digi-amazing .btn-more, .top-selling-products-digi .btn-more',
        ]
      );
      $this->add_control(
        'hr2productsdigistylecarouselkaveh',
        [
          'type' => \Elementor\Controls_Manager::DIVIDER,
        ]
      );
      $this->add_control(
        'buttonpaddingproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Padding', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::DIMENSIONS,
          'size_units' => [ 'px' ],
          'selectors' => [
            '{{WRAPPER}} .digi-amazing .btn-more, .top-selling-products-digi .btn-more' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
          ],
        ]
      );
      $this->end_controls_section();
      $this->start_controls_section(
        'style3_productsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Image Styles', 'kavehTheme' ),
          'tab' => \Elementor\Controls_Manager::TAB_STYLE,
          'condition' => [
            'showticol1productsdigistylecarouselkaveh' => 'yes',
          ],
        ]
      );
      $this->add_control(
        'imagewidth3productsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Image Width', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SLIDER,
          'size_units' => [ 'px' ],
          'range' => [
            'px' => [
              'min' => 0,
              'max' => 500,
              'step' => 5,
            ],

          ],
          'selectors' => [
            '{{WRAPPER}} .digi-amazing-right img' => 'width: {{SIZE}}{{UNIT}};',

          ],
        ]
      );
      $this->add_control(
        'imageheight3amazingoffersecondstkaveh',
        [
          'label' => esc_html__( 'Image Height', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SLIDER,
          'size_units' => [ 'px' ],
          'range' => [
            'px' => [
              'min' => 0,
              'max' => 500,
              'step' => 5,
            ],
          ],
          'selectors' => [
            '{{WRAPPER}} .digi-amazing-right img' => 'height: {{SIZE}}{{UNIT}};',
          ],
        ]
      );
      
      $this->end_controls_section();
      $this->start_controls_section(
        'style5_productsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Carousel Arrow Styles', 'kavehTheme' ),
          'tab' => \Elementor\Controls_Manager::TAB_STYLE,
          'condition' => [
            'showarrowsproductsdigistylecarouselkaveh' => 'yes',

          ],
        ]
      );
      $this->start_controls_tabs(
        'style_tabsarrowproductsdigistylecarouselkaveh'
      );
    
      $this->start_controls_tab(
        'style_normal_tabarrowproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Normal', 'kavehTheme' ),
        ]
      );
      $this->add_control(
        'textbutton1colorarrowproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Icon Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .digi-amazing-left .swiper-button-next::after' => 'color: {{VALUE}}',
            '{{WRAPPER}} .digi-amazing-left .swiper-button-prev::after' => 'color: {{VALUE}}',

          ],
        ]
      ); 
      $this->add_control(
        'buttoncolorarrowproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Background Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .digi-amazing-left .swiper-button-next' => 'background-color: {{VALUE}}',
            '{{WRAPPER}} .digi-amazing-left .swiper-button-prev' => 'background-color: {{VALUE}}',
          ],
        ]
      ); 

      $this->end_controls_tab();
      $this->start_controls_tab(
        'style_hove_tabarrowproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Hover', 'kavehTheme' ),
        ]
      );
      $this->add_control(
        'textbutton1hovercolorarrowproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Icon Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .digi-amazing-left .swiper-button-next:hover::after' => 'color: {{VALUE}}',
            '{{WRAPPER}} .digi-amazing-left .swiper-button-prev:hover::after' => 'color: {{VALUE}}',          ],
        ]
      ); 
      $this->add_control(
        'buttoncolorhoverarrowproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Background Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .digi-amazing-left .swiper-button-next:hover' => 'background-color: {{VALUE}}',
            '{{WRAPPER}} .digi-amazing-left .swiper-button-prev:hover' => 'background-color: {{VALUE}}',

          ],
        ]
      ); 
      $this->end_controls_tab();
      $this->end_controls_tabs();
      $this->end_controls_section();
      $this->start_controls_section(
        'stylebox_productsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Background Styles', 'kavehTheme' ),
          'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        ]
      );
      $this->add_control(
        'boxbgnproductsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Background Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .digi-amazing' => 'background-color: {{VALUE}}',

          ],
        ]
      ); 
      $this->end_controls_section();
      $this->start_controls_section(
        'stylebox_2productsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Product Box Styles', 'kavehTheme' ),
          'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        ]
      );
      $this->add_control(
        'boxbghov2productsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Product Image Background Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .product-fifteen .image' => 'background-color: {{VALUE}}',
          ],
        ]
      ); 
      $this->add_control(
        'boxradi2productsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Product Image Background Border Radius', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::DIMENSIONS,
          'size_units' => [ 'px' ],
          'selectors' => [
            '{{WRAPPER}} .product-fifteen .image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
          ],
        ]
      );
      $this->add_control(
        'imageofferwidth3productsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Discounted Product Image Width', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SLIDER,
          'size_units' => [ 'px' ],
          'range' => [
            'px' => [
              'min' => 0,
              'max' => 500,
              'step' => 5,
            ],

          ],
          'selectors' => [
            '{{WRAPPER}} .off-timear img' => 'width: {{SIZE}}{{UNIT}};',

          ],
        ]
      );
      $this->add_control(
        'imageofferheight3amazingoffersecondstkaveh',
        [
          'label' => esc_html__( 'Discounted Product Image Height', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SLIDER,
          'size_units' => [ 'px' ],
          'range' => [
            'px' => [
              'min' => 0,
              'max' => 500,
              'step' => 5,
            ],
          ],
          'selectors' => [
            '{{WRAPPER}} .off-timear img' => 'height: {{SIZE}}{{UNIT}};',
          ],
        ]
      );
      $this->add_control(
        'boxpercentage2productsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Discount Percentage Background Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .product-fifteen .image .offer' => 'background-color: {{VALUE}}',

          ],
        ]
      ); 
      $this->add_control(
        'boxbgpercentage2productsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Discount Percentage Text Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .product-fifteen .image .offer' => 'color: {{VALUE}} !important',

          ],
        ]
      ); 
      $this->add_control(
        'timercl2productsdigistylecarouselkaveh',
        [
          'label' => esc_html__( 'Timer Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .product-fifteen .timear' => 'color: {{VALUE}}',

          ],
        ]
      ); 
      $this->end_controls_section();

        }
 

  protected function render(){
    $settings = $this->get_settings_for_display();
    $clsid = $this->get_id();
    // Build swiper settings array
    $swiper_settings = array(
      'watchSlidesProgress' => true,
      'breakpoints' => array(
        320 => array(
          'slidesPerView' => (int) $settings['productcolumn3productsdigistylecarouselkaveh'],
          'spaceBetween' => 12
        ),
        576 => array(
          'slidesPerView' => (int) $settings['productcolumn3productsdigistylecarouselkaveh'],
          'spaceBetween' => 12
        ),
        768 => array(
          'slidesPerView' => (int) $settings['productcolumn2productsdigistylecarouselkaveh'],
          'spaceBetween' => 12
        ),
        992 => array(
          'slidesPerView' => (int) $settings['productcolumnproductsdigistylecarouselkaveh'],
          'spaceBetween' => 16
        ),
        1200 => array(
          'slidesPerView' => (int) $settings['productcolumnproductsdigistylecarouselkaveh'],
          'spaceBetween' => 24
        )
      )
    );
    // Add navigation if arrows are enabled
    if (isset($settings['showarrowproductsdigistylecarouselkaveh']) && $settings['showarrowproductsdigistylecarouselkaveh'] === 'yes') {
      $swiper_settings['navigation'] = array(
        'nextEl' => '.swiper-button-next',
        'prevEl' => '.swiper-button-prev'
      );
    }
    // Add optional settings only if they exist and are not default
    if (isset($settings['loopproductsdigistylecarouselkaveh']) && $settings['loopproductsdigistylecarouselkaveh'] === 'yes') {
      $swiper_settings['loop'] = true;
    }
    if (isset($settings['speedproductsdigistylecarouselkaveh']) && !empty($settings['speedproductsdigistylecarouselkaveh'])) {
      $swiper_settings['speed'] = (int) $settings['speedproductsdigistylecarouselkaveh'];
    }
    if (isset($settings['centeredslidesproductsdigistylecarouselkaveh']) && $settings['centeredslidesproductsdigistylecarouselkaveh'] === 'yes') {
      $swiper_settings['centeredSlides'] = true;
    }
    if (isset($settings['freemodeproductsdigistylecarouselkaveh']) && $settings['freemodeproductsdigistylecarouselkaveh'] === 'yes') {
      $swiper_settings['freeMode'] = true;
    }
    if (isset($settings['effectproductsdigistylecarouselkaveh']) && $settings['effectproductsdigistylecarouselkaveh'] !== 'slide') {
      $swiper_settings['effect'] = $settings['effectproductsdigistylecarouselkaveh'];
    }
    // Add autoplay if enabled
    if (isset($settings['autoplayproductsdigistylecarouselkaveh']) && $settings['autoplayproductsdigistylecarouselkaveh'] === 'yes') {
      $autoplay_settings = array(
        'delay' => isset($settings['autoplaydelayproductsdigistylecarouselkaveh']) ? (int) $settings['autoplaydelayproductsdigistylecarouselkaveh'] : 3000,
        'disableOnInteraction' => false
      );
      if (isset($settings['pauseonhoverproductsdigistylecarouselkaveh']) && $settings['pauseonhoverproductsdigistylecarouselkaveh'] === 'yes') {
        $autoplay_settings['pauseOnMouseEnter'] = true;
      }
      $swiper_settings['autoplay'] = $autoplay_settings;
    }
    // Add pagination if enabled
    if (isset($settings['showdotsproductsdigistylecarouselkaveh']) && $settings['showdotsproductsdigistylecarouselkaveh'] === 'yes') {
      $swiper_settings['pagination'] = array(
        'el' => '.swiper-pagination',
        'type' => 'bullets',
        'clickable' => true
      );
    }
    // Properly encode and escape JSON
    $swiper_json = wp_json_encode($swiper_settings, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
    ?>
    <section class="digi-amazing">
    <div class="container-fluid d-flex pe-0 flex-column flex-md-row">
    <?php if("yes"===$settings['showticol1productsdigistylecarouselkaveh']){?>
      <!-- Start Title -->
      <div class="digi-amazing-right w-100 d-flex flex-column align-items-center align-items-md-end mb-5 mb-md-0">
        <img src="<?php echo esc_url($settings['bottomimgproductsdigistylecarouselkaveh']['url']); ?>" alt="" width="125" height="78">
        <a href="<?php echo  esc_url($settings['buttontilink2productsdigistylecarouselkaveh']); ?>" class="btn btn-danger-4 btn-more rounded-0 d-none d-md-block"> <?php echo  esc_html($settings['buttonti2productsdigistylecarouselkaveh']); ?></a>
      </div>
      <!-- End Title -->
      <?php } ?>
      <!-- Start Products -->
      <div class="digi-amazing-left w-100">
        <!-- Start Carousel -->
        <div class="swiper swiper-digi-amazing position-relative overflow-hidden" data-swiper='{"navigation":{"nextEl":".swiper-button-next","prevEl":".swiper-button-prev"},"breakpoints":{"320":{"slidesPerView":<?php echo esc_html($settings['productcolumn3productsdigistylecarouselkaveh']); ?>,"spaceBetween":12,"slidesPerGroup":1,"centeredSlides":true},"576":{"slidesPerView":<?php echo esc_html($settings['productcolumn3productsdigistylecarouselkaveh']); ?>,"spaceBetween":12,"slidesPerGroup":2,"centeredSlides":false},"768":{"slidesPerView":<?php echo esc_html($settings['productcolumn2productsdigistylecarouselkaveh']); ?>,"spaceBetween":12,"slidesPerGroup":2},"992":{"slidesPerView":<?php echo esc_html($settings['productcolumn2productsdigistylecarouselkaveh']); ?>,"spaceBetween":16,"slidesPerGroup":3},"1200":{"slidesPerView":<?php echo esc_html($settings['productcolumnproductsdigistylecarouselkaveh']); ?>,"spaceBetween":20,"slidesPerGroup":4},"1400":{"slidesPerView":<?php echo esc_html($settings['productcolumnproductsdigistylecarouselkaveh']); ?>,"spaceBetween":24,"slidesPerGroup":4}}}'>
          <div class="swiper-wrapper">
          <?php if('cat'===$settings['pproductsdigistylecarouselkaveh']){ ?>
              <?php 
                  
                  // WP_Query args
                  $q_pc2_query_args = array(
                    'post_type' => array('product'),
'post_status' => array('publish'),
                    'posts_per_page' => $settings['productnumberproductsdigistylecarouselkaveh'],
                    'order' => 'DESC',
                    'orderby' => 'date',
                    'tax_query' => array(
                      array(
                        "taxonomy" => "product_cat",
                        "field"    => "tag_ID",
                        "terms"    => $settings['catproductsdigistylecarouselkaveh'],
                      ),
                    ),
                     
                    
                  );
                  if ("yes" === $settings['kaveh_exclude_out_of_stock']) {
                    $q_pc2_query_args['meta_query'] = array(
                        array(
                            'key' => '_stock_status',
                            'value' => 'outofstock',
                            'compare' => 'NOT IN',
                        ),
                    );
                  }

                  // The Query
                  $pc2_query = new \WP_Query($q_pc2_query_args);
                  
                  // The Loop
                  if ( $pc2_query->have_posts() ) {
                    while ( $pc2_query->have_posts() ) {
                      $pc2_query->the_post(); ?>
                    <?php 
                    global $product;
                    $product = wc_get_product();
                    $product_id = $product->get_id();
                    $product_type = $product->get_type();
                    $sale_price_dates_from = $sale_price_dates_to = '';
                    $sale_price = $product->get_sale_price();
                    $normal_price = $product->get_regular_price();
                    $pr_id = get_the_ID();
                    $stocka = $product->get_stock_status();
                    ?>
                <!-- Start Slide -->
                <div class="swiper-slide h-auto">
                  <div class="product-fifteen bg-white h-100">
                    <div class="off-timear d-flex align-items-center justify-content-between">
                    <?php if (!empty($settings['offimgproductsdigistylecarouselkaveh']['url'])) {
                              if (!empty($sale_price)) { ?>
                      <img src="<?php echo esc_url($settings['offimgproductsdigistylecarouselkaveh']['url']); ?>" alt="image" width="130" height="16">
                      <?php   }
                          }
                        if ($date_from = get_post_meta($product_id, '_sale_price_dates_from', true)) {
                          $sale_price_dates_from = date('Y-m-d 00:00:00', $date_from);
                        }
                        if ($date_to = get_post_meta($product_id, '_sale_price_dates_to', true)) {
                          $sale_price_dates_to = date('Y-m-d 23:59:59', $date_to);
                        }
                        $deal_start_date = $sale_price_dates_from;
                        $deal_start_time = strtotime($deal_start_date);
                        $deal_end_date = $sale_price_dates_to;
                        $deal_end_time = strtotime($deal_end_date, current_time('timestamp'));
                        //$current_date = current_time( 'Y-m-d H:i:s', true );
                        $current_time = strtotime('NOW', current_time('timestamp'));
                        $time_diff = ($deal_end_time - $current_time); ?>
                        <div class="cs-height_10 cs-height_lg_10"></div>
                        <?php if ("instock" == $stocka) { ?>
                          <?php if (!empty($deal_end_date)) { ?>
                      <ul class="timear d-flex align-items-center" data-time="<?php echo $deal_end_date; ?>">
                        <li class="second">00</li>:
                        <li class="minute">00</li>:
                        <li class="hour">00</li>:
                        <li class="day">00</li>
                      </ul>
                      <?php } else {
                                }
                              } ?>
                    </div>
                    <div class="image position-relative d-flex align-items-center justify-content-center overflow-hidden">
                        <?php
                              $categories = wp_get_post_terms( $product->get_id(), 'product_cat' );
                              foreach ($categories as $category) {
                              $category_link = get_term_link( $category );
                              $category_name = $category->name;
                              
                              echo '<a href="' . esc_url( $category_link ) . '" class="category position-absolute top-0 start-0 bg-white d-flex align-items-center justify-content-center">';
                              echo  esc_html( $category_name );
                              echo '</a>';
                              }
                              ?>
                      <a href="<?php the_permalink(); ?>">
                        <img src="<?php the_post_thumbnail_url('full'); ?>" alt="<?php the_title(); ?>" width="290" height="290">
                      </a>
                      <?php if (!empty($normal_price)) {
                            if ("instock" == $stocka) {
                              if (!empty($sale_price)) { ?>
                      <span
                        class="offer position-absolute bottom-0 end-0 text-white d-flex align-items-center justify-content-center">
                        <?php if (class_exists('kavehWoo')) { $offer_percentage = kavehWoo::showofferpercentage($product); echo $offer_percentage; } ?> </span>
                      <?php }
                         } 
                     }
                      $terms = get_the_terms( $pr_id , 'pa_size' );
                      // Loop through the terms
                      if(!empty($terms)){ ?>
                      <ul class="sizes d-flex align-items-center position-absolute bottom-0 end-0 w-100 bg-white">
                      <?php
                      foreach ( $terms as $term ) {
                      $tooltip = get_term_meta( $term->term_id, 'wpcvs_tooltip', true ) ?: $term->name;
                      ?>
                      <li>
                        <a href="<?php the_permalink(); ?>" class="d-block"> <?php echo esc_attr( $tooltip ) ?> </a>
                      </li>
                      <?php
                      }
                      ?>
                    </ul>
                    <?php }else{ ?>
                      <style>
                      .product-fifteen:hover .image .offer {
                        -webkit-transform: translateY(0);
                        -moz-transform: translateY(0);
                        -ms-transform: translateY(0);
                        -o-transform: translateY(0);
                        transform: translateY(0);
                    }
                    </style>
                  <?php  } ?>
                    </div>
                    <div class="d-flex align-items-center justify-content-between">
                      <h2 class="title mb-0">
                        <a href="<?php the_permalink(); ?>"> <?php the_title(); ?> </a>
                      </h2>
                    </div>
                    
                    <div class="price d-flex align-items-center justify-content-end">
                      <?php if("instock"==$stocka){ 
                          if ( !$product->is_type( 'variable' ) ) { 
                              if(empty($sale_price) && empty($normal_price)) { 
                                  $price_v = $product->get_price_html(); ?>
                                  <?php
                                  echo str_replace("&ndash;","<span class=\"dashvar\"> – </span>", $price_v); ?>
                                  <?php
                                  ?>
                                  <?php }else{ ?>
                                  <?php if(!empty($sale_price) ) { ?>
                                  
                                  <del class="me-2">
                                  <?php if (!empty($normal_price)) {
                                  echo number_format($normal_price, 0, '.', ',');
                                  } ?>
                                  </del>
                                  <?php echo number_format($sale_price, 0, '.', ','); ?>
                                  <span class="currency-fifteen">
                                  <?php echo get_woocommerce_currency_symbol(); ?>
                                  </span>
                                  <?php }else{ ?>
                                  <?php if (!empty($normal_price)) { ?>
                                  <?php
                                  echo number_format($normal_price, 0, '.', ',');
                                  } ?>
                                  <span class="currency-fifteen">
                                  <?php echo get_woocommerce_currency_symbol(); ?>
                                  </span>
                                  <?php } ?>
                                  <?php } }else{ 
                                  $price_v = $product->get_price_html(); ?>
                                  <?php
                                  echo str_replace("&ndash;","<span class=\"dashvar\"> – </span>", $price_v); ?>
                                  <?php
                                  } 
                                  }else{ ?>
                                    <span class="outstock">
                                    Out of Stock 
                                    </span>
                                  <?php
                                  }
                                  ?>
                    </div>
                  </div>
                </div>
                <!-- End Slide -->
            <?php
                // Reset Original Post Data
                  wp_reset_postdata();
                }
              }
                  
                  ?>
              <?php }elseif('all'===$settings['pproductsdigistylecarouselkaveh']){
                // WP_Query args
            $ordvalue = $settings['psortproductsdigistylecarouselkaveh'];
            $ordi = $settings['psortiproductsdigistylecarouselkaveh'];
            $q_pc2_query_args = array(
              'post_type' => array('product'),
'post_status' => array('publish'),
              'posts_per_page' => $settings['productnumberproductsdigistylecarouselkaveh'],
              'order' => $ordi,
              'orderby' => 'meta_value_num',
              'meta_key'       => $ordvalue,

             
            );
            if ("yes" === $settings['kaveh_exclude_out_of_stock']) {
              $q_pc2_query_args['meta_query'] = array(
                  array(
                      'key' => '_stock_status',
                      'value' => 'outofstock',
                      'compare' => 'NOT IN',
                  ),
              );
            }

            // The Query
            $pc2_query = new \WP_Query($q_pc2_query_args);

            // The Loop
            if ( $pc2_query->have_posts() ) {
              while ( $pc2_query->have_posts() ) {
                $pc2_query->the_post(); ?>
                <?php 
                global $product;
                $product = wc_get_product();
                $product_id = $product->get_id();
                $product_type = $product->get_type();
                $sale_price_dates_from = $sale_price_dates_to = '';
                $sale_price = $product->get_sale_price();
                $normal_price = $product->get_regular_price();
                $pr_id = get_the_ID();
                $stocka = $product->get_stock_status();
                ?>
                <!-- Start Slide -->
                <div class="swiper-slide h-auto">
                  <div class="product-fifteen bg-white h-100">
                    <div class="off-timear d-flex align-items-center justify-content-between">
                    <?php if (!empty($settings['offimgproductsdigistylecarouselkaveh']['url'])) {
                              if (!empty($sale_price)) { ?>
                      <img src="<?php echo esc_url($settings['offimgproductsdigistylecarouselkaveh']['url']); ?>" alt="image" width="130" height="16">
                      <?php   }
                          }
                        if ($date_from = get_post_meta($product_id, '_sale_price_dates_from', true)) {
                          $sale_price_dates_from = date('Y-m-d 00:00:00', $date_from);
                        }
                        if ($date_to = get_post_meta($product_id, '_sale_price_dates_to', true)) {
                          $sale_price_dates_to = date('Y-m-d 23:59:59', $date_to);
                        }
                        $deal_start_date = $sale_price_dates_from;
                        $deal_start_time = strtotime($deal_start_date);
                        $deal_end_date = $sale_price_dates_to;
                        $deal_end_time = strtotime($deal_end_date, current_time('timestamp'));
                        //$current_date = current_time( 'Y-m-d H:i:s', true );
                        $current_time = strtotime('NOW', current_time('timestamp'));
                        $time_diff = ($deal_end_time - $current_time); ?>
                        <div class="cs-height_10 cs-height_lg_10"></div>
                        <?php if ("instock" == $stocka) { ?>
                          <?php if (!empty($deal_end_date)) { ?>
                      <ul class="timear d-flex align-items-center" data-time="<?php echo $deal_end_date; ?>">
                        <li class="second">00</li>:
                        <li class="minute">00</li>:
                        <li class="hour">00</li>:
                        <li class="day">00</li>
                      </ul>
                      <?php } else {
                                }
                              } ?>
                    </div>
                    <div class="image position-relative d-flex align-items-center justify-content-center overflow-hidden">
                        <?php
                              $categories = wp_get_post_terms( $product->get_id(), 'product_cat' );
                              foreach ($categories as $category) {
                              $category_link = get_term_link( $category );
                              $category_name = $category->name;
                              
                              echo '<a href="' . esc_url( $category_link ) . '" class="category position-absolute top-0 start-0 bg-white d-flex align-items-center justify-content-center">';
                              echo  esc_html( $category_name );
                              echo '</a>';
                              }
                              ?>
                      <a href="<?php the_permalink(); ?>">
                        <img src="<?php the_post_thumbnail_url('full'); ?>" alt="<?php the_title(); ?>" width="290" height="290">
                      </a>
                      <?php if (!empty($normal_price)) {
                            if ("instock" == $stocka) {
                              if (!empty($sale_price)) { ?>
                      <span
                        class="offer position-absolute bottom-0 end-0 text-white d-flex align-items-center justify-content-center">
                        <?php if (class_exists('kavehWoo')) { $offer_percentage = kavehWoo::showofferpercentage($product); echo $offer_percentage; } ?> </span>
                      <?php }
                         } 
                     }
                      $terms = get_the_terms( $pr_id , 'pa_size' );
                      // Loop through the terms
                      if(!empty($terms)){ ?>
                      <ul class="sizes d-flex align-items-center position-absolute bottom-0 end-0 w-100 bg-white">
                      <?php
                      foreach ( $terms as $term ) {
                      $tooltip = get_term_meta( $term->term_id, 'wpcvs_tooltip', true ) ?: $term->name;
                      ?>
                      <li>
                        <a href="<?php the_permalink(); ?>" class="d-block"> <?php echo esc_attr( $tooltip ) ?> </a>
                      </li>
                      <?php
                      }
                      ?>
                    </ul>
                    <?php }else{ ?>
                      <style>
                      .product-fifteen:hover .image .offer {
                        -webkit-transform: translateY(0);
                        -moz-transform: translateY(0);
                        -ms-transform: translateY(0);
                        -o-transform: translateY(0);
                        transform: translateY(0);
                    }
                    </style>
                  <?php  } ?>
                    </div>
                    <div class="d-flex align-items-center justify-content-between">
                      <h2 class="title mb-0">
                        <a href="<?php the_permalink(); ?>"> <?php the_title(); ?> </a>
                      </h2>
                    </div>
                    
                    <div class="price d-flex align-items-center justify-content-end">
                      <?php if("instock"==$stocka){ 
                          if ( !$product->is_type( 'variable' ) ) { 
                              if(empty($sale_price) && empty($normal_price)) { 
                                  $price_v = $product->get_price_html(); ?>
                                  <?php
                                  echo str_replace("&ndash;","<span class=\"dashvar\"> – </span>", $price_v); ?>
                                  <?php
                                  ?>
                                  <?php }else{ ?>
                                  <?php if(!empty($sale_price) ) { ?>
                                  
                                  <del class="me-2">
                                  <?php if (!empty($normal_price)) {
                                  echo number_format($normal_price, 0, '.', ',');
                                  } ?>
                                  </del>
                                  <?php echo number_format($sale_price, 0, '.', ','); ?>
                                  <span class="currency-fifteen">
                                  <?php echo get_woocommerce_currency_symbol(); ?>
                                  </span>
                                  <?php }else{ ?>
                                  <?php if (!empty($normal_price)) { ?>
                                  <?php
                                  echo number_format($normal_price, 0, '.', ',');
                                  } ?>
                                  <span class="currency-fifteen">
                                  <?php echo get_woocommerce_currency_symbol(); ?>
                                  </span>
                                  <?php } ?>
                                  <?php } }else{ 
                                  $price_v = $product->get_price_html(); ?>
                                  <?php
                                  echo str_replace("&ndash;","<span class=\"dashvar\"> – </span>", $price_v); ?>
                                  <?php
                                  } 
                                  }else{ ?>
                                    <span class="outstock">
                                    Out of Stock 
                                    </span>
                                  <?php
                                  }
                                  ?>
                    </div>
                  </div>
                </div>
                <!-- End Slide -->
                <?php
                // Reset Original Post Data
                  wp_reset_postdata();
                }
              }
                  
                  ?>
                <?php } ?>

          </div>
          <?php if('yes'===$settings['showarrowsproductsdigistylecarouselkaveh']){ ?>
          <!-- Start Button -->
          <div class="swiper-button-next d-none d-md-flex align-items-md-center justify-content-md-center"></div>
          <div class="swiper-button-prev d-none d-md-flex align-items-md-center justify-content-md-center"></div>
          <!-- End Button -->
          <?php } ?>
        </div>
        <!-- End Carousel -->
      </div>
      <!-- End Products -->
      <a href="<?php echo  esc_url($settings['buttontilink2productsdigistylecarouselkaveh']); ?>" class="btn btn-danger-4 btn-more rounded-0 d-md-none mt-4 fw-bold mx-auto"> <?php echo  esc_html($settings['buttonti2productsdigistylecarouselkaveh']); ?></a>
    </div>
  </section>
    <style>
.product-fifteen .image img {
    mix-blend-mode: darken;
    max-height: 200px;
    object-fit: contain;
}
.currency-fifteen{
  font-size:13px;
  margin-right:3px;
}
.product-fifteen .image {
    height: 350px;
}
    </style>
    
    <?php
  }


}
