<?php

define('AIDOO_VER', '1.0.0');

class Aidoo_Core
{
    /**
     * Class prefix for autoload
     *
     * @var string
     */
    protected $prefix = 'Aidoo';

    /**
     * Variable hold the page options
     *
     * @var array
     */

    public function __construct()
    {
        require_once get_template_directory() . '/netbase-core/vendor/tgmpa/class-tgm-plugin-activation.php';

        if(! class_exists('Merlin')) {
            require_once get_parent_theme_file_path( '/inc/merlin/vendor/autoload.php' );
            require_once get_parent_theme_file_path( '/inc/merlin/class-merlin.php' );
            require_once get_parent_theme_file_path( '/netbase-core/import/merlin-config.php' );
        }

        spl_autoload_register(array($this, 'autoload'));

        include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
        new Aidoo_Customize();

        Aidoo_Helper::include_template_tags();

        if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
            new Aidoo_Extensions_Woocommerce();
        }

        require_once get_template_directory() . '/netbase-core/extensions/extras.php';

        add_action('after_switch_theme', array($this, 'nbcore_setup_after_switch_theme'));
        add_action('after_setup_theme', array($this, 'nbcore_theme_setup'));
        add_action('widgets_init', array($this, 'nbcore_default_sidebars'));
        add_action('wp_enqueue_scripts', array($this, 'core_scripts_enqueue'), 9998);
        add_action('wp_enqueue_scripts', array($this, 'nbcore_print_embed_style'), 9999);
        add_action('wp_enqueue_scripts', array($this, 'nbcore_google_fonts_url'));
        add_action('wp_head', array('Aidoo_Helper', 'nbcore_pingback_header'));

        add_filter('body_class', array('Aidoo_Helper', 'nbcore_body_classes'));
        add_filter('show_recent_comments_widget_style', '__return_false');
        add_filter('upload_mimes', array($this, 'nbcore_upload_mimes'));
        add_filter( 'woocommerce_prevent_automatic_wizard_redirect', array($this, 'nbcore_woo_prevent_automatic_wizard_redirect'));

        $content_width = 1170;

        if(empty(get_transient('current_load_css')) && $this->nbcore_is_plugin_active_byme('nb-fw/nb-fw.php')) {
            set_transient('current_load_css', NBT_LOAD_CUSTOMIZE_FROM_HEAD, NBT_TIMEOUT_TRANSIENT_CUSTOMIZE);
        }

