<?php
/*
	Brand color

	Table of contents: (you can use search)
	# 1. Variables
	# 2. Brand color
	# 3. View
*/

# 1. Variables

$brand_color = false;

# 2. Brand color

$brand_color = StockieSettings::get( 'page_brand_color', 'global' );


# 3. View

if ( $brand_color ) {

    // --- start of brand color CSS ---
    $_style_block = '
            .brand-color, .brand-color-after, .brand-color-before, .brand-color-hover-after, .brand-color-hover-before, .brand-color-i, .brand-color-after-i, .brand-color-before-i, .brand-color-hover-i:hover, .brand-color-hover-i-after, .brand-color-hover-i-before, .brand-color-after:after, .brand-color-before:before, .brand-color-hover:hover, .brand-color-hover-after:hover:after, .brand-color-hover-before:before, .has-brand-color-color, .is-style-outline .has-brand-color-color, a:hover, .blog-grid:hover h3 a, .portfolio-item.grid-2:hover h4.title, .fullscreen-nav li a:hover, .socialbar.inline a:hover, .btn-link:hover, a.btn-link:hover, .owl-nav .owl-prev .ion:hover, .owl-nav .owl-next .ion:hover, .owl-nav .move-up .ion:hover, .owl-nav .move-down .ion:hover, .slider-nav .owl-prev .ion:hover, .slider-nav .owl-next .ion:hover, .slider-nav .move-up .ion:hover, .slider-nav .move-down .ion:hover, .gallery .expand .ion:hover, .close .ion:hover, .accordionItem_title:hover, .tab .tabNav_link:hover, .widget .socialbar a:hover, .social-bar .socialbar a:hover, .share-bar .links a:hover, .widget_shopping_cart_content .buttons a.button:first-child:hover, .woo_c-products .slider .owl-next:hover:after, .woo_c-products .slider .owl-prev:hover:after, .btn-link.active, span.page-numbers.current, a.page-numbers:hover, .main-nav .nav-item.active-main-item > .menu-link, .comment-content a, .header-title .subtitle b:before, nav.pagination li .btn.active, nav.pagination li .page-numbers.active, #mega-menu-wrap > ul .sub-menu > li > a:hover, #mega-menu-wrap > ul .sub-sub-menu > li > a:hover, #mega-menu-wrap > ul .current-menu-ancestor > a, #mega-menu-wrap > ul .current-menu-item > a, #fullscreen-mega-menu-wrap > ul .current-menu-ancestor > a, #fullscreen-mega-menu-wrap > ul .current-menu-item > a, .woocommerce .woo-my-nav li.is-active a, .portfolio-sorting li a.active, .team-member .socialbar a:hover, .widget_nav_menu .current-menu-item a, .widget_pages .current-menu-item a
        {';
    $_style_block .= 'color:' . $brand_color . ';';
    $_style_block .= '}';


    // --- start of brand border color CSS ---
    $_style_block .= '
            .brand-border-color, .brand-border-color-after, .brand-border-color-before, .brand-border-color-hover, .brand-border-color-hover-after, .brand-border-color-hover-before, .brand-border-color-i, .brand-border-color-after-i, .brand-border-color-before-i, .brand-border-color-hover-i, .brand-border-color-hover-i-after, .brand-border-color-hover-i-before, .button.brand-border-color, .has-brand-color-background-color, .is-style-outline .has-brand-color-color, .wp-block-button__link:hover, .btn-brand, input[type="submit"]:hover, button:hover, .btn:hover, a.btn:hover, input.btn:hover, a.button:hover, span.button:hover, div.button:hover, input[type="text"]:focus, input[type="number"]:focus, input[type="email"]:focus, textarea:focus, button:focus, .btn:focus, a.button:focus
        {';
    $_style_block .= 'border-color:' . $brand_color . ';';
    $_style_block .= '}';


    // --- start of brand background color CSS ---
    $_style_block .= '
            .brand-bg-color, .brand-bg-color-after, .brand-bg-color-before, .brand-bg-color-hover, .brand-bg-color-hover-after:hover:after, .brand-bg-color-hover-before:hover:before, .brand-bg-color-hover-after, .brand-bg-color-hover-before, .brand-bg-color-i, .brand-bg-color-after-i, .brand-bg-color-before-i, .brand-bg-color-hover-i, .brand-bg-color-hover-i-after, .brand-bg-color-hover-i-before, .btn-brand:not(.btn-outline), .has-brand-color-background-color, .blog-grid-content a.tag, a.brand-bg-color, .wp-block-button__link:hover, .widget_price_filter .ui-slider-range, .widget_price_filter .ui-slider-handle:after, .main-nav .nav-item:before, .main-nav .nav-item.current-menu-item:before, .main-nav .nav-item.current-menu-ancestor:before, .widget_calendar caption, .tag:hover, .reply a:hover, input[type="submit"]:hover, button:hover, .btn:hover, a.btn:hover, input.btn:hover, a.button:hover, span.button:hover, div.button:hover, .btn-outline:hover, input[type="submit"].btn-outline:hover, a.btn-outline:hover, .tooltip-item.left:before, .tooltip-item.right:before, .portfolio-page .tag, .header-title .tags .tag, .divider, .radio input:checked + .input:after, .btn-flat:hover, input[type="submit"].btn-flat:hover, a.btn-flat:hover, .tag:not(body):hover, .woo-onsale:hover, .price-discount:hover, .tag-cloud-link:hover, .pricing_price_time:hover, .reply a:hover, .portfolio-item span.category:hover,  button:focus, .btn:focus, a.button:focus,
            .yith-woocommerce-ajax-product-filter .yith-wcan-reset-navigation:hover, .yith-woocommerce-ajax-product-filter .yith-wcan-group li.chosen a, .yith-woocommerce-ajax-product-filter .yith-wcan-group li:hover a
        {';
    $_style_block .= 'background-color:' . $brand_color . ';';
    $_style_block .= '}';

    $_style_block .= '.brand-bg-color-i,.brand-bg-color-after-i:after,.brand-bg-color-before-i:before,.brand-bg-color-hover-i:hover,.brand-bg-color-hover-i-after:after,.brand-bg-color-hover-i-before:before{';
    $_style_block .= 'background-color:' . $brand_color . ' !important;';
    $_style_block .= '}';

    // --- end of CSS ---
    StockieLayout::append_to_dynamic_css_buffer( $_style_block );
}