<?php
$slice_url = dirname(__FILE__);
if ( $_SERVER['HTTP_HOST'] == 'themes.slicetheme.com' && !empty($_GET['path']) ) {
	require_once '../../../../../'. $_GET['path'] .'/wp-load.php';
}
elseif ( preg_match('#wp-content#isU', $slice_url) ) {
	require_once '../../../../wp-load.php';  
}
else {
	require_once '../../../../../wp-load.php';  
}  
header("Content-type: text/css");


/*******************************************************************
Custom Skins
********************************************************************/
$style_skin_custom = st_option('style_skin_custom');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($style_skin_custom)) ) {
	echo ".btn:hover, 
button:hover,
.button:hover,
.wc-forward:hover,
html input[type=\"button\"]:hover, 
input[type=\"reset\"]:hover, 
input[type=\"submit\"]:hover,
.more-link a:hover,
.load-more a:hover,
.address .edit:hover,
.reset_variations:hover,
.st-highlight,
.st-dropcap,
.st-link.style-2:after,
.st-link.style-3:before,
.st-tabs .tab-title li.active a, 
.woocommerce-tabs ul.tabs li.active a,
.st-accordion .accordion-title.active .accordion-icon,
.st-iconbox.style-1 .box-image .box-icon,
.st-trailerbox .box-content span,
.st-progress .bar,
.st-offer-slider .offer-button:hover,
.st-social a:hover,
#footer .st-social a:hover,
.blog-container .post-format,
.portfolio-container .zoom-link a:hover,
.team-container.style-1 .team-photo,
.team-container.style-2 .team-photo,
#fullscreen-menu li a:hover,
.portfolio-filter li a:hover,
.portfolio-filter li.active a,
.portfolio-filter li.active a:hover,
.widget.widget_tag_cloud a:hover,
.widget.widget_product_tag_cloud a:hover{
	background-color:$style_skin_custom;
}

.btn:hover, 
button:hover,
.button:hover,
.wc-forward:hover,
html input[type=\"button\"]:hover, 
input[type=\"reset\"]:hover, 
input[type=\"submit\"]:hover,
.more-link a:hover,
.load-more a:hover,
.address .edit:hover,
.reset_variations:hover,
.header-cart a.button:hover,
blockquote,
blockquote.pull-right,
.primary-menu ul li a:before, 
.canvas-menu ul li a:before,
.st-link.style-1:after,
.st-iconbox.style-1 .box-image:hover .box-icon,
.owl-theme .owl-controls .owl-page.active span, 
.owl-theme .owl-controls.clickable .owl-page:hover span,
.st-offer-slider .offer-title h4:before,
.st-offer-slider .offer-button:hover,
.post-meta span:before, 
.widget-blog .media-list span:before,
.team-meta:after,
.team-container.style-2 .st-social a:hover,
.portfolio-filter li a:hover,
.portfolio-filter li.active a,
.portfolio-filter li.active a:hover{
	border-color:$style_skin_custom;
}

.fs-menu-on .toggle-menu:hover span:before,
.st-accordion .accordion-title:hover,
.st-accordion .accordion-title.active,
.st-iconbox.style-1 .box-image:hover .box-icon,
.st-iconbox.style-2 .box-icon,
.st-articlebox a:hover,
.st-link.style-4,
.testimonial-position,
.widget_nav_menu ul li a:hover,
.widget_nav_menu ul li a:hover:before,
.portfolio-container .post-title a:hover,
.portfolio-list .post-category,
.blog-container .post-title a:hover,
.owl-theme .owl-controls.clickable .owl-buttons div:hover,
#footer a:hover,
.product-container:hover h3 a,
.entry-summary .price .amount,
.woocommerce .product-category a{
	color:$style_skin_custom;
}\n";
}

/*******************************************************************
Body Background
********************************************************************/
$style_bg_body = st_option('style_bg_body');
if ( is_array($style_bg_body) ) {
	$style_bg_output = '';
	if ( preg_match('/[A-F0-9]{6}/', strtoupper($style_bg_body['color'])) ) $style_bg_output.= "background-color: ". $style_bg_body['color'] .";\n";
	if ( !empty($style_bg_body['image']) ) {
														$style_bg_output.= "background-image: url('". $style_bg_body['image'] ."');\n";
		if ( !empty($style_bg_body['repeat']) ) 		$style_bg_output.= "background-repeat: ". $style_bg_body['repeat'] .";\n";
		if ( !empty($style_bg_body['position']) ) 		$style_bg_output.= "background-position: ". $style_bg_body['position'] .";\n";
		if ( !empty($style_bg_body['attachment']) )		$style_bg_output.= "background-attachment: ". $style_bg_body['attachment'] .";\n";
	}
	if ( !empty($style_bg_output) ) {
		echo "body {\n";
			echo $style_bg_output;
		echo "}\n";
	}
}

/*******************************************************************
Page Background
********************************************************************/
$style_bg_page = st_option('style_bg_page');
$style_bg_output = '';
if ( preg_match('/[A-F0-9]{6}/', strtoupper($style_bg_page)) ) {
	$style_bg_output.= "background-color: ". $style_bg_page .";\n";
}
if ( !empty($style_bg_output) ) {
	echo "#st-wrapper {\n";
		echo $style_bg_output;
	echo "}\n";
}

/*******************************************************************
Header Background
********************************************************************/
$style_bg_header = st_option('style_bg_header');
$style_bg_output = '';
if ( preg_match('/[A-F0-9]{6}/', strtoupper($style_bg_header)) ) {
	$rgba = slicetheme_hex2rgb( $style_bg_header );
	$style_bg_output.= "background-color: rgba(".$rgba['red'].", ".$rgba['green'].", ".$rgba['blue'].", ".st_option('style_bg_header_opacity', 1).");\n";
	$style_bg_output.= "border: none !important;\n";
}
if ( !empty($style_bg_output) ) {
	echo "#header {\n";
		echo $style_bg_output;
	echo "}\n";
}

/*******************************************************************
Vertical Header Background
********************************************************************/
$style_bg_vertical = st_option('style_bg_vertical');
if ( is_array($style_bg_vertical) ) {
	$style_bg_output = '';
	if ( preg_match('/[A-F0-9]{6}/', strtoupper($style_bg_vertical['color'])) )	$style_bg_output.= "background-color: ". $style_bg_vertical['color'] .";\n";
	if ( !empty($style_bg_vertical['image']) ) {
														$style_bg_output.= "background-image: url('". $style_bg_vertical['image'] ."');\n";
		if ( !empty($style_bg_vertical['repeat']) ) 	$style_bg_output.= "background-repeat: ". $style_bg_vertical['repeat'] .";\n";
		if ( !empty($style_bg_vertical['position']) ) 	$style_bg_output.= "background-position: ". $style_bg_vertical['position'] .";\n";
		if ( !empty($style_bg_vertical['attachment']) )	$style_bg_output.= "background-attachment: ". $style_bg_vertical['attachment'] .";\n";
	}
	if ( !empty($style_bg_output) ) {
		echo "#header-side {\n";
			echo $style_bg_output;
		echo "}\n";
	}
}

/*******************************************************************
Top Bar Background
********************************************************************/
$style_bg_topbar = st_option('style_bg_topbar');
$style_bg_output = '';
if ( preg_match('/[A-F0-9]{6}/', strtoupper($style_bg_topbar)) ) {
	$rgba = slicetheme_hex2rgb( $style_bg_topbar );
	$style_bg_output.= "background-color: rgba(".$rgba['red'].", ".$rgba['green'].", ".$rgba['blue'].", ".st_option('style_bg_topbar_opacity', 1).");\n";
	$style_bg_output.= "border: none !important;\n";
}
if ( !empty($style_bg_output) ) {
	echo "#header #top-wrapper {\n";
		echo $style_bg_output;
	echo "}\n";
}

/*******************************************************************
Sticky Background
********************************************************************/
$style_bg_sticky = st_option('style_bg_sticky');
$style_bg_output = '';
if ( preg_match('/[A-F0-9]{6}/', strtoupper($style_bg_sticky)) ) {
	$rgba = slicetheme_hex2rgb( $style_bg_sticky );
	$style_bg_output.= "background-color: rgba(".$rgba['red'].", ".$rgba['green'].", ".$rgba['blue'].", ".st_option('style_bg_sticky_opacity', 1).");\n";
	$style_bg_output.= "border: none !important;\n";
}
if ( !empty($style_bg_output) ) {
	echo "#header .is-sticky {\n";
		echo $style_bg_output;
	echo "}\n";
}

/*******************************************************************
Menu Background
********************************************************************/
$style_bg_menu = st_option('style_bg_menu');
$style_bg_output = '';
if ( preg_match('/[A-F0-9]{6}/', strtoupper($style_bg_menu)) ) {
	$rgba = slicetheme_hex2rgb( $style_bg_menu );
	$style_bg_output.= "background-color: rgba(".$rgba['red'].", ".$rgba['green'].", ".$rgba['blue'].", ".st_option('style_bg_menu_opacity', 1).");\n";
}
if ( !empty($style_bg_output) ) {
	echo "ul.primary-menu > li > ul {\n";
		echo $style_bg_output;
	echo "}\n";
}

/*******************************************************************
Footer Background
********************************************************************/
$style_bg_footer = st_option('style_bg_footer');
if ( is_array($style_bg_footer) ) {
	$style_bg_output = '';
	if ( preg_match('/[A-F0-9]{6}/', strtoupper($style_bg_footer['color'])) )	$style_bg_output.= "background-color: ". $style_bg_footer['color'] .";\n";
	if ( !empty($style_bg_footer['image']) ) {
														$style_bg_output.= "background-image: url('". $style_bg_footer['image'] ."');\n";
		if ( !empty($style_bg_footer['repeat']) ) 		$style_bg_output.= "background-repeat: ". $style_bg_footer['repeat'] .";\n";
		if ( !empty($style_bg_footer['position']) ) 	$style_bg_output.= "background-position: ". $style_bg_footer['position'] .";\n";
		if ( !empty($style_bg_footer['attachment']) )	$style_bg_output.= "background-attachment: ". $style_bg_footer['attachment'] .";\n";
	}
	if ( !empty($style_bg_output) ) {
		echo "#footer {\n";
			echo $style_bg_output;
		echo "}\n";
	}
}

/*******************************************************************
Font Family
********************************************************************/
$font_body_ft = st_option('font_body_ft'); //print_r($font_body_ft);
$font_heading_ft = st_option('font_heading_ft'); //print_r($font_heading_ft);
$font_menu_ft = st_option('font_menu_ft'); //print_r($font_menu_ft);
$font_menu2_ft = st_option('font_menu2_ft'); //print_r($font_menu2_ft);
$font_menu3_ft = st_option('font_menu3_ft'); //print_r($font_menu3_ft);
$font_title_ft = st_option('font_title_ft'); //print_r($font_title_ft);
$font_subtitle_ft = st_option('font_subtitle_ft'); //print_r($font_subtitle_ft);

if ( !empty($font_body_ft) ) {
	echo "body, p { font-family: '$font_body_ft'; }\n";
}
if ( !empty($font_heading_ft) ) {
	echo "h1,h2,h3,h4,h5,h6 { font-family: '$font_heading_ft'; }\n";
}
elseif ( !empty($font_body_ft) ) {
	echo "h1,h2,h3,h4,h5,h6 { font-family: '$font_body_ft'; }\n";
}
if ( !empty($font_menu_ft) ) {
	echo "ul.primary-menu > li > a { font-family: '$font_menu_ft'; }\n";
}
if ( !empty($font_menu2_ft) ) {
	echo "ul.primary-menu > li > ul > li > a { font-family: '$font_menu2_ft'; }\n";
}
if ( !empty($font_menu3_ft) ) {
	echo "ul.primary-menu > li > ul > li > ul > li a { font-family: '$font_menu3_ft'; }\n";
}
if ( !empty($font_title_ft) ) {
	echo "h1.page-title { font-family: '$font_title_ft'; }\n";
}
if ( !empty($font_subtitle_ft) ) {
	echo ".page-subtitle { font-family: '$font_subtitle_ft'; }\n";
}

/*******************************************************************
Font Typography
********************************************************************/
$font_body = st_option('font_body');
$font_menu = st_option('font_menu');
$font_menu2 = st_option('font_menu2');
$font_menu3 = st_option('font_menu3');
$font_title = st_option('font_title');
$font_subtitle = st_option('font_subtitle');

if ( is_array($font_body) ) {
	$font_output = '';
	if ( !empty($font_body['size']) ) {
		$font_output.= "font-size: ". $font_body['size'] ."; ";
	}
	if ( !empty($font_body['height']) ) {
		$font_output.= "line-height: ". $font_body['height'] ."; ";
	}
	if ( !empty($font_body['weight']) ) {
		$font_output.= "font-weight: ". $font_body['weight'] ."; ";
	}
	if ( !empty($font_output) ) {
		echo "body { ";
			echo $font_output;
		echo "}\n";
	}
}

if ( is_array($font_menu) ) {
	$font_output = '';
	if ( !empty($font_menu['size']) ) {
		$font_output.= "font-size: ". $font_menu['size'] ."; ";
	}
	if ( !empty($font_menu['height']) ) {
		$font_output.= "line-height: ". $font_menu['height'] ."; ";
	}
	if ( !empty($font_menu['weight']) ) {
		$font_output.= "font-weight: ". $font_menu['weight'] ."; ";
	}
	if ( !empty($font_output) ) {
		echo "ul.primary-menu > li > a { ";
			echo $font_output;
		echo "}\n";
	}
}

if ( is_array($font_menu2) ) {
	$font_output = '';
	if ( !empty($font_menu2['size']) ) {
		$font_output.= "font-size: ". $font_menu2['size'] ."; ";
	}
	if ( !empty($font_menu2['height']) ) {
		$font_output.= "line-height: ". $font_menu2['height'] ."; ";
	}
	if ( !empty($font_menu2['weight']) ) {
		$font_output.= "font-weight: ". $font_menu2['weight'] ."; ";
	}
	if ( !empty($font_output) ) {
		echo "ul.primary-menu > li > ul > li > a { ";
			echo $font_output;
		echo "}\n";
	}
}

if ( is_array($font_menu3) ) {
	$font_output = '';
	if ( !empty($font_menu3['size']) ) {
		$font_output.= "font-size: ". $font_menu3['size'] ."; ";
	}
	if ( !empty($font_menu3['height']) ) {
		$font_output.= "line-height: ". $font_menu3['height'] ."; ";
	}
	if ( !empty($font_menu3['weight']) ) {
		$font_output.= "font-weight: ". $font_menu3['weight'] ."; ";
	}
	if ( !empty($font_output) ) {
		echo "ul.primary-menu > li > ul > li > ul > li a { ";
			echo $font_output;
		echo "}\n";
	}
}

for ($i = 1; $i <= 6; $i++)
{
	$font_heading = st_option('font_heading_h'.$i);
	
	if ( is_array($font_heading) ) {
		$font_output = '';
		if ( !empty($font_heading['size']) ) {
			$font_output.= "font-size: ". $font_heading['size'] ."; ";
		}
		if ( !empty($font_heading['height']) ) {
			$font_output.= "line-height: ". $font_heading['height'] ."; ";
		}
		if ( !empty($font_heading['weight']) ) {
			$font_output.= "font-weight: ". $font_heading['weight'] ."; ";
		}
		if ( !empty($font_output) ) {
			echo "h".$i." { ";
				echo $font_output;
			echo "}\n";
		}
	}
}

if ( is_array($font_title) ) {
	$font_output = '';
	if ( !empty($font_title['size']) ) {
		$font_output.= "font-size: ". $font_title['size'] ."; ";
	}
	if ( !empty($font_title['height']) ) {
		$font_output.= "line-height: ". $font_title['height'] ."; ";
	}
	if ( !empty($font_title['weight']) ) {
		$font_output.= "font-weight: ". $font_title['weight'] ."; ";
	}
	if ( !empty($font_output) ) {
		echo "h1.page-title { ";
			echo $font_output;
		echo "}\n";
	}
}

if ( is_array($font_subtitle) ) {
	$font_output = '';
	if ( !empty($font_subtitle['size']) ) {
		$font_output.= "font-size: ". $font_subtitle['size'] ."; ";
	}
	if ( !empty($font_subtitle['height']) ) {
		$font_output.= "line-height: ". $font_subtitle['height'] ."; ";
	}
	if ( !empty($font_subtitle['weight']) ) {
		$font_output.= "font-weight: ". $font_subtitle['weight'] ."; ";
	}
	if ( !empty($font_output) ) {
		echo ".page-subtitle { ";
			echo $font_output;
		echo "}\n";
	}
}

/*******************************************************************
Custom Color
********************************************************************/
// Header Area
$color_header_text = st_option('color_header_text');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_header_text)) ) {
	echo "#header { color: $color_header_text; }\n";
}

// Vertical Header Area
$color_vertical_text = st_option('color_vertical_text');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_vertical_text)) ) {
	echo "#header-side { color: $color_vertical_text; }\n";
}

