// Refund link click
document.querySelector(".refund-link").addEventListener("click", (e) => {
  e.preventDefault();
  alert("Refund policy page will open here.");
});

// DOM loaded
window.addEventListener("DOMContentLoaded", () => {
  const data = JSON.parse(localStorage.getItem("bookingData"));

  if (data) {
    const services =
      data.services && data.services.length
        ? data.services.join(", ")
        : "No service selected";

    const subtitle = document.querySelector(".subtitle");

    subtitle.innerHTML = `
      Hello ${data.name || "User"},<br>
      You have booked: <b>${services}</b><br>
      Mobile: ${data.mobile || "-"}<br>
      City: ${data.city || "-"}<br>
      Address: ${data.address || "-"}
    `;
  }
});

// Continue button (restart flow)
document.querySelector(".continue-btn").addEventListener("click", () => {
  window.location.href = "./html/page7.html";
});

// Page1 reopen after 5-6 sec 


setTimeout(function () {
  window.location.href = "page7.html"; 
}, 3000); 
