/* Google Fonts Import */
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap");

/* Global Styles */
body {
  background-image: url("grain.jpg");
  background-size: cover;
  margin: 0;
  font-family: "Roboto", sans-serif;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.fade {
  transition: opacity 0.5s ease;
}

#mainContent {
  text-align: center;
  padding-top: 80px;
}

.title {
  font-size: 3rem;
  font-weight: bold;
  color: black;
  margin-bottom: 20px;
}

.highlight {
  background-color: lightblue;
  padding: 5px 10px;
  border-radius: 5px;
  color: rgb(0, 104, 139);
}

/* SEGMENT 1 BUTTONS */
.button-container {
  display: flex;
  width: 350px;
  height: 45px;
  border: 1px solid lightblue;
  border-radius: 10px;
  overflow: hidden;
  margin: 25px auto 20px;
}

.button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 500;
  color: white;
  background-color: rgba(10, 84, 108, 0.5);
  padding: 10px;
  transition: background-color 0.3s, opacity 0.2s, transform 0.18s;
  cursor: pointer;
  text-transform: none;
  opacity: 0.7;
  user-select: none;
  pointer-events: auto;
}

.button.active,
.button.selected {
  background-color: rgba(10, 84, 108, 0.9);
  opacity: 1;
}

.button:not(:last-child) {
  border-right: 1px solid lightblue;
}

.info-section {
  font-size: 1rem;
  color: black;
  margin-top: 40px;
}

.info-section a {
  text-decoration: underline;
  color: rgb(255, 255, 255);
  font-weight: bold;
}

.gradient-icon {
  width: 100px;
  height: auto;
  margin: 0 auto 10px;
  filter: brightness(0) saturate(100%) invert(100%);
}

/* SEGMENT 1 CARD STYLES */
.card-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 5vh;
}

.card {
  width: 250px;
  height: 220px;
  border: 1px solid lightblue;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  background-color: rgba(10, 84, 108, 0.5);
  padding: 20px;
  box-shadow: inset 0 0 30px 5px rgba(0, 104, 139, 0.9),
              inset 0 0 15px 3px rgba(173, 216, 230, 0.9);
  text-align: center;
  transition: box-shadow 0.3s, background-color 0.3s, transform 0.18s, opacity 0.18s;
  cursor: pointer;
  opacity: 0.7;
}

.card.selected,
.card:active {
  background-color: rgba(10, 84, 108, 0.85);
  opacity: 1;
  box-shadow: 0 0 0 2px #ffe066, 0 0 30px 5px #00688b;
}

.card:hover {
  opacity: 1;
  transform: scale(1.035);
  background-color: rgba(10, 84, 108, 0.75);
  z-index: 2;
}

.card img {
  margin: 5px 0;
}

.card img.sedan {
  width: 200px;
  height: auto;
}

.card img.suv {
  width: 170px;
  height: auto;
}

.card img.truck {
  width: 180px;
  height: auto;
}

.card p {
  font-size: 1rem;
  font-weight: normal;
  margin-bottom: 10px;
}

.continue-button {
  margin: 80px auto;
  display: block;
  width: 220px;
  height: 45px;
  border: 1px solid grey;
  border-radius: 10px;
  background-color: grey;
  color: white;
  font-size: 1.3rem;
  font-weight: bold;
  box-shadow: inset 0 0 10px grey, inset 0 0 5px grey;
  text-align: center;
  line-height: 45px;
  transition: all 0.3s ease-in-out;
  cursor: not-allowed;
}

.continue-button.enabled {
  background-color: rgba(10, 84, 108, 0.5);
  border: 1px solid lightblue;
  box-shadow: inset 0 0 30px 5px rgba(0, 104, 139, 0.9),
              inset 0 0 15px 3px rgba(173, 216, 230, 0.9);
  cursor: pointer;
}

.continue-button.enabled:hover {
  background-color: rgba(10, 84, 108, 0.75);
  transform: scale(1.05);
}

/* SEGMENT 2: REWORKED CARDS */
#secondaryContent .card-container {
  gap: 20px;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  display: none;
  margin-top: 120px;
  transition: opacity 0.5s cubic-bezier(0.56, 0.07, 0.58, 1.02);
}

