<?php

$garden_farm_first_color = get_theme_mod('garden_farm_first_color');
$garden_farm_second_color = get_theme_mod('garden_farm_second_color');
$garden_farm_color_scheme_css = '';

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

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

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

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

// Sticky Header
$garden_farm_resp_stickyheader = get_theme_mod( 'garden_farm_sticky_header',false);
if($garden_farm_resp_stickyheader != true){
    $garden_farm_color_scheme_css .='.header-fixed{';
        $garden_farm_color_scheme_css .='position:static;';
    $garden_farm_color_scheme_css .='} ';
}
if($garden_farm_resp_stickyheader == true){
    $garden_farm_color_scheme_css .='@media screen and (max-width:575px) {';
    $garden_farm_color_scheme_css .='.header-fixed{';
        $garden_farm_color_scheme_css .='position:fixed;';
    $garden_farm_color_scheme_css .='} }';
}else if($garden_farm_resp_stickyheader == false){
    $garden_farm_color_scheme_css .='@media screen and (max-width:575px){';
    $garden_farm_color_scheme_css .='.header-fixed{';
        $garden_farm_color_scheme_css .='position:static;';
    $garden_farm_color_scheme_css .='} }';
}

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

  if($garden_farm_logo_width != false){

    $garden_farm_color_scheme_css .='.garden-farm-logo img{';

      $garden_farm_color_scheme_css .='width: '.esc_html($garden_farm_logo_width).'px;';

    $garden_farm_color_scheme_css .='}';
  }

  // by default header
  $garden_farm_slider = get_theme_mod('garden_farm_slider', true);

  if($garden_farm_slider != true){

  $garden_farm_color_scheme_css .='.page-template-template-home-page .mainhead{';

    $garden_farm_color_scheme_css .='position: static;';

  $garden_farm_color_scheme_css .='}';

  }

  $garden_farm_slider_nav_img = get_theme_mod('garden_farm_slider_nav_img');
  if($garden_farm_slider_nav_img != false){
    $garden_farm_color_scheme_css .='#slider-cat .owl-nav .owl-next:after{';
      $garden_farm_color_scheme_css .='background: url('.esc_attr($garden_farm_slider_nav_img).'); background-size: cover;';
    $garden_farm_color_scheme_css .='}';
  }

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

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

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

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

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

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

/*--------------------------- Blog Post Page Image Box Shadow -------------------*/

$garden_farm_blog_post_page_image_box_shadow = get_theme_mod('garden_farm_blog_post_page_image_box_shadow',0);
if($garden_farm_blog_post_page_image_box_shadow != false){
    $garden_farm_color_scheme_css .='.blog-post .post-thumb img{';
        $garden_farm_color_scheme_css .='box-shadow: '.esc_attr($garden_farm_blog_post_page_image_box_shadow).'px '.esc_attr($garden_farm_blog_post_page_image_box_shadow).'px '.esc_attr($garden_farm_blog_post_page_image_box_shadow).'px #cccccc;';
    $garden_farm_color_scheme_css .='}';
}  

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

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

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

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

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

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

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

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

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

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

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

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

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

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