        //Exclude pages from WordPress Search
        if (!is_admin()) {
            function wpb_search_filter($query) {
                if ($query->is_search && ! $query->is_archive) {
                    $query->query_vars['posts_per_page'] = 9;
                }
                return $query;
            }
            add_filter('pre_get_posts','wpb_search_filter');
        }
    }

    

    public function autoload($class_name)
    {
        if (0 !== strpos($class_name, $this->prefix)) {
            return false;
        }

        // Generate file path from class name.
        $base = get_template_directory() . '/netbase-core/';
        $path = strtolower(str_replace('_', '/', substr($class_name, strlen($this->prefix))));

        // Check if class file exists.
        $standard = $path . '.php';
        $alternative = $path . '/' . current(array_slice(explode('/', str_replace('\\', '/', $path)), -1)) . '.php';

        while (true) {
            // Check if file exists in standard path.
            if (@is_file($base . $standard)) {
                $exists = $standard;

                break;
            }

            // Check if file exists in alternative path.
            if (@is_file($base . $alternative)) {
                $exists = $alternative;

                break;
            }

            // If there is no more alternative file, quit the loop.
            if (false === strrpos($standard, '/') || 0 === strrpos($standard, '/')) {
                break;
            }

            // Generate more alternative files.
            $standard = preg_replace('#/([^/]+)$#', '-\\1', $standard);
            $alternative = implode('/', array_slice(explode('/', str_replace('\\', '/', $standard)), 0, -1)) . '/' . substr(current(array_slice(explode('/', str_replace('\\', '/', $standard)), -1)), 0, -4) . '/' . current(array_slice(explode('/', str_replace('\\', '/', $standard)), -1));
        }

        // Include class declaration file if exists.
        if (isset($exists)) {
            return include_once $base . $exists;
        }

        return false;
    }

    public function nbcore_theme_setup()
    {
        new Aidoo_Admin();
       
        load_theme_textdomain('aidoo', get_template_directory() . '/languages');

        // Add default posts and comments RSS feed links to head.
        add_theme_support('automatic-feed-links');

        /*
         * Let WordPress manage the document title.
         * By adding theme support, we declare that this theme does not use a
         * hard-coded <title> tag in the document head, and expect WordPress to
         * provide it for us.
         */
        add_theme_support('title-tag');

        /*
         * Enable support for Post Thumbnails on posts and pages.
         *
         * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
         */
        add_theme_support('post-thumbnails');

        // A theme must have at least one navbar, right?
        register_nav_menus(array(
            'primary' => esc_html__('Primary', 'aidoo'),
            'header-sub' => esc_html__('Header sub menu', 'aidoo'),
        ));

        /*
         * Switch default core markup for search form, comment form, and comments
         * to output valid HTML5.
         */
        add_theme_support('html5', array(
            'search-form',
            'comment-form',
            'comment-list',
            'gallery',
            'caption',
        ));

        /*
         * Enable support for Post Formats.
         * See https://developer.wordpress.org/themes/functionality/post-formats/
         */

        // Add theme support for selective refresh for widgets.
        add_theme_support('customize-selective-refresh-widgets');

        add_image_size('nbcore-masonry', 450, 450, true);
        
        add_theme_support( 'woocommerce' );

        add_theme_support('custom-header');

        add_theme_support('custom-background');

        add_editor_style(get_template_directory_uri() . '/assets/editor-style/editor-style.css');
    }

    public function nbcore_setup_after_switch_theme() {
        //update revslider-templates-check option to prevent download rev templates
        update_option( 'revslider-templates-check', strtotime(date("Y-m-d H:i:s")), 'yes' );
    }

    // since woo 3.6, need this function to activate plugin below Woo in Merlin Import
    public function nbcore_woo_prevent_automatic_wizard_redirect() {
        return true;
    }



    /**
     * Theme default sidebar.
     *
     * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
     */
    public function nbcore_default_sidebars()
    {
        register_sidebar(array(
            'name' => esc_html__('Default Sidebar', 'aidoo'),
            'id' => 'default-sidebar',
            'description' => esc_html__('Add widgets here.', 'aidoo'),
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<div class="wrap-title"><h4 class="widget-title">',
            'after_title' => '</h4></div>',
        ));

        register_sidebar(array(
            'name' => esc_html__('Shop Sidebar', 'aidoo'),
            'id' => 'shop-sidebar',
            'description' => esc_html__('Add widgets for category page.', 'aidoo'),
            'before_widget' => '<div id="%1$s" class="widget %2$s shop-sidebar">',
            'after_widget' => '</div>',
            'before_title' => '<h4 class="widget-title">',
            'after_title' => '</h4>',
        ));

        register_sidebar(array(
            'name' => esc_html__('Page Sidebar', 'aidoo'),
            'id' => 'page-sidebar',
            'description' => esc_html__('Add widgets for single page.', 'aidoo'),
            'before_widget' => '<div id="%1$s" class="widget %2$s page-sidebar">',
            'after_widget' => '</div>',
            'before_title' => '<h4 class="widget-title">',
            'after_title' => '</h4>',
        ));

        register_sidebar(array(
            'name' => esc_html__('Product Sidebar', 'aidoo'),
            'id' => 'product-sidebar',
            'description' => esc_html__('Add widgets for product details page', 'aidoo'),
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<div class="wrap-title"><h4 class="widget-title">',
            'after_title' => '</h4></div>',
        ));

        register_sidebar(array(
            'name' => esc_html__('Currency Switcher', 'aidoo'),
            'id' => 'currency-switcher',
            'description' => esc_html__('For best display, please assign only one widget in this section.', 'aidoo'),
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h4 class="widget-title">',
            'after_title' => '</h4>',
        ));

        register_sidebar(array(
            'name' => esc_html__('Footer Bottom #1', 'aidoo'),
            'id' => 'footer-bot-1',
            'description' => esc_html__('For best display, please assign only one widget in this section.', 'aidoo'),
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h4 class="widget-title">',
            'after_title' => '</h4>',
        ));

        register_sidebar(array(
            'name' => esc_html__('Footer Bottom #2', 'aidoo'),
            'id' => 'footer-bot-2',
            'description' => esc_html__('For best display, please assign only one widget in this section.', 'aidoo'),
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h4 class="widget-title">',
            'after_title' => '</h4>',
        ));

        register_sidebar(array(
            'name' => esc_html__('Footer Bottom #3', 'aidoo'),
            'id' => 'footer-bot-3',
            'description' => esc_html__('For best display, please assign only one widget in this section.', 'aidoo'),
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h4 class="widget-title">',
            'after_title' => '</h4>',
        ));

        register_sidebar(array(
            'name' => esc_html__('Footer Bottom #4', 'aidoo'),
            'id' => 'footer-bot-4',
            'description' => esc_html__('For best display, please assign only one widget in this section.', 'aidoo'),
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h4 class="widget-title">',
            'after_title' => '</h4>',
        ));

        register_sidebar(array(
            'name' => esc_html__('Footer Bottom #5', 'aidoo'),
            'id' => 'footer-bot-5',
            'description' => esc_html__('For best display, please assign only one widget in this section.', 'aidoo'),
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h4 class="widget-title">',
            'after_title' => '</h4>',
        ));
    }


    // Todo change to minified version and load conditional. Example: isotope is now always load
    public function core_scripts_enqueue()
    {
        //TODO Remember this
        // wp_dequeue_script('wc-cart');
        wp_enqueue_style('fontello', get_template_directory_uri() . '/assets/vendor/fontello/fontello.css', array(), AIDOO_VER);

        wp_enqueue_style('nbcore_front_style', get_template_directory_uri() . '/assets/netbase/css/main.css', array(), AIDOO_VER);

        if(is_rtl()){
            wp_enqueue_style('nbcore_front_style_rtl', get_template_directory_uri() . '/rtl.css', array(), AIDOO_VER);
        }

        wp_enqueue_script('isotope', get_template_directory_uri() . '/assets/vendor/isotope/isotope.pkdg.min.js', array('jquery', 'imagesloaded'), '3.0.3', true);

        wp_enqueue_style('magnific-popup', get_template_directory_uri() . '/assets/vendor/magnific-popup/magnific-popup.css', array(), '2.0.5');
        wp_enqueue_script('magnific-popup', get_template_directory_uri() . '/assets/vendor/magnific-popup/jquery.magnific-popup.min.js', array('jquery'), '2.0.5', true);

        wp_enqueue_style('swiper', get_template_directory_uri() . '/assets/vendor/swiper/swiper.min.css', array(), '4.5.0');
        wp_enqueue_script('swiper', get_template_directory_uri() . '/assets/vendor/swiper/swiper.min.js', array('jquery'), '4.5.0', true);

        if (is_singular() && comments_open() && get_option('thread_comments')) {
            wp_enqueue_script('comment-reply');
        }

        if (function_exists('is_product') && is_product() && 'accordion-tabs' == aidoo_get_options('nbcore_info_style')) {
            wp_enqueue_script('jquery-ui-accordion');
        }

        if (aidoo_get_options('nbcore_header_fixed')) {
            wp_enqueue_script('waypointstheme', get_template_directory_uri() . '/assets/vendor/waypoints/jquery.waypoints.min.js', array('jquery'), '4.0.1', true);
        }

        if (aidoo_get_options('nbcore_blog_sticky_sidebar') || aidoo_get_options('shop_sticky_sidebar') || aidoo_get_options('product_sticky_sidebar'))  {
            wp_enqueue_script('sticky-kit', get_template_directory_uri() . '/assets/vendor/sticky-kit/jquery.sticky-kit.min.js', array('jquery'), '1.1.2', true);
        }

        wp_enqueue_script('nbcore_front_script', get_template_directory_uri() . '/assets/netbase/js/main.js', array('jquery'), AIDOO_VER, true);

        $localize_array = array(
            'ajaxurl'               => admin_url( 'admin-ajax.php', 'relative' ),
            'rest_api_url'          => home_url() . '/wp-json/wp/v2/',
            'upsells_columns'       => aidoo_get_options('nbcore_pd_upsells_columns'),
            'related_columns'       => aidoo_get_options('nbcore_pd_related_columns'),
            'cross_sells_columns'   => aidoo_get_options('nbcore_cross_sells_per_row'),
            'thumb_pos'             => aidoo_get_options('nbcore_pd_thumb_pos'),
            'menu_resp'             => aidoo_get_options('nbcore_menu_resp'),
        );
        
        wp_localize_script('nbcore_front_script','aidoo', $localize_array);

        wp_dequeue_script('yith-wcqv-frontend');
        wp_dequeue_style('yith-quick-view');
    }


    //TODO optimize this(grouping and bring to css if can)
    //TODO early esc_
    public static function get_embed_style()
    {
        $bg_color = aidoo_get_options('nbcore_background_color');
        $inner_bg = aidoo_get_options('nbcore_inner_background');

        $top_padding = aidoo_get_options('nbcore_top_section_padding');
        $top_bg = aidoo_get_options('nbcore_header_top_bg');
        $top_color = aidoo_get_options('nbcore_header_top_color');
        $top_color_hover = aidoo_get_options('nbcore_header_top_color_hover');
        $middle_padding = aidoo_get_options('nbcore_middle_section_padding');
        $middle_bg = aidoo_get_options('nbcore_header_middle_bg');
        $middle_color = aidoo_get_options('nbcore_header_middle_color');
        $middle_color_hover = aidoo_get_options('nbcore_header_middle_color_hover');
        
        $bot_padding = aidoo_get_options('nbcore_bot_section_padding');
        $bot_bg = aidoo_get_options('nbcore_header_bot_bg');
        $bot_color = aidoo_get_options('nbcore_header_bot_color');
        $menu_color = aidoo_get_options('nbcore_header_mainmn_color');
        $menu_header_color = aidoo_get_options('nbcore_header_mainmn_head_color');
        $menu_bor = aidoo_get_options('nbcore_header_mainmn_bor');
        $menu_color2 = aidoo_get_options('nbcore_header_mainmnhover_color');
        $menu_bor2 = aidoo_get_options('nbcore_header_mainmnhover_bor');

        $logo_area_width = aidoo_get_options('nbcore_logo_width');
        $logo_currency_width = aidoo_get_options('nbcore_logo_currency_width');
        $blog_width = aidoo_get_options('nbcore_blog_width');
        $primary_color = aidoo_get_options('nbcore_primary_color');
        $divider_color = aidoo_get_options('nbcore_divider_color');

        $font_type_scale = aidoo_get_options('font_type_scale');
        $heading_font_array = explode(",", aidoo_get_options('heading_font_family'));
        $heading_family = end($heading_font_array);
        $heading_font_style = explode(",", aidoo_get_options('heading_font_style'));
        $heading_weight = end($heading_font_style);
        $heading_color = aidoo_get_options('nbcore_heading_color');

        $heading_base_size = aidoo_get_options('heading_base_size');

        $body_family_array = explode(",", aidoo_get_options('body_font_family'));
        $body_family = end($body_family_array);
        $body_style_array = explode(",", aidoo_get_options('body_font_style'));
        $body_weight = end($body_style_array);
        $body_color = aidoo_get_options('nbcore_body_color');
        $body_size = aidoo_get_options('body_font_size');

        $link_color = aidoo_get_options('nbcore_link_color');
        $link_hover_color = aidoo_get_options('nbcore_link_hover_color');

        $blog_sidebar = aidoo_get_options('nbcore_blog_sidebar');
        $page_title_padding = aidoo_get_options('nbcore_page_title_padding');
        $page_title_color = aidoo_get_options('nbcore_page_title_color');

        $wc_content_width = aidoo_get_options('nbcore_shop_content_width');
        $shop_sidebar = aidoo_get_options('nbcore_shop_sidebar');
        $loop_columns = aidoo_get_options('nbcore_loop_columns');
        $pd_details_sidebar = aidoo_get_options('nbcore_pd_details_sidebar');
        $pd_details_width = aidoo_get_options('nbcore_pd_details_width');
        $pd_images_width = aidoo_get_options('nbcore_pd_images_width');

        $pb_bg = aidoo_get_options('nbcore_pb_background');
        $pb_bg_hover = aidoo_get_options('nbcore_pb_background_hover');
        $pb_text = aidoo_get_options('nbcore_pb_text');
        $pb_text_hover = aidoo_get_options('nbcore_pb_text_hover');
        $pb_border = aidoo_get_options('nbcore_pb_border');
        $pb_border_hover = aidoo_get_options('nbcore_pb_border_hover');
        $pb_mask = aidoo_get_options('nbcore_pb_mask');

        $sb_bg = aidoo_get_options('nbcore_sb_background');
        $sb_bg_hover = aidoo_get_options('nbcore_sb_background_hover');
        $sb_text = aidoo_get_options('nbcore_sb_text');
        $sb_text_hover = aidoo_get_options('nbcore_sb_text_hover');
        $sb_border = aidoo_get_options('nbcore_sb_border');
        $sb_border_hover = aidoo_get_options('nbcore_sb_border_hover');

        $button_padding = aidoo_get_options('nbcore_button_padding');
        $button_border_radius = aidoo_get_options('nbcore_button_border_radius');
        $button_border_width = aidoo_get_options('nbcore_button_border_width');

        $footer_top_heading = aidoo_get_options('nbcore_footer_top_heading');
        $footer_top_color = aidoo_get_options('nbcore_footer_top_color');
        $footer_top_bg = aidoo_get_options('nbcore_footer_top_bg');
        $footer_top_padding_top = aidoo_get_options('nbcore_footer_top_padding_top');
        $footer_top_padding_bottom = aidoo_get_options('nbcore_footer_top_padding_bottom');
        $footer_bot_heading = aidoo_get_options('nbcore_footer_bot_heading');
        $footer_bot_color = aidoo_get_options('nbcore_footer_bot_color');
        $footer_bot_bg = aidoo_get_options('nbcore_footer_bot_bg');
        $footer_bot_padding_top = aidoo_get_options('nbcore_footer_bot_padding_top');
        $footer_bot_padding_bottom = aidoo_get_options('nbcore_footer_bot_padding_bottom');
        $footer_bot_border_top_color = aidoo_get_options('nbcore_footer_bot_border_top_color');
        $footer_bot_border_bot_color = aidoo_get_options('nbcore_footer_bot_border_bot_color');
        $footer_abs_bg = aidoo_get_options('nbcore_footer_abs_bg');
        $footer_abs_color = aidoo_get_options('nbcore_footer_abs_color');

        $blog_title_size = aidoo_get_options('nbcore_blog_single_title_size');
        $page_title_size = aidoo_get_options('nbcore_page_title_size');

        $footer_abs_padding = aidoo_get_options('nbcore_footer_abs_padding');

        $pages_sidebar      = aidoo_get_options('nbcore_pages_sidebar');
        $page_content_width = aidoo_get_options('nbcore_page_content_width') != 0 ? aidoo_get_options('nbcore_page_content_width') : 70;

        $page_bg = wp_get_attachment_image_src(get_post_meta(get_the_ID(), 'page_bg_image', true), 'full');
        $page_bg_color = get_post_meta(get_the_ID(), 'page_bg_color', true);
        $nbcore_container_width = aidoo_get_options('nbcore_container_width');
        $main_content_super_width = $nbcore_container_width - 300;
        

        $css = "";

        if(isset($nbcore_container_width) && $nbcore_container_width > 1170){
            $css .= "
            @media (min-width: 1920px){
                .container {
                    max-width: " . esc_attr($nbcore_container_width) . "px;
                    width: " . esc_attr($nbcore_container_width) . "px;
                }
                
            }
            ";
        }

        if(isset($nbcore_container_width) && $nbcore_container_width == 1790){
            $css .= "
            @media (min-width: 1920px){
                .site-content .layout-content {
                    max-width: " . esc_attr($main_content_super_width) . "px;
                    width: " . esc_attr($main_content_super_width) . "px;
                }
                
            }
            ";
        }

        if($body_family_array[0] === 'custom') {
            $body_custom_font_url = array_slice($body_family_array, 1, -1);
            $css .= "
            @font-face {
                font-family: '" . end($body_family_array) . "';            
                ";

                foreach($body_custom_font_url as $url) {
                    $css .= "
                    src: url('" . esc_url($url) . "');
                    ";
                }

                $css .= "
            }
            ";
        }
        if($heading_font_array[0] === 'custom') {
            $heading_custom_font_url = array_slice($heading_font_array, 1, -1);
            $css .= "
            @font-face {
                font-family: '" . end($heading_font_array) . "';            
                ";

                foreach($heading_custom_font_url as $url) {
                    $css .= "
                    src: url('" . esc_url($url) . "');
                    ";
                }

                $css .= "
            }
            ";
        }
        $css .= "
            #site-wrapper {
        background: " . esc_attr($bg_color) . ";
    }
    .nb-page-title-wrap,
    .shop-main.accordion-tabs .accordion-title-wrap,
    .woocommerce .woocommerce-message,
    .woocommerce .woocommerce-info,
    .woocommerce .woocommerce-error,
    .woocommerce-page .woocommerce-message,
    .woocommerce-page .woocommerce-info,
    .woocommerce-page .woocommerce-error,
    .blog.style-2 .post .entry-content
    {
        background-color: " . esc_attr($inner_bg) . ";
    }
    .products.list-type .product .list-type-wrap .product-image:before {
        border-right-color: " . esc_attr($inner_bg) . ";
    }
    .main-logo img{
        width: " . esc_attr($logo_area_width) . "px;
    }
    .dd-select .dd-selected img,
    .site-header .sub-navigation .menu-menu-top-left-container ~ .WOOCS_SELECTOR .woocs_flag_view_item{
        width: " . esc_attr($logo_currency_width) . "px;
    }
    .dd-options .dd-option img{
        width: calc(" . esc_attr($logo_currency_width) . "px + 15px);
    }
    a,
    .widget ul li a,
    .footer-section a,
    .footer-section .widget ul li a {
        color: " . esc_attr($link_color) . ";
    }
    a:hover, a:focus, a:active,
    .widget ul li a:hover,
    .widget_nbelement_contact_info ul.nbelement-info li:hover i {
        color: " . esc_attr($link_hover_color) . ";
    }
    body {
        font-family: " . esc_attr($body_family) . "; 
        font-weight: " . esc_attr($body_weight) . ";
        font-size: " . esc_attr($body_size) . "px;
        ";
        if (in_array("italic", $body_style_array)) {
            $css .= "
            font-style: italic;
            ";
        }
        if (in_array("underline", $body_style_array)) {
            $css .= "
            text-decoration: underline;
            ";
        }
        if (in_array("uppercase", $body_style_array)) {
            $css .= "
            text-transform: uppercase;
            ";
        }
        $css .= "
    }
    .button,
    .category_banner .vc_column-inner .button_comback_shop a,
    .nb_layout_wp-img-left .nb_wp_post .nb-post-block .nb-post-content .nb-post-readmore a,
    .nb_layout_wp-img-top .nb_wp_post .nb-post-block .nb-post-content .readmore,
    .button_joinus.vc_btn3-center.vc_btn3-container a.vc_general.vc_btn3,
    .nb-primary-button,
    .wc-proceed-to-checkout a,
    span.nb-checkout-button input,
    .single_add_to_cart_button .button-mask,
    .error404 .home-link a,
    .wishlist_add_to_cart_button a,
    #blog_swipper .entry-content .read-more-link a,
    .blog .post .read-more-link .readmore-shadow a,
    .search-results .content-search .wrap_post article .readmore a,
    .shop-main .woocommerce-Reviews #review_form_wrapper .form-submit input,
    .cart-notice-wrap .cart-url a,
    .form-contact .wpcf7 p input[type=\"submit\"]
    {
        color: " . esc_attr($pb_text) . " !important;
        background-color: " . esc_attr($pb_bg) . ";
        border-color: " . esc_attr($pb_border) . ";
    }
    .woocommerce-order .btn-pdf-preview,.text-notice a{
        color: " . esc_attr($pb_text) . " !important;
        background-color: " . esc_attr($pb_bg) . " !important;
        border-color: " . esc_attr($pb_border) . " !important;        
    }
    .button:hover, .button:focus, .nb-primary-button:focus,
    .contact-tshirt .contact_right input[type='submit']:hover,
    .button_joinus.vc_btn3-center.vc_btn3-container a.vc_general.vc_btn3:hover,
    .category_banner .vc_column-inner .button_comback_shop a:hover,
    .nb_layout_wp-img-left .nb_wp_post .nb-post-block .nb-post-content .nb-post-readmore a:hover,
    .nb_layout_wp-img-top .nb_wp_post .nb-post-block .nb-post-content .readmore:hover,
    .wpb_content_element .wp-posts .nb_wp_post .nb-post-readmore.btn-shadow a.readmore:hover,
    .category .blog .bt-4.nb-secondary-button:hover,
    .nb-primary-button:hover,
    .related div[class^=\"swiper-button-\"]:hover,
    
    .wc-proceed-to-checkout a:hover,
    span.nb-checkout-button input:hover,
    .single_add_to_cart_button .button-mask:hover,

    .error404 .home-link a:hover,
    .wishlist_add_to_cart_button a:hover,

    #blog_swipper .entry-content .read-more-link a:hover,
    .blog .post .read-more-link .readmore-shadow a:hover,
    .search-results .content-search .wrap_post article .readmore a:hover,
    .shop-main .woocommerce-Reviews #review_form_wrapper .form-submit input:hover,
    .cart-notice-wrap .cart-url a:hover,
    .form-contact .wpcf7 p input[type=\"submit\"]:hover
    {
        color: " . esc_attr($pb_text_hover) . " !important;
        background-color: " . esc_attr($pb_bg_hover) . ";
        border-color: " . esc_attr($pb_border_hover) . ";
    }
    .woocommerce-order .btn-pdf-preview:hover,.text-notice a:hover,.woocommerce-checkout .woocommerce a.button:hover{
        color: " . esc_attr($pb_text_hover) . " !important;
        background-color: " . esc_attr($pb_bg_hover) . " !important;
        border-color: " . esc_attr($pb_border_hover) . " !important;        
    }
    .wpb_content_element .wp-posts .nb_wp_post .nb-post-readmore.btn-shadow:before {
        background-color: " . esc_attr($pb_bg_hover) . ";
    }";
    if ($pb_mask) {
        $css .= "
        .wc-proceed-to-checkout,
        span.nb-checkout-button,
        .nb_layout_wp-img-left .nb_wp_post .nb-post-block .nb-post-content .nb-post-readmore,
        .nb_layout_wp-img-top .nb_wp_post .nb-post-block .nb-post-content .nb-post-readmore,
        .error404 .home-link,
        .wishlist_add_to_cart_button,
        .search-results .content-search .wrap_post article .readmore,
        .single-post .comment-form > p.form-submit,
        .cart-notice-wrap .cart-url
         {
            position: relative;
            z-index: 1;
        }
        span.nb-checkout-button {
            display: block;
        }
        .mini-cart-wrap .buttons a {
            position: relative;
        }
        .single_add_to_cart_button {
            position: relative;
            z-index: 1;
            border: none;
            width: calc(100% - 150px);
        }
        .grouped_form .single_add_to_cart_button {
            width: auto;
        }
        .single_add_to_cart_button .button-mask {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            border: solid 1px;
            transition: all .2s ease;
        }

        span.nb-update-cart-button,
        .shop-main .woocommerce-Reviews #review_form_wrapper .form-submit,
        .woocommerce-cart .return-to-shop,
        .form-contact .wpcf7 .wpcf7-form > p:nth-child(3) {
            display: inline-block;
            position: relative;
            z-index: 1;
        }

        .nb_layout_wp-img-top .nb_wp_post .nb-post-block .nb-post-content .nb-post-readmore {
            width: auto;
            display: inline-block;
        }

        .wc-proceed-to-checkout a:before,
        #blog_swipper .entry-content .read-more-link a:before,
        .blog .post .read-more-link .readmore-shadow a:before,
        .nb_layout_wp-img-left .nb_wp_post .nb-post-block .nb-post-content .nb-post-readmore a:before,
        .nb_layout_wp-img-top .nb_wp_post .nb-post-block .nb-post-content .nb-post-readmore a:before,
        .mini-cart-wrap .buttons a:before,
        .single_add_to_cart_button .button-mask:before,
        span.nb-checkout-button:before,
        span.nb-update-cart-button:before,
        .error404 .home-link a:before,
        .custom-login-wrap.has-register-form .custom-login .login-wrap form p.form-row:before,
        .custom-login-wrap.has-register-form div.custom-register .register-wrap form p.form-row:not(.form-row-wide):before,
        .wishlist_add_to_cart_button a:before,
        .search-results .content-search .wrap_post article .readmore a:before,
        .shop-main .woocommerce-Reviews #review_form_wrapper .form-submit:before,
        .single-post .comment-form > p.form-submit:before,
        .woocommerce-cart .return-to-shop:before,
        .cart-notice-wrap .cart-url:before,
        .form-contact .wpcf7 .wpcf7-form > p:nth-child(3):before
        {
            content: '';
            z-index: -1;
            position: absolute;
            top: 10px;
            left: 10px;
            width: 100%;
            height: 100%;
            -webkit-transition: 0.5s;
            -o-transition: 0.5s;
            transition: 0.5s;
            background: " . esc_attr($primary_color) . ";
            ";
            if ($button_border_radius) {
                $css .= "
                border-radius: " . esc_attr($button_border_radius) . "px;
                ";
            }
        $css .="
        }
        .wc-proceed-to-checkout a:hover:before,
        #blog_swipper .entry-content .read-more-link a:hover:before,
        .blog .post .read-more-link .readmore-shadow a:hover:before,
        .nb_layout_wp-img-left .nb_wp_post .nb-post-block .nb-post-content .nb-post-readmore a:hover:before,
        .nb_layout_wp-img-top .nb_wp_post .nb-post-block .nb-post-content .nb-post-readmore a:hover:before,
        .mini-cart-wrap .buttons a:hover:before,
        span.nb-checkout-button:hover:before,
        span.nb-update-cart-button:hover:before,
        .single_add_to_cart_button:hover .button-mask:before,
        .error404 .home-link a:hover:before,
        .custom-login-wrap.has-register-form .custom-login .login-wrap form p.form-row:hover:before,
        .custom-login-wrap.has-register-form div.custom-register .register-wrap form p.form-row:not(.form-row-wide):hover:before,
        .wishlist_add_to_cart_button a:hover:before,
        .search-results .content-search .wrap_post article .readmore a:hover:before,
        .shop-main .woocommerce-Reviews #review_form_wrapper .form-submit:hover:before,
        .single-post .comment-form > p.form-submit:hover:before,
        .woocommerce-cart .return-to-shop:hover:before,
        .cart-notice-wrap .cart-url:hover:before,
        .form-contact .wpcf7 .wpcf7-form > p:nth-child(3):hover:before,

        .wc-proceed-to-checkout a:focus:before,
        #blog_swipper .entry-content .read-more-link a:focus:before,
        .blog .post .read-more-link .readmore-shadow a:focus:before,
        .nb_layout_wp-img-left .nb_wp_post .nb-post-block .nb-post-content .nb-post-readmore a:focus:before,
        .nb_layout_wp-img-top .nb_wp_post .nb-post-block .nb-post-content .nb-post-readmore a:focus:before,
        .mini-cart-wrap .buttons a:focus:before,
        span.nb-checkout-button:focus:before,
        span.nb-update-cart-button:focus:before,
        .single_add_to_cart_button:focus .button-mask:before,
        .error404 .home-link a:focus:before,
        .custom-login-wrap.has-register-form .custom-login .login-wrap form p.form-row:focus:before,
        .custom-login-wrap.has-register-form div.custom-register .register-wrap form p.form-row:not(.form-row-wide):focus:before,
        .wishlist_add_to_cart_button a:focus:before,
        .search-results .content-search .wrap_post article .readmore a:focus:before,
        .shop-main .woocommerce-Reviews #review_form_wrapper .form-submit:focus:before,
        .single-post .comment-form > p.form-submit:focus:before,
        .woocommerce-cart .return-to-shop:focus:before,
        .cart-notice-wrap .cart-url:focus:before,
        .form-contact .wpcf7 .wpcf7-form > p:nth-child(3):focus:before
        {
            top: 0;
            left: 0;
        }
        
        button[name=\"calc_shipping\"]:hover,
        a.button.nbd-button:hover,
        .woocommerce-message a.button:hover {
            background: " . esc_attr($primary_color) . ";
        }
        ";
    }

    $css .= "
    .nb-secondary-button {
        color: " . esc_attr($sb_text) . ";
        background-color: " . esc_attr($sb_bg) . ";
        border-color: " . esc_attr($sb_border) . ";
    }
    .nb-secondary-button:hover, 
    .nb-secondary-button:focus,
    .search .view-all-button a
     {
        color: " . esc_attr($sb_text_hover) . ";
        background-color: " . esc_attr($sb_bg_hover) . ";
        border-color: " . esc_attr($sb_border_hover) . ";
    }
    
    .single-product-wrap .wc-single-online-desginer .nbdesigner_frontend_container p a.button,
    .ou-tab .tablinks:not(.activated),
    .button.nbdesign-button,
    .nbd-cart-upload-file > a,
    .coupon input[type=\"submit\"],
    .woof_submit_search_form_container button,
    .woof_price_filter .price_slider_amount button,
    .single-product-wrap .wc-single-online-desginer .nbdesigner_frontend_container p a.button,
    .ou-tab .tablinks:not(.activated),
    .button.nbdesign-button,
    .nb-input-group .search-button button,
    .product .product-action.vertical ~ .product-image-mask a.replace-add-to-cart-button,
    .product .product-action.vertical ~ .product-image-mask a.add_to_cart_button,
    .product .product-action.vertical ~ .product-image-mask a.product_type_simple,
    .product .product-action.vertical ~ .product-image-mask a.product_type_grouped,
    .product .product-action.vertical ~ .product-image-mask a.product_type_external,
    .instagram-widget-img div[class^='swiper-button-'],
    .post-password-form input[type='submit']
    {
        color: " . esc_attr($sb_text) . " !important;
        background-color: " . esc_attr($sb_bg) . ";
        border-color: " . esc_attr($sb_border) . ";
    }
    .single-product-wrap .wc-single-online-desginer .nbdesigner_frontend_container p a.button:hover,
    .ou-tab .tablinks.activated,
    .button.nbdesign-button:hover,
    .nbd-cart-upload-file > a:hover,
    .coupon input[type=\"submit\"]:hover,
    .woof_submit_search_form_container button:hover,
    .woof_price_filter .price_slider_amount button:hover,
    .single-product-wrap .wc-single-online-desginer .nbdesigner_frontend_container p a.button:hover,
    .ou-tab .tablinks.activated,
    .button.nbdesign-button:hover,
    .nb-input-group .search-button button:hover,
    .product .product-action.vertical ~ .product-image-mask a.replace-add-to-cart-button:hover,
    .product .product-action.vertical ~ .product-image-mask a.add_to_cart_button:hover,
    .product .product-action.vertical ~ .product-image-mask a.product_type_simple:hover,
    .product .product-action.vertical ~ .product-image-mask a.product_type_grouped:hover,
    .product .product-action.vertical ~ .product-image-mask a.product_type_external:hover,
    .instagram-widget-img div[class^='swiper-button-']:hover,
    .post-password-form input[type='submit']:hover
    {
        color: " . esc_attr($sb_text_hover) . " !important;
        background-color: " . esc_attr($sb_bg_hover) . ";
        border-color: " . esc_attr($sb_border_hover) . ";
    }
    .list-type .add_to_cart_button, 
    .nb-primary-button, 
    .nb-secondary-button, 
    .single_add_to_cart_button, 
    .post-password-form input[type='submit'],
    .wc-backward
    {
        padding-left: " . esc_attr($button_padding) . "px;
        padding-right: " . esc_attr($button_padding) . "px;
        border-width: " . esc_attr($button_border_width) . "px;
        -webkit-appearance: none;
        ";
        if ($button_border_radius) {
            $css .= "
            border-radius: " . esc_attr($button_border_radius) . "px;
            ";
        } else {
            $css .= "
            border-radius: 0px;
            ";
        }
        $css .= "
    }

    .woocommerce div.product form.cart .variations .wrap-variation select
    {";
        $css .= "
        border-color: " . esc_attr($pb_border) . ";
    }
    

    .wc-proceed-to-checkout a,
    .mini-cart-wrap .buttons a,
    span.nb-checkout-button input,
    .single_add_to_cart_button .button-mask,
    .nb_layout_wp-img-left .nb_wp_post .nb-post-block .nb-post-content .nb-post-readmore a,
    .nb_layout_wp-img-top .nb_wp_post .nb-post-block .nb-post-content .nb-post-readmore a,
    .error404 .home-link a,
    .wishlist_add_to_cart_button a,
    .search-results .content-search .wrap_post article .readmore a,
    .shop-main .woocommerce-Reviews #review_form_wrapper .form-submit input,
    .cart-notice-wrap .cart-url a,
    .form-contact .wpcf7 p input[type=\"submit\"]
    {
        border-width: " . esc_attr($button_border_width) . "px;";
        
        if ($button_border_radius) {
            $css .= "
            border-radius: " . esc_attr($button_border_radius) . "px;
            ";
        }
        else {
            $css .= "
            border-radius: 0px;
            ";
        }
        $css .="
    }

    body,
    .woocommerce-breadcrumb a,
    .nb-social-icons > a,
    .wc-tabs > li:not(.active) a,
    .shop-main.accordion-tabs .accordion-title-wrap:not(.ui-state-active) a,
    .nb-account-dropdown a,
    .header-account-wrap .not-logged-in,
    .mid-inline .nb-account-dropdown a, 
    .mid-inline .mini-cart-section span, 
    .mid-inline .mini-cart-section a, 
    .mid-inline .mini-cart-section strong,
    .entry-meta .byline a,
    .comments-link a{
        color: " . esc_attr($body_color) . ";
    }";

    if($font_type_scale == 'major_third') {
        $css .= "
        h1 {
            font-size: " . esc_attr(intval($heading_base_size * 2.441)) . "px;
        }
        h2 {
            font-size: " . esc_attr(intval($heading_base_size * 1.953)) . "px;
        }
        h3 {
            font-size: " . esc_attr(intval($heading_base_size * 1.563)) . "px;
        }
        h4 {
            font-size: " . esc_attr(intval($heading_base_size * 1.250)) . "px;
        }
        h5 {
            font-size: " . esc_attr(intval($heading_base_size * 1)) . "px;
        }
        h6 {
            font-size: " . esc_attr(intval($heading_base_size * 0.8)) . "px;
        }
        ";
    }
    else if($font_type_scale == 'major_second') {
        $css .= "
        h1 {
            font-size: " . esc_attr(intval($heading_base_size * 1.602)) . "px;
        }
        h2 {
            font-size: " . esc_attr(intval($heading_base_size * 1.424)) . "px;
        }
        h3 {
            font-size: " . esc_attr(intval($heading_base_size * 1.266)) . "px;
        }
        h4 {
            font-size: " . esc_attr(intval($heading_base_size * 1.125)) . "px;
        }
        h5 {
            font-size: " . esc_attr(intval($heading_base_size * 1)) . "px;
        }
        h6 {
            font-size: " . esc_attr(intval($heading_base_size * 0.889)) . "px;
        }
        ";
    }

    

    $css .= "
    h1, h2, h3, h4, h5, h6,
    h1 > a, h2 > a, h3 > a, h4 > a, h5 > a, h6 > a,
    .entry-title > a,
    .woocommerce-Reviews .comment-reply-title,
    .sp-ou-meta .sp-ou-title {
        font-family: " . esc_attr($heading_family) . "; 
        font-weight: " . esc_attr($heading_weight) . ";
        color: " . esc_attr($heading_color) . ";
        ";
        if (in_array("italic", $heading_font_style)) {
            $css .= "
            font-style: italic;
            ";
        }
        if (in_array("underline", $heading_font_style)) {
            $css .= "
            text-decoration: underline;
            ";
        }
        if (in_array("uppercase", $heading_font_style)) {
            $css .= "
            text-transform: uppercase;
            ";
        }
        //TODO after make inline below woocommerce.css remove these !important
        //TODO postMessage font-size .header-top-bar a
        $css .= "
    }
    .site-header .top-section-wrap {
        padding: " . esc_attr($top_padding) . "px 0;
        background-color: " . esc_attr($top_bg) . ";
    }
    .site-header.left-inline .top-section-wrap .header_top_right_menu
    {
        margin: -" . esc_attr($top_padding) . "px 0;
    }
    .site-header.left-inline .top-section-wrap .header_top_right_menu ul,
    .site-header .sub-navigation .widget .dd-select
    {
        padding: " . esc_attr($top_padding) . "px 0;
    }
    .WOOCS_SELECTOR .wSelect,
    .WOOCS_SELECTOR .chosen-container,
    .site-header .sub-navigation .menu-menu-top-left-container ~ .WOOCS_SELECTOR select.woocommerce-currency-switcher,
    .site-header .sub-navigation .menu-menu-top-left-container ~ .WOOCS_SELECTOR .woocs_flag_view_item
    {
        margin: calc(" . esc_attr($top_padding) . "px - 3px) 0 0;
    }
    .top-section-wrap .nb-header-sub-menu a {
        color: " . esc_attr($top_color) . ";
    }
    .top-section-wrap a:hover,
    .site-header .top-section-wrap .sub-navigation .nb-header-sub-menu li.menu-item-has-children .sub-menu li:hover > a > span,
    .top-section-wrap .nb-header-sub-menu a:hover,.top-section-wrap li:hover > a > span,.site-header .top-section-wrap .sub-navigation .nb-header-sub-menu li.menu-item-has-children .sub-menu li:hover > a > span,
    .site-header .top-section-wrap .header_top_right_menu .data_user .user-menu > li > a:hover {
        color: " . esc_attr($top_color_hover) . ";
    }
    
    .top-section-wrap .nb-header-sub-menu .sub-menu {
        background-color: " . esc_attr($top_bg) . ";
    }
    .site-header.aidoo-header-1 .middle-section-wrap .main-nav-wrap {
        padding: " . esc_attr($middle_padding) . "px 0;
        background-color: " . esc_attr($middle_bg) . ";
    }
    .site-header .middle-section-wrap .nb-navbar,
    .site-header.header-desktop .main-nav-wrap .mega-menu-wrap#mega-menu-wrap-primary ul.mega-menu#mega-menu-primary
    {
        margin: -" . esc_attr($middle_padding) . "px 0;  
    }
    .site-header .middle-section-wrap .nb-navbar > .menu-item,
    .site-header.header-desktop .main-nav-wrap .mega-menu-wrap#mega-menu-wrap-primary ul.mega-menu#mega-menu-primary > li,
    .site-header.header-desktop .mega-menu-wrap#mega-menu-wrap-primary ul.mega-menu#mega-menu-primary > li
    {
        padding: " . esc_attr($middle_padding) . "px 0;  
    }
  
    .site-header:not(.mid-stack) .bot-section-wrap {
        padding: " . esc_attr($bot_padding) . "px 0;                
    }
    .site-header.mid-stack .nb-navbar > .menu-item > a {
        padding: " . esc_attr($bot_padding) . "px 20px;                
    }
    .site-header .bot-section-wrap {
        background-color: " . esc_attr($bot_bg) . ";           
    }
    .bot-section-wrap a, .bot-section-wrap span, .bot-section-wrap i, .bot-section-wrap div{
        color: " . esc_attr($bot_color) . ";
    }
    .nbt-ajax-cart-icon i,.nbt-ajax-cart .nbt-ajax-cart-icon .nbt-ajax-cart-count{
        color: " . esc_attr($middle_color) . ";
    }
    .nbt-icon-search{
        color: " . esc_attr($middle_color) . " !important;
    }
    .middle-section-wrap .nb-navbar .menu-item:hover > a,
    .middle-section-wrap .nb-navbar .menu-item:hover > a span,
    .mini-cart-section .mini-cart-wrap .mini_cart_item .minicart-pd-meta a:hover,.mini-cart-section .mini-cart-wrap .mini_cart_item .remove:hover i,
    .nbt-ajax-cart .nbt-ajax-cart-popup .woocommerce-Price-amount
    {
        color: " . esc_attr($middle_color_hover) . ";
    }
    .nbt-ajax-cart .nbt-ajax-cart-popup ul li .nbt-ajax-cart-right h4 a{
        color: " . esc_attr($middle_color_hover) . "!important;
    }
    .nbt-ajax-cart .nbt-ajax-cart-icon .nbt-ajax-cart-count{
        background: " . esc_attr($middle_color_hover) . ";
    }
    .nbt-ajax-cart .nbt-ajax-cart-popup .buttons a:hover{
        background: " . esc_attr($middle_color_hover) . "!important;
    }
    .mini-cart-wrap .mini_cart_item .mini-cart-pd-image:hover img{
        border-color: " . esc_attr($middle_color_hover) . ";
    }
    .nbt-ajax-cart .nbt-ajax-cart-icon:after{
        border-bottom-color: " . esc_attr($middle_color_hover) . ";
    }
    .nbt-ajax-cart .nbt-ajax-cart-popup{
        border-top-color: " . esc_attr($middle_color_hover) . ";
    }
    .site-header.header-desktop .main-nav-wrap .mega-menu-wrap#mega-menu-wrap-primary ul.mega-menu#mega-menu-primary > li > ul.mega-sub-menu::before
    {
        background-color: " . esc_attr($middle_color_hover) . ";
    }
    .site-header.header-desktop .main-nav-wrap .mega-menu-wrap#mega-menu-wrap-primary ul.mega-menu#mega-menu-primary > li.mega-toggle-on > a::before,
    .site-header.header-desktop .main-nav-wrap .mega-menu-wrap#mega-menu-wrap-primary ul.mega-menu#mega-menu-primary > li:hover > a::before
    {
        border-top-color:  " . esc_attr($middle_color_hover) . ";
    }
    .top-section-wrap span, .top-section-wrap i, .top-section-wrap div{
        color: " . esc_attr($top_color) . ";
    }
    .nb-navbar > .menu-item,.nb-navbar a,.nb-navbar span,
    .middle-section-wrap .mega-menu-wrap#mega-menu-wrap-primary i,
    header.enable #mega-menu-wrap-primary #mega-menu-primary  li > a,
    .site-header.enable #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link,
    .site-header.header-desktop.enable .main-navigation #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu .menu_page .menu li.menu-item a,
    .site-header.header-desktop.enable .main-navigation #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-menu-flyout > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link
    {
        color: " . esc_attr($menu_color) . ";
    }
    .site-header.header-desktop.enable .main-navigation #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item h4.mega-block-title
    {
        color: " . esc_attr($menu_header_color) . ";
    }
    .nb-navbar > .menu-item:hover >a span,.nb-navbar a:hover,
    
    .site-header.header-mobile .main-nav-wrap .mega-menu-wrap#mega-menu-wrap-primary ul.mega-menu#mega-menu-primary > li.mega-menu-flyout .mega-sub-menu > li:hover > a,
    .site-header.header-mobile .main-nav-wrap .mega-menu-wrap#mega-menu-wrap-primary ul.mega-menu#mega-menu-primary > li.mega-toggle-on > a,
    .site-header.header-mobile .main-nav-wrap .mega-menu-wrap#mega-menu-wrap-primary ul.mega-menu#mega-menu-primary > li.mega-current-menu-ancestor > a,
    .site-header.header-mobile .main-nav-wrap .mega-menu-wrap#mega-menu-wrap-primary ul.mega-menu#mega-menu-primary li.mega-current-menu-item > a,
    .site-header.header-mobile .main-nav-wrap .mega-menu-wrap#mega-menu-wrap-primary ul.mega-menu#mega-menu-primary li.current-menu-item > a,
    .middle-section-wrap .mega-menu-wrap#mega-menu-wrap-primary .mega-menu-item:hover >a,
    .middle-section-wrap .mega-menu-wrap#mega-menu-wrap-primary .mega-menu-item:hover >a *,
    .site-header.header-desktop.enable .main-navigation #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu .menu_page .menu li.menu-item:hover a,
    .site-header.header-desktop .main-navigation #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item .menu > li.menu-item:hover a,
    .site-header.header-desktop .main-navigation #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu .menu_online_design ul.mega-sub-menu ul.mega-sub-menu > li.mega-menu-item .product-online-desginer .row > div.col-md-12 a:hover h4,
    .site-header.header-desktop .main-navigation #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-menu-flyout > ul.mega-sub-menu > li.mega-menu-item:hover > a.mega-menu-link,
    .site-header.header-desktop .main-navigation #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item h5.product-title:hover a,
    .site-header .top-section-wrap .sub-navigation .nb-header-sub-menu .nav-currency-dropdown:hover .woocommerce-currency-switcher
    {   
        color: " . esc_attr($menu_color2) . ";
    }
    
    .site-header.aidoo-header-1 .middle-section-wrap div.main-nav-wrap,
    .site-header.header-desktop .main-navigation #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item #menu-magamenu-1 > li.menu-item
    {
        border-color: " . esc_attr($menu_bor) . ";
    }
    
    .nb-navbar .menu-item-has-children > a span:after,
    .icon-header-section .nb-cart-section,
    .nb-navbar .menu-item a,
    .nb-navbar .sub-menu > .menu-item:not(:last-child),
    .nb-header-sub-menu .sub-menu > .menu-item:not(:last-child),
    .widget .widget-title,
    .blog .classic .post .entry-footer,
    .single-post .single-blog .entry-footer,
    .nb-social-icons > a,
    .single-blog .entry-author-wrap,
    .shop-main:not(.wide) .single-product-wrap .product_meta,
    .shop-main.accordion-tabs .accordion-item .accordion-title-wrap,
    .shop-main.horizontal-tabs .wc-tabs-wrapper .wc-tabs,
    .shop_table thead th,
    .shop_table th,
    .shop_table td,
    .mini-cart-wrap .total,
    .icon-header-wrap .nb-account-dropdown ul li:not(:last-of-type) a,
    .widget tbody th, .widget tbody td,
    .widget ul > li:not(:last-of-type),
    .blog .post .entry-image .entry-cat,
    .comment-list .comment,
    .paging-navigation.pagination-style-1 .page-numbers.current,
    .woocommerce-pagination.pagination-style-1 .page-numbers.current,
    .single-product-wrap .cart,
    .single-product-wrap .woocommerce-product-details__short-description, 
    .sp-ou-meta,
    .widget.WOOF_Widget .woof .woof_container.woof_by_rating_container .woof_container_inner .chosen-results li
    {
        border-color: " . esc_attr($divider_color) . ";
    }
    @media (max-width: 767px) {
        .shop_table.cart {
            border: 1px solid " . esc_attr($divider_color) . ";
        }
        .shop_table.cart td {
            border-bottom: 1px solid " . esc_attr($divider_color) . ";
        }
    }

    .sticky .entry-image {
        box-shadow: 0px -3px 10px 1px " . esc_attr($primary_color) . ";
    }

    .sticky .entry-content {
        box-shadow: 0px 0px 10px 1px " . esc_attr($primary_color) . ";
    }


    .product .product-image .onsale,
    .wc-tabs > li.active,
    .product .onsale.sale-style-2 .percent,
    .product .onsale.sale-style-3 .percent,
    .wc-tabs-wrapper .woocommerce-Reviews #review_form_wrapper .comment-respond,
    .site-header.mid-stack .main-navigation .nb-navbar > .menu-item:hover,
    .shop-main.accordion-tabs .accordion-item .accordion-title-wrap.ui-accordion-header-active,
    .widget .tagcloud a:hover,
    .footer-section .widget .tagcloud a:hover,
    .cart-notice-wrap .cart-notice,
    .products .product .product-action.center .bt-4:hover,
    .products .product .nb-loop-variable .nbtcs-swatches .swatch:hover:before,
    .single-product-wrap .nbtcs-swatches .swatch:hover:before,
    .vc-tab-product-wrapper .vc-tab-product-content .tab-panel .cat_img a .cat_img_button:hover,
    .vc-tab-product-wrapper .vc-tab-product-content .tab-panel .cat_img a:hover .cat_img_button,
    .uvc-heading-spacer.line_with_icon:before, 
    .uvc-heading-spacer.line_with_icon:after,
    .new_letter_1 .footer-newsletter .footer-newsletter-form button[type='submit'],
    .widget .nbfw-social-link-widget.gray-icon li a:hover,
    .related-product:hover > a img,
    .loading.demo7 #loading-center #loading-center-absolute .object,
    .nb-page-title-wrap.bg_img .nb-page-title h1:before,
    .single-product-wrap .product-image .thumb-gallery .swiper-slide.swiper-slide-thumb-active img,
    .loading.demo3 #loading-center #loading-center-absolute .object,
    #yith-wcwl-popup-message,
    .nbt-upload-zone .nbt-oupload-target,
    .single-product-wrap .nbtcs-swatches .swatch-color.circle.selected:before,
    .nbd-gallery #primary .nbd-list-designs .nbd-gallery-item:hover,
    .woof .woof_redraw_zone .woof_container.woof_container_label ul.woof_list li span.checkbox:hover,
    .woof .woof_redraw_zone .woof_container.woof_container_label ul.woof_list li span.checkbox.checked,
    .woof .woof_redraw_zone .woof_container.woof_container_color .woof_tooltip:hover span.checkbox,
    .woof .woof_redraw_zone .woof_container.woof_container_color .woof_tooltip span.checkbox.checked,
    .products .product .nb-loop-variable .nbtcs-swatches .swatch.swatch-text:hover,
    .products .product .nb-loop-variable .nbtcs-swatches .swatch.swatch-image:hover,
    .vc_testimonial_wrap.testimonial_single_thumb_style_2 .vc-item-testimonial .vc-avatar-img:before,
    .vc_testimonial_wrap.testimonial_single_thumb_style_2 .vc-item-testimonial .vc-avatar-img .wrap-image,
    .site-header.header-desktop .main-navigation #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu,
    #yith-quick-view-content .product-image .featured-gallery div[role='button']:not(.swiper-button-disabled):hover:before,
    .single-product-wrap .woocommerce-product-gallery__wrapper .featured-gallery .swiper-button-next:hover:before, 
    .single-product-wrap .woocommerce-product-gallery__wrapper .featured-gallery .swiper-button-prev:hover:before,
    .woocommerce-page .woocommerce-message,
    .widget.WOOF_Widget .woof .woof_container.woof_container_color .woof_tooltip:hover,
    .widget.WOOF_Widget .woof .woof_container.woof_container_color .woof_list_color li[checked] .woof_tooltip,
    .shop-main .woof .woof_redraw_zone .woof_container.woof_container_color .woof_tooltip:hover,
    .shop-main .woof .woof_redraw_zone .woof_container.woof_container_color .woof_list_color li[checked] .woof_tooltip,
    .single_variation_wrap .variations_button .compare:hover,
    .single-product-wrap ~ .wrap-orderupload .wrap-button .compare:hover,
    .single-product-wrap .compare:hover,
    .single-product-wrap .yith-wcwl-add-to-wishlist > div a:hover,
    .single-blog .entry-recent div[class^='swiper-button-']:hover
    {
        border-color: " . esc_attr($primary_color) . ";
    }
    .product .product-image .product-action.vertical a:not(.add_to_cart_button) span.tooltip:before{
        border-left-color: " . esc_attr($primary_color) . ";
    }
    .loading.demo14 #loading-center #loading-center-absolute .object{
        border-left-color: " . esc_attr($primary_color) . ";
        border-right-color: " . esc_attr($primary_color) . ";
    }
    .loading.demo15 #loading-center #loading-center-absolute .object{
        border-left-color: " . esc_attr($primary_color) . ";
        border-top-color: " . esc_attr($primary_color) . ";
    }
    .nbfw_banner-container .nbfw-txt-info .banner-more:hover,.stepbystep2 .wpb_column:hover .wpb_single_image .vc_box_rounded,    
    .woof .woof_redraw_zone .woof_container.woof_container_image .woof_tooltip span.checkbox:hover,
    .woof .woof_redraw_zone .woof_container.woof_container_image .woof_tooltip span.checkbox.checked,
    .products .product .nb-loop-variable .nbtcs-swatches .swatches-radio li:hover .check,
    .products .product .nb-loop-variable .nbtcs-swatches .swatches-radio li input[type=radio]:checked ~ .check,
    .about-us-info .aio-icon-box.left-icon:hover .aio-icon-left .aio-icon
    {
        border-color: " . esc_attr($primary_color) . " !important;
    }
    .growl-message{
        border: 1px solid " . esc_attr($primary_color) . ";
    }
    .noo-line .line-one span:first-child:before,.noo-line .line-one span:last-child:before,.noo-line .line-two span:first-child:before,.noo-line .line-two span:last-child:before{
        border: 2px solid " . esc_attr($primary_color) . ";
    }
    .products .product .product-action.center .tooltip:before,
    .products .product .product-action.horizontal .tooltip:before,
    .mini-cart-wrap,.nbt-search-wrapper,
    .nbfw_banner-container .nbfw-txt-info .txt-caption .txt-caption-divider
    {
        border-top-color: " . esc_attr($primary_color) . ";
    }
    .widget .widget-title:before,
    .paging-navigation.pagination-style-2 .current,
    .product .onsale.sale-style-1,
    .woocommerce-pagination.pagination-style-2 .page-numbers:not(.dots).current,
    .widget .tagcloud a:hover,
    .nb-back-to-top-wrap a:hover,
	.nb_layout_wp-img-top .nb_wp_post .nb-post-date .nb-post-date-i,
    .nb_layout_wp-img-left .nb_wp_post .nb-post-block .nb-post-content .nb-post-readmore a::before,
    .swiper-pagination .swiper-pagination-bullet.swiper-pagination-bullet-active,
    .products .product .product-action .button:not(.add_to_cart_button) .tooltip,
    .product .product-image .wishlist-fixed-btn .yith-wcwl-add-to-wishlist .tooltip,
    .wpt-loading:after,
    .vc-tab-product-wrapper .vc-tab-product-content .tab-panel .cat_img a:hover .cat_img_button,
    .vc-tab-product-wrapper .vc-tab-product-header .product-tab-header.show_heading_line h2:after,
    .line-through .uvc-main-heading h1:after, 
    .line-through .uvc-main-heading h2:after, 
    .line-through .uvc-main-heading h3:after, 
    .line-through .uvc-main-heading h4:after, 
    .line-through .uvc-main-heading h5:after, 
    .line-through .uvc-main-heading h6:after,
    .uvc-heading.hp1-heading .uvc-sub-heading:before,
    .uvc-heading.hp1-heading .uvc-sub-heading:after,
    .nbfw_banner-container .nbfw-txt-info .banner-more:hover,
    .bg-fullwidth .nbfw_banner-container,
    .category-layout-hp4 .nbfw_banner-container:hover .nbfw-txt-info h4,
    .info-box-our-services .aio-icon-box:hover,
    .content_manage .link_profile li a::before,
    .nb_vc_page_tab:hover .page_tab_content::before,
    .new_letter_1  .footer-newsletter .footer-newsletter-form button[type='submit'],
    .vc_testimonial_wrap.testimonial_multi_thumb_style_1 .vc-avatar-testimonial .swiper-slide .vc-title .client-name::before,
    .vc_testimonial_wrap.testimonial_multi_thumb_style_1 .vc-avatar-testimonial .swiper-slide .vc-title .client-name::after,
    .widget .sidebar-policy .clear .sidebar-top-icon,
    .faq_page .vc_toggle.vc_toggle_active .vc_toggle_title,
    #secondary .widget .nbfw-social-link-widget.gray-icon li a:hover,
    .new_letter_1 .footer-newsletter .footer-newsletter-form input[type='submit'],
    .loading #loading-center #loading-center-absolute #object,
    .loading #loading-center #loading-center-absolute .object,
    .loading #loading-center .object-one,
    .loading #loading-center .object-two,
    .text-notice a:hover,
    .page-template-nb-checkout #nb-checkout-cart .shop_table .nbt-ou-fast button,
    .shop-main .woof_products_top_panel ul li a,
    .woof_select_radio_check dt.woof_select_radio_check_opened a,
    .woof .woof_redraw_zone .woof_container.woof_container_label ul.woof_list li span.checkbox:hover,
    .woof .woof_redraw_zone .woof_container.woof_container_label ul.woof_list li span.checkbox.checked,
    .woof .woof_redraw_zone .woof_container.woof_container_label ul.woof_list li span.woof_label_count,
    .woof .woof_redraw_zone .woof_container.woof_container_image .woof_tooltip .woof_tooltip_data,
    .woof .woof_container .woof_add_subscr_cont #woof_add_subscr:hover,
    .woof input.woof_add_query_save:hover,
    .woof .woof_redraw_zone .woof_container.woof_container_slider span.irs-with-grid span.irs-slider:hover:after,
    .woof .woof_redraw_zone .woof_container.woof_price_filter span.irs-with-grid span.irs-slider:hover:after,
    .woof .widget_price_filter .ui-slider .ui-slider-range,
    .products .product .nb-loop-variable .nbtcs-swatches .swatches-radio li input[type=radio]:checked ~ .check::before,
    .site-header .sub-navigation .woocommerce-currency-switcher-form .wSelect-theme-classic .wSelect-option-selected, 
    .site-header .sub-navigation .woocommerce-currency-switcher-form .wSelect-theme-classic .wSelect-option:hover,
    div.button-1:before,
    .site-header .top-section-wrap .header_top_right_menu .header-cart-wrap .nb-cart-section .count-item,
    .site-header .main-nav-wrap #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item:hover > a.mega-menu-link > span.mega-line:before,
    .paging-navigation.pagination-style-2 .page-numbers.current,
    .paging-navigation.pagination-style-2 .page-numbers:hover,
    .wrap_post article .readmore:after,
    .product .product-image .product-action a:not(.add_to_cart_button) span.tooltip,
    .product .product-image .product-action a:hover,
    .product .product-image .product-action a.compare.added:before,
    .woocommerce-pagination.pagination-style-2 .page-numbers:not(.dots):hover,
    .wc-tabs > li.active a:after,
    .wc-tabs > li.active a:hover:after,
    .wc-tabs > li.active a:focus:after,  
    .vc-tab-product-wrapper ul.style-separated li.active a:before, 
    .vc-tab-product-wrapper ul.style-separated li:hover a:before,
    .woof_list li .woof_tooltip .woof_tooltip_data,
    .single-product-wrap ~ .wrap-orderupload .wrap-button .compare:hover,
    .single-product-wrap ~ .wrap-orderupload .wrap-button .wishlist-btn a:hover,
    .single_variation_wrap .variations_button .wishlist-btn a:hover,
    .single_variation_wrap .variations_button .compare:hover,
    .single-product-wrap .yith-wcwl-add-to-wishlist .add_to_wishlist:hover,
    .single-product-wrap .yith-wcwl-add-to-wishlist > div a:hover,
    .single-blog .entry-recent div[class^='swiper-button-']:hover,
    .site-header .middle-section-wrap .icon-header-section .icon-header-wrap .header-cart-wrap .nb-cart-section .count-item
    {
        background-color: " . esc_attr($primary_color) . ";
    }
    .swiper-pagination-bullet-active,
    .site-header .sub-navigation .menu-menu-top-left-container ~ .WOOCS_SELECTOR .chosen-container .chosen-drop .chosen-results li.result-selected,
    .site-header .sub-navigation .menu-menu-top-left-container ~ .WOOCS_SELECTOR .chosen-container .chosen-drop .chosen-results li.active-result:hover,
    .woof .woof_container .chosen-container .chosen-drop .chosen-results .active-result.highlighted,
    .about-us-info .aio-icon-box.left-icon:hover .aio-icon-left .aio-icon
    {
        background-color: " . esc_attr($primary_color) . " !important;
    }
    .product .star-rating:before,
    .product .star-rating span,
    .single-product-wrap .price ins,
    .single-product-wrap .price > span.amount,
    .single-product-wrap .summary >.price .nbtwccs_price_code > span.amount,
    .wc-tabs .ui-accordion-header-active a,
    .wc-tabs .ui-accordion-header-active a:focus,
    .wc-tabs .ui-accordion-header-active a:hover,
    .shop-main.accordion-tabs .ui-accordion-header-active:after,
    .cart_totals #shipping_method .amount,
    .cart_totals .shipping-calculator-button,
    .shop_table.woocommerce-checkout-review-order-table .order-total .amount,
    .woocommerce-order .woocommerce-thankyou-order-received,
    .woocommerce-order .woocommerce-table--order-details .amount,
    .paging-navigation.pagination-style-1 .current,
    .nb_vc_page_tab .page_tab_content .page_tab_readmore:hover,
    .nb_layout_wp-img-top .nb_wp_post .nb-post-block .nb-post-meta a:hover,
    .woocommerce-pagination.pagination-style-1 .page-numbers.current,
    .product .product-image .wishlist-fixed-btn .yith-wcwl-wishlistexistsbrowse .icon-heart, 
    .product .product-image .wishlist-fixed-btn .yith-wcwl-wishlistaddedbrowse .icon-heart, 
    .product .product-image .wishlist-fixed-btn .yith-wcwl-add-to-wishlist i.icon-heart:hover,
    .products .product .price .amount,
    .vc_toggle .vc_toggle_title .vc_custom_heading,
    .uvc-heading-spacer.line_with_icon .aio-icon,
    .uvc-heading.hp1-heading .uvc-main-heading .big-text,
    .content_manage .link_profile li a,
    .content_manage .read_more,
    .category-layout-hp5 .nbfw_banner-container:hover .nbfw-txt-info h4,
    .site-footer .footer-workingtime-wrapper .love-hour .love-hour-text span i,
    .widget .nbfw-social-link-widget.gray-icon li a:hover,
    .widget .nbfw-social-link-widget.white-icon li a:hover,
    .banner-images-1 .txt_primary_custom_1,
    .banner-images-1 .txt_primary_custom_2,
    .nb_layout_wp-content-absolute .nb-post-block .nb-post-header .nb-post-meta .nb-post-comments:hover,
    .text_signature,
    .category .style-3 article.type-post .entry-content .entry-title a:hover,
    .demo-shortcode-heading .uvc-main-heading h3,
    .shop-main .woocommerce-Reviews #review_form_wrapper .stars a,
    .vc_testimonial_wrap .swiper-button-next:not(.swiper-button-disabled):hover,
    .vc_testimonial_wrap .swiper-button-prev:not(.swiper-button-disabled):hover,
    .about_history_content .vc_toggle_content .about_content_aug .content_right p .about_seemore,
    .vc_testimonial_wrap.testimonial_multi_thumb_zoom_image .vc-content-testimonial .swiper-wrapper .swiper-slide .vc-testimonial-img .vc-testimonial-content .client-position,
    .related-product .relate_content .price,
    .widget .sidebar-policy .clear:nth-of-type(2n+1) i,
    .widget.page-sidebar .menu .menu-item.current-menu-item a,
    .site-footer .footer-abs-middle a,
    .widget.shop-sidebar ul.menu .menu-item-has-children.current-menu-parent > a,
    .widget.shop-sidebar ul.menu .current-menu-item  a,
    .start_designing_1 .vc_btn3-container .vc_general:hover,
    .nb_wp_post .nb-title-post a:hover,
    .single-product-wrap .woocommerce-product-gallery__wrapper .featured-gallery div:not(.swiper-button-disabled):hover:before,
    .nbd-gallery #primary .nbd-sidebar .nbd-sidebar-con .nbd-sidebar-con-inner ul li a:hover,
    .woocommerce-cart .cart_item .product-name a:hover,
    .nbd-gallery #primary .nbd-sidebar .nbd-sidebar-con .nbd-sidebar-con-inner .nbd-tag:hover,
    .woof_list li:hover > label,
    .woof_list li > input[checked] ~ label,
    .woof_container > .woof_container_inner:hover > label,
    .woof_container > .woof_container_inner > input[checked] ~ label,
    .woof_price_filter li:hover > label,
    .woof_price_filter li > input[checked] ~ label,
    .woof .woof_redraw_zone .woof_container.woof_author_search_container .woof_container .woof_container_inner ul.woof_authors li:hover label,
    .woof .woof_redraw_zone .woof_container.woof_author_search_container .woof_container .woof_container_inner ul.woof_authors li > input[checked] ~ label,
    .products .product .nb-loop-variable .nbtcs-swatches .swatch.swatch-text:hover,
    .products .product .nb-loop-variable .nbtcs-swatches .swatches-radio li:hover .swatch-radio,
    .products .product .nb-loop-variable .nbtcs-swatches .swatches-radio li input[type=radio]:checked ~ label,
    .site-header .sub-navigation .widget .dd-options .dd-option-selected .dd-option-text,
    .site-header .sub-navigation .widget .dd-container:hover .dd-selected label,
    .site-header .sub-navigation .widget .dd-container:hover .dd-selected small,
    .site-header .sub-navigation .widget .dd-container:hover .dd-select .dd-pointer,
    .site-header .sub-navigation .menu-menu-top-left-container ~ .WOOCS_SELECTOR .chosen-container .chosen-single:hover span,
    .site-header .sub-navigation .menu-menu-top-left-container ~ .WOOCS_SELECTOR .wSelect .wSelect-selected:hover,
    .site-header.header-desktop .main-navigation #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item span,
    .site-header.header-desktop .main-navigation #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item del ~ ins:before,
    #blog_swipper .entry-content .entry-cat a,
    #blog_swipper .entry-content h3.entry-title a:hover,
    .blog .post .entry-cat a,
    .blog .post .entry-title a:hover,
    .single-blog .single-blog-nav .prev .navi:hover, 
    .single-blog .single-blog-nav .next .navi:hover,
    .single-blog h1.entry-title a:hover,
    .comment-list .comment-body .reply a,
    .custom-login-wrap.has-register-form .custom-text .text-wrap .custom-direct-register a,
    .error404 .pnf-heading,
    .footer-section .widget ul li a:hover,
    .footer-section .widget ul.nbfw-social-link-widget li a:hover,
    .search-results article .entry-cat a,
    .search-results article .entry-title a:hover,
    .search-results .content-search .wrap_product .product .price span,
    .woocommerce-cart .cart_item .product-thumbnail .wrap-thumbnail a:last-child:hover,
    #yith-wcwl-form .shop_table.wishlist_table.cart .product-remove a.remove:hover,
    #yith-wcwl-form .shop_table.wishlist_table.cart td.product-price span,
    #vc-our-team .our-thumbnail .ourteam-social-share a:hover,
    .woocommerce-page .woocommerce-message:before,
    .sale-product .sale_content .price .regular,
    .price-matrix-container .single_variation_wrap .price span,
    .product-online-desginer ul li a:hover h4,
    .single-product-wrap .price_rating .price .nbtwccs_price_code,
    .single_variation_wrap .variations_button .single_variation .price ins,
    .single_variation_wrap .variations_button .single_variation .price,
    single-blog .entry-meta,
    .comments-title,
    .search-results .content-search header span strong,
    .search-results .content-search header > a:hover,
    .widget.widget_recent_comments .recentcomments a:hover,
    .widget ul li cite,
    .widget.widget_nav_menu .sub-menu a:hover,
    .single-blog .entry-cat a
    {
        color: " . esc_attr($primary_color) . ";
    }
    .text-notice a{
        background-color: " . esc_attr($primary_color) . " !important;
    }
    .nbt-ajax-cart .nbt-ajax-cart-popup ul li .nbt-ajax-cart-right .product-price span,
    .stepbystep2 .wpb_column:hover .step-heading .uvc-main-heading > *,
    .nb-fw.banner .nbfw-txt-info:hover .txt-primary{
        color: " . esc_attr($primary_color) . " !important;  
    }
    .new_letter_1 .wpb_raw_code .footer-newsletter .footer-newsletter-form input[type='email']{
        border: 1px solid " . esc_attr($primary_color) . ";
    }
    .nb-page-title-wrap.bg_img {
        padding-top: " . esc_attr($page_title_padding) . "px;
        padding-bottom: " . esc_attr($page_title_padding) . "px;            
    }
    .nb-page-title-wrap a, .nb-page-title-wrap h1, .nb-page-title-wrap nav {
        color: " . esc_attr($page_title_color) . ";
    }            
    .nb-page-title-wrap h1 {
        font-size: " . esc_attr($page_title_size) . "px;
        text-transform: uppercase;
    }
    .woocommerce-page.wc-no-sidebar #primary {
        width: 100%;
    }
    .shop-main .products.grid-type .product:nth-child(" . esc_attr($loop_columns) . "n + 1) {
        clear: both;
    }                                   
    ";
    $css .= "
    .footer-section{
        background-color: " . esc_attr($footer_bot_bg) . ";
    }
    footer.site-footer .footer-section .wrap-footer{
        padding-top:".esc_attr($footer_bot_padding_top)."px;
        padding-bottom:".esc_attr($footer_bot_padding_bottom)."px;
        border-bottom: 1px solid " . esc_attr($footer_bot_border_bot_color) . ";
        border-top: 3px double " . esc_attr($footer_bot_border_top_color) . ";
    }
    .footer-section h1,
    .footer-section h2,
    .footer-section h3,
    .footer-section h4,
    .footer-section h5,
    .footer-section h6,
    .footer-section .widget-title a{
        color: " . esc_attr($footer_bot_heading) . ";
    }
    .footer-section a,
    .footer-section .widget ul li a,
    .footer-section .widget ul.nbfw-social-link-widget li a{
        color: " . esc_attr($footer_bot_color) . ";
    }
    .footer-section .widget .tagcloud a{
        border-color: " . esc_attr($footer_bot_color) . ";
    }
    .footer-abs-section{
        color: " . esc_attr($footer_abs_color) . ";
        background-color: " . esc_attr($footer_abs_bg) . ";
        padding-top: " . esc_attr($footer_abs_padding) . "px;
        padding-bottom: " . esc_attr($footer_abs_padding) . "px;
    }
    .footer-abs-section a, .footer-abs-section p {
        color: " . esc_attr($footer_abs_color) . ";
    }
    .single-post .nb-page-title .entry-title,
    .single-post .entry-title{
        font-size: " . esc_attr($blog_title_size) . "px;
    }
    ";
    if ($page_bg_color) {
        $css .= "
        .page #site-wrapper {
            background-color: " . esc_attr($page_bg_color) . ";
        }
        ";
    }
    if ($page_bg[0]) {
        $css .= "
        .page #site-wrapper {
            background: url(" . esc_url($page_bg[0]) . ") repeat center center / cover; 
        }
        ";
    }
    $css .= "
    @media (min-width: 992px) {
        .shop-main:not(.wide) .single-product-wrap .product-image {
            -webkit-box-flex: 0;
            -ms-flex: 0 0 " . esc_attr($pd_images_width) . "%;
            flex: 0 0 " . esc_attr($pd_images_width) . "%;                   
            max-width: " . esc_attr($pd_images_width) . "%;
        }
        .shop-main:not(.wide) .single-product-wrap .entry-summary {
            -webkit-box-flex: 0;
            -ms-flex: 0 0 calc(100% - " . esc_attr($pd_images_width) . "%);
            flex: 0 0 calc(100% - " . esc_attr($pd_images_width) . "%);                   
            max-width: calc(100% - " . esc_attr($pd_images_width) . "%);
        }
    }
    @media (min-width: 992px) {
        ";

        if ('no-sidebar' !== $blog_sidebar) {
            
            if(is_active_sidebar('default-sidebar')){
                $css .= "            
                .site-content .blog #primary,
                .site-content .single-blog #primary {
                    -webkit-box-flex: 0;
                    -ms-flex: 0 0 " . esc_attr($blog_width) . "%;
                    flex: 0 0 " . esc_attr($blog_width) . "%;
                    max-width: " . esc_attr($blog_width) . "%;
                } 
                .site-content .blog #secondary,
                .site-content .single-blog #secondary {
                    -webkit-box-flex: 0;
                    -ms-flex: 0 0 calc(100% - " . esc_attr($blog_width) . "%);
                    flex: 0 0 calc(100% - " . esc_attr($blog_width) . "%);
                    max-width: calc(100% - " . esc_attr($blog_width) . "%);
                }                                  
                ";
            }
        }
        if ('left-sidebar' == $blog_sidebar) {
            $css .= "
            .single-blog #primary, .blog #primary {
                order: 2;
            }
            ";
        } elseif ('right-sidebar' == $blog_sidebar) {
            $css .= "
            
            ";
        }

        /*Pages sidebar*/
        
        if ('no-sidebar' !== $pages_sidebar) {
            $css .= "            
                .page .site-content #primary
                {
                    -webkit-box-flex: 0;
                    -ms-flex: 0 0 " . esc_attr($page_content_width) . "%;
                    flex: 0 0 " . esc_attr($page_content_width) . "%;                 
                    max-width: " . esc_attr($page_content_width) . "%;
                    
                } 
                .page .site-content #primary{width: 70%;}
                .page .site-content #secondary {
                    -webkit-box-flex: 0;
                    -ms-flex: 0 0 calc(100% - " . esc_attr($page_content_width) . "%);
                    flex: 0 0 calc(100% - " . esc_attr($page_content_width) . "%);              
                    max-width: calc(100% - " . esc_attr($page_content_width) . "%);

                }                                  
            ";
        }
        if ('left-sidebar' == $pages_sidebar) {
            $css .= "
                .page .site-content #primary {
                    order: 2;
                }
              
            ";
        } elseif('right-sidebar' == $pages_sidebar) {
            $css .= "
                .page .site-content #secondary {
                    order: 2;
                }
                
            ";
        }


        if ('left-sidebar' == $shop_sidebar) {
            $css .= "
            .archive.woocommerce .shop-main {
                order: 2;
            }
            .archive.woocommerce #secondary {
                padding-left: 15px;
                z-index: 0;
            }
            ";
        } elseif('right-sidebar' == $shop_sidebar) {
            $css .= "
            .archive.woocommerce #secondary {
                padding-right: 15px;
            }
            ";
        }

        if ('left-sidebar' == $pd_details_sidebar) {
            $css .= "
            .single-product .shop-main {
                order: 2;
            }
            ";
        } elseif('right-sidebar' == $pd_details_sidebar) {
            $css .= "

            ";
        }
        if ('no-sidebar' !== $pd_details_sidebar) {
            $css .= "
            .single-product.wc-pd-has-sidebar .shop-main {
                -webkit-box-flex: 0;
                -ms-flex: 0 0 " . esc_attr($pd_details_width) . "%;
                flex: 0 0 " . esc_attr($pd_details_width) . "%;
                max-width: " . esc_attr($pd_details_width) . "%;
            }
            .single-product #secondary {
                -webkit-box-flex: 0;
                -ms-flex: 0 0 calc(100% - " . esc_attr($pd_details_width) . "%);
                flex: 0 0 calc(100% - " . esc_attr($pd_details_width) . "%);
                max-width: calc(100% - " . esc_attr($pd_details_width) . "%);
            }
            ";
        }
        // TODO check this for tag ... ?
        if ('no-sidebar' !== $shop_sidebar) {
            $css .= "
            .archive.woocommerce.wc-left-sidebar .shop-main,
            .archive.woocommerce.wc-right-sidebar .shop-main {
                -webkit-box-flex: 0;
                -ms-flex: 0 0 " . esc_attr($wc_content_width) . "%;
                flex: 0 0 " . esc_attr($wc_content_width) . "%;
                max-width: " . esc_attr($wc_content_width) . "%;
            }
            .archive.woocommerce.wc-left-sidebar #secondary,
            .archive.woocommerce.wc-right-sidebar #secondary {
                -webkit-box-flex: 0;
                -ms-flex: 0 0 calc(100% - " . esc_attr($wc_content_width) . "%);
                flex: 0 0 calc(100% - " . esc_attr($wc_content_width) . "%);
                max-width: calc(100% - " . esc_attr($wc_content_width) . "%);
            }
            ";
        } else {
            $css .= "
            .site-content .shop-main {
                -webkit-box-flex: 0;
                -ms-flex: 0 0 100%;
                flex: 0 0 100%;
                max-width: 100%;
            }
            ";
        }

        $css .= "
    }
    ";

    return $css;
}

