   <div class="side-bar">
       <div class="booking-form">
           <h3> Book Your Trip</h3>
           <form id="booking-form" class="contact-form" novalidate>
               <div class="form-group">
                   <label for="name">Full Name</label>
                   <input type="text" id="name" class="form-control" placeholder="Enter your name" required>
                   <small id="name-error" class="text-danger error-message"></small>
               </div>
               <div class="form-group">
                   <label for="phone">Phone Number</label>
                   <input type="tel" id="phone" class="form-control" placeholder="Enter phone number" required>
                   <small id="phone-error" class="text-danger error-message"></small>
               </div>
               <div class="form-group">
                   <label for="destination">Trip Destination</label>
                   <select id="destination" class="form-select" required>
                       <option value="" selected disabled>Select Destination</option>
                       <option value="kandhaloor">Kandhaloor (2D/1N)</option>
                       <option value="Valparai-&-Athirappilly">Valparai & Athirappilly (3D/1N)</option>
                       <option value="Topslip-&-Valparai">Topslip & Valparai (2D/1N)</option>
                       <option value="munnar-kandhaloor">Munnar & Kandhaloor (3D/2N)</option>
                       <option value="valparai-&-kandhaloor-tour-package">Valparai & Kandhaloor (3D/2N)</option>
                       <option value="topslip-athirappilly">Topslip – Valparai – Athirappilly (2D)</option>
                       <option value="thirumoorthi-falls">Thirumoorthi Falls</option>
                       <option value="valparai-&-athirappilly-3-day-tour">Valparai & Athirappilly 3-Day</option>
                   </select>
                   <small id="destination-error" class="text-danger error-message"></small>
               </div>
               <div class="form-group mt-3">
                   <label for="package">Select Package</label>
                   <select id="package" class="form-select" required>
                       <option value="" selected disabled>Select Package</option>
                       <option value="Standard">Standard</option>
                       <option value="Premium">Premium</option>
                       <option value="Luxury">Luxury</option>
                   </select>
                   <small id="package-error" class="text-danger error-message"></small>
               </div>
               <div class="form-group mt-3">
                   <label for="trip-date">Trip Date</label>
                   <input type="date" id="trip-date" class="form-control" required>
                   <small id="trip-date-error" class="text-danger error-message"></small>
               </div>
               <div class="form-group">
                   <label for="persons">Number of Persons</label>
                   <input type="number" id="persons" class="form-control" placeholder="Enter number of persons" min="1" required>
                   <small id="persons-error" class="text-danger error-message"></small>
               </div>
               <div class="form-group">
                   <label for="message">Message</label>
                   <textarea id="message" class="form-control" rows="4" placeholder="Your message here..." required></textarea>
                   <small id="message-error" class="text-danger error-message"></small>
               </div>
               <div class="custom-btn">
                   <button type="submit" class="liquid-btn">
                       Book now <i class="bi bi-chevron-double-right"></i>
                   </button>
               </div>
           </form>
       </div>
       <div class="related-packages mt-3">
           <h3>Related Packages</h3>
           <ul>
               <li><a href="kandhaloor-tour-package-from-pollachi.php" title="Kandhaloor 2 Days 1 Night Tour Package"><i class="bi bi-caret-right-fill"></i> Kandhaloor (2D/1N)</a></li>
               <li><a href="valparai-athirappilly-tour-package.php" title="Valparai and Athirappilly 3 Days 1 Night Tour"><i class="bi bi-caret-right-fill"></i> Valparai & Athirappilly (3D/1N)</a></li>
               <li><a href="topslip-valparai-tour-package.php" title="Topslip and Valparai 2 Days 1 Night Tour"><i class="bi bi-caret-right-fill"></i> Topslip & Valparai (2D/1N)</a></li>
               <li><a href="munnar-kandhaloor-tour-package-from-pollachi.php" title="Munnar and Kandhaloor 3 Days 2 Nights Tour"><i class="bi bi-caret-right-fill"></i> Munnar & Kandhaloor (3D/2N)</a></li>
               <li><a href="valparai-kandhaloor-tour-package.php" title="Valparai and Kandhaloor 3 Days 2 Nights Tour"><i class="bi bi-caret-right-fill"></i> Valparai & Kandhaloor (3D/2N)</a></li>
               <li><a href="valparai-kandhaloor-tour-package.php" title="Topslip, Valparai, and Athirappilly 2 Days Tour"><i class="bi bi-caret-right-fill"></i> Topslip – Valparai – Athirappilly (2D)</a></li>
               <li><a href="thirumoorthi-falls" title="Thirumoorthi Falls Tour Package"><i class="bi bi-caret-right-fill"></i> Thirumoorthi Falls</a></li>
               <li><a href="valparai-athirappilly-3-day-tour-package.php" title="Valparai and Athirappilly 3 Days Tour Package"><i class="bi bi-caret-right-fill"></i> Valparai & Athirappilly 3-Day</a></li>
           </ul>
       </div>
   </div>

   <!-- form validation -->
   <script>
       document.getElementById('booking-form').addEventListener('submit', function(e) {
           e.preventDefault();
           document.querySelectorAll('.error-message').forEach(el => el.textContent = '');
           let isValid = true;
           const name = document.getElementById('name').value.trim();
           const phone = document.getElementById('phone').value.trim();
           const destination = document.getElementById('destination').value;
           const packageType = document.getElementById('package').value;
           const tripDate = document.getElementById('trip-date').value;
           const persons = document.getElementById('persons').value.trim();
           const message = document.getElementById('message').value.trim();
           // Validation
           if (name === '') {
               document.getElementById('name-error').textContent = 'Please enter your name';
               isValid = false;
           }
           if (!/^\d{10,15}$/.test(phone)) {
               document.getElementById('phone-error').textContent = 'Enter a valid phone number';
               isValid = false;
           }

           if (destination === '') {
               document.getElementById('destination-error').textContent = 'Select a destination';
               isValid = false;
           }

           if (packageType === '') {
               document.getElementById('package-error').textContent = 'Select a package';
               isValid = false;
           }

           if (tripDate === '') {
               document.getElementById('trip-date-error').textContent = 'Select your trip date';
               isValid = false;
           }

           if (persons === '' || persons <= 0) {
               document.getElementById('persons-error').textContent = 'Enter a valid number of persons';
               isValid = false;
           }

           if (message === '') {
               document.getElementById('message-error').textContent = 'Please write a message';
               isValid = false;
           }

           if (!isValid) return;

           // Send data to PHP
           const formData = new FormData();
           formData.append('name', name);
           formData.append('phone', phone);
           formData.append('destination', destination);
           formData.append('package', packageType);
           formData.append('trip_date', tripDate);
           formData.append('persons', persons);
           formData.append('message', message);

           fetch('mail.php', {
                   method: 'POST',
                   body: formData
               })
               .then(res => res.json())
               .then(data => {
                   Toastify({
                       text: data.message || 'Form submitted successfully!',
                       duration: 3000,
                       backgroundColor: data.status === 'success' ? 'green' : 'red',
                       close: true
                   }).showToast();

                   if (data.status === 'success') {
                       document.getElementById('booking-form').reset();
                   }
               })
               .catch(() => {
                   Toastify({
                       text: 'Something went wrong. Please try again!',
                       duration: 3000,
                       backgroundColor: 'red'
                   }).showToast();
               });
       });
   </script>