<?php

$car_booking_custom_css = "";

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

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

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

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

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

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

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

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

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

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

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

	if ($car_booking_global_color) {
		$car_booking_custom_css .= ':root {';
		$car_booking_custom_css .= '--global-color: ' . esc_attr($car_booking_global_color) . ';';
		$car_booking_custom_css .= '}';
	}
	
	/*-------------------- Content Font -------------------*/

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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