<?php
$electrician_services_custom_style= "";

// sticky header

if (false === get_option('electrician_services_sticky_header')) {
    add_option('electrician_services_sticky_header', 'off');
}

// Define the custom CSS based on the 'electrician_services_sticky_header' option

if (get_option('electrician_services_sticky_header', 'off') !== 'on') {
    $electrician_services_custom_style .= '.fixed-header.fixed {';
    $electrician_services_custom_style .= 'position: static;';
    $electrician_services_custom_style .= '}';
}

if (get_option('electrician_services_sticky_header', 'off') !== 'off') {
    $electrician_services_custom_style .= '.fixed-header.fixed {';
    $electrician_services_custom_style .= 'position: fixed; background:var(--theme-primary-color);padding:10px; padding-left:80px;';
    $electrician_services_custom_style .= '}';

    $electrician_services_custom_style .= '.admin-bar .fixed {';
    $electrician_services_custom_style .= ' margin-top: 32px;';
    $electrician_services_custom_style .= '}';
}

/*---------------------------Scroll-top-position -------------------*/

$electrician_services_scroll_options = get_theme_mod( 'electrician_services_scroll_options','right_align');

if($electrician_services_scroll_options == 'right_align'){

$electrician_services_custom_style .='.scroll-top button{';

	$electrician_services_custom_style .='';

$electrician_services_custom_style .='}';

}else if($electrician_services_scroll_options == 'center_align'){

$electrician_services_custom_style .='.scroll-top button{';

	$electrician_services_custom_style .='right: 0; left:0; margin: 0 auto; top:85% !important';

$electrician_services_custom_style .='}';

}else if($electrician_services_scroll_options == 'left_align'){

$electrician_services_custom_style .='.scroll-top button{';

	$electrician_services_custom_style .='right: auto; left:5%; margin: 0 auto';

$electrician_services_custom_style .='}';
}

$electrician_services_logo_max_height = get_theme_mod('electrician_services_logo_max_height');

if($electrician_services_logo_max_height != false){

$electrician_services_custom_style .='.custom-logo-link img{';

	$electrician_services_custom_style .='max-height: '.esc_html($electrician_services_logo_max_height).'px;';

$electrician_services_custom_style .='}';
}

$electrician_services_scroll_color = get_theme_mod( 'electrician_services_scroll_color');
$electrician_services_custom_style .='.scroll-top .scrollup{';
$electrician_services_custom_style .='background-color: '.esc_attr($electrician_services_scroll_color).';';
$electrician_services_custom_style .='}';

/*---------------------------text-transform-------------------*/

$electrician_services_text_transform = get_theme_mod( 'electrician_services_menu_text_transform','CAPITALISE');
if($electrician_services_text_transform == 'CAPITALISE'){

$electrician_services_custom_style .='nav#top_gb_menu ul li a{';

	$electrician_services_custom_style .='text-transform: capitalize ;';

$electrician_services_custom_style .='}';

}else if($electrician_services_text_transform == 'UPPERCASE'){

$electrician_services_custom_style .='nav#top_gb_menu ul li a{';

	$electrician_services_custom_style .='text-transform: uppercase ;';

$electrician_services_custom_style .='}';

}else if($electrician_services_text_transform == 'LOWERCASE'){

$electrician_services_custom_style .='nav#top_gb_menu ul li a{';

	$electrician_services_custom_style .='text-transform: lowercase ; ';

$electrician_services_custom_style .='}';
}

/*-------------------------Slider-content-alignment-------------------*/

$electrician_services_slider_content_alignment = get_theme_mod( 'electrician_services_slider_content_alignment','LEFT-ALIGN');