// Top Bar Area
$color_topbar_text = st_option('color_topbar_text');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_topbar_text)) ) {
	echo "#header #top-wrapper { color: $color_topbar_text; }\n";
}

// Sticky Area
$color_sticky_text = st_option('color_sticky_text');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_sticky_text)) ) {
	echo "#header .is-sticky { color: $color_sticky_text; }\n";
}

// Menu Area
$color_menu_link = st_option('color_menu_link');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_menu_link)) ) {
	echo "ul.primary-menu > li > a { color: $color_menu_link; }\n";
}
$color_menu2_link = st_option('color_menu2_link');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_menu2_link)) ) {
	echo "ul.primary-menu > li > ul > li > a, .primary-menu ul.mega-menu > li a { color: $color_menu2_link; }\n";
}
$color_menu3_link = st_option('color_menu3_link');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_menu3_link)) ) {
	echo "ul.primary-menu > li > ul > li > ul > li a, .primary-menu ul.mega-menu > li > ul > li a { color: $color_menu3_link; }\n";
}
$color_menu_link_hover = st_option('color_menu_link_hover');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_menu_link_hover)) ) {
	echo "ul.primary-menu > li > a:hover { color: $color_menu_link_hover; }\n";
}
$color_menu2_link_hover = st_option('color_menu2_link_hover');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_menu2_link_hover)) ) {
	echo "ul.primary-menu > li > ul > li > a:hover, .primary-menu ul.mega-menu > li a:hover { color: $color_menu2_link_hover; }\n";
}
$color_menu3_link_hover = st_option('color_menu3_link_hover');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_menu3_link_hover)) ) {
	echo "ul.primary-menu > li > ul > li > ul > li a:hover, .primary-menu ul.mega-menu > li > ul > li a:hover { color: $color_menu3_link_hover; }\n";
}

