/* ============================================================
   INSPECTCAR INTERACTIVE BOOKING FLOW & CALENDAR STYLES
   (100% Mobile Compatible Across All Phone Sizes & iOS Safari)
   ============================================================ */

/* Modal Backdrop */
.booking-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* Mobile Dynamic Viewport Height */
  background: rgba(6, 6, 10, 0.96);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 16px;
  transform: translateZ(0);
  box-sizing: border-box;
}

.booking-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Container */
.booking-modal-container {
  width: min(860px, 100%);
  max-height: 90vh;
  max-height: 90dvh;
  background: #121219;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.booking-modal-overlay.active .booking-modal-container {
  transform: scale(1);
}

/* Modal Header */
.booking-modal-header {
  padding: 16px 24px;
  background: #171722;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.booking-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.booking-modal-title img {
  height: 28px;
  width: auto;
}

.booking-modal-title h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  margin: 0;
}

.booking-modal-title h3 span {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.booking-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* Progress Steps Bar */
.booking-progress-wrapper {
  padding: 12px 20px;
  background: #14141D;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.booking-steps-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.booking-steps-bar::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.booking-progress-fill {
  position: absolute;
  top: 15px;
  left: 15px;
  height: 2px;
  background: var(--accent-grad);
  z-index: 2;
  transition: width 0.3s ease;
  width: 0%;
}

.step-node {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #171720;
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.step-node.active .step-circle {
  background: var(--accent-1);
  border-color: var(--accent-3);
  color: #fff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.step-node.completed .step-circle {
  background: #10b981;
  border-color: #34d399;
  color: #fff;
}

.step-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-faint);
}

.step-node.active .step-label {
  color: var(--accent-3);
}

.step-node.completed .step-label {
  color: #34d399;
}

/* Modal Body */
.booking-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}

.booking-modal-body::-webkit-scrollbar {
  width: 5px;
}
.booking-modal-body::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 10px;
}

.booking-step-content {
  display: none;
}

.booking-step-content.active {
  display: block;
}

.step-heading {
  margin-bottom: 16px;
}

.step-heading h4 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.step-heading p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

/* STEP 1: PACKAGE CARDS */
.booking-package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.booking-package-card {
  background: #171722;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  position: relative;
}

.booking-package-card.selected {
  border-color: var(--accent-2);
  background: rgba(139, 92, 246, 0.12);
}

.pkg-radio {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.booking-package-card.selected .pkg-radio {
  border-color: var(--accent-3);
  background: var(--accent-2);
}

.booking-package-card.selected .pkg-radio::after {
  content: "✓";
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.pkg-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-3);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.booking-package-card.selected .pkg-badge {
  background: var(--accent-grad);
  color: #fff;
}

.pkg-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.pkg-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent-3);
  margin-bottom: 12px;
}

.pkg-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pkg-features li {
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pkg-features li i {
  color: #34d399;
}

/* STEP 2: VEHICLE DETAILS */
.brand-chips-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.brand-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.brand-chip {
  padding: 8px 14px;
  border-radius: 12px;
  background: #171722;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-chip.selected {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  background: #171722;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-2);
}

.form-select option {
  background: #171720;
  color: #fff;
}

/* STEP 3: INTERACTIVE CALENDAR & TIME SLOTS */
.calendar-time-container {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}

.calendar-card {
  background: #171722;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-month-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.calendar-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
}

.calendar-day-cell.today {
  border: 1px solid var(--accent-3);
  color: var(--accent-3);
  font-weight: 800;
}

.calendar-day-cell.selected {
  background: var(--accent-grad) !important;
  color: #fff !important;
  font-weight: 800;
}

.calendar-day-cell.disabled {
  opacity: 0.2;
  cursor: not-allowed;
  background: transparent;
}

.time-slots-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slots-group-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-3);
  display: flex;
  align-items: center;
  gap: 5px;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.time-slot-pill {
  padding: 8px 10px;
  border-radius: 10px;
  background: #171722;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.time-slot-pill span.sub {
  font-size: 9px;
  color: #34d399;
}

.time-slot-pill.selected {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
}

.time-slot-pill.selected span.sub {
  color: #e0e7ff;
}

.time-slot-pill.booked,
.time-slot-pill.disabled {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(239, 68, 68, 0.25);
  color: #666;
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.time-slot-pill.booked span.sub,
.time-slot-pill.disabled span.sub {
  color: #ef4444 !important;
  font-weight: 700;
}

.slot-notice-badge {
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  color: #34d399;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hidden {
  display: none !important;
}

/* GOOGLE MAPS LOCATION AUTOCOMPLETE & BADGES */
.gmaps-suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: #161625;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 10px;
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.gmaps-suggestions-dropdown.hidden,
#gmapsSuggestions.hidden {
  display: none !important;
}