if($electrician_services_slider_content_alignment == 'LEFT-ALIGN'){

$electrician_services_custom_style .='.slide-inner-box{';

	$electrician_services_custom_style .='text-align:left; left: 10%; right: 45%;';

$electrician_services_custom_style .='}';

$electrician_services_custom_style .='@media screen and (max-width:1199px){';

$electrician_services_custom_style .='.slide-inner-box{';

	$electrician_services_custom_style .='text-align:left; right: 30%; left: 10%;';

$electrician_services_custom_style .='} }';

$electrician_services_custom_style .='@media screen and (max-width:991px){';

$electrician_services_custom_style .='.slide-inner-box{';

	$electrician_services_custom_style .='text-align:left; right: 20%; left: 10%;';

$electrician_services_custom_style .='} }';


}else if($electrician_services_slider_content_alignment == 'CENTER-ALIGN'){

$electrician_services_custom_style .='.slide-inner-box{';

	$electrician_services_custom_style .='text-align:center; left: 20%; right: 20%;';

$electrician_services_custom_style .='}';


}else if($electrician_services_slider_content_alignment == 'RIGHT-ALIGN'){

$electrician_services_custom_style .='.slide-inner-box{';

	$electrician_services_custom_style .='text-align:right; left: 45%; right: 10%;';

$electrician_services_custom_style .='}';

$electrician_services_custom_style .='@media screen and (max-width:1199px){';

$electrician_services_custom_style .='.slide-inner-box{';

	$electrician_services_custom_style .='text-align:left; right: 10%; left: 30%;';

$electrician_services_custom_style .='} }';

$electrician_services_custom_style .='@media screen and (max-width:991px){';

$electrician_services_custom_style .='.slide-inner-box{';

	$electrician_services_custom_style .='text-align:left; right: 10%; left: 20%;';

$electrician_services_custom_style .='} }';

}

//--------------------Logo max-width----------------------------

$electrician_services_logo_max_height = get_theme_mod('electrician_services_logo_max_height','100');

if($electrician_services_logo_max_height != false){

$electrician_services_custom_style .='.custom-logo-link img{';

	$electrician_services_custom_style .='max-height: '.esc_html($electrician_services_logo_max_height).'px;';

$electrician_services_custom_style .='}';
}



//related products
if( get_option( 'electrician_services_related_product',true) != 'on') {

$electrician_services_custom_style .='.related.products{';

	$electrician_services_custom_style .='display: none;';
	
$electrician_services_custom_style .='}';
}

if( get_option( 'electrician_services_related_product',true) != 'off') {

$electrician_services_custom_style .='.related.products{';

	$electrician_services_custom_style .='display: block;';
	
$electrician_services_custom_style .='}';
}

// footer text alignment
$electrician_services_footer_content_alignment = get_theme_mod( 'electrician_services_footer_content_alignment','CENTER-ALIGN');

if($electrician_services_footer_content_alignment == 'LEFT-ALIGN'){

$electrician_services_custom_style .='.site-info{';

	$electrician_services_custom_style .='text-align:left; padding-left: 30px;';

$electrician_services_custom_style .='}';

$electrician_services_custom_style .='.site-info a{';

	$electrician_services_custom_style .='padding-left: 30px;';

$electrician_services_custom_style .='}';


}else if($electrician_services_footer_content_alignment == 'CENTER-ALIGN'){

$electrician_services_custom_style .='.site-info{';

	$electrician_services_custom_style .='text-align:center;';

$electrician_services_custom_style .='}';


}else if($electrician_services_footer_content_alignment == 'RIGHT-ALIGN'){

$electrician_services_custom_style .='.site-info{';

	$electrician_services_custom_style .='text-align:right; padding-right: 30px;';

$electrician_services_custom_style .='}';

$electrician_services_custom_style .='.site-info a{';

	$electrician_services_custom_style .='padding-right: 30px;';

$electrician_services_custom_style .='}';

}

// slider button
$mobile_button_setting = get_option('electrician_services_slider_button_mobile_show_hide', '1');
$main_button_setting = get_option('electrician_services_slider_button_show_hide', '1');

$electrician_services_custom_style .= '#slider .home-btn {';

if ($main_button_setting == 'off') {
    $electrician_services_custom_style .= 'display: none;';
}

$electrician_services_custom_style .= '}';

// Add media query for mobile devices
$electrician_services_custom_style .= '@media screen and (max-width: 600px) {';
if ($main_button_setting == 'off' || $mobile_button_setting == 'off') {
    $electrician_services_custom_style .= '#slider .home-btn { display: none; }';
}
$electrician_services_custom_style .= '}';


// scroll button
$mobile_scroll_setting = get_option('electrician_services_scroll_enable_mobile', '1');
$main_scroll_setting = get_option('electrician_services_scroll_enable', '1');

$electrician_services_custom_style .= '.scrollup {';

if ($main_scroll_setting == 'off') {
    $electrician_services_custom_style .= 'display: none;';
}

$electrician_services_custom_style .= '}';

// Add media query for mobile devices
$electrician_services_custom_style .= '@media screen and (max-width: 600px) {';
if ($main_scroll_setting == 'off' || $mobile_scroll_setting == 'off') {
    $electrician_services_custom_style .= '.scrollup { display: none; }';
}
$electrician_services_custom_style .= '}';

