<?php

$responsive_landing_page_custom_css = "";

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

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

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

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

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

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

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

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

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

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

	$responsive_landing_page_global_color = get_theme_mod('responsive_landing_page_global_color', '#8D6AEE '); // Add a fallback if the color isn't set

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

	$responsive_landing_page_global_secondary_color = get_theme_mod('responsive_landing_page_global_secondary_color', '#0F131F'); // Add a fallback if the color isn't set

	if ($responsive_landing_page_global_secondary_color) {
		$responsive_landing_page_custom_css .= ':root {';
		$responsive_landing_page_custom_css .= '--secondary-color: ' . esc_attr($responsive_landing_page_global_secondary_color) . ';';
		$responsive_landing_page_custom_css .= '}';
	}
	
	/*-------------------- Content Font -------------------*/

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

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

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

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

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

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

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

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

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

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

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

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

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