/* Shared Online Booking styles define form cards, steps, controls and summary. */
.d2d-back {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent-ink);
  font-size: 14px;
}
.d2d-actions {
  margin: 0;
  padding: 22px 32px;
}
.d2d-return-toggle,
.d2d-tax-toggle {
  margin: 24px 0;
}
[hidden] {
  display: none !important;
}
.field input[type="file"] {
  padding: 12px;
  font-size: 12px;
}
.summary-row .val {
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.d2d-bank {
  padding: 20px;
  border-radius: var(--r-md);
  background: var(--bg-soft);
  margin-bottom: 24px;
}
.d2d-bank h3 {
  font-size: 28px;
  letter-spacing: 0.05em;
  margin: 12px 0;
}
.d2d-photo {
  width: 100%;
  height: 140px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--bg-soft);
  margin-top: 8px;
}
#booking-stepper {
  scroll-margin-top: 85px;
}
@media (max-width: 560px) {
  .d2d-actions {
    padding: 20px;
  }
}

.d2d-attachments {
  margin-top: 32px;
}
.d2d-attachments-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.d2d-attachments-head h3 {
  margin: 0;
  font-size: 22px;
}
.d2d-attachments-head small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted, #83928f);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
}
.d2d-photo-count {
  padding: 10px 16px;
  border-radius: 30px;
  background: #e8f8f5;
  color: #298f85;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.d2d-attachments-hint {
  margin: 20px 0 24px;
  color: var(--text-muted, #6f7e7b);
  line-height: 1.7;
}
.d2d-photo-progress {
  display: block;
  width: 100%;
  height: 6px;
  margin-bottom: 20px;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #edf3f1;
}
.d2d-photo-progress::-webkit-progress-bar {
  background: #edf3f1;
}
.d2d-photo-progress::-webkit-progress-value {
  background: #14afa1;
  border-radius: 8px;
}
.d2d-photo-progress::-moz-progress-bar {
  background: #14afa1;
}
.d2d-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.d2d-photo-slot {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  border: 1.5px dashed #d9e2df;
  border-radius: 24px;
  background: #f7f9f8;
}
.d2d-photo-label {
  color: #637571;
  font-size: 18px;
  font-weight: 600;
}
.d2d-photo-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.d2d-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  padding: 0;
}
.d2d-photo-choose,
.d2d-photo-remove {
  padding: 10px 16px;
  border: 1px solid #c8e7e1;
  border-radius: 12px;
  background: white;
  color: #298f85;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.d2d-photo-remove {
  color: #a63c3c;
  border-color: #e9cccc;
}
.d2d-photo-choose:focus-visible,
.d2d-photo-remove:focus-visible,
.d2d-photo-input:focus-visible + .d2d-photo-choose {
  outline: 3px solid #14afa1;
  outline-offset: 3px;
}
.d2d-photo-preview {
  width: 100%;
  min-height: 0;
  flex: 1;
  object-fit: contain;
  border-radius: 12px;
}
.d2d-photo-slot.has-photo {
  justify-content: flex-start;
}
.d2d-photo-error {
  margin: 0;
  color: #a63c3c;
  font-size: 12px;
  text-align: center;
}
.d2d-photo-error:empty {
  display: none;
}
@media (max-width: 560px) {
  .d2d-photo-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .d2d-attachments-head {
    flex-wrap: wrap;
  }
}

.tax-types {
  display: flex;
  padding: 5px;
  gap: 5px;
  margin-bottom: 20px;
  background: var(--bg-soft, #f5f5f5);
  border-radius: 10px;
}
.tax-types button {
  flex: 1;
  padding: 14px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.tax-types button[aria-pressed="true"] {
  background: var(--bg, white);
  box-shadow: 0 1px 4px #0002;
  font-weight: 600;
}
.tax-types button:focus-visible {
  outline: 2px solid var(--accent, #14afa1);
  outline-offset: 2px;
}
#tax-address-fields {
  margin-top: 20px;
}

/* -------------------------------------------------------------
   Payment Step Redesign (PromptPay QR & Checkout Grid)
------------------------------------------------------------- */
.payment-step {
  margin: 28px 0 64px;
}
.payment-header {
  margin-bottom: 28px;
  text-align: left;
}
.payment-header .pagehead-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-ink);
  font-weight: 600;
  margin-bottom: 8px;
}
.payment-header h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  line-height: 1.2;
}
.payment-header p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.payment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 420px);
  gap: 28px;
  align-items: start;
}

/* Left Column: Summary Card */
.payment-summary-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.summary-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.summary-card-title .card-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}
.summary-card-title h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.booking-ref-chip {
  text-align: right;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  padding: 8px 12px;
  border-radius: 10px;
}
.booking-ref-chip .lbl {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.booking-ref-chip strong {
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.confirm-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 14px;
}
.confirm-row:last-child {
  border-bottom: none;
}
.confirm-row .lbl {
  color: var(--muted);
  font-weight: 500;
  min-width: 110px;
}
.confirm-row .val {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}

.summary-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.btn-danger-soft {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.18);
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 13px;
  transition: background 0.2s;
  cursor: pointer;
}
.btn-danger-soft:hover {
  background: rgba(220, 38, 38, 0.15);
}

/* Right Column: Checkout Card */
.payment-checkout-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 88px;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.checkout-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-ink);
  animation: status-pulse-anim 1.8s infinite;
}
@keyframes status-pulse-anim {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  transition: background 0.3s, color 0.3s;
}
.countdown-badge strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.countdown-badge.urgent {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.countdown-badge.urgent strong {
  color: #b91c1c;
}

.payment-status-message {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0;
  line-height: 1.5;
}
.payment-error-text {
  color: var(--danger);
  font-size: 13px;
  margin: 4px 0;
  min-height: 18px;
}

.checkout-form-area {
  margin: 18px 0;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
}
.payment-qr {
  width: 260px;
  max-width: 100%;
  padding: 14px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.payment-qr img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.payment-form-wrap {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.payment-form-wrap form {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* KBank Inline QR Container Override */
.payment-container[_kpayment],
body .payment-container[_kpayment] {
  position: static !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 340px !important;
  min-height: 480px !important;
  background: #fff !important;
  /* border: 1px solid var(--line) !important; */
  border-radius: 16px !important;
  /* box-shadow: var(--shadow-sm) !important; */
  /* margin: 0 auto !important; */
  overflow: hidden !important;
  z-index: 1 !important;
}
.payment-container[_kpayment] iframe,
body .payment-container[_kpayment] iframe {
  border: none !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 880px !important;
  border-radius: 14px !important;
  background: #fff !important;
  display: block !important;
}
body.scroll-y-hidden {
  overflow: auto !important;
}

.btn-check-status {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 12px;
}

@media (max-width: 840px) {
  .payment-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .payment-checkout-card {
    order: 1;
    position: static;
  }
  .payment-summary-card {
    order: 2;
  }
}

@media (max-width: 560px) {
  .payment-summary-card,
  .payment-checkout-card {
    padding: 20px;
  }
  .summary-card-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .booking-ref-chip {
    text-align: left;
    width: 100%;
  }
}

