<?php

$elegant_jewellery_custom_css = "";

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

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

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

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

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

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

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

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

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

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

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

	$elegant_jewellery_global_secondary_color = get_theme_mod('elegant_jewellery_global_secondary_color', '#1a1a1a'); // Add a fallback if the color isn't set

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

	$elegant_jewellery_content_typography_font = get_theme_mod('elegant_jewellery_content_typography_font', 'libre-baskerville'); // Add a fallback if the color isn't set

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

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

	$elegant_jewellery_heading_typography_font = get_theme_mod('elegant_jewellery_heading_typography_font', 'libre-baskerville'); // Add a fallback if the color isn't set

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

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

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

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

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

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

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

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

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