<?php

$trucking_company_custom_css = "";

	$trucking_company_theme_pagination_options_alignment = get_theme_mod('trucking_company_theme_pagination_options_alignment', 'Center');
	if ($trucking_company_theme_pagination_options_alignment == 'Center') {
		$trucking_company_custom_css .= '.navigation.pagination,.navigation.posts-navigation .nav-links{';
		$trucking_company_custom_css .= 'justify-content: center;margin: 0 auto;';
		$trucking_company_custom_css .= '}';
	} else if ($trucking_company_theme_pagination_options_alignment == 'Right') {
		$trucking_company_custom_css .= '.navigation.pagination,.navigation.posts-navigation .nav-links{';
		$trucking_company_custom_css .= 'justify-content: right;margin: 0 0 0 auto;';
		$trucking_company_custom_css .= '}';
	} else if ($trucking_company_theme_pagination_options_alignment == 'Left') {
		$trucking_company_custom_css .= '.navigation.pagination,.navigation.posts-navigation .nav-links{';
		$trucking_company_custom_css .= 'justify-content: left;margin: 0 auto 0 0;';
		$trucking_company_custom_css .= '}';
	}

	$trucking_company_theme_breadcrumb_enable = get_theme_mod('trucking_company_theme_breadcrumb_enable',true);
    if($trucking_company_theme_breadcrumb_enable != true){
        $trucking_company_custom_css .='nav.breadcrumb-trail.breadcrumbs,nav.woocommerce-breadcrumb{';
            $trucking_company_custom_css .='display: none;';
        $trucking_company_custom_css .='}';
    }

	$trucking_company_theme_breadcrumb_options_alignment = get_theme_mod('trucking_company_theme_breadcrumb_options_alignment', 'Left');
	if ($trucking_company_theme_breadcrumb_options_alignment == 'Center') {
	    $trucking_company_custom_css .= '.breadcrumbs ul,nav.woocommerce-breadcrumb{';
	    $trucking_company_custom_css .= 'text-align: center !important;';
	    $trucking_company_custom_css .= '}';
	} else if ($trucking_company_theme_breadcrumb_options_alignment == 'Right') {
	    $trucking_company_custom_css .= '.breadcrumbs ul,nav.woocommerce-breadcrumb{';
	    $trucking_company_custom_css .= 'text-align: Right !important;';
	    $trucking_company_custom_css .= '}';
	} else if ($trucking_company_theme_breadcrumb_options_alignment == 'Left') {
	    $trucking_company_custom_css .= '.breadcrumbs ul,nav.woocommerce-breadcrumb{';
	    $trucking_company_custom_css .= 'text-align: Left !important;';
	    $trucking_company_custom_css .= '}';
	}

	$trucking_company_single_page_content_alignment = get_theme_mod('trucking_company_single_page_content_alignment', 'left');
	if ($trucking_company_single_page_content_alignment == 'left') {
	    $trucking_company_custom_css .= '#single-page .type-page,section.theme-custom-block.theme-error-sectiontheme-error-section.error-block-middle,section.theme-custom-block.theme-error-section.error-block-heading .theme-area-header{';
	    $trucking_company_custom_css .= 'text-align: left !important;';
	    $trucking_company_custom_css .= '}';
	} else if ($trucking_company_single_page_content_alignment == 'center') {
	    $trucking_company_custom_css .= '#single-page .type-page,section.theme-custom-block.theme-error-sectiontheme-error-section.error-block-middle,section.theme-custom-block.theme-error-section.error-block-heading .theme-area-header{';
	    $trucking_company_custom_css .= 'text-align: center !important;';
	    $trucking_company_custom_css .= '}';
	} else if ($trucking_company_single_page_content_alignment == 'right') {
	    $trucking_company_custom_css .= '#single-page .type-page,section.theme-custom-block.theme-error-sectiontheme-error-section.error-block-middle,section.theme-custom-block.theme-error-section.error-block-heading .theme-area-header{';
	    $trucking_company_custom_css .= 'text-align: right !important;';
	    $trucking_company_custom_css .= '}';
	}

	$trucking_company_single_post_content_alignment = get_theme_mod('trucking_company_single_post_content_alignment', 'left');
	if ($trucking_company_single_post_content_alignment == 'left') {
	    $trucking_company_custom_css .= '#single-page .type-post,#single-page .type-post .entry-meta,#single-page .type-post .is-layout-flex{';
	    $trucking_company_custom_css .= 'text-align: left !important;justify-content: left;';
	    $trucking_company_custom_css .= '}';
	} else if ($trucking_company_single_post_content_alignment == 'center') {
	    $trucking_company_custom_css .= '#single-page .type-post,#single-page .type-post .entry-meta,#single-page .type-post .is-layout-flex{';
	    $trucking_company_custom_css .= 'text-align: center !important;justify-content: center;';
	    $trucking_company_custom_css .= '}';
	} else if ($trucking_company_single_post_content_alignment == 'right') {
	    $trucking_company_custom_css .= '#single-page .type-post,#single-page .type-post .entry-meta,#single-page .type-post .is-layout-flex{';
	    $trucking_company_custom_css .= 'text-align: right !important;justify-content: right;';
	    $trucking_company_custom_css .= '}';
	}

	$trucking_company_menu_text_transform = get_theme_mod('trucking_company_menu_text_transform', 'uppercase');
	if ($trucking_company_menu_text_transform == 'Capitalize') {
	    $trucking_company_custom_css .= '.site-navigation .primary-menu > li a{';
	    $trucking_company_custom_css .= 'text-transform: Capitalize !important;';
	    $trucking_company_custom_css .= '}';
	} else if ($trucking_company_menu_text_transform == 'uppercase') {
	    $trucking_company_custom_css .= '.site-navigation .primary-menu > li a{';
	    $trucking_company_custom_css .= 'text-transform: uppercase !important;';
	    $trucking_company_custom_css .= '}';
	} else if ($trucking_company_menu_text_transform == 'lowercase') {
	    $trucking_company_custom_css .= '.site-navigation .primary-menu > li a{';
	    $trucking_company_custom_css .= 'text-transform: lowercase !important;';
	    $trucking_company_custom_css .= '}';
	}

	$trucking_company_footer_widget_title_alignment = get_theme_mod('trucking_company_footer_widget_title_alignment', 'left');
	if ($trucking_company_footer_widget_title_alignment == 'left') {
	    $trucking_company_custom_css .= 'h2.widget-title{';
	    $trucking_company_custom_css .= 'text-align: left !important;';
	    $trucking_company_custom_css .= '}';
	} else if ($trucking_company_footer_widget_title_alignment == 'center') {
	    $trucking_company_custom_css .= 'h2.widget-title{';
	    $trucking_company_custom_css .= 'text-align: center !important;';
	    $trucking_company_custom_css .= '}';
	} else if ($trucking_company_footer_widget_title_alignment == 'right') {
	    $trucking_company_custom_css .= 'h2.widget-title{';
	    $trucking_company_custom_css .= 'text-align: right !important;';
	    $trucking_company_custom_css .= '}';
	}

    $trucking_company_show_hide_related_product = get_theme_mod('trucking_company_show_hide_related_product',true);
    if($trucking_company_show_hide_related_product != true){
        $trucking_company_custom_css .='.related.products{';
            $trucking_company_custom_css .='display: none;';
        $trucking_company_custom_css .='}';
    }

	/*-------------------- Global First Color -------------------*/

	$trucking_company_global_color = get_theme_mod('trucking_company_global_color', '#1037b6'); // Add a fallback if the color isn't set

	if ($trucking_company_global_color) {
		$trucking_company_custom_css .= ':root {';
		$trucking_company_custom_css .= '--global-color: ' . esc_attr($trucking_company_global_color) . ';';
		$trucking_company_custom_css .= '}';
	}
	
	/*-------------------- Global Second Color -------------------*/

	$trucking_company_secondary_color = get_theme_mod('trucking_company_secondary_color', '#f68b21'); // Add a fallback if the color isn't set

	if ($trucking_company_secondary_color) {
		$trucking_company_custom_css .= ':root {';
		$trucking_company_custom_css .= '--global-colorr: ' . esc_attr($trucking_company_secondary_color) . ';';
		$trucking_company_custom_css .= '}';
	}


	/*-------------------- Content Font -------------------*/

	$trucking_company_content_typography_font = get_theme_mod('trucking_company_content_typography_font', 'roboto'); // Add a fallback if the color isn't set

	if ($trucking_company_content_typography_font) {
		$trucking_company_custom_css .= ':root {';
		$trucking_company_custom_css .= '--font-main: ' . esc_attr($trucking_company_content_typography_font) . ';';
		$trucking_company_custom_css .= '}';
	}

	/*-------------------- Heading Font -------------------*/

	$trucking_company_heading_typography_font = get_theme_mod('trucking_company_heading_typography_font', 'roboto'); // Add a fallback if the color isn't set

	if ($trucking_company_heading_typography_font) {
		$trucking_company_custom_css .= ':root {';
		$trucking_company_custom_css .= '--font-head: ' . esc_attr($trucking_company_heading_typography_font) . ';';
		$trucking_company_custom_css .= '}';
	}

	$trucking_company_columns = get_theme_mod('trucking_company_posts_per_columns', 3);
	$trucking_company_columns = absint($trucking_company_columns);
	if ( $trucking_company_columns < 1 || $trucking_company_columns > 6 ) {
		$trucking_company_columns = 3;
	}
	$trucking_company_custom_css .= "
		.site-content .article-wraper-archive {
			grid-template-columns: repeat({$trucking_company_columns}, 1fr);
		}
	";

	$trucking_company_copyright_alignment = get_theme_mod( 'trucking_company_copyright_alignment', 'Default' );
	if ( $trucking_company_copyright_alignment === 'Reverse' ) {
		$trucking_company_custom_css .= '.site-info .column-row { flex-direction: row-reverse; }';
		$trucking_company_custom_css .= '.footer-credits { justify-content: flex-end; }';
		$trucking_company_custom_css .= '.footer-copyright { text-align: right; }';
		$trucking_company_custom_css .= '.site-info .column.column-3 { text-align: left; }';
	} elseif ( $trucking_company_copyright_alignment === 'Center' ) {
		$trucking_company_custom_css .= '.site-info .column-row { flex-direction: column; align-items: center; gap: 15px; }';
		$trucking_company_custom_css .= '.footer-credits { justify-content: center; }';
		$trucking_company_custom_css .= '.footer-copyright { text-align: center; }';
		$trucking_company_custom_css .= '.site-info .column.column-3 { text-align: center; }';
	}

	$trucking_company_footer_widget_background_color = get_theme_mod('trucking_company_footer_widget_background_color');
	if ($trucking_company_footer_widget_background_color) {

		$trucking_company_custom_css .= "
			.footer-widgetarea {
				background-color: ". esc_attr($trucking_company_footer_widget_background_color) .";
			}
		";
	}

	$trucking_company_footer_widget_background_image = get_theme_mod('trucking_company_footer_widget_background_image');
	if ($trucking_company_footer_widget_background_image) {
		$trucking_company_custom_css .= "
			.footer-widgetarea {
				background-image: url(" . esc_url($trucking_company_footer_widget_background_image) . ");
			}
		";
	}

	$trucking_company_copyright_font_size = get_theme_mod('trucking_company_copyright_font_size');
	if ($trucking_company_copyright_font_size) {

		$trucking_company_custom_css .= "
			.footer-copyright {
				font-size: ". esc_attr($trucking_company_copyright_font_size) ."px;
			}
		";
	}

	/*-------------------- Menu Color CSS -------------------*/

	$trucking_company_header_menus_color = get_theme_mod('trucking_company_header_menus_color');
	if($trucking_company_header_menus_color != false){
		$trucking_company_custom_css .='.site-navigation .primary-menu a{';
			$trucking_company_custom_css .='color: '.esc_attr($trucking_company_header_menus_color).'!important;';
		$trucking_company_custom_css .='}';
	}

	$trucking_company_header_menus_hover_color = get_theme_mod('trucking_company_header_menus_hover_color');
	if($trucking_company_header_menus_hover_color != false){
		$trucking_company_custom_css .='.site-navigation .primary-menu a:hover{';
			$trucking_company_custom_css .='color: '.esc_attr($trucking_company_header_menus_hover_color).'!important;';
		$trucking_company_custom_css .='}';
	}

	$trucking_company_header_submenus_color = get_theme_mod('trucking_company_header_submenus_color');
	if($trucking_company_header_submenus_color != false){
		$trucking_company_custom_css .='.site-navigation .primary-menu ul.sub-menu li a,.site-navigation .primary-menu li ul li a{';
			$trucking_company_custom_css .='color: '.esc_attr($trucking_company_header_submenus_color).'!important;';
		$trucking_company_custom_css .='}';
	}

	$trucking_company_header_submenus_hover_color = get_theme_mod('trucking_company_header_submenus_hover_color');
	if($trucking_company_header_submenus_hover_color != false){
		$trucking_company_custom_css .='.site-navigation .primary-menu > li ul.sub-menu a:hover,.site-navigation .primary-menu li ul li a:hover{';
			$trucking_company_custom_css .='color: '.esc_attr($trucking_company_header_submenus_hover_color).'!important;';
		$trucking_company_custom_css .='}';
	}