<?php

$automobile_hub_tp_theme_css = '';

$automobile_hub_tp_color_option = get_theme_mod('automobile_hub_tp_color_option');

// 1st color
$automobile_hub_tp_color_option = get_theme_mod('automobile_hub_tp_color_option', '#2db7ff');
if ($automobile_hub_tp_color_option) {
    $automobile_hub_tp_theme_css .= ':root {';
    $automobile_hub_tp_theme_css .= '--color-primary1: ' . esc_attr($automobile_hub_tp_color_option) . ';';
    $automobile_hub_tp_theme_css .= '}';
}

//SECONDARY COLOR
$car_wash_services_tp_secondary_color_option = get_theme_mod('car_wash_services_tp_secondary_color_option');

$automobile_hub_tp_theme_css .= '@media screen and (max-width: 1000px) {';
if($car_wash_services_tp_secondary_color_option != false){
$automobile_hub_tp_theme_css .=' .sidenav ,.page-template-front-page .headerbox,.page-template-front-page .header-home {';
$automobile_hub_tp_theme_css .='background: '.esc_attr($car_wash_services_tp_secondary_color_option).';';
$automobile_hub_tp_theme_css .='}';
}
$automobile_hub_tp_theme_css .= '}';

if($car_wash_services_tp_secondary_color_option != false){
$automobile_hub_tp_theme_css .='#theme-sidebar button[type="submit"]:hover, .next.page-numbers:hover , .woocommerce ul.products li.product .onsale ,.woocommerce a.button:hover, .woocommerce span.onsale , .woocommerce button.button.alt:hover, .woocommerce #respond input#submit:hover , .woocommerce button.button:hover, .woocommerce a.button.alt:hover,#slider .carousel-control-prev-icon:hover, #slider .carousel-control-next-icon:hover, .more-btn a:hover, .headerbox, .main-navigation .sub-menu,.wc-block-cart__submit-container a:hover,.page-template-front-page .header-home {';
$automobile_hub_tp_theme_css .='background: '.esc_attr($car_wash_services_tp_secondary_color_option).';';
$automobile_hub_tp_theme_css .='}';
}

if($car_wash_services_tp_secondary_color_option != false){
$automobile_hub_tp_theme_css .='.logo h1 a , .page-box h4 a:hover,.box-content a:hover, .nav-links:hover, #footer .tagcloud a, p.wp-block-tag-cloud a:hover, .woocommerce-account .woocommerce-MyAccount-content a:hover, .woocommerce-products-header h1, woocommerce div.product .product_title, .woocommerce #reviews #comments h2, .woocommerce h1 h2 h3 , #related products h2, .entry-summary a:hover, woocommerce-info a:hover, .woocommerce-billing-fields h3, .woocommerce-additional-fields h3 ,#order_review_heading h3, a:hover, .page-header h1, #featured-car h2, .car-inner-content h3, h1, h2, h3, h4, h5, h6{';
$automobile_hub_tp_theme_css .='color: '.esc_attr($car_wash_services_tp_secondary_color_option).';';
$automobile_hub_tp_theme_css .='}';
}
if($car_wash_services_tp_secondary_color_option != false){
$automobile_hub_tp_theme_css .=' .readmore-btn a:hover  {';
$automobile_hub_tp_theme_css .='border-color: '.esc_attr($car_wash_services_tp_secondary_color_option).';';
$automobile_hub_tp_theme_css .='}';
}

//preloader

$automobile_hub_tp_preloader_color1_option = get_theme_mod('automobile_hub_tp_preloader_color1_option');

if($automobile_hub_tp_preloader_color1_option != false){
$automobile_hub_tp_theme_css .='.center1{';
$automobile_hub_tp_theme_css .='border-color: '.esc_attr($automobile_hub_tp_preloader_color1_option).' !important;';
$automobile_hub_tp_theme_css .='}';
}
if($automobile_hub_tp_preloader_color1_option != false){
$automobile_hub_tp_theme_css .='.center1 .ring::before{';
$automobile_hub_tp_theme_css .='background: '.esc_attr($automobile_hub_tp_preloader_color1_option).' !important;';
$automobile_hub_tp_theme_css .='}';
}

$automobile_hub_tp_preloader_color2_option = get_theme_mod('automobile_hub_tp_preloader_color2_option');

