<?php

$beauty_parlour_salon_custom_css = "";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	if ($beauty_parlour_salon_heading_typography_font) {
		$beauty_parlour_salon_custom_css .= ':root {';
		$beauty_parlour_salon_custom_css .= '--font-head: ' . esc_attr($beauty_parlour_salon_heading_typography_font) . ';';
		$beauty_parlour_salon_custom_css .= '}';
	}
	
	$beauty_parlour_salon_columns = get_theme_mod('beauty_parlour_salon_posts_per_columns', 3);
	$beauty_parlour_salon_columns = absint($beauty_parlour_salon_columns);
	if ( $beauty_parlour_salon_columns < 1 || $beauty_parlour_salon_columns > 6 ) {
		$beauty_parlour_salon_columns = 3;
	}
	$beauty_parlour_salon_custom_css .= "
		.site-content .article-wraper-archive {
			grid-template-columns: repeat({$beauty_parlour_salon_columns}, 1fr);
		}
	";

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

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

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

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

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

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

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

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

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

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

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