<?php

$home_construction_builder_custom_css = "";

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

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

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

	$home_construction_builder_single_page_content_alignment = get_theme_mod('home_construction_builder_single_page_content_alignment', 'left');
	if ($home_construction_builder_single_page_content_alignment == 'left') {
	    $home_construction_builder_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{';
	    $home_construction_builder_custom_css .= 'text-align: left !important;';
	    $home_construction_builder_custom_css .= '}';
	} else if ($home_construction_builder_single_page_content_alignment == 'center') {
	    $home_construction_builder_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{';
	    $home_construction_builder_custom_css .= 'text-align: center !important;';
	    $home_construction_builder_custom_css .= '}';
	} else if ($home_construction_builder_single_page_content_alignment == 'right') {
	    $home_construction_builder_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{';
	    $home_construction_builder_custom_css .= 'text-align: right !important;';
	    $home_construction_builder_custom_css .= '}';
	}

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

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

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

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

	$home_construction_builder_sticky_sidebar = get_theme_mod('home_construction_builder_sticky_sidebar',true);
    if($home_construction_builder_sticky_sidebar != true){
        $home_construction_builder_custom_css .='.widget-area-wrapper{';
            $home_construction_builder_custom_css .='position: relative !important;';
        $home_construction_builder_custom_css .='}';
    }

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

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

	if ($home_construction_builder_global_color) {
		$home_construction_builder_custom_css .= ':root {';
		$home_construction_builder_custom_css .= '--global-color: ' . esc_attr($home_construction_builder_global_color) . ';';
		$home_construction_builder_custom_css .= '}';
	}

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

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

	if ($home_construction_builder_secondary_color) {
		$home_construction_builder_custom_css .= ':root {';
		$home_construction_builder_custom_css .= '--secondary-color: ' . esc_attr($home_construction_builder_secondary_color) . ';';
		$home_construction_builder_custom_css .= '}';
	}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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