<?php

    $pastry_bakers_theme_css= "";

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

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

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

    $pastry_bakers_slider_img_height = get_theme_mod('pastry_bakers_slider_img_height');
    if($pastry_bakers_slider_img_height != false){
        $pastry_bakers_theme_css .='#top-slider .owl-carousel .owl-item img{';
            $pastry_bakers_theme_css .='height: '.esc_attr($pastry_bakers_slider_img_height).';';
        $pastry_bakers_theme_css .='}';
    }

    /*---------------- Single post Settings ------------------*/

    $pastry_bakers_single_post_navigation_show_hide = get_theme_mod('pastry_bakers_single_post_navigation_show_hide',true);
    if($pastry_bakers_single_post_navigation_show_hide != true){
        $pastry_bakers_theme_css .='.nav-links{';
            $pastry_bakers_theme_css .='display: none;';
        $pastry_bakers_theme_css .='}';
    }

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

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

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

    $pastry_bakers_single_post_page_image_box_shadow = get_theme_mod('pastry_bakers_single_post_page_image_box_shadow',0);
    if($pastry_bakers_single_post_page_image_box_shadow != false){
        $pastry_bakers_theme_css .='.single-post .entry-header img{';
            $pastry_bakers_theme_css .='box-shadow: '.esc_attr($pastry_bakers_single_post_page_image_box_shadow).'px '.esc_attr($pastry_bakers_single_post_page_image_box_shadow).'px '.esc_attr($pastry_bakers_single_post_page_image_box_shadow).'px #cccccc;';
        $pastry_bakers_theme_css .='}';
    }

     /*--------------------------- Single Post Page Image Border Radius -------------------*/

    $pastry_bakers_single_post_page_image_border_radius = get_theme_mod('pastry_bakers_single_post_page_image_border_radius', 0);
    if($pastry_bakers_single_post_page_image_border_radius != false){
        $pastry_bakers_theme_css .='.single-post .entry-header img{';
            $pastry_bakers_theme_css .='border-radius: '.esc_attr($pastry_bakers_single_post_page_image_border_radius).'px;';
        $pastry_bakers_theme_css .='}';
    }

    /*--------------------------- Footer Background Image Position -------------------*/

    $pastry_bakers_footer_bg_image_position = get_theme_mod( 'pastry_bakers_footer_bg_image_position','scroll');
    if($pastry_bakers_footer_bg_image_position == 'fixed'){
        $pastry_bakers_theme_css .='#colophon{';
            $pastry_bakers_theme_css .='background-attachment: fixed !important; background-position: center !important;';
        $pastry_bakers_theme_css .='}';
    }elseif ($pastry_bakers_footer_bg_image_position == 'scroll'){
        $pastry_bakers_theme_css .='#colophon{';
            $pastry_bakers_theme_css .='background-attachment: scroll !important; background-position: center !important;';
        $pastry_bakers_theme_css .='}';
    }

    /*--------------------------- Footer Widget Heading Alignment -------------------*/

    $pastry_bakers_footer_widget_heading_alignment = get_theme_mod( 'pastry_bakers_footer_widget_heading_alignment','Left');
    if($pastry_bakers_footer_widget_heading_alignment == 'Left'){
        $pastry_bakers_theme_css .='#colophon h5, h5.footer-column-widget-title{';
        $pastry_bakers_theme_css .='text-align: left;';
        $pastry_bakers_theme_css .='}';
    }else if($pastry_bakers_footer_widget_heading_alignment == 'Center'){
        $pastry_bakers_theme_css .='#colophon h5, h5.footer-column-widget-title{';
            $pastry_bakers_theme_css .='text-align: center;';
        $pastry_bakers_theme_css .='}';
    }else if($pastry_bakers_footer_widget_heading_alignment == 'Right'){
        $pastry_bakers_theme_css .='#colophon h5, h5.footer-column-widget-title{';
            $pastry_bakers_theme_css .='text-align: right;';
        $pastry_bakers_theme_css .='}';
    }

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

    $pastry_bakers_footer_bg_image = get_theme_mod('pastry_bakers_footer_bg_image');
    if($pastry_bakers_footer_bg_image != false){
        $pastry_bakers_theme_css .='#colophon{';
            $pastry_bakers_theme_css .='background: url('.esc_attr($pastry_bakers_footer_bg_image).');';
        $pastry_bakers_theme_css .='}';
    }


    /*--------------------------- Copyright Background Color -------------------*/

    $pastry_bakers_copyright_background_color = get_theme_mod('pastry_bakers_copyright_background_color');
    if($pastry_bakers_copyright_background_color != false){
        $pastry_bakers_theme_css .='.footer_info{';
            $pastry_bakers_theme_css .='background-color: '.esc_attr($pastry_bakers_copyright_background_color).' !important;';
        $pastry_bakers_theme_css .='}';
    } 

    /*--------------------------- Site Title And Tagline Color -------------------*/

    $pastry_bakers_logo_title_color = get_theme_mod('pastry_bakers_logo_title_color');
    if($pastry_bakers_logo_title_color != false){
        $pastry_bakers_theme_css .='p.site-title a, .navbar-brand a{';
            $pastry_bakers_theme_css .='color: '.esc_attr($pastry_bakers_logo_title_color).' !important;';
        $pastry_bakers_theme_css .='}';
    }

    $pastry_bakers_logo_tagline_color = get_theme_mod('pastry_bakers_logo_tagline_color');
    if($pastry_bakers_logo_tagline_color != false){
        $pastry_bakers_theme_css .='.logo p.site-description, .navbar-brand p{';
            $pastry_bakers_theme_css .='color: '.esc_attr($pastry_bakers_logo_tagline_color).'  !important;';
        $pastry_bakers_theme_css .='}';
    }

    /*--------------------------- Footer Widget Content Alignment -------------------*/

    $pastry_bakers_footer_widget_content_alignment = get_theme_mod( 'pastry_bakers_footer_widget_content_alignment','Left');
    if($pastry_bakers_footer_widget_content_alignment == 'Left'){
        $pastry_bakers_theme_css .='#colophon ul, #colophon p, .tagcloud, .widget{';
        $pastry_bakers_theme_css .='text-align: left;';
        $pastry_bakers_theme_css .='}';
    }else if($pastry_bakers_footer_widget_content_alignment == 'Center'){
        $pastry_bakers_theme_css .='#colophon ul, #colophon p, .tagcloud, .widget{';
            $pastry_bakers_theme_css .='text-align: center;';
        $pastry_bakers_theme_css .='}';
    }else if($pastry_bakers_footer_widget_content_alignment == 'Right'){
        $pastry_bakers_theme_css .='#colophon ul, #colophon p, .tagcloud, .widget{';
            $pastry_bakers_theme_css .='text-align: right;';
        $pastry_bakers_theme_css .='}';
    }

    /*--------------------------- Copyright Content Alignment -------------------*/

    $pastry_bakers_copyright_content_alignment = get_theme_mod( 'pastry_bakers_copyright_content_alignment','Right');
    if($pastry_bakers_copyright_content_alignment == 'Left'){
        $pastry_bakers_theme_css .='.footer-menu-left{';
        $pastry_bakers_theme_css .='text-align: left;';
        $pastry_bakers_theme_css .='}';
    }else if($pastry_bakers_copyright_content_alignment == 'Center'){
        $pastry_bakers_theme_css .='.footer-menu-left{';
            $pastry_bakers_theme_css .='text-align: center;';
        $pastry_bakers_theme_css .='}';
    }else if($pastry_bakers_copyright_content_alignment == 'Right'){
        $pastry_bakers_theme_css .='.footer-menu-left{';
            $pastry_bakers_theme_css .='text-align: right;';
        $pastry_bakers_theme_css .='}';
    }

    /*---------------------------Width Layout -------------------*/

    $pastry_bakers_width_option = get_theme_mod( 'pastry_bakers_width_option','Full Width');
    if($pastry_bakers_width_option == 'Boxed Width'){
        $pastry_bakers_theme_css .='body{';
            $pastry_bakers_theme_css .='max-width: 1140px; width: 100%; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto;';
        $pastry_bakers_theme_css .='}';
        $pastry_bakers_theme_css .='.scrollup i{';
            $pastry_bakers_theme_css .='right: 100px;';
        $pastry_bakers_theme_css .='}';
        $pastry_bakers_theme_css .='.page-template-custom-home-page .home-page-header{';
            $pastry_bakers_theme_css .='padding: 0px 40px 0 10px;';
        $pastry_bakers_theme_css .='}';
    }else if($pastry_bakers_width_option == 'Wide Width'){
        $pastry_bakers_theme_css .='body{';
            $pastry_bakers_theme_css .='width: 100%;padding-right: 15px;padding-left: 15px;margin-right: auto;margin-left: auto;';
        $pastry_bakers_theme_css .='}';
        $pastry_bakers_theme_css .='.scrollup i{';
            $pastry_bakers_theme_css .='right: 30px;';
        $pastry_bakers_theme_css .='}';
    }else if($pastry_bakers_width_option == 'Full Width'){
        $pastry_bakers_theme_css .='body{';
            $pastry_bakers_theme_css .='max-width: 100%;';
        $pastry_bakers_theme_css .='}';
    }

    /*------------------ Nav Menus -------------------*/

    $pastry_bakers_nav_menu = get_theme_mod( 'pastry_bakers_nav_menu_text_transform','Uppercase');
    if($pastry_bakers_nav_menu == 'Capitalize'){
        $pastry_bakers_theme_css .='.main-navigation .menu > li > a{';
            $pastry_bakers_theme_css .='text-transform:Capitalize;';
        $pastry_bakers_theme_css .='}';
    }
    if($pastry_bakers_nav_menu == 'Lowercase'){
        $pastry_bakers_theme_css .='.main-navigation .menu > li > a{';
            $pastry_bakers_theme_css .='text-transform:Lowercase;';
        $pastry_bakers_theme_css .='}';
    }
    if($pastry_bakers_nav_menu == 'Uppercase'){
        $pastry_bakers_theme_css .='.main-navigation .menu > li > a{';
            $pastry_bakers_theme_css .='text-transform:Uppercase;';
        $pastry_bakers_theme_css .='}';
    }

    $pastry_bakers_menu_font_size = get_theme_mod( 'pastry_bakers_menu_font_size');
    if($pastry_bakers_menu_font_size != ''){
        $pastry_bakers_theme_css .='.main-navigation .menu > li > a{';
            $pastry_bakers_theme_css .='font-size: '.esc_attr($pastry_bakers_menu_font_size).'px;';
        $pastry_bakers_theme_css .='}';
    }

    $pastry_bakers_nav_menu_font_weight = get_theme_mod( 'pastry_bakers_nav_menu_font_weight',500);
    if($pastry_bakers_menu_font_size != ''){
        $pastry_bakers_theme_css .='.main-navigation .menu > li > a{';
            $pastry_bakers_theme_css .='font-weight: '.esc_attr($pastry_bakers_nav_menu_font_weight).';';
        $pastry_bakers_theme_css .='}';
    }

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

    $pastry_bakers_global_color = get_theme_mod('pastry_bakers_global_color');
    

    if ($pastry_bakers_global_color) {
        $pastry_bakers_theme_css .= ':root {';
        $pastry_bakers_theme_css .= '--first-color: ' . esc_attr($pastry_bakers_global_color) . ' !important;';
        $pastry_bakers_theme_css .= '} ';
    }

    /*------------------ Slider CSS -------------------*/

    $pastry_bakers_slider_content_layout = get_theme_mod( 'pastry_bakers_slider_content_layout','Center');
    if($pastry_bakers_slider_content_layout == 'Left'){
        $pastry_bakers_theme_css .='.slider-inner-box, #top-slider .slider-inner-box p{';
            $pastry_bakers_theme_css .='text-align : left;';
        $pastry_bakers_theme_css .='}';
    }
    if($pastry_bakers_slider_content_layout == 'Center'){
        $pastry_bakers_theme_css .='.slider-inner-box, #top-slider .slider-inner-box p{';
            $pastry_bakers_theme_css .='text-align : center;';
        $pastry_bakers_theme_css .='}';
    }
    if($pastry_bakers_slider_content_layout == 'Right'){
        $pastry_bakers_theme_css .='.slider-inner-box, #top-slider .slider-inner-box p{';
            $pastry_bakers_theme_css .='text-align : right;';
        $pastry_bakers_theme_css .='}';
    }

    /*------------------ Slider CSS -------------------*/
    $pastry_bakers_slider_opacity_setting = get_theme_mod( 'pastry_bakers_slider_opacity_setting',true);
    $pastry_bakers_image_opacity_color = get_theme_mod( 'pastry_bakers_image_opacity_color');
    $pastry_bakers_slider_opacity = get_theme_mod( 'pastry_bakers_slider_opacity');
    if( $pastry_bakers_slider_opacity_setting != false) {
        $pastry_bakers_theme_css .='.slider-box img{';
            $pastry_bakers_theme_css .='opacity: '. $pastry_bakers_slider_opacity. ';';
        $pastry_bakers_theme_css .='}';
        if( $pastry_bakers_image_opacity_color != '') {
            $pastry_bakers_theme_css .='.slider-box{';
                $pastry_bakers_theme_css .='background-color: '. $pastry_bakers_image_opacity_color. ';';
            $pastry_bakers_theme_css .='}';
        }
    } else {
        $pastry_bakers_theme_css .='.slider-box img{';
            $pastry_bakers_theme_css .='opacity: 1;';
        $pastry_bakers_theme_css .='}';
    }

    /*------------------ Footer CSS -------------------*/
    $pastry_bakers_footer_bg_color = get_theme_mod( 'pastry_bakers_footer_bg_color');
    if($pastry_bakers_footer_bg_color != '' ){
        $pastry_bakers_theme_css .='#colophon {';
            $pastry_bakers_theme_css .='background-color: '.esc_attr($pastry_bakers_footer_bg_color).'; ';
        $pastry_bakers_theme_css .='}';
    }

    $pastry_bakers_footer_content_color = get_theme_mod( 'pastry_bakers_footer_content_color');
    if($pastry_bakers_footer_content_color != ''){
        $pastry_bakers_theme_css .='#colophon, #colophon a, #colophon h5, #colophon .widget #wp-calendar caption {';
            $pastry_bakers_theme_css .='color: '.esc_attr($pastry_bakers_footer_content_color).';';
        $pastry_bakers_theme_css .='}';
    }

    /*------------------ Copyright CSS -------------------*/
    $pastry_bakers_copyright_text_color = get_theme_mod( 'pastry_bakers_copyright_text_color');
    if($pastry_bakers_copyright_text_color != ''){
        $pastry_bakers_theme_css .='#colophon .site-info a, #colophon .site-info span {';
            $pastry_bakers_theme_css .='color: '.esc_attr($pastry_bakers_copyright_text_color).';';
        $pastry_bakers_theme_css .='}';
    }

    /*--------------------------- Featured Image Border Radius -------------------*/

    $pastry_bakers_post_page_image_border_radius = get_theme_mod('pastry_bakers_post_page_image_border_radius', 0);
    if($pastry_bakers_post_page_image_border_radius != false){
        $pastry_bakers_theme_css .='.article-box img{';
            $pastry_bakers_theme_css .='border-radius: '.esc_attr($pastry_bakers_post_page_image_border_radius).'px;';
        $pastry_bakers_theme_css .='}';
    }

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

    $pastry_bakers_post_page_image_box_shadow = get_theme_mod('pastry_bakers_post_page_image_box_shadow',0);
    if($pastry_bakers_post_page_image_box_shadow != false){
        $pastry_bakers_theme_css .='.article-box img{';
            $pastry_bakers_theme_css .='box-shadow: '.esc_attr($pastry_bakers_post_page_image_box_shadow).'px '.esc_attr($pastry_bakers_post_page_image_box_shadow).'px '.esc_attr($pastry_bakers_post_page_image_box_shadow).'px #cccccc;';
        $pastry_bakers_theme_css .='}';
    }

    /*---------------- Single post Settings ------------------*/

    $pastry_bakers_single_post_navigation_show_hide = get_theme_mod('pastry_bakers_single_post_navigation_show_hide',true);
    if($pastry_bakers_single_post_navigation_show_hide != true){
        $pastry_bakers_theme_css .='.nav-links{';
            $pastry_bakers_theme_css .='display: none;';
        $pastry_bakers_theme_css .='}';
    }

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

    $pastry_bakers_single_post_page_image_box_shadow = get_theme_mod('pastry_bakers_single_post_page_image_box_shadow',0);
    if($pastry_bakers_single_post_page_image_box_shadow != false){
        $pastry_bakers_theme_css .='.single-post .entry-header img{';
            $pastry_bakers_theme_css .='box-shadow: '.esc_attr($pastry_bakers_single_post_page_image_box_shadow).'px '.esc_attr($pastry_bakers_single_post_page_image_box_shadow).'px '.esc_attr($pastry_bakers_single_post_page_image_box_shadow).'px #cccccc;';
        $pastry_bakers_theme_css .='}';
    }

     /*--------------------------- Single Post Page Image Border Radius -------------------*/

    $pastry_bakers_single_post_page_image_border_radius = get_theme_mod('pastry_bakers_single_post_page_image_border_radius', 0);
    if($pastry_bakers_single_post_page_image_border_radius != false){
        $pastry_bakers_theme_css .='.single-post .entry-header img{';
            $pastry_bakers_theme_css .='border-radius: '.esc_attr($pastry_bakers_single_post_page_image_border_radius).'px;';
        $pastry_bakers_theme_css .='}';
    }

     /*-------------------- Heading typography -------------------*/

    $pastry_bakers_heading_color = get_theme_mod('pastry_bakers_heading_color');
    $pastry_bakers_heading_font_family = get_theme_mod('pastry_bakers_heading_font_family');
    $pastry_bakers_heading_font_size = get_theme_mod('pastry_bakers_heading_font_size');
    if($pastry_bakers_heading_color != false || $pastry_bakers_heading_font_family != false || $pastry_bakers_heading_font_size != false){
        $pastry_bakers_theme_css .='h1, h2, h3, h4, h5, h6, .navbar-brand h1.site-title, h2.entry-title, h1.entry-title, h2.page-title, #latest_post h2, h2.woocommerce-loop-product__title, #colophon h5, .sidebar h5, .article-box h3.entry-title, .slider-inner-box h2, #top-slider .slider-inner-box h2, #top-slider .slider-inner-box h3, h2.wp-block-heading a, .featured h3.main-heading, .featured h4.main-heading, h5.slider-short, h5.box-title, h5.main-title, h5.class-title, h5.service-title, h6.box-short{';
            $pastry_bakers_theme_css .='color: '.esc_attr($pastry_bakers_heading_color).'!important; 
            font-family: '.esc_attr($pastry_bakers_heading_font_family).'!important;
            font-size: '.esc_attr($pastry_bakers_heading_font_size).'px !important;';
        $pastry_bakers_theme_css .='}';
    }

    $pastry_bakers_paragraph_color = get_theme_mod('pastry_bakers_paragraph_color');
    $pastry_bakers_paragraph_font_family = get_theme_mod('pastry_bakers_paragraph_font_family');
    $pastry_bakers_paragraph_font_size = get_theme_mod('pastry_bakers_paragraph_font_size');
    if($pastry_bakers_paragraph_color != false || $pastry_bakers_paragraph_font_family != false || $pastry_bakers_paragraph_font_size != false){
        $pastry_bakers_theme_css .='p, p.site-title, span, .article-box p, ul, li{';
            $pastry_bakers_theme_css .='color: '.esc_attr($pastry_bakers_paragraph_color).'!important; 
            font-family: '.esc_attr($pastry_bakers_paragraph_font_family).'!important;
            font-size: '.esc_attr($pastry_bakers_paragraph_font_size).'px !important;';
        $pastry_bakers_theme_css .='}';
    }