<?php
$full_height_2 = theme_get_option('woocommerce','2_columns_height_full');
$full_height_3 = theme_get_option('woocommerce','3_columns_height_full');
$full_height_4 = theme_get_option('woocommerce','4_columns_height_full');
$sidebar_height_2 = theme_get_option('woocommerce','2_columns_height_sidebar');
$sidebar_height_3 = theme_get_option('woocommerce','3_columns_height_sidebar');
$sidebar_height_4 = theme_get_option('woocommerce','4_columns_height_sidebar');

$product_side_height = theme_get_option('woocommerce','single_product_side_height');
$product_full_height = theme_get_option('woocommerce','single_product_full_height');
$woo_fonts = array(
	'onsale_text_size'=>'',	
	'product_info_size'=>'',	
	'woo_th_size'=>'',	
	'woo_td_size'=>'',	
	'price_box_size'=>'',
);
foreach($woo_fonts as $area => $woo_font){
	$woo_fonts[$area] = theme_get_option('woocommerce',$area);
}
$sale_side_height = $product_side_height+8;
$sale_full_height = $product_full_height+8;
$woo_colors = array(
	'price_color' => '',
	'price_sale_color'=> '',
	'price_text_color'=> '',
	'price_sale_text_color'=>'',
	'sale_label_color'=> '',
	'sale_label_text_color'=> '',
	'list_thumb_hover_color'=> '',
	'list_item_hover_color'=> '',
	'product_sale_bg_color'=>'',
	'product_sale_text_color'=>'',
	'product_tab_bg_color'=>'',
	'product_tab_hover_bg_color'=>'',
	'product_tab_active_bg_color'=>'',
	'product_tab_text_color'=>'',
	'product_tab_active_text_color'=>'',
	'product_info_title_color'=>'',
	'woo_table_th_color'=>'',
	'woo_table_td_color'=>'',
	'woo_table_th_text_color'=>'',
	'woo_table_td_text_color'=>'',
	'fancy_box_close_color'=>'',
);
$default_color = theme_get_option('color','default_color');
if($default_color != 'default'){
	$WOO_RES_DIR = THEME_COLOR_DIR.'/'.$color['default_color'];
	$WOO_RES_URI = '../colors/'.$color['default_color'];
	$check_image = 'background: url("'.$WOO_RES_URI.'/check.png") no-repeat scroll 0 0 transparent;';
	$woo_theme_color = include_once($WOO_RES_DIR.'/woo_color.php');
	foreach($woo_colors as $label => $woo_color){
		$wooColor = theme_get_option('woocommerce',$label);
		if(!empty($wooColor))
			$woo_colors[$label] = $wooColor;
		elseif(array_key_exists($label,$woo_theme_color)){
			$woo_colors[$label] = $woo_theme_color[$label];
		}else
			$woo_colors[$label]='transparent';
	}
	$woo_colors['sale_label_color_ie']='';
	if(!empty($woo_colors['sale_label_color']) && $woo_colors['sale_label_color']!='transparent'){
		$woo_colors['sale_label_color_ie'] = $woo_colors['sale_label_color'];
		$woo_colors['sale_label_color'] = change_rgba($woo_colors['sale_label_color'],'0.8');
	}
	if(!empty($woo_colors['list_item_hover_color']) && $woo_colors['list_item_hover_color']!='transparent'){
		$list_item_hover_color = change_rgba($woo_colors['list_item_hover_color'],'0');
		$woo_colors['list_item_hover_color'] = "
			background:".$woo_colors['list_item_hover_color'].";\n
			background: -moz-linear-gradient(top,  ".$woo_colors['list_item_hover_color']." 0%,".$list_item_hover_color." 100%); \n
			background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,".$woo_colors['list_item_hover_color']."), color-stop(100%,".$list_item_hover_color.")); \n
			background: -webkit-linear-gradient(top,  ".$woo_colors['list_item_hover_color']." 0%,".$list_item_hover_color." 100%); \n
			background: -o-linear-gradient(top,  ".$woo_colors['list_item_hover_color']." 0%,".$list_item_hover_color." 100%); \n
			background: -ms-linear-gradient(top,  ".$woo_colors['list_item_hover_color']." 0%,".$list_item_hover_color." 100%); \n
			background: linear-gradient(top,  ".$woo_colors['list_item_hover_color']." 0%,".$list_item_hover_color." 100%); ";
	}
}
return <<<CSS
.right_sidebar .products_two_columns li img,
.left_sidebar .products_two_columns li img,
.right_sidebar .products_two_columns li .onsale-wrap,
.left_sidebar .products_two_columns li .onsale-wrap{
	height:{$sidebar_height_2}px;
}
.full_width .products_two_columns li img,
.full_width .products_two_columns li .onsale-wrap{
	height:{$full_height_2}px;
}
.right_sidebar .products_three_columns li img,
.left_sidebar .products_three_columns li img,
.right_sidebar .products_three_columns li .onsale-wrap,
.left_sidebar .products_three_columns li .onsale-wrap{
	height:{$sidebar_height_3}px;
}
.full_width .products_three_columns li img,
.full_width .products_three_columns li .onsale-wrap{
	height:{$full_height_3}px;
}
.right_sidebar .products_four_columns li img,
.left_sidebar .products_four_columns li img,
.right_sidebar .products_four_columns li .onsale-wrap,
.left_sidebar .products_four_columns li .onsale-wrap{
	height:{$sidebar_height_4}px;
}
.full_width .products_four_columns li img,
.full_width .products_four_columns li .onsale-wrap{
	height:{$full_height_4}px;
}

