<?php

$medical_care_unit_custom_css = "";

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

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

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

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

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

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

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

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

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

	$medical_care_unit_global_color = get_theme_mod('medical_care_unit_global_color', '#05cd9e'); // Add a fallback if the color isn't set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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