<?php
/**
 * Search result page entry content
 *
 * @package OceanWP WordPress theme
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

global $post;

// Excerpt length.
// $length = apply_filters( 'ocean_search_results_excerpt_length', '30' );

?>



	   
 
	   <a class="car-page-link" href="<?php the_permalink(); ?>">
 <div id="custom-bg" class="car-img" style="background-image: url(<?php the_post_thumbnail_url(); ?>); "></div>
            </a>



	   
	<div class="car-info">
		<div class="tour-info">
		
                <h4>
               <a href="<?php the_permalink(); ?>" class="c-accl-post-thumb__link" rel="bookmark"><span class="c-accl-post-thumb__link-title"><?php the_title() ?></span></a>
                </h4>
		   <?php if ( get_field('tour_duration') ) : ?>
            <p class="price-per-day"><?php echo get_field('tour_duration'); ?></p>
            <?php endif; ?>
		   <?php if ( get_field('price') ) : ?>
            <p class="price-info">Price: <?php echo get_field('price'); ?> <?php else : ?><em>Price: Negotiatable</em></p>
            <?php endif; ?>
				
		</div>
                <div class="car-card-cta tours">
               
	                        
<a id="myBtn<?php echo bl_get_post_id_by_title( 'Digitized motivating structure' );?>"><p class="whatsapp-cta"><i class="fa-solid fa-envelope" aria-hidden="true"></i> Contact Us</p></a>
	<div id="myModal<?php echo bl_get_post_id_by_title( 'Digitized motivating structure' );?>" class="modal modal<?php echo bl_get_post_id_by_title( 'Digitized motivating structure' );?>">

  <!-- Modal content -->
  <div class="modal-content">
	  <span class="close close<?php echo bl_get_post_id_by_title( 'Digitized motivating structure' );?>">&times;</span>
	  <?php the_title(); ?>
    <?php echo do_shortcode('[contact-form-7 id="2515" title="Contact form 7-archive-tours"]') ;?>
  </div>

</div>				
					
					
<script>
// Get the modal
var modal<?php echo bl_get_post_id_by_title( 'Digitized motivating structure' );?> = document.getElementById("myModal<?php echo bl_get_post_id_by_title( 'Digitized motivating structure' );?>");

// Get the button that opens the modal
var btn = document.getElementById("myBtn<?php echo bl_get_post_id_by_title( 'Digitized motivating structure' );?>");

// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close<?php echo bl_get_post_id_by_title( 'Digitized motivating structure' );?>")[0];

// When the user clicks the button, open the modal 
btn.onclick = function() {
  modal<?php echo bl_get_post_id_by_title( 'Digitized motivating structure' );?>.style.display = "block";
}

// When the user clicks on <span> (x), close the modal
span.onclick = function() {
  modal<?php echo bl_get_post_id_by_title( 'Digitized motivating structure' );?>.style.display = "none";
}

// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
  if (event.target == modal<?php echo bl_get_post_id_by_title( 'Digitized motivating structure' );?>) {
    modal<?php echo bl_get_post_id_by_title( 'Digitized motivating structure' );?>.style.display = "none";
  }
}
</script>
				
					
                </div>
            </div>




<style>
.car-card-cta a .whatsapp-cta {
    padding: 5px 20px;
    background: #FF9800!important;
    width: auto;
    text-align: center;
    color: #fff;
    border-radius: 3px;
    font-weight: 600;
    font-size: .9em;
}
	.car-card-cta a:hover .whatsapp-cta{
		 background: #000!important;
	}
	.price-per-day{
		margin-bottom:0;
	}
	a.car-page-link:hover .car-img{
		opacity:.9;
	} 
	ul.page-numbers {
    display: inline-block;
    width: 100%;
    margin: 0;
    padding: 50px 0 0;
    list-style: none;
    text-align: center;
    clear: both;
}
	
</style>
