<?php

$building_contractor_first_color = get_theme_mod('building_contractor_first_color');
$building_contractor_second_color = get_theme_mod('building_contractor_second_color');
$building_contractor_third_color = get_theme_mod('building_contractor_third_color');
$building_contractor_color_scheme_css = '';

/*------------------ Global First Color -----------*/

if ($building_contractor_first_color) {
  $building_contractor_color_scheme_css .= ':root {';
  $building_contractor_color_scheme_css .= '--first-theme-color: ' . esc_attr($building_contractor_first_color) . ' !important;';
  $building_contractor_color_scheme_css .= '} ';
}

/*------------------ Global Second Color -----------*/

if ($building_contractor_second_color) {
  $building_contractor_color_scheme_css .= ':root {';
  $building_contractor_color_scheme_css .= '--second-theme-color: ' . esc_attr($building_contractor_second_color) . ' !important;';
  $building_contractor_color_scheme_css .= '} ';
}

/*------------------ Global Third Color -----------*/

if ($building_contractor_second_color) {
  $building_contractor_color_scheme_css .= ':root {';
  $building_contractor_color_scheme_css .= '--third-theme-color: ' . esc_attr($building_contractor_third_color) . ' !important;';
  $building_contractor_color_scheme_css .= '} ';
}

$building_contractor_color_scheme_css .= ' h4.post-title {';
$building_contractor_color_scheme_css .= 'background-color: ' . esc_attr($building_contractor_first_color) . '!important;';
$building_contractor_color_scheme_css .= ' opacity: 0.7 !important;';
$building_contractor_color_scheme_css .= '}';

// slider hide css
$building_contractor_hide_categorysec = get_theme_mod( 'building_contractor_slider', false);
$building_contractor_slider_cat = get_theme_mod( 'building_contractor_slider_cat');
if($building_contractor_hide_categorysec != true || $building_contractor_slider_cat != true){
$building_contractor_color_scheme_css .='.page-template-template-home-page .header {';
  $building_contractor_color_scheme_css .='position:static;';
$building_contractor_color_scheme_css .='}';
$building_contractor_color_scheme_css .='.page-template-template-home-page p.site-title a, .page-template-template-home-page span.site-description{';
  $building_contractor_color_scheme_css .='color:var(--second-theme-color);';
$building_contractor_color_scheme_css .='}';
}

//---------------------------------Logo-Max-height--------- 
$building_contractor_logo_width = get_theme_mod('building_contractor_logo_width');

if($building_contractor_logo_width != false){

$building_contractor_color_scheme_css .='.building-contractor-logo img{';

  $building_contractor_color_scheme_css .='width: '.esc_html($building_contractor_logo_width).'px;';

$building_contractor_color_scheme_css .='}';
}

/*---------------------------Slider Height ------------*/

$building_contractor_slider_img_height = get_theme_mod('building_contractor_slider_img_height');
if($building_contractor_slider_img_height != false){
    $building_contractor_color_scheme_css .='.imagebox img{';
        $building_contractor_color_scheme_css .='height: '.esc_attr($building_contractor_slider_img_height).' !important;';
    $building_contractor_color_scheme_css .='}';
}

/*--------------------------- Footer background image -------------------*/

$building_contractor_footer_bg_image = get_theme_mod('building_contractor_footer_bg_image');
if($building_contractor_footer_bg_image != false){
    $building_contractor_color_scheme_css .='#footer{';
        $building_contractor_color_scheme_css .='background: url('.esc_attr($building_contractor_footer_bg_image).');';
        $building_contractor_color_scheme_css .= 'background-size: cover;';  
    $building_contractor_color_scheme_css .='}';
}

/*--------------------------- Footer image position -------------------*/

$building_contractor_footer_img_position = get_theme_mod('building_contractor_footer_img_position','center center');
if($building_contractor_footer_img_position != false){
    $building_contractor_color_scheme_css .='#footer{';
        $building_contractor_color_scheme_css .='background-position: '.esc_attr($building_contractor_footer_img_position).';';
    $building_contractor_color_scheme_css .='}';
}	

/*--------------------------- Scroll to top positions -------------------*/

$building_contractor_scroll_position = get_theme_mod( 'building_contractor_scroll_position','Right');
if($building_contractor_scroll_position == 'Right'){
    $building_contractor_color_scheme_css .='#button{';
        $building_contractor_color_scheme_css .='right: 20px;';
    $building_contractor_color_scheme_css .='}';
}else if($building_contractor_scroll_position == 'Left'){
    $building_contractor_color_scheme_css .='#button{';
        $building_contractor_color_scheme_css .='left: 20px;';
    $building_contractor_color_scheme_css .='}';
}else if($building_contractor_scroll_position == 'Center'){
    $building_contractor_color_scheme_css .='#button{';
        $building_contractor_color_scheme_css .='right: 50%;left: 50%;';
    $building_contractor_color_scheme_css .='}';
}