#secondaryContent .card-container.visible {
  opacity: 1;
  pointer-events: all;
  display: flex;
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#secondaryContent .seg2-card {
  width: 250px;
  min-height: 220px;
  border: 1px solid lightblue;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  font-size: 14px;
  font-weight: normal;
  color: white;
  background-color: rgba(10, 84, 108, 0.5);
  padding: 0;
  box-shadow: inset 0 0 30px 5px rgba(0, 104, 139, 0.9),
              inset 0 0 15px 3px rgba(173, 216, 230, 0.9);
  text-align: left;
  transition: box-shadow 0.3s, background 0.3s, transform 0.18s, opacity 0.18s;
  cursor: pointer;
  overflow: hidden;
  margin-bottom: 0;
  opacity: 0.7;
}

#secondaryContent .seg2-card.selected,
#secondaryContent .seg2-card:active {
  background-color: rgba(10, 84, 108, 0.85);
  opacity: 1;
  box-shadow: 0 0 0 2px #ffe066, 0 0 30px 5px #00688b;
  z-index: 2;
}

#secondaryContent .seg2-card:hover {
  opacity: 1;
  transform: scale(1.035);
  background-color: rgba(10, 84, 108, 0.75);
  z-index: 2;
}

.seg2-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px 16px;
  border-bottom: 1px solid #b2c9db;
  background: none;
}

.seg2-card-title {
  color: #ffe066;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.seg2-price {
  color: #ffe066;
  font-size: 16px;
  font-weight: bold;
  margin-left: 8px;
  margin-right: 0;
  min-width: 78px;
  text-align: right;
}

.seg2-card-description {
  padding: 15px 16px;
  margin: 0;
  flex-grow: 1;
  line-height: 1.4;
}

.seg2-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 0 0 10px 10px;
  flex: 1;
}

.seg2-feature-list li {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #b2c9db;
  height: 42px;
  font-size: 14px;
  padding: 0;
  background: transparent;
  position: relative;
}

.seg2-feature-list li:last-child {
  border-bottom: none;
}

.seg2-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 32px;
  min-width: 32px;
  border-right: 1px solid #b2c9db;
  margin-right: 12px;
  font-size: 16px;
}

.tick {
  color: #25d366;
  font-weight: bold;
}

.cross {
  color: #f44336;
  font-weight: bold;
}

#secondaryContent {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  opacity: 0;
  z-index: 1000;
  background-image: url("grain.jpg");
  background-size: cover;
  background-position: center;
}

#secondaryContent.active {
  display: flex;
  opacity: 1;
  transition: opacity 0.5s ease;
}

#seg2RelativeWrap {
  position: relative;
  width: 100vw;
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#backButton {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 32px;
  font-weight: bold;
  color: black;
  cursor: pointer;
  user-select: none;
  z-index: 10;
}

/* SEG2 BUTTON CONTAINER */
#seg2ButtonContainer {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  width: 350px;
  height: 45px;
  border: 1px solid lightblue;
  border-radius: 10px;
  overflow: hidden;
  background: none;
  z-index: 2;
  transition: top 0.5s cubic-bezier(0.56, 0.07, 0.58, 1.02),
              transform 0.5s cubic-bezier(0.56, 0.07, 0.58, 1.02);
}

#seg2ButtonContainer.moved-up-more {
  top: calc(50% - 175px);
}
#seg2ButtonContainer.moved-interior {
  top: calc(50% - 175px);
}
#seg2ButtonContainer.moved-int-ext {
  top: calc(50% - 175px);
}
#seg2ButtonContainer.moved {
  top: calc(50% - 170px);
}

#seg2TitleContainer {
  position: absolute;
  left: 50%;
  top: calc(50% - 240px);
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#seg2TitleContainer.visible {
  opacity: 1;
}

#selectedCarType {
  color: white;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 8px;
  display: none;
}

#seg2ButtonContainer .seg2button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 500;
  color: white;
  background-color: rgba(10, 84, 108, 0.5);
  cursor: pointer;
  text-transform: none;
  transition: background-color 0.3s;
  border: none;
  outline: none;
  height: 100%;
}

#seg2ButtonContainer .seg2button:not(:last-child) {
  border-right: 1px solid lightblue;
}

#seg2ButtonContainer .seg2button.active {
  background-color: rgba(10, 84, 108, 0.9);
}

#seg2CardColumn {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100vw;
  margin-top: 0;
}

/* Segment 2 continue button */
#seg2ContinueButton {
  opacity: 0;
  pointer-events: none;
  margin-top: 30px;
  transition: opacity 0.3s, background 0.3s, color 0.3s;
  background-color: grey !important;
  color: #eee;
}

#seg2ContinueButton.visible {
  opacity: 0.4;
}

