<?php

$nutrition_diet_custom_style= "";

/*---------------------------Width -------------------*/
$nutrition_diet_theme_width = get_theme_mod( 'nutrition_diet_width_options','full_width');

if($nutrition_diet_theme_width == 'full_width'){

$nutrition_diet_custom_style .='body{';

	$nutrition_diet_custom_style .='max-width: 100%;';

$nutrition_diet_custom_style .='}';

}else if($nutrition_diet_theme_width == 'container'){

$nutrition_diet_custom_style .='body{';

	$nutrition_diet_custom_style .='width: 100%; padding-right: 15px; padding-left: 15px;  margin-right: auto !important; margin-left: auto !important;';

$nutrition_diet_custom_style .='}';

$nutrition_diet_custom_style .='@media screen and (min-width: 601px){';

$nutrition_diet_custom_style .='body{';

    $nutrition_diet_custom_style .='max-width: 720px;';
    
$nutrition_diet_custom_style .='} }';

$nutrition_diet_custom_style .='@media screen and (min-width: 992px){';

$nutrition_diet_custom_style .='body{';

    $nutrition_diet_custom_style .='max-width: 960px;';
    
$nutrition_diet_custom_style .='} }';

$nutrition_diet_custom_style .='@media screen and (min-width: 1200px){';

$nutrition_diet_custom_style .='body{';

    $nutrition_diet_custom_style .='max-width: 1140px;';
    
$nutrition_diet_custom_style .='} }';

$nutrition_diet_custom_style .='@media screen and (min-width: 1400px){';

$nutrition_diet_custom_style .='body{';

    $nutrition_diet_custom_style .='max-width: 1320px;';
    
$nutrition_diet_custom_style .='} }';

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

$nutrition_diet_custom_style .='body{';

    $nutrition_diet_custom_style .='max-width: 100%; padding-right:0px; padding-left: 0px';
    
$nutrition_diet_custom_style .='} }';

}else if($nutrition_diet_theme_width == 'container_fluid'){

$nutrition_diet_custom_style .='body{';

	$nutrition_diet_custom_style .='width: 100%;padding-right: 15px;padding-left: 15px;margin-right: auto;margin-left: auto;';

$nutrition_diet_custom_style .='}';

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

$nutrition_diet_custom_style .='body{';

    $nutrition_diet_custom_style .='max-width: 100%; padding-right:0px; padding-left: 0px';
    
$nutrition_diet_custom_style .='} }';
}

//--------------------sticky header----------------------
if (false === get_option('nutrition_diet_sticky_header')) {
    add_option('nutrition_diet_sticky_header', 'off');
}

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

if (get_option('nutrition_diet_sticky_header', 'off') !== 'on') {
    $nutrition_diet_custom_style .= '.fixed_header.fixed {';
    $nutrition_diet_custom_style .= 'position: static;';
    $nutrition_diet_custom_style .= '}';
}

if (get_option('nutrition_diet_sticky_header', 'off') !== 'off') {
    $nutrition_diet_custom_style .= '.fixed_header.fixed {';
    $nutrition_diet_custom_style .= 'position: fixed; background:#fff;';
    $nutrition_diet_custom_style .= '}';

    $nutrition_diet_custom_style .= '.admin-bar .fixed {';
    $nutrition_diet_custom_style .= ' margin-top: 32px;';
    $nutrition_diet_custom_style .= '}';
}
/*---------------------------Scroll-top-position -------------------*/

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

if($nutrition_diet_scroll_options == 'right_align'){

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

	$nutrition_diet_custom_style .='';

$nutrition_diet_custom_style .='}';

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

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

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

$nutrition_diet_custom_style .='}';

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

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

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

$nutrition_diet_custom_style .='}';
}

//-----------------logo-max-height

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

if($nutrition_diet_logo_max_height != false){

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

	$nutrition_diet_custom_style .='max-height: '.esc_html($nutrition_diet_logo_max_height).'px;';

$nutrition_diet_custom_style .='}';
}

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

$nutrition_diet_text_transform = get_theme_mod( 'nutrition_diet_menu_text_transform','CAPITALISE');
if($nutrition_diet_text_transform == 'CAPITALISE'){

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

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

$nutrition_diet_custom_style .='}';

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

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

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

$nutrition_diet_custom_style .='}';

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

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

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

$nutrition_diet_custom_style .='}';
}

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

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

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

$nutrition_diet_custom_style .='#slider .carousel-caption{';

	$nutrition_diet_custom_style .='text-align:left; right: 55%; left: 15%;';

$nutrition_diet_custom_style .='}';


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

$nutrition_diet_custom_style .='#slider .carousel-caption{';

    $nutrition_diet_custom_style .='right: 35%; left: 15%';
    
$nutrition_diet_custom_style .='} }';

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

$nutrition_diet_custom_style .='#slider .carousel-caption{';

    $nutrition_diet_custom_style .='right: 25%; left: 15%';
    
$nutrition_diet_custom_style .='} }';


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

$nutrition_diet_custom_style .='#slider .carousel-caption{';

	$nutrition_diet_custom_style .='text-align:center;right: 15%; left: 15%;';

