/* In-page checkout modal wizard */
#checkoutModal .checkout-modal-dialog {
  max-width: 42rem;
  margin: 0.75rem auto;
  max-height: calc(100dvh - 1.5rem);
  height: auto;
}

#checkoutModal .checkout-modal-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 1.5rem);
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--bs-body-bg, #fff);
  box-shadow: 0 1.25rem 3rem rgba(15, 23, 42, 0.18);
}

#checkoutModal .checkout-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem 0.65rem;
  flex-shrink: 0;
}

#checkoutModal .checkout-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
  line-height: 1.3;
}

#checkoutModal .checkout-modal-subtitle {
  font-size: 0.8125rem;
  color: var(--bs-secondary-color, #6c757d);
  max-width: 36rem;
}

#checkoutModal .checkout-modal-close {
  margin-top: 0.15rem;
}

#checkoutModal .checkout-modal-stepper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 1.35rem 0.75rem;
  flex-shrink: 0;
}

#checkoutModal .cm-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  opacity: 0.45;
}

#checkoutModal .cm-step span {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bs-secondary-bg, #e9ecef);
  color: var(--bs-body-color, #212529);
  flex-shrink: 0;
}

#checkoutModal .cm-step em {
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#checkoutModal .cm-step.is-active,
#checkoutModal .cm-step.is-done {
  opacity: 1;
}

#checkoutModal .cm-step.is-active span,
#checkoutModal .cm-step.is-done span {
  background: var(--bs-primary, #0d6efd);
  color: #fff;
}

#checkoutModal .cm-step-line {
  flex: 1;
  height: 2px;
  background: var(--bs-border-color, #dee2e6);
  min-width: 0.75rem;
}

/* Scrollable middle — this is what was broken */
#checkoutModal .checkout-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.35rem 1.35rem 1.1rem;
  position: relative;
}

#checkoutModal .checkout-modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 8rem;
}

#checkoutModal .checkout-modal-alert {
  margin-bottom: 0.75rem;
}

#checkoutModal .checkout-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.85rem 1.35rem 1.1rem;
  border-top: 1px solid var(--bs-border-color, #dee2e6);
  flex-shrink: 0;
  background: var(--bs-body-bg, #fff);
}

#checkoutModal .checkout-modal-footer #checkoutModalBack:not([hidden]) {
  margin-right: auto;
}

#checkoutModal .checkout-modal-footer .btn {
  min-width: 7rem;
}

#checkoutModal .cm-plans {
  display: grid;
  gap: 0.75rem;
}

#checkoutModal .cm-plan {
  text-align: left;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.85rem;
  padding: 1rem 1.1rem;
  background: transparent;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  position: relative;
}

#checkoutModal .cm-plan:hover:not(:disabled) {
  border-color: var(--bs-primary, #0d6efd);
}

#checkoutModal .cm-plan.is-selected {
  border-color: var(--bs-primary, #0d6efd);
  box-shadow: 0 0 0 1px var(--bs-primary, #0d6efd);
  background: color-mix(in srgb, var(--bs-primary, #0d6efd) 6%, transparent);
}

#checkoutModal .cm-plan:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#checkoutModal .cm-plan-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

#checkoutModal .cm-plan-name {
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
}

#checkoutModal .cm-plan-price {
  font-weight: 800;
  font-size: 1.05rem;
  white-space: nowrap;
}

#checkoutModal .cm-plan-price small {
  font-weight: 500;
  font-size: 0.75rem;
  opacity: 0.7;
}

#checkoutModal .cm-plan-desc {
  font-size: 0.8125rem;
  color: var(--bs-secondary-color, #6c757d);
  margin: 0 0 0.65rem;
}

#checkoutModal .cm-plan-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bs-primary, #0d6efd);
  color: #fff;
  margin-bottom: 0.4rem;
}

#checkoutModal .cm-plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

#checkoutModal .cm-plan-features li {
  font-size: 0.8125rem;
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
}

#checkoutModal .cm-plan-features li.is-off {
  opacity: 0.45;
  text-decoration: line-through;
}

#checkoutModal .cm-billing .form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

#checkoutModal .cm-billing .form-control,
#checkoutModal .cm-billing .form-select {
  min-height: 2.5rem;
}

#checkoutModal .cm-summary-card {
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.85rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

#checkoutModal .cm-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  margin-bottom: 0.55rem;
}

#checkoutModal .cm-summary-row.is-total {
  font-weight: 700;
  border-top: 1px solid var(--bs-border-color, #dee2e6);
  padding-top: 0.65rem;
  margin-top: 0.35rem;
  margin-bottom: 0;
}

#checkoutModal .cm-gateways {
  display: grid;
  gap: 0.55rem;
}

#checkoutModal .cm-gateway {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  margin: 0;
}

#checkoutModal .cm-gateway.is-active {
  border-color: var(--bs-primary, #0d6efd);
  box-shadow: 0 0 0 1px var(--bs-primary, #0d6efd);
}

#checkoutModal .cm-gateway input {
  margin-right: 0.5rem;
}

#checkoutModal .cm-gateway-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

#checkoutModal .cm-gateway-logos img {
  height: 1.1rem;
  width: auto;
}

#checkoutModal .cm-section-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vr-theme-color, var(--bs-primary, #0d6efd));
  margin: 0.25rem 0 0.75rem;
}

#checkoutModal .cm-location-hint {
  display: block;
  font-size: 0.7rem;
  line-height: 1.35;
  color: #9aa3af;
}

#checkoutModal .cm-plan-summary {
  margin-bottom: 1rem;
}

#checkoutModal .select2-container {
  width: 100% !important;
}

#checkoutModal .select2-container--default .select2-selection--single {
  min-height: 2.5rem;
  display: flex;
  align-items: center;
}

#checkoutModal .cm-account-block {
  margin-top: 0.35rem;
  padding: 0.95rem 1rem;
  border-radius: 0.75rem;
  background: var(--bs-secondary-bg, #f8f9fa);
}

#checkoutModal .cm-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--bs-secondary-color, #6c757d);
  margin-top: 0.85rem;
}

@media (max-width: 575.98px) {
  #checkoutModal .checkout-modal-dialog {
    margin: 0.5rem;
    max-height: calc(100dvh - 1rem);
    max-width: calc(100% - 1rem);
  }

  #checkoutModal .checkout-modal-content {
    max-height: calc(100dvh - 1rem);
  }

  #checkoutModal .cm-step em {
    display: none;
  }

  #checkoutModal .checkout-modal-header,
  #checkoutModal .checkout-modal-body,
  #checkoutModal .checkout-modal-footer,
  #checkoutModal .checkout-modal-stepper {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #checkoutModal .checkout-modal-footer .btn {
    min-width: 0;
    flex: 1;
  }

  #checkoutModal .checkout-modal-footer #checkoutModalBack:not([hidden]) {
    flex: 0 0 auto;
    margin-right: 0;
  }
}