// theme breadcrumb
$mobile_breadcrumb_setting = get_option('electrician_services_enable_breadcrumb_mobile', '1');
$main_breadcrumb_setting = get_option('electrician_services_enable_breadcrumb', '1');

$electrician_services_custom_style .= '.archieve_breadcrumb {';

if ($main_breadcrumb_setting == 'off') {
    $electrician_services_custom_style .= 'display: none;';
}

$electrician_services_custom_style .= '}';

// Add media query for mobile devices
$electrician_services_custom_style .= '@media screen and (max-width: 600px) {';
if ($main_breadcrumb_setting == 'off' || $mobile_breadcrumb_setting == 'off') {
    $electrician_services_custom_style .= '.archieve_breadcrumb { display: none; }';
}
$electrician_services_custom_style .= '}';

// single post and page breadcrumb
$mobile_single_breadcrumb_setting = get_option('electrician_services_single_enable_breadcrumb_mobile', '1');
$main_single_breadcrumb_setting = get_option('electrician_services_single_enable_breadcrumb', '1');

$electrician_services_custom_style .= '.single_breadcrumb {';

if ($main_single_breadcrumb_setting == 'off') {
    $electrician_services_custom_style .= 'display: none;';
}

$electrician_services_custom_style .= '}';

// Add media query for mobile devices
$electrician_services_custom_style .= '@media screen and (max-width: 600px) {';
if ($main_single_breadcrumb_setting == 'off' || $mobile_single_breadcrumb_setting == 'off') {
    $electrician_services_custom_style .= '.single_breadcrumb { display: none; }';
}
$electrician_services_custom_style .= '}';

// woocommerce breadcrumb
$mobile_woo_breadcrumb_setting = get_option('electrician_services_woocommerce_enable_breadcrumb_mobile', '1');
$main_woo_breadcrumb_setting = get_option('electrician_services_woocommerce_enable_breadcrumb', '1');

$electrician_services_custom_style .= '.woocommerce-breadcrumb {';

if ($main_woo_breadcrumb_setting == 'off') {
    $electrician_services_custom_style .= 'display: none;';
}

$electrician_services_custom_style .= '}';

// Add media query for mobile devices
$electrician_services_custom_style .= '@media screen and (max-width: 600px) {';
if ($main_woo_breadcrumb_setting == 'off' || $mobile_woo_breadcrumb_setting == 'off') {
    $electrician_services_custom_style .= '.woocommerce-breadcrumb { display: none; }';
}
$electrician_services_custom_style .= '}';

//colors
$color = get_theme_mod('electrician_services_primary_color', '#ff3947');
$color_heading = get_theme_mod('electrician_services_heading_color', '#2a2a34');
$color_text = get_theme_mod('electrician_services_text_color', '#757575');
$color_fade = get_theme_mod('electrician_services_primary_fade', '#ffe0e2');
$color_footer_bg = get_theme_mod('electrician_services_footer_bg', '#2a2a34');
$color_post_bg = get_theme_mod('electrician_services_post_bg', '#ffffff');
$slider_overlay = get_theme_mod( 'electrician_services_slider_overlay','#000000');


$electrician_services_custom_style .= ":root {";
    $electrician_services_custom_style .= "--theme-primary-color: {$color};";
    $electrician_services_custom_style .= "--theme-heading-color: {$color_heading};";
    $electrician_services_custom_style .= "--theme-text-color: {$color_text};";
    $electrician_services_custom_style .= "--theme-primary-fade: {$color_fade};";
    $electrician_services_custom_style .= "--theme-footer-color: {$color_footer_bg};";
    $electrician_services_custom_style .= "--post-bg-color: {$color_post_bg};";
    $electrician_services_custom_style .= "--slider-overlay: {$slider_overlay};";
$electrician_services_custom_style .= "}";

$electrician_services_slider_opacity = get_theme_mod( 'electrician_services_slider_opacity','1');