$nutrition_diet_custom_style .='}';


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

$nutrition_diet_custom_style .='#slider .carousel-caption{';

	$nutrition_diet_custom_style .='text-align:right; right: 15%; left: 55%;';

$nutrition_diet_custom_style .='}';

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

$nutrition_diet_custom_style .='#slider .carousel-caption{';

    $nutrition_diet_custom_style .='right: 15%; left: 35%';
    
$nutrition_diet_custom_style .='} }';

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

$nutrition_diet_custom_style .='#slider .carousel-caption{';

    $nutrition_diet_custom_style .='right: 15%; left: 25%';
    
$nutrition_diet_custom_style .='} }';

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

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

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

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

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

	$nutrition_diet_custom_style .='display: block;';
	
$nutrition_diet_custom_style .='}';
}
// footer text alignment
$nutrition_diet_footer_content_alignment = get_theme_mod( 'nutrition_diet_footer_content_alignment','CENTER-ALIGN');

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

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

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

$nutrition_diet_custom_style .='}';

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

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

$nutrition_diet_custom_style .='}';


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

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

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

$nutrition_diet_custom_style .='}';


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

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

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

$nutrition_diet_custom_style .='}';

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

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

$nutrition_diet_custom_style .='}';

}

// slider button
$mobile_button_setting = get_option('nutrition_diet_slider_button_mobile_show_hide', '1');
$main_button_setting = get_option('nutrition_diet_slider_button_show_hide', '1');

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

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

$nutrition_diet_custom_style .= '}';

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


// scroll button
$mobile_scroll_setting = get_option('nutrition_diet_scroll_enable_mobile', '1');
$main_scroll_setting = get_option('nutrition_diet_scroll_enable', '1');

$nutrition_diet_custom_style .= '.scrollup {';

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

$nutrition_diet_custom_style .= '}';

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

// theme breadcrumb
$mobile_breadcrumb_setting = get_option('nutrition_diet_enable_breadcrumb_mobile', '1');
$main_breadcrumb_setting = get_option('nutrition_diet_enable_breadcrumb', '1');

$nutrition_diet_custom_style .= '.archieve_breadcrumb {';

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

$nutrition_diet_custom_style .= '}';

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

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

$nutrition_diet_custom_style .= '.single_breadcrumb {';

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

$nutrition_diet_custom_style .= '}';

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

// woocommerce breadcrumb
$mobile_woo_breadcrumb_setting = get_option('nutrition_diet_woocommerce_enable_breadcrumb_mobile', '1');
$main_woo_breadcrumb_setting = get_option('nutrition_diet_woocommerce_enable_breadcrumb', '1');

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

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

$nutrition_diet_custom_style .= '}';

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


//colors
$color = get_theme_mod('nutrition_diet_primary_color', '#4ce5a2');
$color_heading = get_theme_mod('nutrition_diet_heading_color', '#223645');
$color_text = get_theme_mod('nutrition_diet_text_color', '#949fa7');
$color_fade = get_theme_mod('nutrition_diet_primary_fade', '#ecfff7');
$color_footer_bg = get_theme_mod('nutrition_diet_footer_bg', '#223645');
$color_post_bg = get_theme_mod('nutrition_diet_post_bg', '#ffffff');
$slider_overlay = get_theme_mod( 'nutrition_diet_slider_overlay','#ffffff');


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


$nutrition_diet_slider_opacity = get_theme_mod( 'nutrition_diet_slider_opacity','0.5');

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

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

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

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

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

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

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

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

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

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

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

}
$nutrition_diet_slider_heading_color = get_theme_mod( 'nutrition_diet_slider_heading_color','#223645');
$nutrition_diet_custom_style .='#slider .carousel-caption h2 {';
$nutrition_diet_custom_style .='color: '.esc_attr($nutrition_diet_slider_heading_color).';';
$nutrition_diet_custom_style .='}';

$nutrition_diet_slider_excerpt_color = get_theme_mod( 'nutrition_diet_slider_excerpt_color','#223645');
$nutrition_diet_custom_style .='#slider .slider-excerpt {';
$nutrition_diet_custom_style .='color: '.esc_attr($nutrition_diet_slider_excerpt_color).';';
$nutrition_diet_custom_style .='}';

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

if($nutrition_diet_site_title_fontsize != false){

$nutrition_diet_custom_style .='.nutrition-diet-logo h1,.site-title,.site-title a,.nutrition-diet-logo h1 a{';

    $nutrition_diet_custom_style .='font-size: '.esc_html($nutrition_diet_site_title_fontsize).'px;';

$nutrition_diet_custom_style .='}';
}

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

if($nutrition_diet_site_tagline_fontsize != false){

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

    $nutrition_diet_custom_style .='font-size: '.esc_html($nutrition_diet_site_tagline_fontsize).'px;';

$nutrition_diet_custom_style .='}';
}

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

if($nutrition_diet_menu_fontsize != false){

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

    $nutrition_diet_custom_style .='font-size: '.esc_html($nutrition_diet_menu_fontsize).'px;';

$nutrition_diet_custom_style .='}';
}

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