public function nbcore_print_embed_style()
{
    if (class_exists( 'NetbaseCustomizeClass', false ) ) {
        if(!empty(get_transient('change_customize_css'))) {
            if(get_transient('change_customize_css')==1) {
                set_transient('change_customize_css', 0, NBT_TIMEOUT_TRANSIENT_CUSTOMIZE);
                $style = $this->get_embed_style();
                $style = preg_replace('#/\*.*?\*/#s', '', $style);
                $style = preg_replace('/\s*([{}|:;,])\s+/', '$1', $style);
                $style = preg_replace('/\s\s+(.*)/', '$1', $style);
                if(get_option('customize_save_css')==false) {
                    add_option( 'customize_save_css', $style, '', 'yes' );
                } else {
                    update_option( 'customize_save_css', $style );
                }
                $cp = new NetbaseCustomizeClass();
                $cp->save_css_customize();
            }
        }
    }
    $my_transient = get_transient('current_load_css');
    if(empty($my_transient) || !$this->nbcore_is_plugin_active_byme('nb-fw/nb-fw.php')) {
        $this->nbcore_print_style_head();
    } else {
        if($my_transient==NBT_LOAD_CUSTOMIZE_FROM_HEAD) {
            $this->nbcore_print_style_head();
        } else {
            if($my_transient==NBT_LOAD_CUSTOMIZE_FROM_CSS_FILE && file_exists(NBT_REAL_PATH_TEMPLATE . NBT_CSS_CUSTOMIZE_PATH . NBT_CSS_CUSTOMIZE_NAME)) {
                wp_enqueue_style('aidoo-customize', get_template_directory_uri() . NBT_CSS_CUSTOMIZE_PATH . NBT_CSS_CUSTOMIZE_NAME, array(), AIDOO_VER);
            } else {
                set_transient('current_load_css', NBT_LOAD_CUSTOMIZE_FROM_HEAD, NBT_TIMEOUT_TRANSIENT_CUSTOMIZE);
                $this->nbcore_print_style_head();
            }
        }
    }
}