.gmaps-suggestion-item {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: #F4F4F6;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}

.gmaps-suggestion-item:last-child {
  border-bottom: none;
}

.gmaps-suggestion-item:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
}

.gmaps-suggestion-item i {
  color: #6366F1;
  font-size: 13px;
}

/* STEP 4: LOCATION & CONTACT */
.location-type-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.location-type-btn {
  padding: 10px;
  border-radius: 10px;
  background: #171722;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.location-type-btn.selected {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
}

/* STEP 5: CONFIRMATION & REVIEW */
.summary-container {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}

.booking-summary-card {
  background: #171722;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12.5px;
}

.summary-row .label {
  color: var(--text-muted);
}

.summary-row .value {
  color: #fff;
  font-weight: 700;
  text-align: right;
}

.summary-row.total-row {
  border-bottom: none;
  padding-top: 12px;
  font-size: 15px;
}

.summary-row.total-row .value {
  color: var(--accent-3);
  font-size: 20px;
  font-weight: 800;
}

.promo-box {
  display: flex;
  gap: 6px;
  margin: 12px 0;
}

.promo-input {
  flex-grow: 1;
  padding: 8px 12px;
  background: #171722;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
}

.apply-promo-btn {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 11.5px;
  cursor: pointer;
}

.promo-status {
  font-size: 11px;
  margin-top: -4px;
  margin-bottom: 8px;
}
.promo-status.success { color: #34d399; }
.promo-status.error { color: #f87171; }

.payment-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.payment-choice-card {
  padding: 12px;
  border-radius: 10px;
  background: #171722;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.payment-choice-card.selected {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-2);
}

.payment-choice-card h5 {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.payment-choice-card p {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* SUCCESS VIEW */
.booking-success-view {
  text-align: center;
  padding: 16px 8px;
}

.success-icon-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.ref-code-box {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px dashed var(--accent-3);
  border-radius: 20px;
  font-family: monospace;
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-3);
  letter-spacing: 1px;
  margin: 10px 0 16px;
}

.success-actions-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn-whatsapp-confirm {
  padding: 10px 18px;
  border-radius: 10px;
  background: #25D366;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.btn-cal-sync {
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

/* Modal Footer & Buttons - ALWAYS VISIBLE STICKY FOOTER ON MOBILE */
.booking-modal-footer {
  padding: 14px 24px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: #14141D;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 10;
}

.booking-btn-prev {
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.booking-btn-next {
  padding: 12px 26px;
  border-radius: 12px;
  background: var(--accent-grad);
  border: none;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.4);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Hide Floating WhatsApp when booking modal is open */
body.modal-open .floating-whatsapp {
  display: none !important;
}

/* =====================================================================
   FULL MOBILE RESPONSIVE REDESIGN (SMALL PHONES 320PX - 768PX)
===================================================================== */
@media (max-width: 768px) {
  .booking-modal-overlay {
    padding: 0;
    align-items: flex-end; /* Mobile Bottom Sheet / Drawer */
  }

  .booking-modal-container {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 20px 20px 0 0;
    border: none;
    border-top: 1px solid rgba(139, 92, 246, 0.3);
  }

  .booking-modal-header {
    padding: 14px 18px;
  }

  .booking-modal-title h3 {
    font-size: 16px;
  }

  .booking-progress-wrapper {
    padding: 10px 14px;
  }

  .booking-steps-bar .step-label {
    display: none; /* Hide text step labels on small phones to prevent overflow */
  }

  .step-circle {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .booking-modal-body {
    padding: 16px;
  }

  .step-heading h4 {
    font-size: 16px;
  }

  .step-heading p {
    font-size: 12px;
  }

  /* Single Column Stack for Mobile */
  .calendar-time-container, .summary-container {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .location-type-selector {
    grid-template-columns: 1fr;
  }

  .location-type-btn {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding: 10px;
  }

  .booking-package-grid {
    grid-template-columns: 1fr;
  }

  .booking-modal-footer {
    padding: 12px 16px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .booking-btn-prev {
    padding: 10px 16px;
    font-size: 12.5px;
  }

  .booking-btn-next {
    padding: 10px 20px;
    font-size: 13px;
  }
}
