<?php
/**
 * Dynamic Styles
 *
 * @package Dotspice
 * @version 1.3.0
 */



/**
 * Variables
 */
extract( dotspice_get_theme_option( 'colors', array() ), EXTR_PREFIX_ALL, 'color' );


/**
 * Jumbotron Background
 */
if ( $jumbotron_bg = dotspice_get_theme_settings( 'jumbotron_bg' ) ) {
	printf( '.jumbotron {background-image: url(%1$s);}', $jumbotron_bg );
}


/**
 * SVG Icons
 */
// WPCF7
printf( 'div.wpcf7 .ajax-loader:before {background-image: %s;}', dotspice_get_svg_icon( 'spinner', 'css', array(
	'fill'  => '#000000',
	'size'  => true,
	'sizes' => array(40, 40)
) ) );

// Thumbnail hover
foreach( array(
	'.gallery .gallery-item .gallery-icon > a',
	'.product-col .product-box-img',
	'.product-box > a:not(.product-box__link)',
	'.woocommerce-product-gallery__image > a',
	'.blog-post__img__link',
) as $path ) {
	printf( $path . ':after {background-image: %s;}', dotspice_get_svg_icon( 'search', 'css', array(
		'fill'  => '#FFF',
		'size'  => true,
		'sizes' => array(18, 18)
	) ) );
}

// Theme
foreach( array(
	'.std-list',
	'.page-content',
	'.post-content'
) as $path ) {
	printf( $path . ' ul li:before {background-image: %s;}', dotspice_get_svg_icon( 'check', 'css', array(
		'fill'  => esc_attr( $color_primary ),
		'size'  => true,
		'sizes' => array(16, 16)
	) ) );
}


// WooCommerce
printf( '.blockUI.blockOverlay:before {background-image: %s;}', dotspice_get_svg_icon( 'spinner', 'css', array(
	'fill'  => '#000000',
	'size'  => true,
	'sizes' => array(30, 30)
) ) );
printf( '.widget_product_categories .cat-parent:after {background-image: %s;}', dotspice_get_svg_icon( 'angle-down', 'css', array(
	'fill'  => '#000000',
	'size'  => true,
	'sizes' => array(12, 12)
) ) );
printf( '.product-box__add-to-cart .icon {background-image: %s;}', dotspice_get_svg_icon( 'shopping-cart', 'css', array(
	'fill'  => '#000000',
	'size'  => true,
	'sizes' => array(18, 18)
) ) );
printf( '.product-box__add-to-cart.loading .icon {background-image: %s;}', dotspice_get_svg_icon( 'spinner', 'css', array(
	'fill'  => '#000000',
	'size'  => true,
	'sizes' => array(18, 18)
) ) );
printf( '.product-box__add-to-cart.added .icon {background-image: %s;}', dotspice_get_svg_icon( 'check', 'css', array(
	'fill'  => '#000000',
	'size'  => true,
	'sizes' => array(18, 18)
) ) );

printf( '.add_to_cart_button.loading:after {background-image: %s;}', dotspice_get_svg_icon( 'spinner', 'css', array(
	'fill'  => '#FFFFFF',
	'size'  => true,
	'sizes' => array(14, 14)
) ) );
printf( '.add_to_cart_button.added:after {background-image: %s;}', dotspice_get_svg_icon( 'check', 'css', array(
	'fill'  => '#FFFFFF',
	'size'  => true,
	'sizes' => array(14, 14)
) ) );

printf( '.woocommerce-mini-cart-item .remove:before {background-image: %s;}', dotspice_get_svg_icon( 'times', 'css', array(
	'fill'  => '#FFFFFF',
	'size'  => true,
	'sizes' => array(12, 12)
) ) );

foreach( array(
	'.star-rating:before',
	'.comment-form-rating p.stars a:before',
	'.comment-form-rating p.stars a:hover ~ a:before',
	'.comment-form-rating p.stars.selected a.active ~ a:before',
) as $path ) {
	printf( $path . ' {background-image: %s;}', dotspice_get_svg_icon( 'star-fa', 'css', array(
		'fill'  => '#f9bc39',
		'size'  => true,
		'sizes' => array(16, 16),
		'style' => false
	) ) );
}

foreach( array(
	'.star-rating span',
	'.comment-form-rating p.stars:hover a:before',
	'.comment-form-rating p.stars.selected a.active:before',
	'.comment-form-rating p.stars.selected a:not(.active):before',
) as $path ) {
	printf( $path . ' {background-image: %s;}', dotspice_get_svg_icon( 'star-fa-solid', 'css', array(
		'fill'  => '#f9bc39',
		'size'  => true,
		'sizes' => array(16, 16),
		'style' => false
	) ) );
}