// Title Area
$color_title_pagetitle = st_option('color_title_pagetitle');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_title_pagetitle)) ) {
	echo "#title-wrapper h1 { color: $color_title_pagetitle; }\n";
}
$color_title_subtitle = st_option('color_title_subtitle');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_title_subtitle)) ) {
	echo "#title-wrapper h1 span { color: $color_title_subtitle; }\n";
}	
$color_breadcrumb = st_option('color_breadcrumb');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_breadcrumb)) ) {
	echo "#title-wrapper .breadcrumb li, #title-wrapper .breadcrumb li a { color: $color_breadcrumb; }\n";
}

// Content Area
$color_body_text = st_option('color_body_text');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_body_text)) ) {
	echo "#main-wrapper { color: $color_body_text; }\n";
}

$color_body_link = st_option('color_body_link');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_body_link)) ) {
	echo "#main-wrapper a { color: $color_body_link; }\n";
}
$color_body_link_hover = st_option('color_body_link_hover');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_body_link_hover)) ) {
	echo "#main-wrapper a:hover { color: $color_body_link_hover; }\n";
}

// Footer Area
$color_footer_heading = st_option('color_footer_heading');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_footer_heading)) ) {
	echo "#footer .widget-title { color: $color_footer_heading; }\n";
}
$color_footer_text = st_option('color_footer_text');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_footer_text)) ) {
	echo "#footer, #footer .widget li { color: $color_footer_text; }\n";
}

$color_footer_link = st_option('color_footer_link');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_footer_link)) ) {
	echo "#footer a { color: $color_footer_link; }\n";
}
$color_footer_link_hover = st_option('color_footer_link_hover');
if ( preg_match('/[A-F0-9]{6}/', strtoupper($color_footer_link_hover)) ) {
	echo "#footer a:hover { color: $color_footer_link_hover; }\n";
}

/*******************************************************************
Custom Header Height
********************************************************************/
$site_logo_height = st_option('site_logo_height');
if ( !empty($site_logo_height) ) {
	echo "#middle-wrapper, .header-style-h2 .header-logo { line-height: {$site_logo_height}px; }\n";
}

/*******************************************************************
Custom CSS
********************************************************************/
if ( $style_css = st_option('style_css') ) {
	echo $style_css."\n";
}

?>