<?php
if (!defined('ABSPATH'))
  exit;

include_once('eurostocks-public-vehicle-details-display-options.php');


if (isset($data['vehicle'])) {

  $vehicle = $data['vehicle'];

  if (isset($options['only_fl']) && $options['only_fl'] == 1 || isset($options['enable_fl']) && $options['enable_fl'] == 1) {
    $eurostocks_fl = $options['enable_fl'];
    $eurostocks_only_fl = $options['only_fl'];
    $eurostocks_fl_interest = $options['fl_percentage'];
    $eurostocks_fl_duration = $options['fl_duration'];
    $eurostocks_fl_rest = $options['fl_restschuld'];
  } else {
    $eurostocks_fl = 0;
    $eurostocks_only_fl = 0;
  }

  $parkingsensors = array(
    "FRONT_SENSORS" => __("front", "eurostocks"),
    "REAR_SENSORS" => __("rear", "eurostocks"),
    "REAR_VIEW_CAM" => __("rear view camera", "eurostocks"),
    "AUTOMATIC_PARKING" => __("automatic parking", "eurostocks"),
    "CAM_360_DEGREES" => __("360°-camera", "eurostocks"),
  );

  if ($diflang && isset($options[esc_html($current_lang)]['experts_one_name']) && $options[esc_html($current_lang)]['experts_one_name'] != '') {
    $experts_one_name_display = $options[esc_html($current_lang)]['experts_one_name'];
  } elseif (isset($options['experts_one_name'])) {
    $experts_one_name_display = $options['experts_one_name'];
  } else {
    $experts_one_name_display = '';
  }

  if ($diflang && isset($options[esc_html($current_lang)]['experts_two_name']) && $options[esc_html($current_lang)]['experts_two_name'] != '') {
    $experts_two_name_display = $options[esc_html($current_lang)]['experts_two_name'];
  } elseif (isset($options['experts_two_name'])) {
    $experts_two_name_display = $options['experts_two_name'];
  } else {
    $experts_two_name_display = '';
  }

  $show_experts_one = trim(wp_strip_all_tags($experts_one_name_display)) !== '';
  $show_experts_two = trim(wp_strip_all_tags($experts_two_name_display)) !== '';
  $show_experts_section = $show_experts_one || $show_experts_two;
  $experts_intro_column_class = ($show_experts_one xor $show_experts_two) ? 'eurocol-md-8' : 'eurocol-md-4';


  echo "<script>document.title = '" . esc_html($vehicle['make']) . " " . esc_html($vehicle['modelDescription']) . " | " . esc_html(get_bloginfo('name')) . "';</script>";

  ?>
<div id="es-vehicle-details">
  <div class="euro-modal-header">
    <h2 class="euro-modal-title"><span class="es-text-primary">
        <?php echo esc_html($vehicle['make']) . '</span> ' . esc_html($vehicle['modelDescription']); ?>
    </h2>
    <?php
    if (isset($options['use_as_iframe']) && $options['use_as_iframe'] == 1) {
    ?>
      <div><button class="euro-btn euro-btn-primary" onclick="goBack()"><?php esc_html_e('Back', 'eurostocks'); ?></button></div>
    <?php
    }
    ?>
  </div>
  <div class="euro-modal-body">
    <div class="es-top euro-row es-bg-white">
      <div class="eurocol-md-7 es-pl-0">
        <div class="owl-carousel">
          <?php
          $image_zero = '';
          foreach ($vehicle['images'] as $image) {
            $key_xl = array_search('XL', array_column($image['images'], 'size'));
            $key_xxxl = array_search('XXXL', array_column($image['images'], 'size'));
            $image_xl_url = $image['images'][$key_xl]['url'];
            $image_xxxl_url = $image['images'][$key_xxxl]['url'];
            if ($image_zero == '') {
              $image_zero = $image_xl_url;
            }
          ?>
            <div class="item"><a data-fslightbox href="<?php echo esc_url($image_xxxl_url); ?>"><img src="<?php echo esc_url($image_xl_url); ?>"
                alt="<?php echo esc_html($vehicle['modelDescription']); ?>" loading="lazy" /></a></div>
          <?php
          }
          ?>
        </div>
      </div>

      <div class="eurocol-md-5">

        <div class="es-inner-text">
          <?php
          if ($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['details_top_txt']) && $options[esc_html($current_lang)]['details_top_txt'] != '') { ?>
            <span>
              <?php echo esc_html($this->eurostocks_replace_merk_model($options['details_top_txt'], $vehicle['make'], $vehicle['model'])); ?>
            </span>
            <?php 
          } else {
            if (isset($options['details_top_txt']) && $options['details_top_txt'] != '') { ?>
              <span>
                <?php echo esc_html($this->eurostocks_replace_merk_model($options['details_top_txt'], $vehicle['make'], $vehicle['model'])); ?>
              </span>
            <?php }
          }
          if (isset($vehicle['priceInfo']['TransportCosts']) && $vehicle['priceInfo']['TransportCosts'] != '') {
            $transportCosts = $vehicle['priceInfo']['TransportCosts'];
          } else {
            $transportCosts = 0;
          }
          if ($options['country'] != 'nl' && $options['country'] != 'nl21') {
            if (isset($vehicle['priceInfo']['ImportMargin']) && $vehicle['priceInfo']['ImportMargin'] != '') {
              $importMargin = $vehicle['priceInfo']['ImportMargin'];
            } else {
              $importMargin = 0;
            }
            if (isset($vehicle['priceInfo']['ImportCosts']) && $vehicle['priceInfo']['ImportCosts'] != '') {
              $importCosts = $vehicle['priceInfo']['ImportCosts'];
            } else {
              $importCosts = 0;
            }
            $price = $vehicle['priceInfo']['PriceMobiledeBruto'] + $importMargin + $importCosts + $transportCosts;
          } elseif ($options['country'] == 'nl21') {
                    if (isset($vehicle['priceInfo']['PriceNlWithVatNl']) && $vehicle['priceInfo']['PriceNlWithVatNl'] != '') {
                        $price = $vehicle['priceInfo']['PriceNlWithVatNl'];
                    } else {
                        if(isset($vehicle['priceInfo']['FallbackPriceNlWithVatNl']) && $vehicle['priceInfo']['FallbackPriceNlWithVatNl'] != '' && isset($options['co2_fallback_display']) && $options['co2_fallback_display'] == 1) {
                            $price = $vehicle['priceInfo']['FallbackPriceNlWithVatNl'];
                        }else{
                            $price = false;
                        }
                    }
                } else {
                    if($options['country'] == 'nl') {
                        if (isset($vehicle['priceInfo']['PriceNlWithVatMobilede']) && $vehicle['priceInfo']['PriceNlWithVatMobilede'] != '') {
                            $price = $vehicle['priceInfo']['PriceNlWithVatMobilede'];
                        }
                        elseif(isset($vehicle['priceInfo']['FallbackPriceNlWithVatMobilede']) && $vehicle['priceInfo']['FallbackPriceNlWithVatMobilede'] != '' && isset($options['co2_fallback_display']) && $options['co2_fallback_display'] == 1) {
                            $price = $vehicle['priceInfo']['FallbackPriceNlWithVatMobilede'];
                        } else {
                            $price = false;
                        }
                    }else {
                       
                        $price = false;
                       
                    }
                }

          if (isset($price) && $price) {
            if (!isset($options['only_fl']) || (isset($options['only_fl']) && $options['only_fl'] != 1)) {
            ?>
              <div class="es-flex">
                <div class="euro-price">
                  <?php esc_html_e('Price', 'eurostocks'); ?>
                </div>
                <div class="euro-price">
                  €
                  <?php

                  echo esc_html(number_format(floatval($price), 0, ',', '.'));
                  ?>,-

                </div>
              </div>
            <?php
            } else { ?>
              <div class="es-flex">
                <div class="euro-price">
                  <?php esc_html_e('Lease from', 'eurostocks'); ?>
                </div>
                <div class="euro-price">
                  €
                  <?php

                  echo esc_html($this->eurostocks_financial_lease($eurostocks_fl_interest, $eurostocks_fl_duration, $eurostocks_fl_rest, $price));
                  ?>,-

                </div>
              </div>
            <?php }
            if (isset($price) && (isset($options['enable_fl']) && $options['enable_fl'] == 1) && (!isset($options['only_fl']) || $options['only_fl'] == 0)) { ?>
              <span class="euro-price-wrapper euro-fl"><span class="euro-helper-text"><?php esc_html_e('Lease from', 'eurostocks'); ?></span> <span
                  class="euro-price">€
                  <?php echo esc_html($this->eurostocks_financial_lease($eurostocks_fl_interest, $eurostocks_fl_duration, $eurostocks_fl_rest, $price)); ?>,-
                </span></span>
            <?php }
          } else { ?>
            <div class="euro-price">
              <?php 
                if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_priceonrequest']) && $options[esc_html($current_lang)]['txt_priceonrequest'] != ""  ){ 
                  echo esc_html($options[esc_html($current_lang)]['txt_priceonrequest']); 
                }else{ 
                   if (isset($options['txt_priceonrequest']) && $options['txt_priceonrequest'] != "") {
                    echo esc_html($options['txt_priceonrequest']);
                  } else {
                    esc_html_e("Price on request", 'eurostocks');
                  } 
                }
              ?>
            </div>
          <?php } ?>


          <div class="es-divider"></div>

          <ul>
            <?php if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_voordeel1']) && $options[esc_html($current_lang)]['txt_voordeel1'] != '') { ?>
              <li>
                <?php echo esc_html($options[esc_html($current_lang)]['txt_voordeel1']); ?>
              </li>
            <?php } else {
             if (isset($options['txt_voordeel1']) && $options['txt_voordeel1'] != '') { ?>
              <li>
                <?php echo esc_html($options['txt_voordeel1']); ?>
              </li>
            <?php } 
            } ?>

            <?php if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_voordeel2']) && $options[esc_html($current_lang)]['txt_voordeel2'] != '') { ?>
              <li>
                <?php echo esc_html($options[esc_html($current_lang)]['txt_voordeel2']); ?>
              </li>
            <?php } else {
              if (isset($options['txt_voordeel2']) && $options['txt_voordeel2'] != '') { ?>
                <li>
                  <?php echo esc_html($options['txt_voordeel2']); ?>
                </li>
              <?php }
            } ?>

            <?php if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_voordeel3']) && $options[esc_html($current_lang)]['txt_voordeel3'] != '') { ?>
              <li>
                <?php echo esc_html($options[esc_html($current_lang)]['txt_voordeel3']); ?>
              </li>
            <?php } else {
              if (isset($options['txt_voordeel3']) && $options['txt_voordeel3'] != '') { ?>
                <li>
                  <?php echo esc_html($options['txt_voordeel3']); ?>
                </li>
              <?php }
            } ?>

            <?php if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_voordeel4']) && $options[esc_html($current_lang)]['txt_voordeel4'] != '') { ?>
              <li>
                <?php echo esc_html($options[esc_html($current_lang)]['txt_voordeel4']); ?>
              </li>
            <?php } else {
              if (isset($options['txt_voordeel4']) && $options['txt_voordeel4'] != '') { ?>
                <li>
                  <?php echo esc_html($options['txt_voordeel4']); ?>
                </li>
              <?php }
            } ?>
          </ul>
          <div class="es-divider"></div>

          <!-- get cta_order -->
          <?php 
            $default_cta_order = $this->eurostocks_get_available_ctas();


            if(!isset($options['cta_order'])) {
              $cta_order = array_keys($default_cta_order);
            } else {
              if (is_string($options['cta_order'])) {
                $cta_order = explode(',', $options['cta_order']);
              } else {
                  $cta_order = $options['cta_order'];
              }
            }

          ?>

          <?php 
              $euro_i = 0;
              foreach ($cta_order as $key => $value) {
              
                ?>
              
          <?php if($value == 'cta_cf'){ ?>
           
            <?php if((isset($options['show_cta_cf']) && $options['show_cta_cf'] == 1) || (!isset($options['show_cta_cf']) && !isset($options['show_cta_app']) && !isset($options['show_cta_tel']) && !isset($options['show_cta_fav'])) || $options['show_cta_fav'] == 0 && $options['show_cta_app'] == 0 && $options['show_cta_tel'] == 0 && $options['show_cta_cf'] == 0 ) { ?>
            <!-- show_cta_cf -->
              <div class="es-flex space-15">
                <a id="euro-cf-cta-btn" class="euro-btn euro-btn-primary es-flex-grow es-ml-0 euro-cta-btn" data-modal="es-contact" href="#">
                <svg class="euro-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"/></svg>
                  <?php
                  if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_btn_product']) && $options[esc_html($current_lang)]['txt_btn_product'] != '') {
                    echo esc_html($options[esc_html($current_lang)]['txt_btn_product']);
                  } else {
                    if (isset($options['txt_btn_product'])) {
                      echo esc_html($options['txt_btn_product']);
                    } else {
                      echo esc_html($options['txt_btn']);
                    } 
                  }?>
                </a>
                <?php if (isset($eurostocks_only_fl) && $eurostocks_only_fl != 1 && $euro_i == 0) { ?>
                  <a class="es-info-help" data-modal="es-info-x" id="es-info-one">
                    <img src="<?php echo esc_url(plugin_dir_url(__FILE__)); ?>../images/circle-info-regular-b.png" alt="">
                  </a>
                <?php } ?>
              </div>
            <!-- end show_cta_cf -->
            <?php } 
            $euro_i++;
            } elseif($value == 'cta_tel'){ ?>
            <?php if((isset($options['show_cta_tel']) && $options['show_cta_tel'] == 1 && isset($options['contact_tel'])) ) { ?>
            <!-- show_cta_tel -->
              <div class="es-flex space-15">
                <a id="euro-tel-cta-btn" class="euro-btn euro-btn-primary es-flex-grow es-ml-0 euro-cta-btn" href="tel:<?php echo esc_html($options['contact_tel']); ?>">
                <svg class="euro-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z"/></svg>
                  <span class="euro-lg-hide"><?php
                  if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['cta_tel']) && $options[esc_html($current_lang)]['cta_tel'] != '') {
                    echo esc_html($options[esc_html($current_lang)]['cta_tel']);
                  } else {
                    if (isset($options['cta_tel']) && $options['cta_tel'] == '' || !isset($options['cta_tel'])) {
                      echo esc_html(__('Call us', 'eurostocks'));
                    } else {
                      echo esc_html($options['cta_tel']);
                    } 
                  }?></span>
                  <span class="euro-lg-show"><?php echo esc_html($options['contact_tel']); ?>
                  </span>
                </a>
                <?php if (isset($eurostocks_only_fl) && $eurostocks_only_fl != 1 && $euro_i == 0) { ?>
                  <a class="es-info-help" data-modal="es-info-x" id="es-info-one">
                    <img src="<?php echo esc_url(plugin_dir_url(__FILE__)); ?>../images/circle-info-regular-b.png" alt="">
                  </a>
                <?php } ?>
              </div>
            <!-- end show_cta_tel -->
            <?php 
               }
               $euro_i++;
              }
              elseif($value == 'cta_app'){
              if(isset($options['show_cta_app']) && $options['show_cta_app'] == 1 && isset($options['contact_app'])) { ?>
                <!-- show_cta_app --> 
                <div class="es-flex space-15">
                  <?php 
                  if(isset($options['contact_app_app']) && $options['contact_app_app'] != '') {
                    $contact_app_message = $options['contact_app_app'];
                    $contact_app_message = str_replace('{{url}}', esc_url($current_url), $contact_app_message);
                    $contact_app_message = rawurlencode($contact_app_message);
                  } else {
                    $contact_app_message = '';
                  }
               
                  ?>
                  <a id="euro-app-cta-btn" class="euro-btn euro-btn-primary es-flex-grow es-ml-0 euro-cta-btn" href="https://api.whatsapp.com/send?phone=<?php echo esc_html($options['contact_app']); ?>&text=<?php echo $contact_app_message; ?>%20<?php echo esc_html($vehicle['make']) . ' ' . esc_html($vehicle['modelDescription']); ?>">
                  <svg class="euro-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7 .9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"/></svg>
                    <?php
                    if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['cta_app']) && $options[esc_html($current_lang)]['cta_app'] != '') {
                      echo esc_html($options[esc_html($current_lang)]['cta_app']);
                    } else {
                      if (isset($options['cta_app']) && $options['cta_app'] != '') {
                        echo esc_html($options['cta_app']);
                      } else {
                        echo esc_html(__('App us', 'eurostocks'));
                      } 
                    }?>
                  </a>
                  <?php if (isset($eurostocks_only_fl) && $eurostocks_only_fl != 1 && $euro_i == 0) { ?>
                  <a class="es-info-help" data-modal="es-info-x" id="es-info-one">
                    <img src="<?php echo esc_url(plugin_dir_url(__FILE__)); ?>../images/circle-info-regular-b.png" alt="">
                  </a>
                <?php } ?>
                </div>

                <?php 
                }
                $euro_i++;
              }elseif($value == 'cta_fav'){
                if(isset($options['show_cta_fav']) && $options['show_cta_fav'] == 1) { ?>
                  <!-- show_cta_fav -->
                  <div class="es-flex space-15">
                    <a class="euro-btn euro-btn-primary es-flex-grow es-ml-0 euro-cta-btn" href="#" data-id="<?php echo esc_html($vehicle['vehicleId']); ?>" id="es-fav">
                    <svg class="euro-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z"/></svg>
                      <span class="euro-button-text"><?php
                      if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['cta_fav']) && $options[esc_html($current_lang)]['cta_fav'] != '') {
                        echo esc_html($options[esc_html($current_lang)]['cta_fav']);
                      } else {
                       
                        if (isset($options['cta_fav']) && $options['cta_fav'] != '') {
                          echo esc_html($options['cta_fav']);
                        } else {
                          echo esc_html(__('Add to favorites', 'eurostocks'));
                        } 
                      }?>
                      </span>
                    </a>
                    <?php if (isset($eurostocks_only_fl) && $eurostocks_only_fl != 1 && $euro_i == 0) { ?>
                      <a class="es-info-help" data-modal="es-info-x" id="es-info-one">
                        <img src="<?php echo esc_url(plugin_dir_url(__FILE__)); ?>../images/circle-info-regular-b.png" alt="">
                      </a>
                    <?php } ?>
                      </div>
                <?php }
                $euro_i++;
              }

            } 
          ?>

          <div class="es-divider"></div>

          <?php if ($options['top_footer_img'] && $options['top_footer_img'] != '') { ?>

            <?php $rev_img_url = wp_get_attachment_image_url($options['top_footer_img'], 'full'); ?>
            <img class="es-mt-10 es-mw-100" src="<?php echo esc_url($rev_img_url); ?>" alt="beoordelingen" loading="lazy" />

          <?php } ?>

        </div>
      </div>
    </div>



    <?php 

    $options_array = array();

    if (isset($vehicle['features']['airco']) && $vehicle['features']['airco'] != '') {
      $options_array[] = $vehicle['features']['airco'];
    }
    if (isset($vehicle['features']['speedControl']) && $vehicle['features']['speedControl'] != '') {
      $options_array[] = $vehicle['features']['speedControl'];
    }
    if (isset($vehicle['features']['trailerCouplingType']) && $vehicle['features']['trailerCouplingType'] != '') {
      $options_array[] = $vehicle['features']['trailerCouplingType'];
    }
    if (isset($vehicle['features']['daytimeRunningLamps']) && $vehicle['features']['daytimeRunningLamps'] != '') {
      $options_array[] = $vehicle['features']['daytimeRunningLamps'];
    }
    if (isset($vehicle['features']['bendingLightsType']) && $vehicle['features']['bendingLightsType'] != '') {
      $options_array[] = $vehicle['features']['bendingLightsType'];
    }
    if (isset($vehicle['radio']) && $vehicle['radio'] != '') {
      foreach ($vehicle['radio'] as $radio) {
        $options_array[] = $radio;
      }
    }
    if (isset($vehicle['features']['breakdownService']) && $vehicle['features']['breakdownService'] != '') {
      $options_array[] = $vehicle['features']['breakdownService'];
    }
    if (isset($vehicle['features']['centralDoorLock']) && $vehicle['features']['centralDoorLock'] != '') {
      $options_array[] = esc_html__("Central door lock", 'eurostocks');
    }
    if (isset($vehicle['features']['rangeExtender']) && $vehicle['features']['rangeExtender'] != '') {
      $options_array[] = esc_html__("Range extender", 'eurostocks');
    }
    if (isset($vehicle['features']['laneDepartureWarning']) && $vehicle['features']['laneDepartureWarning'] != '') {
      $options_array[] = esc_html__("Lane Departure Warning", 'eurostocks');
    }
    if (isset($vehicle['features']['wifiHotSpot']) && $vehicle['features']['wifiHotSpot'] != '') {
      $options_array[] = esc_html__("Wifi hotspot", 'eurostocks');
    }
    if (isset($vehicle['features']['allSeasonTires']) && $vehicle['features']['allSeasonTires'] != '') {
      $options_array[] = esc_html__("All-season tires", 'eurostocks');
    }
    if (isset($vehicle['features']['keyLessEntry']) && $vehicle['features']['keyLessEntry'] != '') {
      $options_array[] = esc_html__("Keyless-entry", 'eurostocks');
    }
    if (isset($vehicle['features']['roofRails']) && $vehicle['features']['roofRails'] != '') {
      $options_array[] = esc_html__("Roof rails", 'eurostocks');
    }
    if (isset($vehicle['features']['metallic']) && $vehicle['features']['metallic'] != '') {
      $options_array[] = esc_html__("Metallic", 'eurostocks');
    }
    if (isset($vehicle['features']['distanceWarningSystem']) && $vehicle['features']['distanceWarningSystem'] != '') {
      $options_array[] = esc_html__("Distance Warning System", 'eurostocks');
    }
    if (isset($vehicle['features']['alarm']) && $vehicle['features']['alarm'] != '') {
      $options_array[] = esc_html__("Alarm", 'eurostocks');
    }
    if (isset($vehicle['features']['sportPackage']) && $vehicle['features']['sportPackage'] != '') {
      $options_array[] = esc_html__("Sport package", 'eurostocks');
    }
    if (isset($vehicle['features']['steelWheels']) && $vehicle['features']['steelWheels'] != '') {
      $options_array[] = esc_html__("Steel wheels", 'eurostocks');
    }
    if (isset($vehicle['features']['alloyWheels']) && $vehicle['features']['alloyWheels'] != '') {
      $options_array[] = esc_html__("Alloy wheels", 'eurostocks');
    }
    if (isset($vehicle['features']['headUpDisplay']) && $vehicle['features']['headUpDisplay'] != '') {
      $options_array[] = esc_html__("Heads-up display", 'eurostocks');
    }
    if (isset($vehicle['features']['dimmingInteriorMirror']) && $vehicle['features']['dimmingInteriorMirror'] != '') {
      $options_array[] = esc_html__("Dimming Interior mirror", 'eurostocks');
    }
    if (isset($vehicle['features']['nightVision']) && $vehicle['features']['nightVision'] != '') {
      $options_array[] = esc_html__("Night vision", 'eurostocks');
    }
    if (isset($vehicle['features']['collisionAvoidance']) && $vehicle['features']['collisionAvoidance'] != '') {
      $options_array[] = esc_html__("Collision avoidance system", 'eurostocks');
    }
    if (isset($vehicle['features']['e10Enabled']) && $vehicle['features']['e10Enabled'] != '') {
      $options_array[] = esc_html__("e10 Enabled", 'eurostocks');
    }
    if (isset($vehicle['features']['esp']) && $vehicle['features']['esp'] != '') {
      $options_array[] = esc_html__("ESP", 'eurostocks');
    }
    if (isset($vehicle['features']['sportSeats']) && $vehicle['features']['sportSeats'] != '') {
      $options_array[] = esc_html__("Sport seats", 'eurostocks');
    }
    if (isset($vehicle['features']['multiFunctionalSteeringwheel']) && $vehicle['features']['multiFunctionalSteeringwheel'] != '') {
      $options_array[] = esc_html__("Mutlifunctional Steering Wheel", 'eurostocks');
    }
    if (isset($vehicle['features']['nonSmokerVehicle']) && $vehicle['features']['nonSmokerVehicle'] != '') {
      $options_array[] = esc_html__("Non-smoker vehicle", 'eurostocks');
    }
    if (isset($vehicle['features']['hillStartAssist']) && $vehicle['features']['hillStartAssist'] != '') {
      $options_array[] = esc_html__("Hill start-assist", 'eurostocks');
    }
    if (isset($vehicle['features']['electricExteriorMirrors']) && $vehicle['features']['electricExteriorMirrors'] != '') {
      $options_array[] = esc_html__("Electric Exterior Mirrors", 'eurostocks');
    }
    if (isset($vehicle['features']['bioDieselSuitable']) && $vehicle['features']['bioDieselSuitable'] != '') {
      $options_array[] = esc_html__("Bio Diesel Suitable", 'eurostocks');
    }
    if (isset($vehicle['features']['airSuspension']) && $vehicle['features']['airSuspension'] != '') {
      $options_array[] = esc_html__("Air suspension", 'eurostocks');
    }
    if (isset($vehicle['features']['fourWheelDrive']) && $vehicle['features']['fourWheelDrive'] != '') {
      $options_array[] = esc_html__("4-wheel drive", 'eurostocks');
    }
    if (isset($vehicle['features']['performanceHandlingSystem']) && $vehicle['features']['performanceHandlingSystem'] != '') {
      $options_array[] = esc_html__("Performance handling system", 'eurostocks');
    }
    if (isset($vehicle['features']['appleCarplay']) && $vehicle['features']['appleCarplay'] != '') {
      $options_array[] = esc_html__("Apple car play", 'eurostocks');
    }
    if (isset($vehicle['features']['navigationSystem']) && $vehicle['features']['navigationSystem'] != '') {
      $options_array[] = esc_html__("Navigation system", 'eurostocks');
    }
    if (isset($vehicle['features']['panoramicGlassRoof']) && $vehicle['features']['panoramicGlassRoof'] != '') {
      $options_array[] = esc_html__("Panoramic glass roof", 'eurostocks');
    }
    if (isset($vehicle['features']['bluetooth']) && $vehicle['features']['bluetooth'] != '') {
      $options_array[] = esc_html__("Bluetooth", 'eurostocks');
    }
    if (isset($vehicle['features']['vegetableOilFuelSuitable']) && $vehicle['features']['vegetableOilFuelSuitable'] != '') {
      $options_array[] = esc_html__("Vegetable Oil Fuel suitable", 'eurostocks');
    }
    if (isset($vehicle['features']['electricHeatedSeats']) && $vehicle['features']['electricHeatedSeats'] != '') {
      $options_array[] = esc_html__("Electric Heated seats", 'eurostocks');
    }
    if (isset($vehicle['features']['trafficSignRecognition']) && $vehicle['features']['trafficSignRecognition'] != '') {
      $options_array[] = esc_html__("Traffic Sign Recognition", 'eurostocks');
    }
    if (isset($vehicle['features']['smokersPackage']) && $vehicle['features']['smokersPackage'] != '') {
      $options_array[] = esc_html__("Smokers package", 'eurostocks');
    }
    if (isset($vehicle['features']['blindSpotDetection']) && $vehicle['features']['blindSpotDetection'] != '') {
      $options_array[] = esc_html__("Blind spot detection", 'eurostocks');
    }
    if (isset($vehicle['features']['taxi']) && $vehicle['features']['taxi'] != '') {
      $options_array[] = esc_html__("Taxi", 'eurostocks');
    }
    if (isset($vehicle['features']['winterPackage']) && $vehicle['features']['winterPackage'] != '') {
      $options_array[] = esc_html__("Winter package", 'eurostocks');
    }
    if (isset($vehicle['features']['lumbarSupport']) && $vehicle['features']['lumbarSupport'] != '') {
      $options_array[] = esc_html__("Lumbar support", 'eurostocks');
    }
    if (isset($vehicle['features']['foldFlatPassengerSeat']) && $vehicle['features']['foldFlatPassengerSeat'] != '') {
      $options_array[] = esc_html__("Fold flat passengerseat", 'eurostocks');
    }
    if (isset($vehicle['features']['startStopSysteem']) && $vehicle['features']['startStopSysteem'] != '') {
      $options_array[] = esc_html__("Start-stop system", 'eurostocks');
    }
    if (isset($vehicle['features']['skiBag']) && $vehicle['features']['skiBag'] != '') {
      $options_array[] = esc_html__("Ski bag", 'eurostocks');
    }
    if (isset($vehicle['features']['cdPlayer']) && $vehicle['features']['cdPlayer'] != '') {
      $options_array[] = esc_html__("CD player", 'eurostocks');
    }
    if (isset($vehicle['features']['handsFreePhoneSystem']) && $vehicle['features']['handsFreePhoneSystem'] != '') {
      $options_array[] = esc_html__("Handsfree Phone system", 'eurostocks');
    }
    if (isset($vehicle['features']['electricBackseatAdjustment']) && $vehicle['features']['electricBackseatAdjustment'] != '') {
      $options_array[] = esc_html__("Electric Backseat adjustment", 'eurostocks');
    }
    if (isset($vehicle['features']['electricTailgate']) && $vehicle['features']['electricTailgate'] != '') {
      $options_array[] = esc_html__("Electric tailgate", 'eurostocks');
    }
    if (isset($vehicle['features']['centerArmRest']) && $vehicle['features']['centerArmRest'] != '') {
      $options_array[] = esc_html__("Center arm rest", 'eurostocks');
    }
    if (isset($vehicle['features']['interiorColor']) && $vehicle['features']['interiorColor'] != '') {
      $options_array[] = esc_html__("Interior color", 'eurostocks');
    }
    if (isset($vehicle['features']['disabledAccessible']) && $vehicle['features']['disabledAccessible'] != '') {
      $options_array[] = esc_html__("Disabled Accessible", 'eurostocks');
    }
    if (isset($vehicle['features']['speedLimiter']) && $vehicle['features']['speedLimiter'] != '') {
      $options_array[] = esc_html__("Speed limiter", 'eurostocks');
    }
    if (isset($vehicle['features']['androidAuto']) && $vehicle['features']['androidAuto'] != '') {
      $options_array[] = esc_html__("Android car", 'eurostocks');
    }
    if (isset($vehicle['features']['isofix']) && $vehicle['features']['isofix'] != '') {
      $options_array[] = esc_html__("Isofix", 'eurostocks');
    }
    if (isset($vehicle['features']['ambientLighting']) && $vehicle['features']['ambientLighting'] != '') {
      $options_array[] = esc_html__("Ambient lighting", 'eurostocks');
    }
    if (isset($vehicle['features']['integratedMusicStreaming']) && $vehicle['features']['integratedMusicStreaming'] != '') {
      $options_array[] = esc_html__("Integrated music streaming", 'eurostocks');
    }
    if (isset($vehicle['features']['highBeamAssist']) && $vehicle['features']['highBeamAssist'] != '') {
      $options_array[] = esc_html__("High beam assist", 'eurostocks');
    }
    if (isset($vehicle['features']['onboardComputer']) && $vehicle['features']['onboardComputer'] != '') {
      $options_array[] = esc_html__("Onboard computer", 'eurostocks');
    }
    if (isset($vehicle['features']['massageSeats']) && $vehicle['features']['massageSeats'] != '') {
      $options_array[] = esc_html__("Massage seats", 'eurostocks');
    }
    if (isset($vehicle['features']['tv']) && $vehicle['features']['tv'] != '') {
      $options_array[] = esc_html__("TV", 'eurostocks');
    }
    if (isset($vehicle['features']['abs']) && $vehicle['features']['abs'] != '') {
      $options_array[] = esc_html__("ABS", 'eurostocks');
    }
    if (isset($vehicle['features']['headlightWasherSystem']) && $vehicle['features']['headlightWasherSystem'] != '') {
      $options_array[] = esc_html__("Headlight washer system", 'eurostocks');
    }
    if (isset($vehicle['features']['auxiliaryHeating']) && $vehicle['features']['auxiliaryHeating'] != '') {
      $options_array[] = esc_html__("Auxiliary Heating", 'eurostocks');
    }
    if (isset($vehicle['features']['powerAssistedSteering']) && $vehicle['features']['powerAssistedSteering'] != '') {
      $options_array[] = esc_html__("Power assisted steering", 'eurostocks');
    }
    if (isset($vehicle['features']['glareFreeHighBeam']) && $vehicle['features']['glareFreeHighBeam'] != '') {
      $options_array[] = esc_html__("Glare free high beam", 'eurostocks');
    }
    if (isset($vehicle['features']['cargoBarrier']) && $vehicle['features']['cargoBarrier'] != '') {
      $options_array[] = esc_html__("Cargo barrier", 'eurostocks');
    }
    if (isset($vehicle['features']['electricHeatedRearSeats']) && $vehicle['features']['electricHeatedRearSeats'] != '') {
      $options_array[] = esc_html__("Electric heated rear seats", 'eurostocks');
    }
    if (isset($vehicle['features']['leatherSteeringWheel']) && $vehicle['features']['leatherSteeringWheel'] != '') {
      $options_array[] = esc_html__("Leather steering wheel", 'eurostocks');
    }
    if (isset($vehicle['features']['summerTires']) && $vehicle['features']['summerTires'] != '') {
      $options_array[] = esc_html__("Summer tires", 'eurostocks');
    }
    if (isset($vehicle['features']['cdMultichanger']) && $vehicle['features']['cdMultichanger'] != '') {
      $options_array[] = esc_html__("CD multichanger", 'eurostocks');
    }
    if (isset($vehicle['features']['usb']) && $vehicle['features']['usb'] != '') {
      $options_array[] = esc_html__("USB", 'eurostocks');
    }
    if (isset($vehicle['features']['soundSystem']) && $vehicle['features']['soundSystem'] != '') {
      $options_array[] = esc_html__("Sound system", 'eurostocks');
    }
    if (isset($vehicle['features']['voiceControl']) && $vehicle['features']['voiceControl'] != '') {
      $options_array[] = esc_html__("Voice control", 'eurostocks');
    }
    if (isset($vehicle['features']['digitalCockpit']) && $vehicle['features']['digitalCockpit'] != '') {
      $options_array[] = esc_html__("Digital cockpit", 'eurostocks');
    }
    if (isset($vehicle['features']['lightSensor']) && $vehicle['features']['lightSensor'] != '') {
      $options_array[] = esc_html__("Light sensor", 'eurostocks');
    }
    if (isset($vehicle['features']['tractionControlSystem']) && $vehicle['features']['tractionControlSystem'] != '') {
      $options_array[] = esc_html__("Traction control system", 'eurostocks');
    }
    if (isset($vehicle['features']['immobilizer']) && $vehicle['features']['immobilizer'] != '') {
      $options_array[] = esc_html__("Immobilizer", 'eurostocks');
    }
    if (isset($vehicle['features']['heatedWindshield']) && $vehicle['features']['heatedWindshield'] != '') {
      $options_array[] = esc_html__("Heated Windshields", 'eurostocks');
    }
    if (isset($vehicle['features']['emergencyCallSystem']) && $vehicle['features']['emergencyCallSystem'] != '') {
      $options_array[] = esc_html__("Emergency Call system", 'eurostocks');
    }
    if (isset($vehicle['features']['electricAdjustableSeats']) && $vehicle['features']['electricAdjustableSeats'] != '') {
      $options_array[] = esc_html__("Electric adjustable Seats", 'eurostocks');
    }
    if (isset($vehicle['features']['winterTires']) && $vehicle['features']['winterTires'] != '') {
      $options_array[] = esc_html__("Winter tires", 'eurostocks');
    }
    if (isset($vehicle['features']['touchScreen']) && $vehicle['features']['touchScreen'] != '') {
      $options_array[] = esc_html__("Touchscreen", 'eurostocks');
    }
    if (isset($vehicle['features']['ventilatedSeats']) && $vehicle['features']['ventilatedSeats'] != '') {
      $options_array[] = esc_html__("Ventilated seats", 'eurostocks');
    }
    if (isset($vehicle['features']['particulateFilterDiesel']) && $vehicle['features']['particulateFilterDiesel'] != '') {
      $options_array[] = esc_html__("Particulate Filter Diesel", 'eurostocks');
    }
    if (isset($vehicle['features']['tirePressureMonitoring']) && $vehicle['features']['tirePressureMonitoring'] != '') {
      $options_array[] = esc_html__("Tire Pressure Monitoring", 'eurostocks');
    }
    if (isset($vehicle['features']['fullServiceHistory']) && $vehicle['features']['fullServiceHistory'] != '') {
      $options_array[] = esc_html__("Full service history", 'eurostocks');
    }
    if (isset($vehicle['features']['electricWindows']) && $vehicle['features']['electricWindows'] != '') {
      $options_array[] = esc_html__("Electrisc windows", 'eurostocks');
    }
    if (isset($vehicle['features']['sunroof']) && $vehicle['features']['sunroof'] != '') {
      $options_array[] = esc_html__("sunroof", 'eurostocks');
    }
    if (isset($vehicle['features']['heatedSteeringWheel']) && $vehicle['features']['heatedSteeringWheel'] != '') {
      $options_array[] = esc_html__("Heated steering wheel", 'eurostocks');
    }
    if (isset($vehicle['features']['warranty']) && $vehicle['features']['warranty'] != '') {
      $options_array[] = esc_html__("Warranty", 'eurostocks');
    }
    sort($options_array);
    $j = 0;
    ?>



    <?php if (isset($options["show_nav"]) && $options["show_nav"] == 1) { ?>
      <div class="es-inpage-links es-flex es-space-around es-bg-white">
        <a href="#specificaties">
          <?php esc_html_e('Specs', 'eurostocks'); ?>
        </a>
        <?php if ((isset($options["hide_kosten_left"]) || $options["hide_kosten_left"] == 1) && isset($options["hide_kosten_right"]) && $options["hide_kosten_right"] == 1) {
          echo "";
        } else { ?><a href="#kosten">
          <?php if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_kosten_diensten']) && $options[esc_html($current_lang)]['txt_kosten_diensten'] != '') {
            echo esc_html($options[esc_html($current_lang)]['txt_kosten_diensten']);
          } else {
            echo esc_html($options['txt_kosten_diensten']);
          } ?>
          </a>
        <?php } ?>
        <?php if ((isset($options["hide_experts"]) && $options["hide_experts"] == 1) || !$show_experts_section) {
          echo "";
        } else { ?><a href="#experts">
            <?php esc_html_e('Contact', 'eurostocks'); ?>
          </a>
        <?php } ?>
        <?php if (isset($options["hide_reviews"]) && $options["hide_reviews"] == 1) {
          echo "";
        } else { ?><a href="#ervaringen">
            <?php esc_html_e('Client experience', 'eurostocks'); ?>
          </a>
        <?php } ?>
        <a href="#fotos"><?php esc_html_e('Photos', 'eurostocks'); ?></a>
      </div>
    <?php } ?>

    <div class="es-specs es-bg-white euro-row" id="specificaties">
      <div class="eurocol-12">
        <h2>
          <?php esc_html_e('Vehicle info', 'eurostocks'); ?>
        </h2>
      </div>
      <div class="eurocol-12">
        <div class="es-divider"></div>
      </div>
      <div class="eurocol-md-4">
        <h5>
          <?php esc_html_e('Specs', 'eurostocks'); ?>
        </h5>
        <div class="euro-row">
          <div class="eurocol-6"><strong>
              <?php esc_html_e("Interior", 'eurostocks'); ?>
            </strong></div>
          <div class="eurocol-6">
            <?php echo esc_html($vehicle['features']['interiorType']); ?>
          </div>
        </div>
        <div class="euro-row">
          <div class="eurocol-6"><strong>
              <?php esc_html_e("Body", 'eurostocks'); ?>
            </strong></div>
          <div class="eurocol-6">
            <?php echo esc_html($vehicle['category']); ?>
          </div>
        </div>
        <div class="euro-row">
          <div class="eurocol-6"><strong>
              <?php esc_html_e("Color", 'eurostocks'); ?>
            </strong></div>
          <div class="eurocol-6">
            <?php echo esc_html($vehicle['exteriorColor']); ?>
          </div>
        </div>
        <div class="euro-row">
          <div class="eurocol-6"><strong>
              <?php esc_html_e("Seats", 'eurostocks'); ?>
            </strong></div>
          <div class="eurocol-6">
            <?php echo esc_html($vehicle['attributes']['seats']); ?>
          </div>
        </div>
        <div class="euro-row">
          <div class="eurocol-6"><strong>
              <?php esc_html_e("VAT/Margin", 'eurostocks'); ?>
            </strong></div>
          <div class="eurocol-6">
            <?php if ($vehicle['priceInfo']['IsVatable'] == "Nee") { ?>
              <?php esc_html_e("Margin-Car", 'eurostocks'); ?>
            <?php } elseif ($vehicle['priceInfo']['IsVatable'] == "Ja") { ?>
              <?php esc_html_e("VAT-Car", 'eurostocks'); ?>
            <?php } else {
              echo esc_html($vehicle['priceInfo']['IsVatable']);
            } ?>
          </div>
        </div>
        <div class="euro-row">
          <div class="eurocol-6"><strong>
              <?php esc_html_e("Power", 'eurostocks'); ?>
            </strong></div>
          <div class="eurocol-6">
            <?php echo esc_html($vehicle['power']); ?> kW (<?php echo esc_html(intval($vehicle['power'] * 1.362)) . " " . esc_html__("HP", 'eurostocks'); ?>)
          </div>
        </div>
        <?php if (isset($vehicle['fuelType']) && $vehicle['fuelType'] == "Elektrisch" || isset($vehicle['fuelType']) && $vehicle['fuelType'] == "Electric") {
        } else { ?>
          <div class="euro-row">
            <div class="eurocol-6"><strong>
              <?php if (isset($vehicle['priceInfo']['FallbackCO2emission']) && $vehicle['priceInfo']['FallbackCO2emission'] != "" && isset( $options['co2_fallback_display']) && $options['co2_fallback_display'] == 1) {
                esc_html_e("Co2 emission indication", 'eurostocks'); 
              } else {
                esc_html_e("CO2 emission", 'eurostocks'); 
              }
              if ((isset($options['co2_disclaimer_display']) && $options['co2_disclaimer_display'] == 1) || !isset($options['co2_disclaimer_display']) || (isset($options['co2_fallback_display']) && $options['co2_fallback_display'] == 1 && isset($vehicle['priceInfo']['FallbackCO2emission']) && $vehicle['priceInfo']['FallbackCO2emission'] != "")) { 
                ?>*
              <?php } ?>
              </strong></div>
            <div class="eurocol-6">
              <?php 
              if (isset($vehicle['priceInfo']['FallbackCO2emission']) && $vehicle['priceInfo']['FallbackCO2emission'] != "" && isset($options['co2_fallback_display']) && $options['co2_fallback_display'] == 1) {
                echo esc_html(number_format(floatval($vehicle['priceInfo']['FallbackCO2emission']))) . " g/km";
              } else{
                if (isset($vehicle['attributes']['co2Emission']) && $vehicle['attributes']['co2Emission'] != "") {
                  echo esc_html(number_format(floatval($vehicle['attributes']['co2Emission']))) . " g/km";
                } else {
                  esc_html_e("Not specified", 'eurostocks');
                }
              }
              ?>
            </div>
          </div>
          <div class="euro-row">
            <div class="eurocol-6"><strong>
                <?php esc_html_e("Emission class", 'eurostocks'); ?>
              </strong></div>
            <div class="eurocol-6">
              <?php echo esc_html($vehicle['features']['emissionClass']); ?>
            </div>
          </div>
        <?php } ?>
        <?php if (isset($vehicle['parkingAssistant']) && count($vehicle['parkingAssistant']) > 0) { ?>
          <div class="euro-row">
            <div class="eurocol-6"><strong>
                <?php esc_html_e("Parking assistant", 'eurostocks'); ?>
              </strong></div>
            <div class="eurocol-6">
              <?php
              foreach ($vehicle['parkingAssistant'] as $parking) {
                if(isset($parkingsensors[$parking]) && $parkingsensors[$parking] != '') {
                  
                  if ($j == 0) {
                    echo ucfirst(esc_html($parkingsensors[$parking]));
                  } else {
                    echo ", " . esc_html($parkingsensors[$parking]);
                  }
                  $j++;
                }
              }
              ?>
            </div>
          </div>
          <?php } ?>
          <?php if (isset($vehicle['features']['airbags']) && $vehicle['features']['airbags']) { ?>
          <div class="euro-row">
            <div class="eurocol-6"><strong>
                <?php esc_html_e("Airbags", 'eurostocks'); ?>
              </strong></div>
            <div class="eurocol-6">
              <?php
                  echo esc_html($vehicle['features']['airbags']);
              ?>
            </div>
          </div>
          <?php } ?>
      </div>
      <?php 
      if(isset($options['show_options_sep']) && $options['show_options_sep'] == 1) { ?>
          <div class="eurocol-md-8">
        <div class="euro-row">
          <div class="eurocol-12"><br></div>
        </div>

        <div class="eurosearch-car-details es-grid es-grid-columns-4">
          <div class="es-b-icon es-registration">
          <?php esc_html_e('Registration date', 'eurostocks'); ?> <br>
            <strong>
              <?php echo esc_html($vehicle['firstRegistrationDate']); ?>
            </strong>
          </div>
          <div class="es-b-icon es-pk">
            <?php esc_html_e('Horsepower', 'eurostocks'); ?> <br>
            <strong>
              <?php echo esc_html(intval($vehicle['power'] * 1.362)) . " " . esc_html__("HP", 'eurostocks'); ?>
            </strong>
          </div>
          <div class="es-b-icon es-gearbox">
            <?php esc_html_e('Transmission', 'eurostocks'); ?> <br>
            <strong>
              <?php if ($vehicle['gearBox'] == "Automatische transmissie") {
                echo "Automaat";
              } else {
                echo esc_html($vehicle['gearBox']);
              } ?>
            </strong>
          </div>
          <div class="es-b-icon es-mileage">
            <?php esc_html_e('Mileage', 'eurostocks'); ?> <br>
            <strong>
              <?php echo esc_html(number_format(floatval($vehicle['mileage']), 0, ',', '.')); ?> km
            </strong>
          </div>
          <div class="es-b-icon es-fueltype">
            <?php esc_html_e('Fuel', 'eurostocks'); ?> <br>
            <strong>
              <?php
              if ($vehicle['fuelType'] == "Hybride (benzine/elektrisch)") {
                echo "Hybride benzine";
              } elseif ($vehicle['fuelType'] == "Hybride (diesel/elektrisch)") {
                echo "Hybride diesel";
              } else {
                echo esc_html($vehicle['fuelType']);
              }
              ?>
            </strong>
          </div>
          <div></div>
          <div class="advnummer">
            <?php esc_html_e('Listing number', 'eurostocks'); ?>
            <?php echo esc_html($vehicle['vehicleId']); ?>
          </div>
        </div>

       

      </div>
     
      <?php }else{ ?>

        <div class="<?php echo esc_attr($experts_intro_column_class); ?>">
          <div class="euro-row">
            <div class="eurocol-12"><br></div>
          </div>

          <div class="eurosearch-car-details es-grid es-grid-columns-2">
            <div class="es-b-icon es-registration">
              <?php esc_html_e('Registration date', 'eurostocks'); ?> <br>
              <strong>
                <?php echo esc_html($vehicle['firstRegistrationDate']); ?>
              </strong>
            </div>
            <div class="es-b-icon es-pk">
              <?php esc_html_e('Horsepower', 'eurostocks'); ?> <br>
              <strong>
                <?php echo esc_html(intval($vehicle['power'] * 1.362)) . " " . esc_html__("HP", 'eurostocks'); ?>
              </strong>
            </div>
            <div class="es-b-icon es-gearbox">
              <?php esc_html_e('Transmission', 'eurostocks'); ?> <br>
              <strong>
                <?php if ($vehicle['gearBox'] == "Automatische transmissie") {
                  echo "Automaat";
                } else {
                  echo esc_html($vehicle['gearBox']);
                } ?>
              </strong>
            </div>
            <div class="es-b-icon es-mileage">
              <?php esc_html_e('Mileage', 'eurostocks'); ?> <br>
              <strong>
                <?php echo esc_html(number_format(floatval($vehicle['mileage']), 0, ',', '.')); ?> km
              </strong>
            </div>
            <div class="es-b-icon es-fueltype">
              <?php esc_html_e('Fuel', 'eurostocks'); ?> <br>
              <strong>
                <?php
                if ($vehicle['fuelType'] == "Hybride (benzine/elektrisch)") {
                  echo "Hybride benzine";
                } elseif ($vehicle['fuelType'] == "Hybride (diesel/elektrisch)") {
                  echo "Hybride diesel";
                } else {
                  echo esc_html($vehicle['fuelType']);
                }
                ?>
              </strong>
            </div>
          </div>

          <div class="advnummer">
            <?php esc_html_e('Listing number', 'eurostocks'); ?>
            <?php echo esc_html($vehicle['vehicleId']); ?>
          </div>

        </div>
     

      <div class="eurocol-md-4">
        <h5>
          <?php esc_html_e('Options', 'eurostocks'); ?>
        </h5>
        <ul class="es-check">
        
          <div id="es-first-10">
            <?php
            foreach ($options_array as $roption) {
              echo '<li>' . esc_html($roption) . '</li>';
              if ($j == 9) {
                echo '</div><a id="show-es-second-10" href="#">Toon meer opties</a><div class="euro-hidden" id="es-second-10">';
              }
              $j++;
            } ?>
            <a id="hide-es-second-10" class="euro-hidden" href="#">
              <?php esc_html_e('Toon minder opties', 'eurostocks'); ?>
            </a>
          </div>
        </ul>
      </div>
      <?php } ?>
    </div>


    
   <?php if ((isset($options['co2_disclaimer_display']) && $options['co2_disclaimer_display'] == 1) || !isset($options['co2_disclaimer_display'])) {
      if (isset($options['co2_fallback_display']) && $options['co2_fallback_display'] == 1 && isset($vehicle['priceInfo']['FallbackCO2emission']) && $vehicle['priceInfo']['FallbackCO2emission'] != "" ) {
    ?>
      <?php if(isset($options['txt_co2_disclaimer_fallback']) && $options['txt_co2_disclaimer_fallback'] != ''){ ?>
         <div class="es-disclaimer es-cotw-disclaimer">
          <?php if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_co2_disclaimer_fallback']) && $options[esc_html($current_lang)]['txt_co2_disclaimer_fallback'] != '') {
            echo esc_html("* " . $options[esc_html($current_lang)]['txt_co2_disclaimer_fallback']);
          } else {
            echo esc_html("* " . $options['txt_co2_disclaimer_fallback']);
          } ?>
        </div>
      <?php

      }else{ ?>
      <div class="es-disclaimer es-cotw-disclaimer">
        <?php echo esc_html("* " . __('The stated CO₂ emissions are an estimate; actual emissions may vary. The calculated residual BPM (private car and motorcycle tax) is an indicative value and cannot be legally binding. For an accurate calculation, please request a quote without obligation.', 'eurostocks')); ?>
      </div>
      <?php }
       
    
      } elseif (isset($options['txt_co2_disclaimer']) && $options['txt_co2_disclaimer'] != '') {
    ?>
        <div class="es-disclaimer es-cotw-disclaimer">
          <?php if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_co2_disclaimer']) && $options[esc_html($current_lang)]['txt_co2_disclaimer'] != '') {
            echo esc_html("* " . $options[esc_html($current_lang)]['txt_co2_disclaimer']);
          } else {
            echo esc_html("* " . $options['txt_co2_disclaimer']);
          } ?>
        </div>
      <?php

      } else {
      ?>
        <div class="es-disclaimer es-cotw-disclaimer">
          * <?php esc_html_e("The CO2 emissions of a car depend on the way the car is used. Therefore, the
            actual CO2 emissions differ from the CO2 emissions stated here."); ?>
        </div>
    <?php

      }
    } ?>