public function nbcore_print_style_head() {

    $style = $this->get_embed_style();

    $style = preg_replace('#/\*.*?\*/#s', '', $style);
    $style = preg_replace('/\s*([{}|:;,])\s+/', '$1', $style);
    $style = preg_replace('/\s\s+(.*)/', '$1', $style);

    wp_add_inline_style('nbcore_front_style', $style);
}

function nbcore_is_plugin_active_byme( $plugin ) {
    return in_array( $plugin, (array) get_option( 'active_plugins', array() ) );
}

public function nbcore_filter_fonts($font)
{
    $font_args = explode(",", aidoo_get_options($font));
    if($font_args[0] === 'google') {
        $this->nbcore_handle_google_font($font_args[1]);
    } elseif($font_args[0] === 'custom') {
        $this->handle_custom_font($font_args[1]);
    } elseif($font_args[0] === 'standard') {
        $this->handle_standard_font($font_args[1]);
    }
}

public function nbcore_handle_google_font($font_name)
{
    $font_subset = 'latin,latin-ext';
    $font_families = array();
    $google_fonts = Aidoo_Helper::google_fonts();
    $font_parse = array();


    $font_weight = $google_fonts[$font_name];
    $font_families[$font_name] = isset($font_families[$font_name]) ? array_unique(array_merge($font_families[$font_name], $font_weight)) : $font_weight;

    foreach ($font_families as $font => $font_weight) {
        $font_parse[] = $font . ':' . implode(',', $font_weight);
    }

    if (aidoo_get_options('subset_cyrillic')) {
        $font_subset .= ',cyrillic,cyrillic-ext';
    }
    if (aidoo_get_options('subset_greek')) {
        $font_subset .= ',greek,greek-ext';
    }
    if (aidoo_get_options('subset_vietnamese')) {
        $font_subset .= ',vietnamese';
    }

    $query_args = array(
        'family' => urldecode(implode('|', $font_parse)),
        'subset' => urldecode($font_subset),
    );

    $font_url = add_query_arg($query_args, 'https://fonts.googleapis.com/css');

    $enqueue = esc_url_raw($font_url);

    wp_enqueue_style('nb-google-fonts', $enqueue);
}

