<?php

/*----------------------------------------------------------------------------------*/

$home_decor_shop_common_inline_css = '';

$home_decor_shop_scroll_top_alignment = get_theme_mod('home_decor_shop_scroll_top_alignment', 'Right');

$home_decor_shop_alignment_styles = [
    'Left' => 'left: 20px;',
    'Center' => 'right: 0; left: 0; margin: 0 auto;',
    'Right' => 'right: 20px;'
];

$alignment_style = $home_decor_shop_alignment_styles[$home_decor_shop_scroll_top_alignment] ?? $home_decor_shop_alignment_styles['Right'];

$home_decor_shop_common_inline_css .= "a.scrollup,button#scroll_2 { $alignment_style }";

/*----------------------------------------------------------------------------------*/

$home_decor_shop_footer_background_color = get_theme_mod('home_decor_shop_footer_background_color', '#222222');

if (!empty($home_decor_shop_footer_background_color)) {
    $home_decor_shop_common_inline_css .= ".footer-widgets { background: " . esc_attr($home_decor_shop_footer_background_color) . "}";
}

/*----------------------------------------------------------------------------------*/

$home_decor_shop_footer_background_image = get_theme_mod('home_decor_shop_footer_background_image', '');

if (!empty($home_decor_shop_footer_background_image)) {
    $home_decor_shop_common_inline_css .= ".footer-widgets { background-image: url('" . esc_url($home_decor_shop_footer_background_image) . "') !important; background-size: cover; background-repeat: no-repeat; }";
}

/*----------------------------------------------------------------------------------*/

$home_decor_shop_copyright_alignment = get_theme_mod('home_decor_shop_copyright_alignment', 'Center');

$home_decor_shop_copyright_alignment_styles = [
    'Left' => 'text-align: left;',
    'Center' => 'text-align: center;',
    'Right' => 'text-align: right;'
];

$alignment_style = $home_decor_shop_copyright_alignment_styles[$home_decor_shop_copyright_alignment] ?? $home_decor_shop_copyright_alignment_styles['Center'];

$home_decor_shop_common_inline_css .= "#footer-copyright p { $alignment_style }";

/*----------------------------------------------------------------------------------*/

$home_decor_shop_container_width = get_theme_mod('home_decor_shop_container_width');

if (!empty($home_decor_shop_container_width)) {
    $home_decor_shop_common_inline_css .= "@media (min-width: 1024px) { 
        body, .navbar-area.header-fixed, .admin-bar .header-fixed,.loading { 
            width: " . esc_attr($home_decor_shop_container_width) . "%; 
            margin: 0 auto; 
        } 
        .admin-bar .header-fixed { 
            margin-top: 32px; 
        } 
    }";
}

/*----------------------------------------------------------------------------------*/   

$home_decor_shop_responsive_scroll_to_top_setting = get_theme_mod( 'home_decor_shop_responsive_scroll_to_top_setting', true );

if ( $home_decor_shop_responsive_scroll_to_top_setting == true && get_theme_mod( 'home_decor_shop_scroll_to_top_setting', true ) != true ) {
    $home_decor_shop_common_inline_css .= "a.scrollup,button#scroll_2 {
        display: none !important;
    }";
}

if ( $home_decor_shop_responsive_scroll_to_top_setting == true ) {
    $home_decor_shop_common_inline_css .= "@media screen and (max-width: 768px) {
        a.scrollup,button#scroll_2 {
            display: block !important;
        }
    }";
} elseif ( $home_decor_shop_responsive_scroll_to_top_setting == false ) {
    $home_decor_shop_common_inline_css .= "@media screen and (max-width: 768px) {
        a.scrollup,button#scroll_2 {
            display: none !important;
        }
    }";
}

/*----------------------------------------------------------------------------------*/ 

$home_decor_shop_responsive_preloader_setting = get_theme_mod( 'home_decor_shop_responsive_preloader_setting', false );

if ( $home_decor_shop_responsive_preloader_setting == true && get_theme_mod( 'home_decor_shop_preloader_setting', false ) == false ) {
    $home_decor_shop_common_inline_css .= "@media screen and (min-width: 768px) {
        .loading {
            display: none !important;
        }
    }";
}

if ( $home_decor_shop_responsive_preloader_setting == false ) {
    $home_decor_shop_common_inline_css .= "@media screen and (max-width: 768px) {
        .loading {
            display: none !important;
        }
    }";
}

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

$home_decor_shop_theme_color_1 = get_theme_mod('home_decor_shop_theme_color_1');

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

if ($home_decor_shop_theme_color_1) {
  $home_decor_shop_common_inline_css .= ':root {';
  $home_decor_shop_common_inline_css .= '--first-color: ' . esc_attr($home_decor_shop_theme_color_1) . ' !important;';
  $home_decor_shop_common_inline_css .= '} ';
}