#seg2ContinueButton.enabled {
  opacity: 1;
  pointer-events: all;
  background-color: rgba(10, 84, 108, 0.5) !important;
  border: 1px solid lightblue;
  color: #fff;
  cursor: pointer;
}

#seg2ContinueButton.enabled:hover {
  background-color: rgba(10, 84, 108, 0.75) !important;
  transform: scale(1.05);
}

/* NEW MOBILE OVERRIDES for SEGMENT 2 & SEGMENT 3 */
@media (max-width: 900px) {
  #secondaryContent .card-container {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    padding-top: 5vh;
    overflow-y: auto;
    height: 80vh;
    scrollbar-width: none;
  }
  #secondaryContent .card-container::-webkit-scrollbar {
    display: none;
  }

  .card-container {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .button-container {
    width: 90%;
    max-width: 350px;
  }

  .card {
    width: 90%;
    max-width: 250px;
  }
  
  #secondaryContent .seg2-card {
    width: 250px;
    min-height: auto;
    height: auto;
    overflow: visible;
  }
  
  .user-details .input-group {
    margin-bottom: 15px;
  }
  
  .user-details .input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 1rem;
    color: #eee;
  }
  
  .user-details .input-group input {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #b2c9db;
    border-radius: 5px;
    background-color: #fff;
    color: #333;
  }

  #seg2ButtonContainer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  #seg2ButtonContainer.moved-up-more,
  #seg2ButtonContainer.moved-interior,
  #seg2ButtonContainer.moved-int-ext,
  #seg2ButtonContainer.moved {
    top: calc(50% - 45%);
  }
}

/* Universal styling for the customer details form */
.user-details {
  margin: 20px 0;
}

.user-details .input-group {
  margin-bottom: 15px;
}

.user-details .input-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 1rem;
  color: #222;
}

.user-details .input-group input {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #b2c9db;
  border-radius: 5px;
  background-color: #fff;
  color: #333;
}

/* ----------- SEGMENT 3 SIDEBAR (APPLE-STYLE CHECKOUT) ------------ */
#seg3Sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 100vw;
  min-width: 320px;
  max-width: 480px;
  height: 100vh;
  background: #1d2530;
  box-shadow: -8px 0 36px 0 rgba(0, 104, 139, 0.32),
              0 0 30px 5px #1d3557 inset;
  border-left: 2px solid #b2c9db;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.65s cubic-bezier(0.66, 0.13, 0.38, 1.06), opacity 0.47s;
  font-family: "Roboto", sans-serif;
}

#seg3Sidebar.visible {
  transform: translateX(0);
  opacity: 1;
}

#seg3Sidebar .seg3-header {
  font-size: 2.2rem;
  font-weight: 600;
  color: #fff;
  background: #1d2027;
  border-bottom: 1.5px solid #b2c9db;
  padding: 30px 40px 18px 40px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#seg3Sidebar .seg3-x {
  font-size: 2.3rem;
  color: #ddeeff;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 12px;
  font-weight: bold;
  transition: color 0.18s;
  line-height: 1;
}

#seg3Sidebar .seg3-x:hover {
  color: #ffe066;
}

#seg3Sidebar .seg3-content {
  padding: 38px 44px 30px 44px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

#seg3Sidebar .summary-section,
#seg3Sidebar .addons-section,
#seg3Sidebar .total-section {
  background: #232d3b;
  border-radius: 16px;
  padding: 20px 20px 18px;
  margin-bottom: 10px;
  box-shadow: 0 3px 22px #00688bbb inset;
}

#seg3Sidebar .summary-section .summary-title {
  font-size: 1.18rem;
  color: #ffe066;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

#seg3Sidebar .summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 1.08rem;
  color: #fff;
}

#seg3Sidebar .summary-row strong {
  color: #ffe066;
}

#seg3Sidebar .addons-section .addons-title {
  font-size: 1.08rem;
  color: #b2c9db;
  font-weight: 600;
  margin-bottom: 13px;
  letter-spacing: 0.01em;
}

#seg3Sidebar .addon-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

#seg3Sidebar .addon-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #31415a;
  padding: 12px 0;
  font-size: 1.04rem;
  color: #fff;
}

#seg3Sidebar .addon-item:last-child {
  border-bottom: none;
}

#seg3Sidebar .addon-label {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

#seg3Sidebar .addon-checkbox {
  accent-color: #ffe066;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  margin-right: 9px;
}

#seg3Sidebar .addon-price {
  color: #ffe066;
  font-weight: 500;
  font-size: 1.02rem;
  min-width: 50px;
  text-align: right;
}