/*--------------------------- Woocommerce Product Image Border Radius -------------------*/

$building_contractor_woo_product_img_border_radius = get_theme_mod('building_contractor_woo_product_img_border_radius');
if($building_contractor_woo_product_img_border_radius != false){
    $building_contractor_color_scheme_css .='.woocommerce ul.products li.product a img{';
        $building_contractor_color_scheme_css .='border-radius: '.esc_attr($building_contractor_woo_product_img_border_radius).'px;';
    $building_contractor_color_scheme_css .='}';
}

/*--------------------------- Woocommerce Product Sale Position -------------------*/    

$building_contractor_product_sale_position = get_theme_mod( 'building_contractor_product_sale_position','Left');
if($building_contractor_product_sale_position == 'Right'){
    $building_contractor_color_scheme_css .='.woocommerce ul.products li.product .onsale{';
        $building_contractor_color_scheme_css .='left:auto !important; right:.5em !important;';
    $building_contractor_color_scheme_css .='}';
}else if($building_contractor_product_sale_position == 'Left'){
    $building_contractor_color_scheme_css .='.woocommerce ul.products li.product .onsale {';
        $building_contractor_color_scheme_css .='right:auto !important; left:.5em !important;';
    $building_contractor_color_scheme_css .='}';
}        

/*--------------------------- Shop page pagination -------------------*/

$building_contractor_wooproducts_nav = get_theme_mod('building_contractor_wooproducts_nav', 'Yes');
if($building_contractor_wooproducts_nav == 'No'){
  $building_contractor_color_scheme_css .='.woocommerce nav.woocommerce-pagination{';
    $building_contractor_color_scheme_css .='display: none;';
  $building_contractor_color_scheme_css .='}';
}

/*--------------------------- Related Product -------------------*/

$building_contractor_related_product_enable = get_theme_mod('building_contractor_related_product_enable',true);
if($building_contractor_related_product_enable == false){
  $building_contractor_color_scheme_css .='.related.products{';
    $building_contractor_color_scheme_css .='display: none;';
  $building_contractor_color_scheme_css .='}';
}

/*--------------------------- Scroll to Top Button Shape -------------------*/

$building_contractor_scroll_top_shape = get_theme_mod('building_contractor_scroll_top_shape', 'circle');
if($building_contractor_scroll_top_shape == 'box' ){
    $building_contractor_color_scheme_css .='#button{';
        $building_contractor_color_scheme_css .=' border-radius: 0%';
    $building_contractor_color_scheme_css .='}';
}elseif($building_contractor_scroll_top_shape == 'curved' ){
    $building_contractor_color_scheme_css .='#button{';
        $building_contractor_color_scheme_css .=' border-radius: 20%';
    $building_contractor_color_scheme_css .='}';
}elseif($building_contractor_scroll_top_shape == 'circle' ){
    $building_contractor_color_scheme_css .='#button{';
        $building_contractor_color_scheme_css .=' border-radius: 50%;';
    $building_contractor_color_scheme_css .='}';
}

/*--------------------------- Menu Typography -------------------*/

$building_contractor_theme_lay = get_theme_mod( 'building_contractor_menu_text_transform','Capitalize');
if($building_contractor_theme_lay == 'Uppercase'){
    $building_contractor_color_scheme_css .='.main-nav a{';
        $building_contractor_color_scheme_css .='text-transform: uppercase;';
    $building_contractor_color_scheme_css .='}';
}else if($building_contractor_theme_lay == 'Lowercase'){
    $building_contractor_color_scheme_css .='.main-nav a{';
        $building_contractor_color_scheme_css .='text-transform: lowercase;';
    $building_contractor_color_scheme_css .='}';
}
else if($building_contractor_theme_lay == 'Capitalize'){
    $building_contractor_color_scheme_css .='.main-nav a{';
        $building_contractor_color_scheme_css .='text-transform: capitalize;';
    $building_contractor_color_scheme_css .='}';
}

/*--------------------------- Post Layout -------------------*/

$building_contractor_blog_layouts = get_theme_mod('building_contractor_blog_layout_option_setting', 'Left');
if ($building_contractor_blog_layouts == 'Left') {
    $building_contractor_color_scheme_css .= '.postsec-list .listarticle{';
    $building_contractor_color_scheme_css .= 'text-align:left;';
    $building_contractor_color_scheme_css .= '}';
} elseif ($building_contractor_blog_layouts == 'Center') {
    $building_contractor_color_scheme_css .= '.postsec-list .listarticle{';
    $building_contractor_color_scheme_css .= 'text-align:center;';
    $building_contractor_color_scheme_css .= '}';
} elseif ($building_contractor_blog_layouts == 'Right') {
    $building_contractor_color_scheme_css .= '.postsec-list .listarticle{';
    $building_contractor_color_scheme_css .= 'text-align:right;';
    $building_contractor_color_scheme_css .= '}';
}