<?php

    $product_affiliate_theme_css= "";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    $product_affiliate_first_color = get_theme_mod('product_affiliate_first_color');
    $product_affiliate_second_color = get_theme_mod('product_affiliate_second_color');

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

    if ($product_affiliate_second_color) {
        $product_affiliate_theme_css .= ':root {';
        $product_affiliate_theme_css .= '--second-color: ' . esc_attr($product_affiliate_second_color) . ' !important;';
        $product_affiliate_theme_css .= '} ';
    }

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

    $product_affiliate_heading_color = get_theme_mod('product_affiliate_heading_color');
    $product_affiliate_heading_font_family = get_theme_mod('product_affiliate_heading_font_family');
    $product_affiliate_heading_font_size = get_theme_mod('product_affiliate_heading_font_size');
    if($product_affiliate_heading_color != false || $product_affiliate_heading_font_family != false || $product_affiliate_heading_font_size != false){
        $product_affiliate_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, h3.search-heading, .details h5{';
            $product_affiliate_theme_css .='color: '.esc_attr($product_affiliate_heading_color).'!important; 
            font-family: '.esc_attr($product_affiliate_heading_font_family).'!important;
            font-size: '.esc_attr($product_affiliate_heading_font_size).'px !important;';
        $product_affiliate_theme_css .='}';
    }

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

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

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

    /*------------------ Slider CSS -------------------*/
    $product_affiliate_slider_opacity_setting = get_theme_mod( 'product_affiliate_slider_opacity_setting',true);
    $product_affiliate_image_opacity_color = get_theme_mod( 'product_affiliate_image_opacity_color');
    $product_affiliate_slider_opacity = get_theme_mod( 'product_affiliate_slider_opacity');
    if( $product_affiliate_slider_opacity_setting != false) {
        $product_affiliate_theme_css .='.slider-box img{';
            $product_affiliate_theme_css .='opacity: '. $product_affiliate_slider_opacity. ';';
        $product_affiliate_theme_css .='}';
        if( $product_affiliate_image_opacity_color != '') {
            $product_affiliate_theme_css .='.slider-box{';
                $product_affiliate_theme_css .='background-color: '. $product_affiliate_image_opacity_color. ';';
            $product_affiliate_theme_css .='}';
        }
    } else {
        $product_affiliate_theme_css .='.slider-box img{';
            $product_affiliate_theme_css .='opacity: 1;';
        $product_affiliate_theme_css .='}';
    }

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

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

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

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

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

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

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

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

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

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

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

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

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