<?php
namespace Sifency\Traits;

if ( ! defined( 'ABSPATH' ) ) {
	exit; }

use Elementor\Controls_Manager;
use Elementor\Group_Control_Typography;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Background;
use Sifency\Traits\Sifency_Addons_Master_Typography;
use Sifency\Traits\Sifency_Addons_Button_Style_Controls;
use Sifency\Traits\Sifency_Addons_Item_Style_Controls;
use Sifency\Traits\Sifency_Addons_Image_Style_Controls;

trait Sifency_Addons_Woocommerce_Base_Controls {
	use Sifency_Addons_Master_Typography;
	use Sifency_Addons_Button_Style_Controls;
	use Sifency_Addons_Item_Style_Controls;
	use Sifency_Addons_Image_Style_Controls;

	protected function add_sifency_addons_woocommerce_base_controls( $args = array() ) {
		$this->add_sifency_addons_item_style_controls(
			array(
				'label'    => esc_html__( 'Product Box Style', 'sifency-addons' ),
				'selector' => '.sifency-wc-loop-item',
			)
		);
		$this->add_sifency_addons_master_typography_controls(
			array(
				'prefix'     => 'title_style',
				'label'      => esc_html__( 'Title Style', 'sifency-addons' ),
				'selector'   => '.sifency-wc-loop-title, .sifency-wc-loop-title h2, .sifency-wc-loop-title h3, .sifency-wc-loop-title h4, .sifency-wc-loop-title h5, .sifency-wc-loop-title h6',
				'color_only' => true,
				'exclude'    => array( 'tabs', 'bg', 'radius', 'transition', 'shadow', 'stroke' ),
			)
		);
		$this->add_sifency_addons_master_typography_controls(
			array(
				'prefix'     => 'price_style',
				'label'      => esc_html__( 'Price Style', 'sifency-addons' ),
				'selector'   => '.sifency-wc-loop-price',
				'color_only' => true,
				'exclude'    => array( 'tabs', 'transition', 'shadow', 'opacity', 'filters' ),
			)
		);
		$this->add_sifency_addons_image_style_controls(
			array(
				'prefix'              => 'image_style_',
				'dimensions_selector' => '.sifency-wc-loop-image img',
				'selector'            => '.sifency-wc-loop-image img',
				'exclude'             => array( 'tabs', 'bg', 'radius', 'border', 'transition', 'shadow', 'stroke' ),
			)
		);
		$this->add_Sifency_Addons_Button_Style_Controls(
			array(
				'prefix'   => 'badge_style_',
				'label'    => esc_html__( 'Sale Badge Style', 'sifency-addons' ),
				'selector' => '.sifency-wc-loop-sale',
			)
		);
		$this->add_Sifency_Addons_Button_Style_Controls(
			array(
				'prefix'   => 'cart_btn_style_',
				'label'    => esc_html__( 'Add to Cart Button', 'sifency-addons' ),
				'selector' => '.sifency-wc-loop-cart a.button',
			)
		);
	}
}