public function nbcore_google_fonts_url()
{
    $gg_font_arr = array();
    $gg_font_parse = array();
    $google_fonts = Aidoo_Helper::google_fonts();
    $gg_subset = 'latin,latin-ext';

    $body_font = explode(',', aidoo_get_options('body_font_family'));
    $heading_font = explode(',', aidoo_get_options('heading_font_family'));

    if($body_font[0] === 'google') {
        $body_name = $body_font[1];
        $body_weight = $google_fonts[$body_name];
        $gg_font_arr[$body_name] = isset($gg_font_arr[$body_name]) ? array_unique(array_merge($gg_font_arr[$body_name], $body_weight)) : $body_weight;
    }

    if($heading_font[0] === 'google') {
        $heading_name = $heading_font[1];
        $heading_weight = $google_fonts[$heading_name];
        $gg_font_arr[$heading_name] = isset($gg_font_arr[$heading_name]) ? array_unique(array_merge($gg_font_arr[$heading_name], $heading_weight)) : $heading_weight;
    }

    if(!empty($gg_font_arr)) {
        foreach ($gg_font_arr as $gg_font_name => $gg_font_weight) {
            $gg_font_parse[] = $gg_font_name . ':' . implode(',', $gg_font_weight);
        }

        if (aidoo_get_options('subset_cyrillic')) {
            $gg_subset .= ',cyrillic,cyrillic-ext';
        }
        if (aidoo_get_options('subset_greek')) {
            $gg_subset .= ',greek,greek-ext';
        }
        if (aidoo_get_options('subset_vietnamese')) {
            $gg_subset .= ',vietnamese';
        }

        $query_args = array(
            'family' => urldecode(implode('|', $gg_font_parse)),
            'subset' => urldecode($gg_subset),
        );

        $font_url = add_query_arg($query_args, 'https://fonts.googleapis.com/css');

        $enqueue = esc_url_raw($font_url);

        $enqueue = str_replace('|', '%7C', $enqueue);

        wp_enqueue_style('nb-google-fonts', $enqueue);
    }
}

public function nbcore_upload_mimes($t)
{
        // Add supported font extensions and MIME types.
    $t['eot'] = 'application/vnd.ms-fontobject';
    $t['otf'] = 'application/x-font-opentype';
    $t['ttf'] = 'application/x-font-ttf';
    $t['woff'] = 'application/font-woff';
    $t['woff2'] = 'application/font-woff2';

    return $t;
}

}
new Aidoo_Core();