if($electrician_services_slider_opacity == '0'){
$electrician_services_custom_style .='#slider img {';
    $electrician_services_custom_style .='opacity: 0';
$electrician_services_custom_style .='}';

}else if($electrician_services_slider_opacity == '0.1'){
$electrician_services_custom_style .='#slider img {';
    $electrician_services_custom_style .='opacity: 0.1';
$electrician_services_custom_style .='}';

}else if($electrician_services_slider_opacity == '0.2'){
$electrician_services_custom_style .='#slider img {';
    $electrician_services_custom_style .='opacity: 0.2';
$electrician_services_custom_style .='}';

}else if($electrician_services_slider_opacity == '0.3'){
$electrician_services_custom_style .='#slider img {';
    $electrician_services_custom_style .='opacity: 0.3';
$electrician_services_custom_style .='}';

}else if($electrician_services_slider_opacity == '0.4'){
$electrician_services_custom_style .='#slider img {';
    $electrician_services_custom_style .='opacity: 0.4';
$electrician_services_custom_style .='}';

}else if($electrician_services_slider_opacity == '0.5'){
$electrician_services_custom_style .='#slider img {';
    $electrician_services_custom_style .='opacity: 0.5';
$electrician_services_custom_style .='}';

}else if($electrician_services_slider_opacity == '0.6'){
$electrician_services_custom_style .='#slider img {';
    $electrician_services_custom_style .='opacity: 0.6';
$electrician_services_custom_style .='}';

}else if($electrician_services_slider_opacity == '0.7'){
$electrician_services_custom_style .='#slider img {';
    $electrician_services_custom_style .='opacity: 0.7';
$electrician_services_custom_style .='}';

}else if($electrician_services_slider_opacity == '0.8'){
$electrician_services_custom_style .='#slider img {';
    $electrician_services_custom_style .='opacity: 0.8';
$electrician_services_custom_style .='}';

}
else if($electrician_services_slider_opacity == '0.9'){
$electrician_services_custom_style .='#slider img {';
    $electrician_services_custom_style .='opacity: 0.9';
$electrician_services_custom_style .='}';

}
else if($electrician_services_slider_opacity == '1'){
$electrician_services_custom_style .='#slider img {';
    $electrician_services_custom_style .='opacity: 1';
$electrician_services_custom_style .='}';

}

$electrician_services_slider_heading_color = get_theme_mod( 'electrician_services_slider_heading_color','#2a2a34');
$electrician_services_custom_style .='h2.slider-title {';
$electrician_services_custom_style .='color: '.esc_attr($electrician_services_slider_heading_color).';';
$electrician_services_custom_style .='}';

$electrician_services_slider_excerpt_color = get_theme_mod( 'electrician_services_slider_excerpt_color','#2a2a34');
$electrician_services_custom_style .='#slider .slider-excerpt {';
$electrician_services_custom_style .='color: '.esc_attr($electrician_services_slider_excerpt_color).';';
$electrician_services_custom_style .='}';

//-------------------title-font-size----//  
$electrician_services_site_title_fontsize = get_theme_mod('electrician_services_site_title_fontsize','25');

if($electrician_services_site_title_fontsize != false){

$electrician_services_custom_style .='.electrician-services-logo h1,.site-title,.site-title a,.electrician-services-logo h1 a{';

    $electrician_services_custom_style .='font-size: '.esc_html($electrician_services_site_title_fontsize).'px;';

$electrician_services_custom_style .='}';
}

//-------------------tagline-font-size----//  
$electrician_services_site_tagline_fontsize = get_theme_mod('electrician_services_site_tagline_fontsize','15');

if($electrician_services_site_tagline_fontsize != false){

$electrician_services_custom_style .='p.site-description{';

    $electrician_services_custom_style .='font-size: '.esc_html($electrician_services_site_tagline_fontsize).'px;';

$electrician_services_custom_style .='}';
}

//-------------------menu-font-size----//  
$electrician_services_menu_fontsize = get_theme_mod('electrician_services_menu_fontsize','14');

if($electrician_services_menu_fontsize != false){

$electrician_services_custom_style .='.gb_nav_menu li a{';

    $electrician_services_custom_style .='font-size: '.esc_html($electrician_services_menu_fontsize).'px;';

$electrician_services_custom_style .='}';
}

//-------------------first-letter-capital----//
if (false === get_option('electrician_services_first_letter_capital_enable')) {
    add_option('electrician_services_first_letter_capital_enable', 'on');
}
if (get_option('electrician_services_first_letter_capital_enable') === 'off') {
    $electrician_services_custom_style .= '.entry-content > p:first-of-type:first-letter {';
    $electrician_services_custom_style .= 'font-size: 16px; float: none; line-height: unset; padding: 0;';
    $electrician_services_custom_style .= '}';
}