<?php
if ( ! get_theme_mod( 'property_dealer_enable_banner_section', false ) ) {
	return;
}
/**
 * Render Banner Section.
*/ 
$property_dealer_banner_section_heading = get_theme_mod( 'property_dealer_banner_section_heading' );
$property_dealer_banner_section_content = get_theme_mod( 'property_dealer_banner_section_content' );
$property_dealer_banner_section_image   = get_theme_mod( 'property_dealer_banner_section_image' );

$property_dealer_default_image_url = get_template_directory_uri() . '/resource/img/default.png';

$property_dealer_banner_bg = ! empty( $property_dealer_banner_section_image ) ? $property_dealer_banner_section_image : $property_dealer_default_image_url;
?>

<section id="property_dealer_banner_section" class="banner-section banner-style-1 wow fadeInDown" data-wow-duration="1.5s" style="background-image: url('<?php echo esc_url( $property_dealer_banner_bg ); ?>');">
    <?php
    if ( is_customize_preview() ) :
        property_dealer_section_link( 'property_dealer_banner_section' );
    endif;
    ?>
    <div class="banner-section-wrapper">
        <div class="asterthemes-wrapper">
            <div class="banner-single-outer">
                <div class="banner-single">
                    <div class="banner-caption">
                        <div class="banner-catption-wrapper">
                            <?php if ( ! empty( $property_dealer_banner_section_heading ) ) : ?>
                                <h1 class="banner-caption-title">
                                    <a href="<?php the_permalink(); ?>">
                                        <?php echo esc_html( $property_dealer_banner_section_heading ); ?>
                                    </a>
                                </h1>
                            <?php endif; ?>
                            <?php if ( ! empty( $property_dealer_banner_section_content ) ) : ?>
                                <p class="banner-caption-content">
                                    <?php echo esc_html( $property_dealer_banner_section_content ); ?>
                                </p>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="banner-search">
                        <?php echo property_dealer_render_search_form(); ?>
                    </div>
                </div>
            </div>		
        </div>
    </div>
</section>