#seg3Sidebar .total-section {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: #202833;
  border: 2px solid #ffe066;
  font-size: 1.28rem;
  color: #ffe066;
  padding: 18px 20px;
  box-shadow: 0 0 0 2px #ffe066, 0 0 15px 0 #00688b;
}

#seg3Sidebar .total-label {
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-right: 14px;
}

#seg3Sidebar .total-value {
  font-size: 1.65rem;
  font-weight: bold;
  margin-left: 10px;
  color: #ffe066;
}

#seg3Sidebar .checkout-btn {
  margin-top: 28px;
  background: linear-gradient(90deg, #ffe066 0%, #ffe799 100%);
  color: #254160;
  border: none;
  border-radius: 11px;
  font-size: 1.2rem;
  font-weight: bold;
  padding: 16px 0;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 2px 10px #ffe06633;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.02em;
}

#seg3Sidebar .checkout-btn:hover {
  background: linear-gradient(90deg, #ffe799 0%, #ffe066 100%);
  color: #0a546c;
}

/* ========= Moved from Inline Script ========= */

/* Input styles for seg3Sidebar user details */
#seg3Sidebar .user-details input {
  color: white !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  padding: 8px 12px !important;
}

#seg3Sidebar .user-details input::placeholder {
  color: rgba(255, 255, 255, 0.6) !important;
}

#seg3Sidebar .input-group label {
  color: white !important;
  margin-bottom: 4px !important;
  display: block !important;
}

#seg3Sidebar .user-details input:focus {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  outline: none !important;
}

#seg3Sidebar .input-group {
  margin-bottom: 16px !important;
}

/* Styles for the Calendar Modal */
#calendarModal {
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-backdrop {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
}

.calendar-modal-content {
  position: relative;
  background: #1b263b;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
  padding: 32px 20px 24px 20px;
  min-width: 290px;
  min-height: 220px;
  z-index: 10;
}

.calendar-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.2rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.calendar-close-btn {
  font-size: 2rem;
  font-weight: bold;
  color: #ffe066;
  cursor: pointer;
}

#calendarForm label {
  font-size: 1rem;
  font-weight: 500;
}

#calendarForm input[type="date"],
#calendarForm select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #b2c9db;
  font-size: 1rem;
  margin-top: 3px;
  margin-bottom: 3px;
  background: #fff;
  color: #222;
}

#calendarForm select[disabled] {
  color: #888;
}

#calendarForm button.calendar-confirm-btn {
  margin-top: 10px;
  background: #ffe066;
  color: #1b263b;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

#calendarForm button.calendar-confirm-btn:hover {
  background: #f9dc4a;
}


/* Styles for the Square Payment Modal */
#squareModal {
  position: fixed;
  z-index: 100000;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

#squareModal.show {
  opacity: 1;
}

.square-backdrop {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
}

.square-modal-content {
  position: relative;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  min-width: 300px;
  z-index: 100001;
  text-align: center;
}

.square-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.square-close-btn {
  font-size: 2rem;
  cursor: pointer;
  color: #444;
}

/* Styles for the Payment Modal */
#paymentModal {
  position: fixed;
  z-index: 999999;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
}

.payment-backdrop {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
}

.payment-modal-content {
  position: relative;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  min-width: 400px;
  max-width: 500px;
  width: 90%;
  z-index: 1000000;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
  border: 2px solid #00688b;
}

.payment-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.2rem;
  margin-bottom: 20px;
  font-weight: 600;
  color: #333;
}

.payment-close-btn {
  font-size: 2rem;
  cursor: pointer;
  color: #666;
  transition: color 0.3s;
}

.payment-close-btn:hover {
  color: #333;
}

#paymentForm {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#paymentForm .input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#paymentForm .input-row {
  display: flex;
  gap: 15px;
}

#paymentForm .input-row .input-group {
  flex: 1;
}

#paymentForm label {
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

#paymentForm input {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#paymentForm input:focus {
  outline: none;
  border-color: #00688b;
  box-shadow: 0 0 0 2px rgba(0, 104, 139, 0.2);
}

.payment-confirm-btn {
  background: linear-gradient(90deg, #ffe066 0%, #ffe799 100%);
  color: #254160;
  border: none;
  border-radius: 8px;
  padding: 15px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  margin-top: 10px;
  box-shadow: 0 2px 10px rgba(255, 224, 102, 0.3);
}

.payment-confirm-btn:hover {
  background: linear-gradient(90deg, #ffe799 0%, #ffe066 100%);
  transform: translateY(-1px);
}

.payment-confirm-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

#payment-status {
  margin-top: 15px;
  padding: 12px;
  border-radius: 6px;
  text-align: center;
  font-weight: 500;
  min-height: 20px;
}

#payment-status:not(:empty) {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
}

