<?php

$agriculture_farm_lite_custom_css = "";

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

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

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

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

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

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

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

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

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

	$agriculture_farm_lite_global_color = get_theme_mod('agriculture_farm_lite_global_color', '#4AB24E'); // Add a fallback if the color isn't set

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

	$agriculture_farm_lite_secondary_color = get_theme_mod('agriculture_farm_lite_secondary_color', '#91C850'); // Add a fallback if the color isn't set

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


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

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

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

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

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

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

	/*-------------------- FOOTER -------------------*/

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

        $agriculture_farm_lite_custom_css .= "
            .footer-widgetarea {
                background-color: ". esc_attr($agriculture_farm_lite_footer_widget_background_color) .";
            }
        ";
    }
	
	$agriculture_farm_lite_footer_widget_background_image = get_theme_mod('agriculture_farm_lite_footer_widget_background_image');
	if ($agriculture_farm_lite_footer_widget_background_image) {
		$agriculture_farm_lite_custom_css .= "
			.footer-widgetarea {
				background-image: url(" . esc_url($agriculture_farm_lite_footer_widget_background_image) . ");
			}
		";
	}

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

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

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

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

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

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

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

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

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