.single-product .right_sidebar .product .images img,
.single-product .left_sidebar .product .images img{
	height:{$product_side_height}px;
}
.single-product .full_width .product .images img{
	height:{$product_full_height}px;
}
.single-product .right_sidebar .onsale-wrap,
.single-product .left_sidebar .onsale-wrap{
	height:{$sale_side_height}px;
}
.single-product .full_width .onsale-wrap{
	height:{$sale_full_height}px;
}
ul.products li.product .price{
	color:{$woo_colors['price_text_color']};
	background-color:{$woo_colors['price_color']};
}
ul.products li.product .price ins{
	color:{$woo_colors['price_sale_text_color']};
	background-color:{$woo_colors['price_sale_color']};
}
ul.products li.product .onsale,
.single-product .product .onsale{
	background-color:{$woo_colors['sale_label_color_ie']};
	background-color:{$woo_colors['sale_label_color']};
	color:{$woo_colors['sale_label_text_color']};
	font-size:{$woo_fonts['onsale_text_size']}px;
}
ul.products li.product img:hover,
.single-product .product .images .thumbnails img:hover {
	border-color:{$woo_colors['list_thumb_hover_color']};
}

ul.products li.product:hover {
	{$woo_colors['list_item_hover_color']}
}
.single-product .product .summary .price ins,
.sidepanel > ul.product_list_widget ins{
	background-color:{$woo_colors['product_sale_bg_color']};
	color:{$woo_colors['product_sale_text_color']};
}
.single-product .woocommerce_tabs ul.tabs a{
	background-color:{$woo_colors['product_tab_bg_color']};
	color:{$woo_colors['product_tab_text_color']} !important;
}
.single-product .woocommerce_tabs ul.tabs a:hover {
	background-color:{$woo_colors['product_tab_hover_bg_color']};
}
.single-product .woocommerce_tabs ul.tabs li.active a{
	background-color:{$woo_colors['product_tab_active_bg_color']};
	color:{$woo_colors['product_tab_active_text_color']} !important;
}
#content-area .woocommerce_tabs h2{
	color:{$woo_colors['product_info_title_color']};
}
table.shop_table th,
.shop_attributes th,
.cart-collaterals .cart_totals table th{
	background-color:{$woo_colors['woo_table_th_color']};
	color:{$woo_colors['woo_table_th_text_color']};
	font-size:{$woo_fonts['woo_th_size']}px;
}
table.shop_table td,
.shop_attributes td,
.cart-collaterals .cart_totals table td{
	background-color:{$woo_colors['woo_table_td_color']};
	color:{$woo_colors['woo_table_td_text_color']};
	font-size:{$woo_fonts['woo_td_size']}px;
}
a.button.added:after, input.button.added:after, button.button.added:after{
	{$check_image}
}
#fancybox-close:hover{
	background-color:{$woo_colors['fancy_box_close_color']} !important;
}
.single-product .summary{
	font-size:{$woo_fonts['product_info_size']}px;
}
.price-no-fit ul.products li.product .price{
	font-size:{$woo_fonts['price_box_size']}px;
}
CSS;
