<?php if (!defined('ABSPATH')) die('Direct access forbidden.');
/**
 * dynamic css, generated by customizer options
 */

if ( defined( 'FW' ) ) {
    
    $typography = deliciko_option( 'typography' );
    $body_bg = deliciko_option( 'style_body_bg', '#fff' );
    $style_primary = deliciko_option( 'style_primary', '#bc906b');
    $title_color = deliciko_option( 'title_color', '#1c1c24');
    $style_primary_dark = deliciko_option( 'style_primary_dark','#333');
    
    // banner style
    $banner_style_settings = deliciko_option( 'banner_style_settings');
    $banner_overlay_color = $banner_style_settings['banner_overlay_color'];
    $banner_title_color = $banner_style_settings['banner_title_color'];
    $banner_heighlihgt_title_color = $banner_style_settings['banner_heighlihgt_title_color'];
    
    
    // menu settings
    $top_menu_color = deliciko_option( 'top_menu_color');
    $top_social_color = deliciko_option( 'top_social_color');

    $menu_color = deliciko_option( 'menu_color');
    $menu_hover_color = deliciko_option( 'menu_hover_color');
    $dropdown_menu_color = deliciko_option( 'dropdown_menu_color');
    $dropdown_menu_hover_color = deliciko_option( 'dropdown_menu_hover_color');
    $menu_font = deliciko_option( 'menu_font');



    // table button
    $header_table_button_settings = deliciko_option( 'header_table_button_settings');
     $header_button_bg_color = $header_table_button_settings['header_button_bg_color'];
     $header_button_text_color = $header_table_button_settings['header_button_text_color'];

     $header_button_bg_colors='';
     $header_button_text_colors='';

    if($header_button_bg_color !=''){
        $header_button_bg_colors = $header_button_bg_color;
    }
    if($header_button_text_color !=''){
        $header_button_text_colors = $header_button_text_color;
    }

    $global_body_font = deliciko_option( 'body_font' );
    Deliciko_Unyson_Google_Fonts::add_typography_v2( $global_body_font );
    $body_font = deliciko_advanced_font_styles( $global_body_font );
    $body_font= deliciko_array_elements_remove($body_font, 2);
    
    $heading_font_one = deliciko_option( 'heading_font_one' );
    Deliciko_Unyson_Google_Fonts::add_typography_v2( $heading_font_one );
    $heading_font_one = deliciko_advanced_font_styles( $heading_font_one );
   
    $heading_font_two = deliciko_option( 'heading_font_two' );
    Deliciko_Unyson_Google_Fonts::add_typography_v2( $heading_font_two );
    $heading_font_two = deliciko_advanced_font_styles( $heading_font_two );

    $heading_font_three = deliciko_option( 'heading_font_three' );
    Deliciko_Unyson_Google_Fonts::add_typography_v2( $heading_font_three );
    $heading_font_three = deliciko_advanced_font_styles( $heading_font_three );

    Deliciko_Unyson_Google_Fonts::add_typography_v2( $menu_font );
    $menu_font = deliciko_advanced_font_styles( $menu_font );

    // init custom css
    $custom_css	 = deliciko_option( 'custom_css' );
    $output = $custom_css;

    // global style
    $output	.= "
        body{ $body_font }

        h1,h2{
            $heading_font_one
        }
        h3{ 
            $heading_font_two 
        }

        h4{ 
            $heading_font_three
        }
    
       
      

        a, .post-meta span i, .entry-header .entry-title a:hover, .sidebar ul li a:hover{
            color: $style_primary;
        }

        .entry-header .entry-title a{
            color: $title_color;
        }
     
        body{
            background-color: $body_bg;
        }
      
     
        .single-intro-text .count-number, .sticky.post .meta-featured-post,
        .sidebar .widget .widget-title:before, .pagination li.active a, .pagination li:hover a,
        .pagination li.active a:hover, .pagination li:hover a:hover,
        .sidebar .widget.widget_search .input-group-btn, .tag-lists a:hover, .tagcloud a:hover,
        .BackTo, .ticket-btn.btn:hover,
        .btn-primary,
        .BackTo,
        .woocommerce ul.products li.product .button,.woocommerce ul.products li.product .added_to_cart,
        .woocommerce nav.woocommerce-pagination ul li a:focus, .woocommerce nav.woocommerce-pagination ul li a:hover, .woocommerce nav.woocommerce-pagination ul li span.current,
        .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt,.sponsor-web-link a:hover i, .woocommerce .widget_price_filter .ui-slider .ui-slider-range,
        .woocommerce span.onsale,
        .woocommerce ul.products li.product .added_to_cart:hover, .woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover,.woocommerce .widget_price_filter .ui-slider .ui-slider-handle{
            background: $style_primary;
        }

        .btn-primary{
            border-color: $style_primary;
        }



        .copyright .footer-social li a i:hover,
        .copyright .copyright-text a,
        .header .navbar-container .navbar-light .main-menu li a:hover,
        .header .navbar-container .navbar-light .main-menu li.active > a,
        .post .entry-header .entry-title a:hover,
        a:hover,
        .woocommerce ul.products li.product .price, 
        .woocommerce ul.products li.product .woocommerce-loop-product__title:hover{
            color: $style_primary;
        }

        ";
     
     if($header_button_bg_colors!=''){
         $output .= "
         .header-book-btn .btn-primary{
            background: $header_button_bg_colors;
            border-color: $header_button_bg_colors;
        }
         "; 
      }    
     if($header_button_text_colors!=''){
         $output .= "
         .header-book-btn .btn-primary{
            color: $header_button_text_colors;
        }
         "; 
      }    
     if($top_social_color!=''){
         $output .= "
         .social-links li a,
         .topbar-transparent .social-links li a,
         .topbar .social-links li a{
             color:  $top_social_color;
         }
         "; 
      }    
     if($top_menu_color!=''){
         $output .= "
            .top-contact-info li{
            color: $top_menu_color;
           }
         "; 
      }    
     if($dropdown_menu_hover_color!=''){
         $output .= "
         .header .navbar-container .navbar-light .main-menu li ul.dropdown-menu li a:hover{
            color: $dropdown_menu_hover_color;
        }
         "; 
      }    
     if($dropdown_menu_color!=''){
         $output .= "
         .header .navbar-container .navbar-light .main-menu li ul.dropdown-menu li a{
            color: $dropdown_menu_color;
        }
         "; 
      }    
     if($menu_color!=''){
         $output .= "
            .header .navbar-container .navbar-light .main-menu > li > a,
            .header-transparent .header-nav-right-info li{
            $menu_font
            color:  $menu_color;
         }"; 
      }    
     if($menu_hover_color!=''){
         $output .= "
           .header .navbar-container .navbar-light .main-menu > li > a:hover{
            color:  $menu_hover_color; 
           }
         "; 
      }    
     if($banner_title_color!=''){
         $output .= "
              .banner-area .banner-title{
                 color: $banner_title_color;
               }
             "; 
      }    
     if($banner_heighlihgt_title_color!=''){
         $output .= "
         .banner-area .banner-title span{
            color: $banner_heighlihgt_title_color;
            }
          "; 
      }    
     if($banner_overlay_color!=''){
         $output .= "
         .banner-area:before{
            background-color: $banner_overlay_color;
         }
         "; 
      }    
       

    // footer style
    $footer_bg_color = deliciko_option( 'footer_bg_color', '#000000' );
    $footer_copyright_color = deliciko_option( 'footer_copyright_color', '#fff' );
    $footer_padding_top = deliciko_option( 'footer_padding_top', '70px' );
    $output	.= "

        .ts-footer{
            background-color: $footer_bg_color;
            padding-top:$footer_padding_top;
        }
        
        ";
     $output .= "

      .copyright .copyright-text{
         color: $footer_copyright_color;
      }

     ";   

    wp_add_inline_style( 'deliciko-style', $output );
}

