<%- include('../partials/head', { metaTitle: tour.p_name + ' | ' + (site.site_name || 'RouteMate') }) %>
<%- include('../partials/offcanvas') %>
<%- include('../partials/header') %>

<main>
   <div class="tp-breadcrumb__area pt-40 pb-40" style="background:#f8f9fb;">
      <div class="container">
         <span style="font-size:12px; color:#999; text-transform:uppercase;"><%= tour.p_location %>, <%= tour.p_country %></span>
         <h1 style="font-size:28px; margin:6px 0;"><%= tour.p_name %></h1>
         <span style="font-size:14px; color:#777;"><%= tour.p_nights %> Nights / <%= parseInt(tour.p_nights) + 1 %> Days &middot; <%= tour.p_category %></span>
      </div>
   </div>

   <div class="tp-tour-details-area pt-60 pb-100">
      <div class="container">
         <div class="row">
            <div class="col-lg-8">
               <img
                  src="<%= tour.p_image ? resolveUpload(tour.p_image) : '/assets/img/tour/01.jpg' %>"
                  alt="<%= tour.p_name %>"
                  style="width:100%; height:420px; object-fit:cover; border-radius:10px; margin-bottom:30px;"
               >

               <div style="border:1px solid #eee; border-radius:10px; padding:15px 20px; margin-bottom:30px; display:flex; gap:20px; flex-wrap:wrap;">
                  <% const includes = [
                     ['p_includes_hotel', 'Hotel'], ['p_includes_meals', 'Meals'], ['p_includes_flight', 'Flight'],
                     ['p_includes_train', 'Train'], ['p_includes_sightseeing', 'Sightseeing'],
                     ['p_includes_transport', 'Transport'], ['p_includes_tour_manager', 'Tour Manager']
                  ]; %>
                  <% includes.forEach(function(inc) { if (tour[inc[0]]) { %>
                     <span style="font-size:13px; color:#16A34A;"><i class="fas fa-check-circle"></i> <%= inc[1] %></span>
                  <% } }) %>
               </div>

               <% if (tour.p_highlights) { %>
                  <h3 style="font-size:19px; margin-bottom:15px;">Highlights</h3>
                  <div style="margin-bottom:30px; font-size:14px; color:#444; line-height:1.7;"><%- tour.p_highlights %></div>
               <% } %>

               <% if (tour.p_d1) { %>
                  <h3 style="font-size:19px; margin-bottom:15px;">Destinations Covered</h3>
                  <div style="margin-bottom:30px; font-size:14px; color:#444; line-height:1.7;"><%- tour.p_d1 %></div>
               <% } %>

               <% if (tour.p_it_detail) { %>
                  <h3 style="font-size:19px; margin-bottom:15px;">Day by Day Itinerary</h3>
                  <div style="margin-bottom:30px; font-size:14px; color:#444; line-height:1.7;"><%- tour.p_it_detail %></div>
               <% } %>

               <div class="row">
                  <% if (tour.p_inclusion) { %>
                     <div class="col-md-6">
                        <h3 style="font-size:17px; margin-bottom:15px;">Inclusions</h3>
                        <div style="margin-bottom:30px; font-size:14px; color:#444; line-height:1.7;"><%- tour.p_inclusion %></div>
                     </div>
                  <% } %>
                  <% if (tour.p_exclusion) { %>
                     <div class="col-md-6">
                        <h3 style="font-size:17px; margin-bottom:15px;">Exclusions</h3>
                        <div style="margin-bottom:30px; font-size:14px; color:#444; line-height:1.7;"><%- tour.p_exclusion %></div>
                     </div>
                  <% } %>
               </div>

               <% if (tour.p_hotel_details) { %>
                  <h3 style="font-size:19px; margin-bottom:15px;">Hotel Details</h3>
                  <div style="margin-bottom:30px; font-size:14px; color:#444; line-height:1.7;"><%- tour.p_hotel_details %></div>
               <% } %>
            </div>

            <div class="col-lg-4">
               <div style="border:1px solid #eee; border-radius:10px; padding:25px; position:sticky; top:100px;">
                  <h3 style="font-size:18px; margin-bottom:15px;">Package Price</h3>
                  <div style="margin-bottom:8px;"><span style="color:#777; font-size:13px;">Adult</span> <strong style="float:right; color:#DC2626;">₹<%= Number(tour.p_adult_price).toLocaleString('en-IN') %></strong></div>
                  <% if (tour.p_child_price && Number(tour.p_child_price) > 0) { %>
                  <div style="margin-bottom:8px;"><span style="color:#777; font-size:13px;">Child (w/o bed)</span> <strong style="float:right;">₹<%= Number(tour.p_child_price).toLocaleString('en-IN') %></strong></div>
                  <% } %>
                  <% if (tour.p_child_w_bed && Number(tour.p_child_w_bed) > 0) { %>
                  <div style="margin-bottom:8px;"><span style="color:#777; font-size:13px;">Child (with bed)</span> <strong style="float:right;">₹<%= Number(tour.p_child_w_bed).toLocaleString('en-IN') %></strong></div>
                  <% } %>
                  <% if (tour.p_infant_price && Number(tour.p_infant_price) > 0) { %>
                  <div style="margin-bottom:20px;"><span style="color:#777; font-size:13px;">Infant</span> <strong style="float:right;">₹<%= Number(tour.p_infant_price).toLocaleString('en-IN') %></strong></div>
                  <% } %>
                  <a href="/contact?tour=<%= encodeURIComponent(tour.p_name) %>" class="tp-btn" style="width:100%; text-align:center; display:block; margin-top:10px;">Enquire Now</a>
                  <p style="font-size:12px; color:#999; margin-top:12px; text-align:center;">Our travel expert will get in touch to confirm availability & finalize your booking.</p>
               </div>
            </div>
         </div>

         <% if (related.length > 0) { %>
         <div style="margin-top:60px;">
            <h3 style="font-size:20px; margin-bottom:20px;">You May Also Like</h3>
            <div class="row">
               <% related.forEach(function(t) { %>
                  <%- include('../partials/tour-card', { tour: t }) %>
               <% }) %>
            </div>
         </div>
         <% } %>
      </div>
   </div>
</main>

<%- include('../partials/footer') %>
<%- include('../partials/scripts') %>
