<?php
/**
 * Add to cart map.
 *
 * @package woodmart
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Direct access not allowed.
}

if ( ! function_exists( 'woodmart_get_vc_map_single_product_add_to_cart' ) ) {
	/**
	 * Content map.
	 */
	function woodmart_get_vc_map_single_product_add_to_cart() {
		$button_typography = woodmart_get_typography_map(
			array(
				'key'      => 'button',
				'selector' => '{{WRAPPER}} button.single_add_to_cart_button',
				'group'    => esc_html__( 'Style', 'woodmart' ),

			)
		);

		$buy_now_button_typography = woodmart_get_typography_map(
			array(
				'key'      => 'buy_now_button',
				'selector' => '{{WRAPPER}} button.wd-buy-now-btn',
				'group'    => esc_html__( 'Style', 'woodmart' ),

			)
		);

		$main_price_typography = woodmart_get_typography_map(
			array(
				'key'           => 'main_price',
				'selector'      => '{{WRAPPER}}.wd-single-add-cart .variations_form .woocommerce-variation-price .price',
				'group'         => esc_html__( 'Style', 'woodmart' ),
				'wd_dependency' => array(
					'element' => 'price_style_tabs',
					'value'   => array( 'main_price' ),
				),
			)
		);

		$old_price_typography = woodmart_get_typography_map(
			array(
				'key'           => 'old_price',
				'selector'      => '{{WRAPPER}}.wd-single-add-cart .variations_form .woocommerce-variation-price .price del',
				'group'         => esc_html__( 'Style', 'woodmart' ),
				'wd_dependency' => array(
					'element' => 'price_style_tabs',
					'value'   => array( 'old_price' ),
				),
			)
		);

		$suffix_typography = woodmart_get_typography_map(
			array(
				'key'           => 'suffix',
				'selector'      => '{{WRAPPER}} .woocommerce-price-suffix',
				'group'         => esc_html__( 'Style', 'woodmart' ),
				'wd_dependency' => array(
					'element' => 'price_style_tabs',
					'value'   => array( 'suffix' ),
				),
			)
		);

		return array(
			'base'        => 'woodmart_single_product_add_to_cart',
			'name'        => esc_html__( 'Product add to cart', 'woodmart' ),
			'category'    => woodmart_get_tab_title_category_for_wpb( esc_html__( 'Single product elements', 'woodmart' ), 'single_product' ),
			'description' => esc_html__( 'Add to cart form and button', 'woodmart' ),
			'icon'        => WOODMART_ASSETS . '/images/vc-icon/sp-icons/sp-add-to-cart.svg',
			'params'      => array(
				array(
					'type'       => 'woodmart_css_id',
					'param_name' => 'woodmart_css_id',
				),

				array(
					'heading'          => esc_html__( 'Alignment', 'woodmart' ),
					'type'             => 'wd_select',
					'param_name'       => 'alignment',
					'style'            => 'images',
					'selectors'        => array(),
					'devices'          => array(
						'desktop' => array(
							'value' => 'left',
						),
					),
					'value'            => array(
						esc_html__( 'Left', 'woodmart' )   => 'left',
						esc_html__( 'Center', 'woodmart' ) => 'center',
						esc_html__( 'Right', 'woodmart' )  => 'right',
					),
					'images'           => array(
						'center' => WOODMART_ASSETS_IMAGES . '/settings/align/center.jpg',
						'left'   => WOODMART_ASSETS_IMAGES . '/settings/align/left.jpg',
						'right'  => WOODMART_ASSETS_IMAGES . '/settings/align/right.jpg',
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'     => esc_html__( 'Stretch', 'woodmart' ),
					'type'        => 'woodmart_switch',
					'param_name'  => 'button_design',
					'true_state'  => 'yes',
					'false_state' => 'no',
					'default'     => 'no',
				),

				/**
				 * Add to cart button styles.
				 */
				array(
					'title'      => esc_html__( 'Add to cart button', 'woodmart' ),
					'group'      => esc_html__( 'Style', 'woodmart' ),
					'type'       => 'woodmart_title_divider',
					'param_name' => 'add_to_cart_button_style_section',
				),

				array(
					'heading'    => esc_html__( 'Design', 'woodmart' ),
					'group'      => esc_html__( 'Style', 'woodmart' ),
					'type'       => 'dropdown',
					'param_name' => 'add_to_cart_design',
					'value'      => array(
						esc_html__( 'Inherit from Theme Settings', 'woodmart' ) => 'default',
						esc_html__( 'Bordered', 'woodmart' ) => 'bordered',
						esc_html__( 'Flat', 'woodmart' ) => 'flat',
					),
				),

				$button_typography['font_family'],
				$button_typography['font_size'],
				$button_typography['font_weight'],
				$button_typography['text_transform'],
				$button_typography['font_style'],
				$button_typography['text_decoration'],
				$button_typography['line_height'],

				// Add to cart button tabs.
				array(
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'woodmart_button_set',
					'param_name'       => 'add_to_cart_tabs',
					'tabs'             => true,
					'value'            => array(
						esc_html__( 'Normal', 'woodmart' ) => 'normal',
						esc_html__( 'Hover', 'woodmart' )  => 'hover',
					),
					'default'          => 'normal',
					'edit_field_class' => 'vc_col-sm-12 vc_column',
				),

				// Normal tab.
				array(
					'heading'          => esc_html__( 'Text color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'add_to_cart_color_normal',
					'selectors'        => array(
						'{{WRAPPER}} button.single_add_to_cart_button' => array(
							'--btn-accented-color: {{VALUE}};',
						),
					),
					'wd_dependency'    => array(
						'element' => 'add_to_cart_tabs',
						'value'   => array( 'normal' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Background color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'add_to_cart_bg_color_normal',
					'selectors'        => array(
						'{{WRAPPER}} button.single_add_to_cart_button' => array(
							'--btn-accented-bgcolor: {{VALUE}};',
						),
					),
					'wd_dependency'    => array(
						'element' => 'add_to_cart_tabs',
						'value'   => array( 'normal' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'type'             => 'woodmart_switch',
					'heading'          => esc_html__( 'Border', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'param_name'       => 'add_to_cart_border_enable',
					'true_state'       => 'yes',
					'false_state'      => 'no',
					'default'          => 'no',
					'wd_dependency'    => array(
						'element' => 'add_to_cart_tabs',
						'value'   => array( 'normal' ),
					),
					'edit_field_class' => 'vc_col-sm-12 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Border type', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_select',
					'param_name'       => 'add_to_cart_border_type',
					'style'            => 'select',
					'selectors'        => array(
						'{{WRAPPER}} button.single_add_to_cart_button' => array(
							'border-style: {{VALUE}};',
						),
					),
					'devices'          => array(
						'desktop' => array(
							'value' => '',
						),
					),
					'value'            => array(
						esc_html__( 'Inherit', 'woodmart' ) => '',
						esc_html__( 'None', 'woodmart' )   => 'none',
						esc_html__( 'Solid', 'woodmart' )  => 'solid',
						esc_html__( 'Dotted', 'woodmart' ) => 'dotted',
						esc_html__( 'Double', 'woodmart' ) => 'double',
						esc_html__( 'Dashed', 'woodmart' ) => 'dashed',
						esc_html__( 'Groove', 'woodmart' ) => 'groove',
					),
					'dependency'       => array(
						'element' => 'add_to_cart_border_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency'    => array(
						'element' => 'add_to_cart_tabs',
						'value'   => array( 'normal' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Border color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'add_to_cart_border_color',
					'selectors'        => array(
						'{{WRAPPER}} button.single_add_to_cart_button' => array(
							'border-color: {{VALUE}};',
						),
					),
					'dependency'       => array(
						'element' => 'add_to_cart_border_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency'    => array(
						'element' => 'add_to_cart_tabs',
						'value'   => array( 'normal' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'       => esc_html__( 'Border width', 'woodmart' ),
					'group'         => esc_html__( 'Style', 'woodmart' ),
					'type'          => 'wd_dimensions',
					'param_name'    => 'add_to_cart_border_width',
					'selectors'     => array(
						'{{WRAPPER}} button.single_add_to_cart_button' => array(
							'border-top-width: {{TOP}}px;',
							'border-right-width: {{RIGHT}}px;',
							'border-bottom-width: {{BOTTOM}}px;',
							'border-left-width: {{LEFT}}px;',
						),
					),
					'devices'       => array(
						'desktop' => array(
							'unit' => 'px',
						),
					),
					'range'         => array(
						'px' => array(),
					),
					'dependency'    => array(
						'element' => 'add_to_cart_border_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency' => array(
						'element' => 'add_to_cart_tabs',
						'value'   => array( 'normal' ),
					),
				),

				array(
					'heading'       => esc_html__( 'Border radius', 'woodmart' ),
					'group'         => esc_html__( 'Style', 'woodmart' ),
					'type'          => 'wd_dimensions',
					'param_name'    => 'add_to_cart_border_radius',
					'selectors'     => array(
						'{{WRAPPER}} button.single_add_to_cart_button' => array(
							'border-top-left-radius: {{TOP}}{{UNIT}};',
							'border-top-right-radius: {{RIGHT}}{{UNIT}};',
							'border-bottom-right-radius: {{BOTTOM}}{{UNIT}};',
							'border-bottom-left-radius: {{LEFT}}{{UNIT}};',
						),
					),
					'devices'       => array(
						'desktop' => array(
							'unit' => 'px',
						),
						'tablet'  => array(
							'unit' => 'px',
						),
						'mobile'  => array(
							'unit' => 'px',
						),
					),
					'range'         => array(
						'px' => array(),
						'%'  => array(),
					),
					'dependency'    => array(
						'element' => 'add_to_cart_border_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency' => array(
						'element' => 'add_to_cart_tabs',
						'value'   => array( 'normal' ),
					),
				),

				// Hover tab.
				array(
					'heading'          => esc_html__( 'Text color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'add_to_cart_color_hover',
					'selectors'        => array(
						'{{WRAPPER}} button.single_add_to_cart_button' => array(
							'--btn-accented-color-hover: {{VALUE}};',
						),
					),
					'wd_dependency'    => array(
						'element' => 'add_to_cart_tabs',
						'value'   => array( 'hover' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Background color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'add_to_cart_bg_color_hover',
					'selectors'        => array(
						'{{WRAPPER}} button.single_add_to_cart_button' => array(
							'--btn-accented-bgcolor-hover: {{VALUE}};',
						),
					),
					'wd_dependency'    => array(
						'element' => 'add_to_cart_tabs',
						'value'   => array( 'hover' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'type'             => 'woodmart_switch',
					'heading'          => esc_html__( 'Border', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'param_name'       => 'add_to_cart_border_hover_enable',
					'true_state'       => 'yes',
					'false_state'      => 'no',
					'default'          => 'no',
					'wd_dependency'    => array(
						'element' => 'add_to_cart_tabs',
						'value'   => array( 'hover' ),
					),
					'edit_field_class' => 'vc_col-sm-12 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Border type', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_select',
					'param_name'       => 'add_to_cart_border_hover_type',
					'style'            => 'select',
					'selectors'        => array(
						'{{WRAPPER}} button.single_add_to_cart_button:hover' => array(
							'border-style: {{VALUE}};',
						),
					),
					'devices'          => array(
						'desktop' => array(
							'value' => '',
						),
					),
					'value'            => array(
						esc_html__( 'Inherit', 'woodmart' ) => '',
						esc_html__( 'None', 'woodmart' )   => 'none',
						esc_html__( 'Solid', 'woodmart' )  => 'solid',
						esc_html__( 'Dotted', 'woodmart' ) => 'dotted',
						esc_html__( 'Double', 'woodmart' ) => 'double',
						esc_html__( 'Dashed', 'woodmart' ) => 'dashed',
						esc_html__( 'Groove', 'woodmart' ) => 'groove',
					),
					'dependency'       => array(
						'element' => 'add_to_cart_border_hover_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency'    => array(
						'element' => 'add_to_cart_tabs',
						'value'   => array( 'hover' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Border color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'add_to_cart_border_hover_color',
					'selectors'        => array(
						'{{WRAPPER}} button.single_add_to_cart_button:hover' => array(
							'border-color: {{VALUE}};',
						),
					),
					'dependency'       => array(
						'element' => 'add_to_cart_border_hover_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency'    => array(
						'element' => 'add_to_cart_tabs',
						'value'   => array( 'hover' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'       => esc_html__( 'Border width', 'woodmart' ),
					'group'         => esc_html__( 'Style', 'woodmart' ),
					'type'          => 'wd_dimensions',
					'param_name'    => 'add_to_cart_border_hover_width',
					'selectors'     => array(
						'{{WRAPPER}} button.single_add_to_cart_button:hover' => array(
							'border-top-width: {{TOP}}px;',
							'border-right-width: {{RIGHT}}px;',
							'border-bottom-width: {{BOTTOM}}px;',
							'border-left-width: {{LEFT}}px;',
						),
					),
					'devices'       => array(
						'desktop' => array(
							'unit' => 'px',
						),
					),
					'range'         => array(
						'px' => array(),
					),
					'dependency'    => array(
						'element' => 'add_to_cart_border_hover_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency' => array(
						'element' => 'add_to_cart_tabs',
						'value'   => array( 'hover' ),
					),
				),

				array(
					'heading'       => esc_html__( 'Border radius', 'woodmart' ),
					'group'         => esc_html__( 'Style', 'woodmart' ),
					'type'          => 'wd_dimensions',
					'param_name'    => 'add_to_cart_border_hover_radius',
					'selectors'     => array(
						'{{WRAPPER}} button.single_add_to_cart_button:hover' => array(
							'border-top-left-radius: {{TOP}}{{UNIT}};',
							'border-top-right-radius: {{RIGHT}}{{UNIT}};',
							'border-bottom-right-radius: {{BOTTOM}}{{UNIT}};',
							'border-bottom-left-radius: {{LEFT}}{{UNIT}};',
						),
					),
					'devices'       => array(
						'desktop' => array(
							'unit' => 'px',
						),
						'tablet'  => array(
							'unit' => 'px',
						),
						'mobile'  => array(
							'unit' => 'px',
						),
					),
					'range'         => array(
						'px' => array(),
						'%'  => array(),
					),
					'dependency'    => array(
						'element' => 'add_to_cart_border_hover_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency' => array(
						'element' => 'add_to_cart_tabs',
						'value'   => array( 'hover' ),
					),
				),

				/**
				 * Buy now button styles.
				 */
				array(
					'title'      => esc_html__( 'Buy now button', 'woodmart' ),
					'group'      => esc_html__( 'Style', 'woodmart' ),
					'type'       => 'woodmart_title_divider',
					'param_name' => 'buy_now_button_style_section',
				),

				array(
					'heading'    => esc_html__( 'Design', 'woodmart' ),
					'group'      => esc_html__( 'Style', 'woodmart' ),
					'type'       => 'dropdown',
					'param_name' => 'buy_now_design',
					'value'      => array(
						esc_html__( 'Inherit from Theme Settings', 'woodmart' ) => 'default',
						esc_html__( 'Bordered', 'woodmart' ) => 'bordered',
						esc_html__( 'Flat', 'woodmart' ) => 'flat',
					),
				),

				$buy_now_button_typography['font_family'],
				$buy_now_button_typography['font_size'],
				$buy_now_button_typography['font_weight'],
				$buy_now_button_typography['text_transform'],
				$buy_now_button_typography['font_style'],
				$buy_now_button_typography['text_decoration'],
				$buy_now_button_typography['line_height'],

				// Buy now button tabs.
				array(
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'woodmart_button_set',
					'param_name'       => 'buy_now_tabs',
					'tabs'             => true,
					'value'            => array(
						esc_html__( 'Normal', 'woodmart' ) => 'normal',
						esc_html__( 'Hover', 'woodmart' )  => 'hover',
					),
					'default'          => 'normal',
					'edit_field_class' => 'vc_col-sm-12 vc_column',
				),

				// Normal tab.
				array(
					'heading'          => esc_html__( 'Text color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'buy_now_color_normal',
					'selectors'        => array(
						'{{WRAPPER}} button.wd-buy-now-btn' => array(
							'--btn-accented-color: {{VALUE}};',
						),
					),
					'wd_dependency'    => array(
						'element' => 'buy_now_tabs',
						'value'   => array( 'normal' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Background color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'buy_now_bg_color_normal',
					'selectors'        => array(
						'{{WRAPPER}} button.wd-buy-now-btn' => array(
							'--btn-accented-bgcolor: {{VALUE}};',
						),
					),
					'wd_dependency'    => array(
						'element' => 'buy_now_tabs',
						'value'   => array( 'normal' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'type'             => 'woodmart_switch',
					'heading'          => esc_html__( 'Border', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'param_name'       => 'buy_now_border_enable',
					'true_state'       => 'yes',
					'false_state'      => 'no',
					'default'          => 'no',
					'wd_dependency'    => array(
						'element' => 'buy_now_tabs',
						'value'   => array( 'normal' ),
					),
					'edit_field_class' => 'vc_col-sm-12 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Border type', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_select',
					'param_name'       => 'buy_now_border_type',
					'style'            => 'select',
					'selectors'        => array(
						'{{WRAPPER}} button.wd-buy-now-btn' => array(
							'border-style: {{VALUE}};',
						),
					),
					'devices'          => array(
						'desktop' => array(
							'value' => '',
						),
					),
					'value'            => array(
						esc_html__( 'Inherit', 'woodmart' ) => '',
						esc_html__( 'None', 'woodmart' )   => 'none',
						esc_html__( 'Solid', 'woodmart' )  => 'solid',
						esc_html__( 'Dotted', 'woodmart' ) => 'dotted',
						esc_html__( 'Double', 'woodmart' ) => 'double',
						esc_html__( 'Dashed', 'woodmart' ) => 'dashed',
						esc_html__( 'Groove', 'woodmart' ) => 'groove',
					),
					'dependency'       => array(
						'element' => 'buy_now_border_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency'    => array(
						'element' => 'buy_now_tabs',
						'value'   => array( 'normal' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Border color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'buy_now_border_color',
					'selectors'        => array(
						'{{WRAPPER}} button.wd-buy-now-btn' => array(
							'border-color: {{VALUE}};',
						),
					),
					'dependency'       => array(
						'element' => 'buy_now_border_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency'    => array(
						'element' => 'buy_now_tabs',
						'value'   => array( 'normal' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'       => esc_html__( 'Border width', 'woodmart' ),
					'group'         => esc_html__( 'Style', 'woodmart' ),
					'type'          => 'wd_dimensions',
					'param_name'    => 'buy_now_border_width',
					'selectors'     => array(
						'{{WRAPPER}} button.wd-buy-now-btn' => array(
							'border-top-width: {{TOP}}px;',
							'border-right-width: {{RIGHT}}px;',
							'border-bottom-width: {{BOTTOM}}px;',
							'border-left-width: {{LEFT}}px;',
						),
					),
					'devices'       => array(
						'desktop' => array(
							'unit' => 'px',
						),
					),
					'range'         => array(
						'px' => array(),
					),
					'dependency'    => array(
						'element' => 'buy_now_border_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency' => array(
						'element' => 'buy_now_tabs',
						'value'   => array( 'normal' ),
					),
				),

				array(
					'heading'       => esc_html__( 'Border radius', 'woodmart' ),
					'group'         => esc_html__( 'Style', 'woodmart' ),
					'type'          => 'wd_dimensions',
					'param_name'    => 'buy_now_border_radius',
					'selectors'     => array(
						'{{WRAPPER}} button.wd-buy-now-btn' => array(
							'border-top-left-radius: {{TOP}}{{UNIT}};',
							'border-top-right-radius: {{RIGHT}}{{UNIT}};',
							'border-bottom-right-radius: {{BOTTOM}}{{UNIT}};',
							'border-bottom-left-radius: {{LEFT}}{{UNIT}};',
						),
					),
					'devices'       => array(
						'desktop' => array(
							'unit' => 'px',
						),
						'tablet'  => array(
							'unit' => 'px',
						),
						'mobile'  => array(
							'unit' => 'px',
						),
					),
					'range'         => array(
						'px' => array(),
						'%'  => array(),
					),
					'dependency'    => array(
						'element' => 'buy_now_border_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency' => array(
						'element' => 'buy_now_tabs',
						'value'   => array( 'normal' ),
					),
				),

				// Hover tab.
				array(
					'heading'          => esc_html__( 'Text color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'buy_now_color_hover',
					'selectors'        => array(
						'{{WRAPPER}} button.wd-buy-now-btn' => array(
							'--btn-accented-color-hover: {{VALUE}};',
						),
					),
					'wd_dependency'    => array(
						'element' => 'buy_now_tabs',
						'value'   => array( 'hover' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Background color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'buy_now_bg_color_hover',
					'selectors'        => array(
						'{{WRAPPER}} button.wd-buy-now-btn' => array(
							'--btn-accented-bgcolor-hover: {{VALUE}};',
						),
					),
					'wd_dependency'    => array(
						'element' => 'buy_now_tabs',
						'value'   => array( 'hover' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'type'             => 'woodmart_switch',
					'heading'          => esc_html__( 'Border', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'param_name'       => 'buy_now_border_hover_enable',
					'true_state'       => 'yes',
					'false_state'      => 'no',
					'default'          => 'no',
					'wd_dependency'    => array(
						'element' => 'buy_now_tabs',
						'value'   => array( 'hover' ),
					),
					'edit_field_class' => 'vc_col-sm-12 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Border type', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_select',
					'param_name'       => 'buy_now_border_hover_type',
					'style'            => 'select',
					'selectors'        => array(
						'{{WRAPPER}} button.wd-buy-now-btn:hover' => array(
							'border-style: {{VALUE}};',
						),
					),
					'devices'          => array(
						'desktop' => array(
							'value' => '',
						),
					),
					'value'            => array(
						esc_html__( 'Inherit', 'woodmart' ) => '',
						esc_html__( 'None', 'woodmart' )   => 'none',
						esc_html__( 'Solid', 'woodmart' )  => 'solid',
						esc_html__( 'Dotted', 'woodmart' ) => 'dotted',
						esc_html__( 'Double', 'woodmart' ) => 'double',
						esc_html__( 'Dashed', 'woodmart' ) => 'dashed',
						esc_html__( 'Groove', 'woodmart' ) => 'groove',
					),
					'dependency'       => array(
						'element' => 'buy_now_border_hover_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency'    => array(
						'element' => 'buy_now_tabs',
						'value'   => array( 'hover' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Border color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'buy_now_border_hover_color',
					'selectors'        => array(
						'{{WRAPPER}} button.wd-buy-now-btn:hover' => array(
							'border-color: {{VALUE}};',
						),
					),
					'dependency'       => array(
						'element' => 'buy_now_border_hover_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency'    => array(
						'element' => 'buy_now_tabs',
						'value'   => array( 'hover' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'       => esc_html__( 'Border width', 'woodmart' ),
					'group'         => esc_html__( 'Style', 'woodmart' ),
					'type'          => 'wd_dimensions',
					'param_name'    => 'buy_now_border_hover_width',
					'selectors'     => array(
						'{{WRAPPER}} button.wd-buy-now-btn:hover' => array(
							'border-top-width: {{TOP}}px;',
							'border-right-width: {{RIGHT}}px;',
							'border-bottom-width: {{BOTTOM}}px;',
							'border-left-width: {{LEFT}}px;',
						),
					),
					'devices'       => array(
						'desktop' => array(
							'unit' => 'px',
						),
					),
					'range'         => array(
						'px' => array(),
					),
					'dependency'    => array(
						'element' => 'buy_now_border_hover_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency' => array(
						'element' => 'buy_now_tabs',
						'value'   => array( 'hover' ),
					),
				),

				array(
					'heading'       => esc_html__( 'Border radius', 'woodmart' ),
					'group'         => esc_html__( 'Style', 'woodmart' ),
					'type'          => 'wd_dimensions',
					'param_name'    => 'buy_now_border_hover_radius',
					'selectors'     => array(
						'{{WRAPPER}} button.wd-buy-now-btn:hover' => array(
							'border-top-left-radius: {{TOP}}{{UNIT}};',
							'border-top-right-radius: {{RIGHT}}{{UNIT}};',
							'border-bottom-right-radius: {{BOTTOM}}{{UNIT}};',
							'border-bottom-left-radius: {{LEFT}}{{UNIT}};',
						),
					),
					'devices'       => array(
						'desktop' => array(
							'unit' => 'px',
						),
						'tablet'  => array(
							'unit' => 'px',
						),
						'mobile'  => array(
							'unit' => 'px',
						),
					),
					'range'         => array(
						'px' => array(),
						'%'  => array(),
					),
					'dependency'    => array(
						'element' => 'buy_now_border_hover_enable',
						'value'   => array( 'yes' ),
					),
					'wd_dependency' => array(
						'element' => 'buy_now_tabs',
						'value'   => array( 'hover' ),
					),
				),

				/**
				 * Variable product styles.
				 */
				array(
					'title'      => esc_html__( 'Variable product', 'woodmart' ),
					'group'      => esc_html__( 'Style', 'woodmart' ),
					'type'       => 'woodmart_title_divider',
					'param_name' => 'variable_product_style_divider',
				),

				array(
					'heading'          => esc_html__( 'Design', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'dropdown',
					'param_name'       => 'design',
					'value'            => array(
						esc_html__( 'Default', 'woodmart' ) => 'default',
						esc_html__( 'Justify', 'woodmart' ) => 'justify',
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Swatches layout', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'dropdown',
					'param_name'       => 'swatch_layout',
					'value'            => array(
						esc_html__( 'Default', 'woodmart' ) => 'default',
						esc_html__( 'Inline', 'woodmart' ) => 'inline',
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Clear button position', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_select',
					'param_name'       => 'reset_button_position',
					'style'            => 'select',
					'selectors'        => array(),
					'devices'          => array(
						'desktop' => array(
							'value' => 'side',
						),
						'mobile'  => array(
							'value' => 'side',
						),
					),
					'value'            => array(
						esc_html__( 'Side', 'woodmart' )   => 'side',
						esc_html__( 'Bottom', 'woodmart' ) => 'bottom',
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				array(
					'heading'          => esc_html__( 'Swatch label position', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_select',
					'param_name'       => 'label_position',
					'style'            => 'select',
					'selectors'        => array(),
					'devices'          => array(
						'desktop' => array(
							'value' => 'side',
						),
						'mobile'  => array(
							'value' => 'side',
						),
					),
					'value'            => array(
						esc_html__( 'Side', 'woodmart' ) => 'side',
						esc_html__( 'Top', 'woodmart' )  => 'top',
						esc_html__( 'Hide', 'woodmart' ) => 'hide',
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				// Price.
				array(
					'title'      => esc_html__( 'Price', 'woodmart' ),
					'group'      => esc_html__( 'Style', 'woodmart' ),
					'type'       => 'woodmart_title_divider',
					'param_name' => 'price_style_divider',
				),

				array(
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'woodmart_button_set',
					'param_name'       => 'price_style_tabs',
					'tabs'             => true,
					'value'            => array(
						esc_html__( 'Regular price', 'woodmart' ) => 'main_price',
						esc_html__( 'Old price', 'woodmart' ) => 'old_price',
						esc_html__( 'Suffix', 'woodmart' ) => 'suffix',
					),
					'default'          => 'main_price',
					'edit_field_class' => 'vc_col-sm-12 vc_column',
				),

				$main_price_typography['font_family'],
				$main_price_typography['font_size'],
				$main_price_typography['font_weight'],
				$main_price_typography['text_transform'],
				$main_price_typography['font_style'],
				$main_price_typography['text_decoration'],
				$main_price_typography['line_height'],

				array(
					'heading'          => esc_html__( 'Text color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'main_price_text_color',
					'selectors'        => array(
						'{{WRAPPER}}.wd-single-add-cart .variations_form .woocommerce-variation-price .price' => array(
							'color: {{VALUE}};',
						),
					),
					'wd_dependency'    => array(
						'element' => 'price_style_tabs',
						'value'   => array( 'main_price' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				$old_price_typography['font_family'],
				$old_price_typography['font_size'],
				$old_price_typography['font_weight'],
				$old_price_typography['text_transform'],
				$old_price_typography['font_style'],
				$old_price_typography['text_decoration'],
				$old_price_typography['line_height'],

				array(
					'heading'          => esc_html__( 'Text color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'old_price_text_color',
					'selectors'        => array(
						'{{WRAPPER}}.wd-single-add-cart .variations_form .woocommerce-variation-price .price del' => array(
							'color: {{VALUE}};',
						),
					),
					'wd_dependency'    => array(
						'element' => 'price_style_tabs',
						'value'   => array( 'old_price' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				$suffix_typography['font_family'],
				$suffix_typography['font_size'],
				$suffix_typography['font_weight'],
				$suffix_typography['text_transform'],
				$suffix_typography['font_style'],
				$suffix_typography['text_decoration'],
				$suffix_typography['line_height'],

				array(
					'heading'          => esc_html__( 'Text color', 'woodmart' ),
					'group'            => esc_html__( 'Style', 'woodmart' ),
					'type'             => 'wd_colorpicker',
					'param_name'       => 'suffix_text_color',
					'selectors'        => array(
						'{{WRAPPER}} .woocommerce-price-suffix' => array(
							'color: {{VALUE}};',
						),
					),
					'wd_dependency'    => array(
						'element' => 'price_style_tabs',
						'value'   => array( 'suffix' ),
					),
					'edit_field_class' => 'vc_col-sm-6 vc_column',
				),

				// Stock status.
				array(
					'title'      => esc_html__( 'Stock status', 'woodmart' ),
					'group'      => esc_html__( 'Style', 'woodmart' ),
					'type'       => 'woodmart_title_divider',
					'param_name' => 'stock_status_style_divider',
				),

				array(
					'heading'     => esc_html__( 'Enable stock status', 'woodmart' ),
					'group'       => esc_html__( 'Style', 'woodmart' ),
					'type'        => 'woodmart_switch',
					'param_name'  => 'enable_stock_status',
					'hint'        => esc_html__( 'If "NO" stock status will be removed.', 'woodmart' ),
					'true_state'  => 'yes',
					'false_state' => 'no',
					'default'     => 'yes',
				),

				// Design options.
				array(
					'heading'    => esc_html__( 'CSS box', 'woodmart' ),
					'group'      => esc_html__( 'Design Options', 'js_composer' ),
					'type'       => 'css_editor',
					'param_name' => 'css',
				),
				woodmart_get_vc_responsive_spacing_map(),

				array(
					'param_name' => 'wd_backdrop_filter',
					'heading'    => esc_html__( 'Backdrop filter', 'woodmart' ),
					'group'      => esc_html__( 'Design Options', 'woodmart' ),
					'type'       => 'wd_backdrop_filter',
					'selectors'  => array(
						'{{WRAPPER}}' => array(
							'backdrop-filter: {{VALUE}};',
							'-webkit-backdrop-filter: {{VALUE}};',
						),
					),
					'class'      => 'xts-col-6',
				),

				// Width option (with dependency Columns option, responsive).
				woodmart_get_responsive_dependency_width_map( 'responsive_tabs' ),
				woodmart_get_responsive_dependency_width_map( 'width_desktop' ),
				woodmart_get_responsive_dependency_width_map( 'custom_width_desktop' ),
				woodmart_get_responsive_dependency_width_map( 'width_tablet' ),
				woodmart_get_responsive_dependency_width_map( 'custom_width_tablet' ),
				woodmart_get_responsive_dependency_width_map( 'width_mobile' ),
				woodmart_get_responsive_dependency_width_map( 'custom_width_mobile' ),
			),
		);
	}
}

add_filter( 'vc_autocomplete_woodmart_single_product_add_to_cart_product_id_callback', 'woodmart_product_id_autocomplete_suggester_new', 10, 1 );
add_filter( 'vc_autocomplete_woodmart_single_product_add_to_cart_product_id_render', 'woodmart_product_id_autocomplete_render', 10, 1 );