if($automobile_hub_tp_preloader_color2_option != false){
$automobile_hub_tp_theme_css .='.center2{';
$automobile_hub_tp_theme_css .='border-color: '.esc_attr($automobile_hub_tp_preloader_color2_option).' !important;';
$automobile_hub_tp_theme_css .='}';
}
if($automobile_hub_tp_preloader_color2_option != false){
$automobile_hub_tp_theme_css .='.center2 .ring::before{';
$automobile_hub_tp_theme_css .='background: '.esc_attr($automobile_hub_tp_preloader_color2_option).' !important;';
$automobile_hub_tp_theme_css .='}';
}

$automobile_hub_tp_preloader_bg_color_option = get_theme_mod('automobile_hub_tp_preloader_bg_color_option');

if($automobile_hub_tp_preloader_bg_color_option != false){
$automobile_hub_tp_theme_css .='.loader{';
$automobile_hub_tp_theme_css .='background: '.esc_attr($automobile_hub_tp_preloader_bg_color_option).';';
$automobile_hub_tp_theme_css .='}';
}

$automobile_hub_tp_footer_bg_color_option = get_theme_mod('automobile_hub_tp_footer_bg_color_option');


if($automobile_hub_tp_footer_bg_color_option != false){
$automobile_hub_tp_theme_css .='#footer{';
$automobile_hub_tp_theme_css .='background: '.esc_attr($automobile_hub_tp_footer_bg_color_option).';';
$automobile_hub_tp_theme_css .='}';
}

$automobile_hub_footer_widget_image = get_theme_mod('automobile_hub_footer_widget_image');
if($automobile_hub_footer_widget_image != false){
$automobile_hub_tp_theme_css .='#footer{';
$automobile_hub_tp_theme_css .='background: url('.esc_attr($automobile_hub_footer_widget_image).');';
$automobile_hub_tp_theme_css .='}';
}

//======================= slider Content layout ===================== //

$car_wash_services_slider_content_layout = get_theme_mod('car_wash_services_slider_content_layout', 'CENTER-ALIGN'); 
$automobile_hub_tp_theme_css .= '#slider .carousel-caption{';
switch ($car_wash_services_slider_content_layout) {
    case 'LEFT-ALIGN':
        $automobile_hub_tp_theme_css .= 'text-align:left; right: 40%; left: 15%';
        break;
    case 'CENTER-ALIGN':
        $automobile_hub_tp_theme_css .= 'text-align:center; left: 30%; right: 30%';
        break;
    case 'RIGHT-ALIGN':
        $automobile_hub_tp_theme_css .= 'text-align:right; left: 40%; right: 15%';
        break;
    default:
        $automobile_hub_tp_theme_css .= 'text-align:left; right: 40%; left: 15%';
        break;
}
$automobile_hub_tp_theme_css .= '}';

//Font Weight
$automobile_hub_menu_font_weight = get_theme_mod( 'automobile_hub_menu_font_weight','400');
if($automobile_hub_menu_font_weight == '100'){
$automobile_hub_tp_theme_css .='.main-navigation a{';
    $automobile_hub_tp_theme_css .='font-weight: 100;';
$automobile_hub_tp_theme_css .='}';
}else if($automobile_hub_menu_font_weight == '200'){
$automobile_hub_tp_theme_css .='.main-navigation a{';
    $automobile_hub_tp_theme_css .='font-weight: 200;';
$automobile_hub_tp_theme_css .='}';
}else if($automobile_hub_menu_font_weight == '300'){
$automobile_hub_tp_theme_css .='.main-navigation a{';
    $automobile_hub_tp_theme_css .='font-weight: 300;';
$automobile_hub_tp_theme_css .='}';
}else if($automobile_hub_menu_font_weight == '400'){
$automobile_hub_tp_theme_css .='.main-navigation a{';
    $automobile_hub_tp_theme_css .='font-weight: 400;';
$automobile_hub_tp_theme_css .='}';
}else if($automobile_hub_menu_font_weight == '500'){
$automobile_hub_tp_theme_css .='.main-navigation a{';
    $automobile_hub_tp_theme_css .='font-weight: 500;';
$automobile_hub_tp_theme_css .='}';
}else if($automobile_hub_menu_font_weight == '600'){
$automobile_hub_tp_theme_css .='.main-navigation a{';
    $automobile_hub_tp_theme_css .='font-weight: 600;';
$automobile_hub_tp_theme_css .='}';
}else if($automobile_hub_menu_font_weight == '700'){
$automobile_hub_tp_theme_css .='.main-navigation a{';
    $automobile_hub_tp_theme_css .='font-weight: 700;';
$automobile_hub_tp_theme_css .='}';
}else if($automobile_hub_menu_font_weight == '800'){
$automobile_hub_tp_theme_css .='.main-navigation a{';
    $automobile_hub_tp_theme_css .='font-weight: 800;';
$automobile_hub_tp_theme_css .='}';
}else if($automobile_hub_menu_font_weight == '900'){
$automobile_hub_tp_theme_css .='.main-navigation a{';
    $automobile_hub_tp_theme_css .='font-weight: 900;';
$automobile_hub_tp_theme_css .='}';
}