/* Responsive Booking Modal styles for #bookingModal (populated by [`finalizeBooking`](script.js)) */
/* --- FIX: ensure overlay element (.bm-overlay) is styled and panel is centered/above everything --- */
#bookingModal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 120000;
  /* keep a neutral backdrop on the container as a fallback */
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Improved Booking Modal UI ---------- */
/* Show when .visible OR aria-hidden="false" (script toggles visible + aria) */
#bookingModal.visible,
#bookingModal[aria-hidden="false"] {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Base container / overlay */
#bookingModal {
  position: fixed;
  inset: 0;
  display: none; /* toggled via .visible or aria-hidden */
  z-index: 120000;
  -webkit-tap-highlight-color: transparent;
}

/* dark translucent backdrop with slight blur */
#bookingModal .bm-overlay,
#bookingModal #bmOverlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 18, 0.6);
  backdrop-filter: blur(3px) saturate(110%);
  z-index: 120000;
  pointer-events: auto;
}

/* Centered panel above overlay */
#bookingModal .bm-panel {
  position: relative;
  z-index: 120001;
  width: min(92%, 760px);
  max-height: 88vh;
  overflow: auto;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,249,253,1));
  box-shadow: 0 30px 60px rgba(2,6,23,0.6);
  padding: 16px;
  box-sizing: border-box;
  transition: transform 220ms ease, opacity 180ms ease;
  transform: translateY(0);
  margin: 24px;
}

/* layout inside panel */
#bookingModal .bm-body {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 18px;
}

/* badge/check */
.bm-badge { flex: 0 0 88px; display:flex; align-items:center; justify-content:center; }
.bm-check {
  width:64px;height:64px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:var(--success,#16a34a); color:#fff; font-weight:700; font-size:28px;
  box-shadow: 0 8px 24px rgba(16,185,129,0.14);
}

/* content area */
#bookingModal .bm-content { flex:1; min-width:0; }
#bookingModal h2 { margin:0 0 8px 0; font-size:1.25rem; color:#0b1220; font-weight:700; }
#bookingModal .bm-sub { margin:0 0 14px 0; color:var(--muted,#6b7280); line-height:1.4; }

/* info grid */
#bookingModal .bm-grid { display:flex; gap:12px; flex-wrap:wrap; margin-top:6px; }
#bookingModal .detail { flex:1 1 45%; min-width:140px; background: rgba(11,17,24,0.03); padding:10px 12px; border-radius:10px; }
.k { font-size:0.82rem; color:var(--muted,#6b7280); margin-bottom:6px; }
.v { font-weight:700; color:#0b1220; }

/* status block aligned top-right inside info area */
#bookingModal .bm-info { display:flex; justify-content:space-between; align-items:center; gap:12px; }

/* actions row */
#bookingModal .bm-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:14px; width:100%; }
#bookingModal .bm-actions .btn { padding:10px 16px; border-radius:10px; font-weight:600; cursor:pointer; border:0; }
#bookingModal .bm-actions .btn-primary { background: linear-gradient(180deg,var(--accent,#0f63d6),#0747a6); color:#fff; box-shadow:0 8px 20px rgba(11,99,214,0.12); }

/* close button: small pill in panel corner for better visibility */
.bm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.9);
  border: 0;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 16px;
  cursor: pointer;
  z-index:120002;
  box-shadow: 0 6px 18px rgba(2,6,23,0.12);
}

/* responsive: stack and full-width actions on small screens */
@media (max-width: 720px) {
  #bookingModal .bm-panel { width: calc(100% - 32px); padding: 12px; margin: 12px; }
  #bookingModal .bm-body { flex-direction: column; padding: 12px; gap: 12px; }
  .bm-badge { margin: 0 auto; }
  #bookingModal .bm-grid { flex-direction: column; }
  #bookingModal .detail { width: 100%; }
  #bookingModal .bm-actions { flex-direction: column-reverse; align-items: stretch; }
  #bookingModal .bm-actions .btn { width: 100%; }
}

/* small polish */
#bookingModal .detail + .detail { margin-top: 0; }
#bookingModal .bm-content p { margin: 0; }

/* ensure other modals keep precedence */
#bookingModal, #bookingModal * { box-sizing: border-box; }