<?php
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! function_exists( 'conceptly_lite_features' ) ) :
	function conceptly_lite_features() {
	$conceptly_default_content 			= conceptly_get_feature_default();
	$conceptly_hide_show_feature			= get_theme_mod('hide_show_feature','1'); 
	$conceptly_features_title				= get_theme_mod('features_title',__('Our Features','clever-fox'));
	$conceptly_features_description		= get_theme_mod('features_description',__('There are many variations of passages of Lorem Ipsum available but the majority have suffered alteration in some form by injected humour.','clever-fox'));
	$conceptly_features_content			= get_theme_mod('feature_content',$conceptly_default_content);
	
	 if($conceptly_hide_show_feature == '1') { 
	?>
<!-- Start: Our Features
    ============================= -->
    <section id="ourfeatures" class="section-padding home-feature position-relative">
        <div class="container">   
		<?php  
			if( ($conceptly_features_title) || ($conceptly_features_description)!='' ) { ?>
            <!-- Start Feature Title -->
			<div class="row">
                <div class="col-lg-8 col-md-10 col-12">                    
					<div class="section-title">
					<?php if ( ! empty( $conceptly_features_title ) || is_customize_preview() ) : ?>
                        <h2><?php echo wp_kses_post($conceptly_features_title); ?> <span></span></h2>
					<?php endif; ?>

					<?php if($conceptly_features_description) {?>
                        <p><?php echo wp_kses_post($conceptly_features_description); ?></p>
					<?php } ?>
                    </div>
                </div>
            </div>
			<!-- /Feature Title -->
			<?php 
				} 
			?>
            <div id="feature-content"class="row">
			<?php
				if ( ! empty( $conceptly_features_content ) ) {
				$conceptly_allowed_html = array(
				'br'     => array(),
				'em'     => array(),
				'strong' => array(),
				'b'      => array(),
				'i'      => array(),
				);
				$conceptly_features_content = json_decode( $conceptly_features_content );
				foreach ( $conceptly_features_content as $conceptly_service_item ) {
					$conceptly_repeater_icon = ! empty( $conceptly_service_item->icon_value ) ? apply_filters( 'conceptly_translate_single_string', $conceptly_service_item->icon_value, 'feature section' ) : '';
					$conceptly_repeater_title = ! empty( $conceptly_service_item->title ) ? apply_filters( 'conceptly_translate_single_string', $conceptly_service_item->title, 'feature section' ) : '';
					$conceptly_repeater_text = ! empty( $conceptly_service_item->text ) ? apply_filters( 'conceptly_translate_single_string', $conceptly_service_item->text, 'feature section' ) : '';
					?>
                <div class="col-lg-4 col-md-6 col-sm-12 features-box pt-3 pb-3">
                    <div class="row" >
                        <div class="col-3">
                            <div class="features-box-icon">
								<?php if ( ! empty( $conceptly_repeater_icon ) ) { ?>	
										<i class="fa <?php echo esc_attr($conceptly_repeater_icon);?>"></i>
								<?php } ?>	
                            </div>
                        </div>
                        <div class="col-9">                                
                            <h3><?php echo esc_html( $conceptly_repeater_title ); ?></h3>
                            <p><?php echo esc_html( $conceptly_repeater_text ); ?> </p>
                        </div>
                    </div>
                </div>
				
				<?php
					}
					}	
				?>
            </div>
        </div>
        <div class="shape15"><img src="<?php echo esc_url( plugin_dir_url( __DIR__ ) . 'images/shape/shape15.png' ); ?>" alt="image"></div>
    </section>
	</section>
<?php } 
}
	endif;
	if ( function_exists( 'conceptly_lite_features' ) ) {
		$cleverfox_section_priority = apply_filters( 'conceptly_section_priority', 27, 'conceptly_lite_features' );
		add_action( 'conceptly_sections', 'conceptly_lite_features', absint( $cleverfox_section_priority ) );
	}