// header
$automobile_hub_slider_arrows = get_theme_mod('automobile_hub_slider_arrows', true);

if($automobile_hub_slider_arrows != true){
$automobile_hub_tp_theme_css .='.page-template-front-page .headerbox{';
$automobile_hub_tp_theme_css .='position:static;';
$automobile_hub_tp_theme_css .='}';
}

// logo tagline color
$automobile_hub_site_tagline_color = get_theme_mod('automobile_hub_site_tagline_color');

if($automobile_hub_site_tagline_color != false){
$automobile_hub_tp_theme_css .='.logo h1 a, .logo p a, .logo p.site-title a{';
$automobile_hub_tp_theme_css .='color: '.esc_attr($automobile_hub_site_tagline_color).';';
$automobile_hub_tp_theme_css .='}';
}

/*------------------ Slider CSS -------------------*/
    $automobile_hub_slider_opacity_setting = get_theme_mod('automobile_hub_slider_opacity_setting', true);
    $automobile_hub_image_opacity_color    = get_theme_mod('automobile_hub_image_opacity_color', '');
    $automobile_hub_slider_opacity         = get_theme_mod('automobile_hub_slider_opacity', '1');

    if ($automobile_hub_slider_opacity_setting) {
        // Apply opacity value to slider image
        if ($automobile_hub_slider_opacity !== '') {
            $automobile_hub_tp_theme_css .= '#slider img {';
            $automobile_hub_tp_theme_css .= 'opacity: ' . esc_attr($automobile_hub_slider_opacity) . ';';
            $automobile_hub_tp_theme_css .= '}';
        }

        // Apply background color to slider if defined
        if ($automobile_hub_image_opacity_color !== '') {
            $automobile_hub_tp_theme_css .= '#slider {';
            $automobile_hub_tp_theme_css .= 'background-color: ' . esc_attr($automobile_hub_image_opacity_color) . ';';
            $automobile_hub_tp_theme_css .= '}';
        }
    } else {
        // If setting is disabled, force full opacity
        $automobile_hub_tp_theme_css .= '#slider img {';
        $automobile_hub_tp_theme_css .= 'opacity: 1;';
        $automobile_hub_tp_theme_css .= '}';
    }

    /*---------------------------Slider Height ------------*/
    $automobile_hub_slider_img_height       = get_theme_mod('automobile_hub_slider_img_height');
    $automobile_hub_slider_img_height_resp  = get_theme_mod('automobile_hub_slider_img_height_responsive');

    if ( $automobile_hub_slider_img_height ) {
        $automobile_hub_tp_theme_css .= '#slider img {';
        $automobile_hub_tp_theme_css .= 'height: ' . esc_attr( $automobile_hub_slider_img_height ) . ';';
        $automobile_hub_tp_theme_css .= '}';
    }

    if ( $automobile_hub_slider_img_height_resp ) {
        $automobile_hub_tp_theme_css .= '@media only screen and (max-width: 767px) {';
        $automobile_hub_tp_theme_css .= '#slider img {';
        $automobile_hub_tp_theme_css .= 'height: ' . esc_attr( $automobile_hub_slider_img_height_resp ) . ';';
        $automobile_hub_tp_theme_css .= '}';
        $automobile_hub_tp_theme_css .= '}';
    }

    // Slider animation
    $car_wash_services_featured_sec_animation = get_theme_mod( 'car_wash_services_featured_sec_animation', true );
    if ( $car_wash_services_featured_sec_animation ) {
        $automobile_hub_tp_theme_css .= '#featured-car { animation: bounceInDown 3s; animation-fill-mode: both; }';
    }