<?php

$ebooks_collection_first_color = get_theme_mod('ebooks_collection_first_color');
$ebooks_collection_second_color = get_theme_mod('ebooks_collection_second_color');
$ebooks_collection_color_scheme_css = '';

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

if ($ebooks_collection_first_color) {
    $ebooks_collection_color_scheme_css .= ':root {';
    $ebooks_collection_color_scheme_css .= '--first-theme-color: ' . esc_attr($ebooks_collection_first_color) . ' !important;';
    $ebooks_collection_color_scheme_css .= '} ';
}
  
/*------------------ Global Second Color -----------*/
  
if ($ebooks_collection_second_color) {
    $ebooks_collection_color_scheme_css .= ':root {';
    $ebooks_collection_color_scheme_css .= '--second-theme-color: ' . esc_attr($ebooks_collection_second_color) . ' !important;';
    $ebooks_collection_color_scheme_css .= '} ';
}

//---------------------------------Logo-Max-height--------- 
$ebooks_collection_logo_width = get_theme_mod('ebooks_collection_logo_width');
if($ebooks_collection_logo_width != false){
$ebooks_collection_color_scheme_css .='.ebooks-collection-logo img{';
    $ebooks_collection_color_scheme_css .='width: '.esc_html($ebooks_collection_logo_width).'px;';
$ebooks_collection_color_scheme_css .='}';
}

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

$ebooks_collection_slider_img_height = get_theme_mod('ebooks_collection_slider_img_height');
if($ebooks_collection_slider_img_height != false){
    $ebooks_collection_color_scheme_css .='#slider-cat{';
        $ebooks_collection_color_scheme_css .='height: '.esc_attr($ebooks_collection_slider_img_height).' !important;';
    $ebooks_collection_color_scheme_css .='}';
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/*--------------------------- Preloader Background Image ------------*/

$ebooks_collection_preloader_bg_image = get_theme_mod('ebooks_collection_preloader_bg_image');
if($ebooks_collection_preloader_bg_image != false){
  $ebooks_collection_color_scheme_css .='#preloader{';
    $ebooks_collection_color_scheme_css .='background: url('.esc_attr($ebooks_collection_preloader_bg_image).'); background-size: cover;';
  $ebooks_collection_color_scheme_css .='}';
}

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

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

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

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

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

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