<?php 
      if(isset($options['show_options_sep']) && $options['show_options_sep'] == 1) { ?>
<div id="opties" class="euro-row">
      <div class="eurocol-12">
        <h2>
          <?php esc_html_e('Options', 'eurostocks'); ?>
        </h2>
      </div>
      <div class="eurocol-12 euro-b-20">
        <div class="es-divider"></div>
      </div>
      <?php 
        $options_array_length = count($options_array);
        $options_array_length = $options_array_length / 3;
        $options_array_length = round($options_array_length);
        $options_column_1 = array_slice($options_array, 0, $options_array_length);
        $options_column_2 = array_slice($options_array, $options_array_length, $options_array_length);
        $options_column_3 = array_slice($options_array, $options_array_length * 2, $options_array_length);
      ?>
      <div class="euro-row eurocol-12 es-specs-columns">
        <div class="eurocol-4">
          <ul class="es-check">
            <?php
              foreach ($options_column_1 as $roption) {
                echo '<li>' . esc_html($roption) . '</li>';
              }
            ?>
            </ul>
          </div>
          <div class="eurocol-4">
            <ul class="es-check">
            <?php
              foreach ($options_column_2 as $roption) {
                echo '<li>' . esc_html($roption) . '</li>';
              }
            ?>
            </ul>
          </div>
          <div class="eurocol-4">
            <ul class="es-check">
            <?php
              foreach ($options_column_3 as $roption) {
                echo '<li>' . esc_html($roption) . '</li>';
              }
            ?>
            </ul>
          </div> 
      </div>
    </div>

    <?php } ?>

    <?php if (isset($options["hide_kosten_left"]) && $options["hide_kosten_left"] == 1 && isset($options["hide_kosten_right"]) && $options["hide_kosten_right"] == 1) {
    } else { ?>
      <div class="euro-row" id="kosten">
        <?php if (isset($options['hide_kosten_left']) && $options['hide_kosten_left'] != 1) { ?>
          <div class="eurocol-md-8 es-bg-white">
            <h2>
              <?php 
              if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_kosten_diensten']) && $options[esc_html($current_lang)]['txt_kosten_diensten'] != '') {
                echo esc_html($options[esc_html($current_lang)]['txt_kosten_diensten']);
              } else {
                echo esc_html($options['txt_kosten_diensten']); 
              }
              ?>
            </h2>
            <ul class="es-check">
              <?php if (isset($options['kosten_one_title']) && $options['kosten_one_title'] != '') { ?>
                <li>
                  <div class="euro-row">
                    <div class="eurocol-12"><strong>
                        <?php 
                        if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['kosten_one_title']) && $options[esc_html($current_lang)]['kosten_one_title'] != '') {
                          echo esc_html($options[esc_html($current_lang)]['kosten_one_title']);
                        } else {
                          echo esc_html($options['kosten_one_title']); 
                        }
                        ?>
                      </strong><br>
                      <?php
                      if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['kosten_one_txt']) && $options[esc_html($current_lang)]['kosten_one_txt'] != '') {
                        echo esc_html($options[esc_html($current_lang)]['kosten_one_txt']);
                      } else {
                       echo esc_html($options['kosten_one_txt']); 
                      }
                       ?>
                    </div>
                  </div>
                </li>
              <?php } ?>
              <?php if (isset($options['kosten_two_title']) && $options['kosten_two_title'] != '' && isset($price) && $price) { ?>
                <li>
                  <div class="euro-row">
                    <div class="eurocol-12"><strong>
                        <?php 
                        if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['kosten_two_title']) && $options[esc_html($current_lang)]['kosten_two_title'] != '') {
                          echo esc_html($options[esc_html($current_lang)]['kosten_two_title']);
                        } else {
                          echo esc_html($options['kosten_two_title']); 
                        }
                        ?>
                      </strong><br>
                      <?php
                      if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['kosten_two_txt']) && $options[esc_html($current_lang)]['kosten_two_txt'] != '') {
                        echo esc_html($options[esc_html($current_lang)]['kosten_two_txt']);
                      } else {
                        echo esc_html($options['kosten_two_txt']); 
                      }
                      ?>
                    </div>
                  </div>
                </li>
              <?php } ?>
            </ul>
          </div>
        <?php } ?>
        <?php if (isset($options['hide_kosten_right']) && $options['hide_kosten_right'] != 1 && isset($price) && $price && $eurostocks_only_fl == 0) { ?>
          <div class="eurocol-md-4">
            <div class="es-bg-secondary">
              <?php if (isset($options['kosten_title']) && $options['kosten_title'] != '') { ?>
                <h2>
                  <?php 
                  if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['kosten_title']) && $options[esc_html($current_lang)]['kosten_title'] != '') {
                    echo esc_html($options[esc_html($current_lang)]['kosten_title']);
                  } else {
                    echo esc_html($options['kosten_title']); 
                  }
                   ?>
                </h2>
              <?php } ?>
              <div class="es-flex">

                <div class="">
                  <?php echo esc_html($options['kosten_vraagprijs']); ?><br>
                  <?php if ($vehicle['priceInfo']['IsVatable'] == "Nee") { ?>
                    <small>
                      <?php 
                      if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['kosten_vraagprijs_no_tax']) && $options[esc_html($current_lang)]['kosten_vraagprijs_no_tax'] != '') {
                        echo esc_html($options[esc_html($current_lang)]['kosten_vraagprijs_no_tax']);
                      } else {
                        echo esc_html($options['kosten_vraagprijs_no_tax']);
                      } 
                      ?>
                    </small>
                  <?php } else { ?>
                    <small>
                      <?php 
                      if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['kosten_vraagprijs_tax']) && $options[esc_html($current_lang)]['kosten_vraagprijs_tax'] != '') {
                        echo esc_html($options[esc_html($current_lang)]['kosten_vraagprijs_tax']);
                      } else {
                        echo esc_html($options['kosten_vraagprijs_tax']);
                      } 
                      ?>
                    </small>
                  <?php } ?>
                </div>
                <div class="">
                  <?php 
                  if($options['country'] == 'nl21'){ ?>
                    €
                    <?php echo esc_html(number_format(floatval($vehicle['priceInfo']['PriceMobiledeBrutoNlVat']), 0, ',', '.')); ?>,-
                  <?php } else { ?>
                    €
                    <?php echo esc_html(number_format(floatval($vehicle['priceInfo']['PriceMobiledeBruto']), 0, ',', '.')); ?>,-
                  <?php } ?>

                </div>
              </div>
              <div class="es-divider"></div>
              <?php if (isset($vehicle['priceInfo']['ImportMargin']) && $vehicle['priceInfo']['ImportMargin'] != '') {
                $importMargin = $vehicle['priceInfo']['ImportMargin']; ?>

                <div class="es-flex">
                  <div class="">
                    <?php 
                    if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['kosten_toelating']) && $options[esc_html($current_lang)]['kosten_toelating'] != '') {
                      echo esc_html($options[esc_html($current_lang)]['kosten_toelating']);
                    } else {
                      echo esc_html($options['kosten_toelating']); 
                    }
                    ?>
                  </div>
                  <div class="">
                    <?php if($options['country'] == 'nl21'){ ?>
                      €
                      <?php echo esc_html(number_format(floatval($vehicle['priceInfo']['ImportMarginNlVat']), 0, ',', '.')); ?>,-
                    <?php } else { ?>
                      €
                      <?php echo esc_html(number_format(floatval($vehicle['priceInfo']['ImportMargin']), 0, ',', '.')); ?>,-
                    <?php } ?>
                  </div>
                </div>
                <div class="es-divider"></div>
              <?php } else {
                $importMargin = 0;
              } ?>
              <?php if (isset($vehicle['priceInfo']['ImportCosts']) && $vehicle['priceInfo']['ImportCosts'] != '') {
                $importCosts = $vehicle['priceInfo']['ImportCosts'];
              ?>
                <div class="es-flex">
                  <div class="">
                    <?php 
                    if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['kosten_transport']) && $options[esc_html($current_lang)]['kosten_transport'] != '') {
                      echo esc_html($options[esc_html($current_lang)]['kosten_transport']);
                    } else {
                      echo esc_html($options['kosten_transport']); 
                    }
                    ?>
                  </div>
                  <div class="">
                    €
                    <?php echo esc_html(number_format(floatval($vehicle['priceInfo']['ImportCosts']), 0, ',', '.')); ?>,-
                  </div>
                </div>
                <div class="es-divider"></div>
              <?php } else {
                $importCosts = 0;
              }
              ?>

              <?php if (isset($vehicle['priceInfo']['TransportCosts']) && $vehicle['priceInfo']['TransportCosts'] != '' && $vehicle['priceInfo']['TransportCosts'] != 0) {
                $transportCosts = $vehicle['priceInfo']['TransportCosts'];
              ?>
                <div class="es-flex">
                  <div class="">
                  <?php 
                    if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['kosten_transport2']) && $options[esc_html($current_lang)]['kosten_transport2'] != '') {
                      echo esc_html($options[esc_html($current_lang)]['kosten_transport2']);
                    } elseif(isset($options['kosten_transport2']) && $options['kosten_transport2'] != '') {
                      echo esc_html($options['kosten_transport2']); 
                    }else{
                      esc_html_e("Transport costs", "eurostocks");
                    }
                     ?>
                  </div>
                  <div class="">
                    €
                    <?php echo esc_html(number_format(floatval($vehicle['priceInfo']['TransportCosts']), 0, ',', '.')); ?>,-
                  </div>
                </div>
                <div class="es-divider"></div>
              <?php } else {
                $transportCosts = 0;
              }


              if (($options['country'] == 'nl' || $options['country'] == 'nl21') && (isset($vehicle['priceInfo']['RestBpmCo2']) && $vehicle['priceInfo']['RestBpmCo2'] != '') || (isset($vehicle['priceInfo']['FallBackRestBPM']) && $vehicle['priceInfo']['FallBackRestBPM'] != '')) {

              ?>
                <div class="es-flex">
                  <div class="">
                    <?php if (isset($options['kosten_restbpm'])) {
                      if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['kosten_restbpm']) && $options[esc_html($current_lang)]['kosten_restbpm'] != '') {
                        echo esc_html($options[esc_html($current_lang)]['kosten_restbpm']);
                      } else {
                        echo esc_html($options['kosten_restbpm']);
                      }
                    } else {
                      echo esc_html__("BPM indication", "eurostocks");
                    } ?>
                  </div>
                  <div class="">
                    €
                    <?php 
                    if ($options['country'] == 'nl') {
                        if (isset($vehicle['priceInfo']['RestBpmCo2']) && $vehicle['priceInfo']['RestBpmCo2'] != '' && isset($vehicle['priceInfo']['PriceNlWithVatMobilede']) && $vehicle['priceInfo']['PriceNlWithVatMobilede'] != '') {
                            echo esc_html(number_format(floatval($vehicle['priceInfo']['RestBpmCo2']), 0, ',', '.'));
                        } elseif (isset($vehicle['priceInfo']['FallBackRestBPM']) && $vehicle['priceInfo']['FallBackRestBPM'] != '' && isset($vehicle['priceInfo']['FallbackPriceNlWithVatMobilede']) && $vehicle['priceInfo']['FallbackPriceNlWithVatMobilede'] != '') {
                            echo esc_html(number_format(floatval($vehicle['priceInfo']['FallBackRestBPM']), 0, ',', '.'));
                        }
                    } elseif ($options['country'] == 'nl21') {
                        if (isset($vehicle['priceInfo']['RestBpmCo2']) && $vehicle['priceInfo']['RestBpmCo2'] != '' && isset($vehicle['priceInfo']['PriceNlWithVatNl']) && $vehicle['priceInfo']['PriceNlWithVatNl'] != '') {
                            echo esc_html(number_format(floatval($vehicle['priceInfo']['RestBpmCo2']), 0, ',', '.'));
                        } elseif (isset($vehicle['priceInfo']['FallBackRestBPM']) && $vehicle['priceInfo']['FallBackRestBPM'] != '' && isset($vehicle['priceInfo']['FallbackPriceNlWithVatNl']) && $vehicle['priceInfo']['FallbackPriceNlWithVatNl'] != '') {
                            echo esc_html(number_format(floatval($vehicle['priceInfo']['FallBackRestBPM']), 0, ',', '.'));
                        }
                    }
                    
                    ?>,-
                  </div>
                </div>
                <div class="es-divider"></div>
              <?php }
              ?>

              <div class="es-flex">
                <div class="">
                  <?php 
                  if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['kosten_totaal']) && $options[esc_html($current_lang)]['kosten_totaal'] != '') {
                    echo esc_html($options[esc_html($current_lang)]['kosten_totaal']);
                  } else {
                    echo esc_html($options['kosten_totaal']); 
                  }
                  ?>

                </div>
                <div class="">
                  <?php if ($options['country'] != 'nl' && $options['country'] != 'nl21') { ?>

                    €
                    <?php echo esc_html(number_format(floatval($vehicle['priceInfo']['PriceMobiledeBruto'] + $importCosts + $importMargin + $transportCosts), 0, ',', '.')); ?>,-
                  <?php } elseif ($options['country'] == 'nl21') { 
                    if (isset($vehicle['priceInfo']['PriceNlWithVatNl']) && $vehicle['priceInfo']['PriceNlWithVatNl'] != '') {
                        $price = $vehicle['priceInfo']['PriceNlWithVatNl'];
                    } else {
                        if(isset($vehicle['priceInfo']['FallbackPriceNlWithVatNl']) && $vehicle['priceInfo']['FallbackPriceNlWithVatNl'] != '' && isset($options['co2_fallback_display']) && $options['co2_fallback_display'] == 1) {
                            $price = $vehicle['priceInfo']['FallbackPriceNlWithVatNl'];
                        }else{
                            $price = false;
                        }
                    }
                    ?>
  
                    €
                    <?php echo esc_html(number_format(floatval($price), 0, ',', '.')); ?>,-
                  <?php } else { 
                    if($options['country'] == 'nl') {
                        if (isset($vehicle['priceInfo']['PriceNlWithVatMobilede']) && $vehicle['priceInfo']['PriceNlWithVatMobilede'] != '') {
                            $price = $vehicle['priceInfo']['PriceNlWithVatMobilede'];
                        }
                        elseif(isset($vehicle['priceInfo']['FallbackPriceNlWithVatMobilede']) && $vehicle['priceInfo']['FallbackPriceNlWithVatMobilede'] != '' && isset($options['co2_fallback_display']) && $options['co2_fallback_display'] == 1) {
                            $price = $vehicle['priceInfo']['FallbackPriceNlWithVatMobilede'];
                        } else {
                            $price = false;
                        }
                    }else {
                        
                          $price = false;
                        
                    } ?>
                    €
                    <?php echo esc_html(number_format(floatval($price), 0, ',', '.')); ?>,-

                  <?php } ?>
                </div>
              </div>

            </div>
            <a class="euro-btn euro-btn-primary w-100 es-price-btn" data-modal="es-contact" href="#">
              <?php
              if (isset($options['txt_btn_product'])) {
                if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_btn_product']) && $options[esc_html($current_lang)]['txt_btn_product'] != '') {
                  echo esc_html($options[esc_html($current_lang)]['txt_btn_product']);
                } else {
                  echo esc_html($options['txt_btn_product']);
                }
              } else {
                echo esc_html($options['txt_btn']);
              } ?>
            </a>

         <?php if ((isset($options['co2_disclaimer_display']) && $options['co2_disclaimer_display'] == 1) || !isset($options['co2_disclaimer_display'])) {
      if (isset($options['co2_fallback_display']) && $options['co2_fallback_display'] == 1 && isset($vehicle['priceInfo']['FallbackCO2emission']) && $vehicle['priceInfo']['FallbackCO2emission'] != "" ) {
    ?>
      <?php if(isset($options['txt_co2_disclaimer_fallback']) && $options['txt_co2_disclaimer_fallback'] != ''){ ?>
         <div class="es-disclaimer es-cotw-disclaimer">
          <?php if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_co2_disclaimer_fallback']) && $options[esc_html($current_lang)]['txt_co2_disclaimer_fallback'] != '') {
            echo esc_html("* " . $options[esc_html($current_lang)]['txt_co2_disclaimer_fallback']);
          } else {
            echo esc_html("* " . $options['txt_co2_disclaimer_fallback']);
          } ?>
        </div>
      <?php

      }else{ ?>
      <div class="es-disclaimer es-cotw-disclaimer">
        <?php echo esc_html("* " . __('The stated CO₂ emissions are an estimate; actual emissions may vary. The calculated residual BPM (private car and motorcycle tax) is an indicative value and cannot be legally binding. For an accurate calculation, please request a quote without obligation.', 'eurostocks')); ?>
      </div>
      <?php }
       
    
      } elseif (isset($options['txt_co2_disclaimer']) && $options['txt_co2_disclaimer'] != '') {
    ?>
        <div class="es-disclaimer es-cotw-disclaimer">
          <?php if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_co2_disclaimer']) && $options[esc_html($current_lang)]['txt_co2_disclaimer'] != '') {
            echo esc_html("* " . $options[esc_html($current_lang)]['txt_co2_disclaimer']);
          } else {
            echo esc_html("* " . $options['txt_co2_disclaimer']);
          } ?>
        </div>
      <?php

      } else {
      ?>
        <div class="es-disclaimer es-cotw-disclaimer">
          * <?php esc_html_e("The CO2 emissions of a car depend on the way the car is used. Therefore, the
            actual CO2 emissions differ from the CO2 emissions stated here."); ?>
        </div>
    <?php

      }
    } ?>
          </div>
        <?php } ?>

      </div>
    <?php } ?>

    <?php if ((isset($options["hide_experts"]) && $options["hide_experts"] == 1) || !$show_experts_section) {
      echo "";
    } else { ?>
      <div id="experts" class="euro-row">
        <div class="<?php echo esc_attr($experts_intro_column_class); ?>">
          <h2>
            <?php 
            if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_experts']) && $options[esc_html($current_lang)]['txt_experts'] != '') {
              echo esc_html($options[esc_html($current_lang)]['txt_experts']);
            } else {
              echo esc_html($options['txt_experts']); 
            }
            ?>
          </h2>

          <?php if ($options['html_experts']) {
            if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['html_experts']) && $options[esc_html($current_lang)]['html_experts'] != '') {
              echo wp_kses($options[esc_html($current_lang)]['html_experts'], $allowed_html);
            } else {
              echo wp_kses($options['html_experts'], $allowed_html);
            }
          } ?>
        </div>
        <?php if ($show_experts_one) { ?>
        <div class="eurocol-md-4">
          <div class="es-card es-bg-white">
            <?php $experts_img_1 = wp_get_attachment_image_url($options['experts_one_img'], 'full'); ?>
            <img src="<?php echo esc_url($experts_img_1); ?>" class="profile-cover" alt="name" loading="lazy" />
            <div class="es-inner-text">
              <h5><?php echo esc_html($experts_one_name_display); ?></h5>
              <div class="es-jobtitle">
                <?php 
                if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['experts_one_function']) && $options[esc_html($current_lang)]['experts_one_function'] != '') {
                  echo esc_html($options[esc_html($current_lang)]['experts_one_function']);
                } else {
                  echo esc_html($options['experts_one_function']); 
                }
                ?>
              </div>
              <div class="es-contact-links">
                <a href="mailto:<?php echo esc_html($options['experts_one_mail']); ?>" class="es-email-icon">
                  <?php 
                  if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['experts_one_mail']) && $options[esc_html($current_lang)]['experts_one_mail'] != '') {
                    echo esc_html($options[esc_html($current_lang)]['experts_one_mail']);
                  } else {
                    echo esc_html($options['experts_one_mail']); 
                  }
                  ?>
                </a>
                <a href="tel:<?php echo esc_html($options['experts_one_tel']); ?>" class="es-tel-icon">
                  <?php 
                  if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['experts_one_tel']) && $options[esc_html($current_lang)]['experts_one_tel'] != '') {
                    echo esc_html($options[esc_html($current_lang)]['experts_one_tel']);
                  } else {
                    echo esc_html($options['experts_one_tel']); 
                  }
                  ?>
                </a>
              </div>
            </div>
          </div>
        </div>
        <?php } ?>
        <?php if ($show_experts_two) { ?>
        <div class="eurocol-md-4">
          <div class="es-card es-bg-white">
            <?php $experts_img_2 = wp_get_attachment_image_url($options['experts_two_img'], 'full'); ?>
            <img src="<?php echo esc_url($experts_img_2); ?>" class="profile-cover" alt="name" loading="lazy" />
            <div class="es-inner-text">
              <h5><?php echo esc_html($experts_two_name_display); ?></h5>
              <div class="es-jobtitle">
                <?php 
                if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['experts_two_function']) && $options[esc_html($current_lang)]['experts_two_function'] != '') {
                  echo esc_html($options[esc_html($current_lang)]['experts_two_function']);
                } else {
                  echo esc_html($options['experts_two_function']); 
                }
                ?>
              </div>
              <div class="es-contact-links">
                <a href="mailto:<?php echo esc_html($options['experts_two_mail']); ?>" class="es-email-icon">
                  <?php 
                  if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['experts_two_mail']) && $options[esc_html($current_lang)]['experts_two_mail'] != '') {
                    echo esc_html($options[esc_html($current_lang)]['experts_two_mail']);
                  } else {
                    echo esc_html($options['experts_two_mail']); 
                  }
                  ?>
                </a>
                <a href="tel:<?php echo esc_html($options['experts_two_tel']); ?>" class="es-tel-icon">
                  <?php 
                  if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['experts_two_tel']) && $options[esc_html($current_lang)]['experts_two_tel'] != '') {
                    echo esc_html($options[esc_html($current_lang)]['experts_two_tel']);
                  } else {
                    echo esc_html($options['experts_two_tel']); 
                  }
                  ?>
                </a>
              </div>
            </div>
          </div>
        </div>
        <?php } ?>
      </div>
    <?php } ?>

    <?php if (isset($options["hide_reviews"]) && $options["hide_reviews"] == 1) {
      echo "";
    } else { ?>
      <div class="euro-row" id="ervaringen">
        <div class="eurocol-12 es-flex es-flex-center">
          <?php if (isset($options['review_img']) && !empty($options['review_img'])) { ?>
            <?php $review_img_url = wp_get_attachment_image_url($options['review_img'], 'medium'); ?>
            <img class="review-score" src="<?php echo esc_url($review_img_url); ?>" alt="klanten vertellen score" loading="lazy" />
          <?php } ?>
          <h2>
            <?php 
            if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_review']) && $options[esc_html($current_lang)]['txt_review'] != '') {
              echo esc_html($options[esc_html($current_lang)]['txt_review']);
            } else {
              echo esc_html($options['txt_review']); 
            }
            ?>
          </h2>
        </div>

        <div class="eurocol-md-6">
          <div class="es-review es-bg-white">
            <h4><strong>
                <?php 
                if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['reviews_one_name']) && $options[esc_html($current_lang)]['reviews_one_name'] != '') {
                  echo esc_html($options[esc_html($current_lang)]['reviews_one_name']);
                } else {
                  echo esc_html($options['reviews_one_name']); 
                }
                ?>
              </strong> -
              <?php 
              if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['reviews_one_place']) && $options[esc_html($current_lang)]['reviews_one_place'] != '') {
                echo esc_html($options[esc_html($current_lang)]['reviews_one_place']);
              } else {
                echo esc_html($options['reviews_one_place']); 
              }
              ?>
            </h4>
            <div class="es-stars">
              <span class="es-star"></span>
              <span class="es-star"></span>
              <span class="es-star"></span>
              <span class="es-star"></span>
              <span class="es-star"></span>
            </div>
            <h5 class="es-review-title">
              <?php 
              if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['reviews_one_title']) && $options[esc_html($current_lang)]['reviews_one_title'] != '') {
                echo esc_html($options[esc_html($current_lang)]['reviews_one_title']);
              } else {
                echo esc_html($options['reviews_one_title']); 
              }
              ?>
            </h5>
            <p>
              <?php 
              if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['reviews_one_text']) && $options[esc_html($current_lang)]['reviews_one_text'] != '') {
                echo esc_html($options[esc_html($current_lang)]['reviews_one_text']);
              } else {
                echo esc_html($options['reviews_one_text']); 
              }
              ?>
            </p>
          </div>
        </div>


        <div class="eurocol-md-6">
          <div class="es-review es-bg-white">
            <h4><strong>
                <?php 
                if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['reviews_two_name']) && $options[esc_html($current_lang)]['reviews_two_name'] != '') {
                  echo esc_html($options[esc_html($current_lang)]['reviews_two_name']);
                } else {
                  echo esc_html($options['reviews_two_name']); 
                }
               
                ?>
              </strong> -
              <?php 
              if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['reviews_two_place']) && $options[esc_html($current_lang)]['reviews_two_place'] != '') {
                echo esc_html($options[esc_html($current_lang)]['reviews_two_place']);
              } else {
                echo esc_html($options['reviews_two_place']);
              }
               ?>
            </h4>
            <div class="es-stars">
              <span class="es-star"></span>
              <span class="es-star"></span>
              <span class="es-star"></span>
              <span class="es-star"></span>
              <span class="es-star"></span>
            </div>
            <h5 class="es-review-title">
              <?php 
              if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['reviews_two_title']) && $options[esc_html($current_lang)]['reviews_two_title'] != '') {
                echo esc_html($options[esc_html($current_lang)]['reviews_two_title']);
              } else {
                echo esc_html($options['reviews_two_title']); 
              }
              ?>
            </h5>
            <p>
              <?php 
              if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['reviews_two_text']) && $options[esc_html($current_lang)]['reviews_two_text'] != '') {
                echo esc_html($options[esc_html($current_lang)]['reviews_two_text']);
              } else {
                echo esc_html($options['reviews_two_text']); 
              }
              ?>
            </p>
          </div>
        </div>
        <div class="eurocol-12 es-text-center">
          <a class="euro-btn euro-btn-primary es-ervaringen-btn" target="_blank"
            href="<?php 
            if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['reviews_url']) && $options[esc_html($current_lang)]['reviews_url'] != '') {
              echo esc_url($options[esc_html($current_lang)]['reviews_url']);
            } else {
              echo esc_url($options['reviews_url']); 
            }
            ?>">
            <?php 
            if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_more_reviews']) && $options[esc_html($current_lang)]['txt_more_reviews'] != '') {
              echo esc_html($options[esc_html($current_lang)]['txt_more_reviews']);
            } else {
              echo esc_html($options['txt_more_reviews']); 
            }
            ?>
          </a>
        </div>

      </div>
    <?php } ?>

    <div class="euro-row es-bg-white" id="fotos">
      <h2>
        <?php esc_html_e('Photos of this', 'eurostocks'); ?>
        <?php echo esc_html($vehicle['make']); ?>
        <?php echo esc_html($vehicle['model']); ?>
      </h2>
      <div class="es-grid es-grid-4 es-grid-gap">
        <?php
        foreach ($vehicle['images'] as $image) {
          $key_l = array_search('M', array_column($image['images'], 'size'));
          $key_xl = array_search('XXXL', array_column($image['images'], 'size'));
          $image_url = $image['images'][$key_l]['url'];
          $image_xl_url = $image['images'][$key_xl]['url'];
        ?>
          <a class="es-img-box" data-fslightbox href="<?php echo esc_url($image_xl_url); ?>"><img src="<?php echo esc_url($image_url); ?>"
              alt="<?php echo esc_html($vehicle['modelDescription']); ?>" loading="lazy" /></a>
        <?php
        }
        ?>
      </div>

      <div class="es-disclaimer">
        <?php 
        if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_disclaimer']) && $options[esc_html($current_lang)]['txt_disclaimer'] != '') {
          echo esc_html($options[esc_html($current_lang)]['txt_disclaimer']);
        } else {
          echo esc_html($options['txt_disclaimer']); 
        }
        ?>
      </div>


    </div>
  </div>
  </div>

  <div class="eurocol-12">
    <?php if (isset($options['enable_pdf']) && $options['enable_pdf'] == 1) {
      if($diflang){
        $pdf_url = get_site_url() . '/' . esc_html($current_lang) . "/auto/" . esc_html($vehicle['vehicleId']) . "/pdf";
      }else{
        $pdf_url = get_site_url() . "/auto/" . esc_html($vehicle['vehicleId']) . "/pdf";
      }
      ?>
      <a href="<?php echo esc_html($pdf_url); ?>" target="_blank"
        class="euro-btn euro-btn-primary es-price-btn euro-txt-inline es-float-left">
        <?php if (isset($options['txt_download_pdf']) && $options['txt_download_pdf'] != "") {
          if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_download_pdf']) && $options[esc_html($current_lang)]['txt_download_pdf'] != '') {
            echo esc_html($options[esc_html($current_lang)]['txt_download_pdf']);
          } else {
            echo esc_html($options['txt_download_pdf']);
          }
        } else {
          esc_html_e('Download PDF', 'eurostocks');
        } ?>
      </a>
    <?php } ?>
    <?php if (isset($options['show_powered_by']) && $options['show_powered_by'] == 1) { ?>
      <div class="eurocol-12">
        <a href="https://www.eurostocks.com/nl-nl/cms/onze-diensten/importsoftware" target="_blank" rel="noopener noreferrer" class="es-float-right es-poweredby-dark">
          <small style="float:left; color: #333; margin-right:8px;"><?php esc_html_e( 'Powered by', 'eurostocks' ); ?></small> <img class="poweredby poweredby-dark es-float-right"
            src="<?php echo esc_url(plugin_dir_url(__FILE__)) . '../images/eurostocks.png'; ?>" alt="Powered By Eurostocks" loading="lazy" />
        </a>
      </div>
    <?php } elseif (isset($options['show_powered_by']) && $options['show_powered_by'] == 2) { ?>
      <div class="eurocol-12">
        <a href="https://www.eurostocks.com/nl-nl/cms/onze-diensten/importsoftware" target="_blank" rel="noopener noreferrer" class="es-float-right">
          <small style="float:left; color: #b4b4b4; margin-right:8px;"><?php esc_html_e( 'Powered by', 'eurostocks' ); ?></small> <img
            class="poweredby es-float-right"
            src="<?php echo esc_url(plugin_dir_url(__FILE__)) . '../images/eurostocks-w.png'; ?>"
            alt="Powered By Eurostocks" loading="lazy" />
        </a>
      </div>

    <?php } ?>
  </div>

  </div>

  <div class="euro-modal" id="es-contact">
    <div class="euro-modal-bg euro-modal-exit"></div>
    <div class="euro-modal-container">
      <h3>
        <?php esc_html_e('Contact opnemen', 'eurostocks'); ?>
      </h3>
      <form method="POST" action="" class="euro-contact-form" id="car-contact-form">
        <?php wp_nonce_field('car_contact_form', 'car_contact_form_nonce'); ?>
        <input type="hidden" name="action" value="car_contact_form">

        <label>
          <?php esc_html_e('Name', 'eurostocks'); ?><br>
          <input type="text" name="name" required>
        </label>
       
        <label class="euro-hidden">
          <?php esc_html_e('Car', 'eurostocks'); ?> <br>
          <input class="euro-car-id" type="text" value="<?php echo esc_url($current_url); ?>" name="car">
        </label>

        <label class="euro-hidden">
          <?php esc_html_e('Car', 'eurostocks'); ?> <br>
          <input class="car-title" type="text"
            value="<?php echo esc_html($vehicle['make']) . ' ' . esc_html($vehicle['modelDescription']); ?>"
            name="carTitle">
        </label>

        <label>
          <?php esc_html_e('Phone number', 'eurostocks'); ?> <br>
          <input type="tel" name="tel" required>
        </label>

        <label class="euro-hidden">
          <?php esc_html_e('Url', 'eurostocks'); ?> <br>
          <input type="url" name="url">
        </label>

        <label class="euro-hidden">
          <?php esc_html_e('Car details', 'eurostocks'); ?> <br>
          <input type="text" name="euroCarDetails"
            value="<?php echo esc_html($vehicle['make'] . ' ' . $vehicle['modelDescription']); ?>
        <?php echo esc_html($vehicle['firstRegistrationDate']); ?> - <?php echo esc_html($vehicle['fuelType']); ?> - 
        <?php echo esc_html(number_format(floatval($vehicle['mileage']), 0, ',', '.')); ?>KM -
        <?php echo esc_html($vehicle['gearBox']); ?> -  <?php echo esc_html($vehicle['power']); ?>kW (<?php echo esc_html(intval($vehicle['power'] * 1.362)) . " " . esc_html__("HP", 'eurostocks'); ?>)">
        </label>

        <label>
          <?php esc_html_e('E-mail', 'eurostocks'); ?><br>
          <input type="email" name="email" required>
        </label>
        <?php if (isset($options['hide_cartrade']) && $options['hide_cartrade'] == 1) {
        } else { ?>
          <label>
            <input type="checkbox" id="auto_ruilen" name="auto_ruilen" value="JA"> <?php esc_html_e('I want to trade in my car', 'eurostocks'); ?>
          </label><br>

          <label class="euro-hidden" id="kenteken"><?php esc_html_e('License plate', 'eurostocks'); ?><br>
            <input type="text" name="kenteken"></label>

          <label class="euro-hidden" id="kilometerstand"><?php esc_html_e('Mileage', 'eurostocks'); ?><br>
            <input type="text" name="kilometerstand"></label>
        <?php } ?>

        <?php if (isset($options['hide_carlease']) && $options['hide_carlease'] == 1) {
        } else { ?>
          <label>
            <input type="checkbox" name="leaseofferte" value="JA"> <?php esc_html_e('Also send me a lease quote', 'eurostocks'); ?>
          </label><br>
        <?php } ?>

        <label>
          <?php esc_html_e('Message', 'eurostocks'); ?><br>
          <textarea rows="5" name="message" required></textarea>
        </label>

        <button type="submit" class="euro-btn euro-btn-primary euro-contactform-submit"
          value="<?php esc_html_e("Send", 'eurostocks'); ?>">
          <?php esc_html_e('Send', 'eurostocks'); ?>
        </button>
      </form>
      <button class="euro-modal-close euro-modal-exit">X</button>
    </div>
  </div>

  <div class="euro-modal" id="es-info-x">
    <div class="euro-modal-bg euro-modal-exit"></div>
    <div class="euro-modal-container">
      <h3>
        <?php if (isset($options['offerte_title'])) {
          if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['offerte_title']) && $options[esc_html($current_lang)]['offerte_title'] != '') {
            echo esc_html($options[esc_html($current_lang)]['offerte_title']);
          } else {
            echo esc_html($options['offerte_title']);
          }
        } ?>
      </h3>
      <?php if (isset($options['offerte_txt'])) {
        if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['offerte_txt']) && $options[esc_html($current_lang)]['offerte_txt'] != '') {
          echo wp_kses($options[esc_html($current_lang)]['offerte_txt'], $allowed_html);
        } else {
          echo wp_kses($options['offerte_txt'], $allowed_html);
        }
      } ?>
      <button class="euro-modal-close euro-modal-exit">X</button>
    </div>
  </div>




<?php
}elseif($data == '404'){
  ?>

<div class="euro-modal-header">
    <h2 class="euro-modal-title">
      <span class="es-text-primary">
        <?php  
        if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_404_title']) && $options[esc_html($current_lang)]['txt_404_title'] != '') {
                echo esc_html($options[esc_html($current_lang)]['txt_404_title']);
        } else {
          if(isset($options['txt_404_title']) && $options['txt_404_title'] != '') {
                echo esc_html($options['txt_404_title']); 
          } else {
            esc_html_e('Car not available', 'eurostocks');
          }
        }
        ?>
      </span>
    </h2>
  
  </div>
  <div class="euro-modal-body">
    <div class="es-404">
      <p>
      <?php  
        if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_404_txt']) && $options[esc_html($current_lang)]['txt_404_txt'] != '') {
                echo esc_html($options[esc_html($current_lang)]['txt_404_txt']);
        } else {
          if(isset($options['txt_404_txt']) && $options['txt_404_txt'] != '') {
                echo esc_html($options['txt_404_txt']); 
          } else {
              esc_html_e('The car you are looking for is no longer available.', 'eurostocks');
          }
        }
        ?>
      </p>
   
      <div>
        <?php
        $filter_page = $options['filters_page'];
        $filter_page_url = get_permalink($filter_page);
        ?>
        <a class="euro-btn euro-btn-primary" onclick="event.preventDefault(); var referrer = document.referrer; var currentHost = window.location.hostname; if (referrer && new URL(referrer).hostname === currentHost) { window.location.href = referrer; } else { window.location.href = this.href; }" href="<?php echo esc_url($filter_page_url); ?>">
          <?php  
            if($diflang && isset($options[esc_html($current_lang)]) && isset($options[esc_html($current_lang)]['txt_404_btn']) && $options[esc_html($current_lang)]['txt_404_btn'] != '') {
                    echo esc_html($options[esc_html($current_lang)]['txt_404_btn']);
            } else {
              if(isset($options['txt_404_btn']) && $options['txt_404_btn'] != '') {
                    echo esc_html($options['txt_404_btn']); 
              } else {
                esc_html_e('Back', 'eurostocks');
              }
            } 
          ?>
        </a>
      </div>
    </div>
  </div>
          </div>
  <?php
}
?>
