/* Checkout layout styles */
html,
body {
  height: 100%;
}

.checkout-header-bar {
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 12px 0;
  min-height: 72px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.checkout-logo {
  height: 32px;
  width: auto;
}
.header-divider {
  display: inline-block;
  width: 1.5px;
  height: 24px;
  background: #e5e7eb;
  margin: 0 16px;
}
.checkout-title {
  font-weight: 600;
  color: rgba(26, 20, 68, 0.5);
  font-size: 14px;
  line-height: 21px;
}

/* Brand styles */
.brand-logo-container {
  display: flex;
  align-items: center;
  gap: 4px;
}
.brand-text {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.brand-omni {
  color: #2977bb;
}
.brand-edupay {
  color: #1a1444;
}

/* Steps: horizontal, responsive */
.checkout-steps {
  margin-top: 8px;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.checkout-steps .steps {
  list-style: none;
  margin: 0;
  padding: 8px 8px;
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-start;
}
.checkout-steps .step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1a1444;
  font-weight: 600;
  position: relative;
  white-space: nowrap;
  flex: 0 0 auto;
}
.checkout-steps .step .index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #d7dde8;
  background: #f8f8f8;
  color: rgba(0, 0, 0, 0.6);
  font-size: 14px;
}
.checkout-steps .step.completed .index {
  background: #e0effe;
  color: #0071cf;
  border-color: #e0effe;
}
.checkout-steps .step.current .index {
  background: #0071cf;
  border-color: #0071cf;
  color: #fff;
}
.checkout-steps .step.upcoming .index {
  background: #f8f8f8;
  color: rgba(0, 0, 0, 0.6);
}
.checkout-steps .step + .step::before {
  content: "";
  display: inline-block;
  width: 36px;
  height: 0;
  border-top: 1px dashed rgba(0, 0, 0, 0.3);
  position: relative;
  top: -1px;
  margin-right: 4px;
}
.checkout-steps .step .label {
  white-space: nowrap;
  font-size: 14px;
}

/* Desktop layout: keep steps inline and right-aligned */
@media (min-width: 992px) {
  .checkout-header-bar > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .checkout-header-bar .header-left,
  .checkout-header-bar .d-flex {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .checkout-steps {
    margin-top: 0;
    overflow: visible;
    position: static;
  }
  .checkout-steps .steps {
    justify-content: flex-end;
    gap: 28px;
    padding: 0;
  }
  .checkout-steps .step + .step::before {
    display: inline-block;
  }
}

/* Mobile responsive tweaks */
@media (max-width: 700px) {
  .checkout-steps .steps {
    gap: 12px;
    padding: 6px 10px;
    justify-content: space-between;
  }
  .checkout-steps .step {
    gap: 6px;
  }
  .checkout-steps .step .index {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .checkout-steps .step .label {
    font-size: 12px;
  }
  .summary-item .icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
  }
  .checkout-steps .step + .step::before {
    display: none;
  }
  .checkout-steps {
    overflow-x: hidden;
  }
}

@media (max-width: 576px) {
  .checkout-steps .steps {
    gap: 8px;
    padding: 6px 8px;
  }
  .checkout-steps .step + .step::before {
    display: none;
  }
  .checkout-steps .step .label {
    white-space: nowrap;
    font-size: 12px;
  }
  .checkout-steps .step .index {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
  .header-divider {
    display: inline-block;
    width: 1px;
    height: 28px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0 8px;
  }
  .checkout-title {
    font-size: 13px;
  }
  .checkout-logo {
    height: 44px;
  }
  .summary-item .icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
  }
}

.checkout-main-bg {
  background: radial-gradient(
      1200px 500px at -100px -100px,
      rgba(42, 97, 164, 0.08),
      rgba(255, 255, 255, 0)
    ),
    #f7fafe;
    height: 100%;
}
.checkout-container {
  padding: 20px 0 32px;
}

/* Two-column grid */
.checkout-grid {
  display: grid;
  grid-template-columns: minmax(380px, 520px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
@media (max-width: 992px) {
  .checkout-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Responsive tweaks */
@media (max-width: 992px) {
  .summary-card {
    max-width: 100%;
    margin-left: 0;
  }
}

/* Mobile header: keep logo/title inline, move steps to new row */
@media (max-width: 991px) {
  /* Override Bootstrap utility that may force space-between (use !important) */
  .checkout-header-bar > .container.header-row.justify-content-between {
    justify-content: center !important;
  }
  /* Center logo + title horizontally on mobile */
  .checkout-header-bar > .container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }
  .checkout-header-bar .header-left {
    order: 1;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
  }
  /* Steps drop to a full-width row below and remain centered */
  .checkout-steps {
    order: 2;
    width: 100%;
    display: block;
    margin-top: 8px;
  }
  .checkout-steps .steps {
    justify-content: center;
  }
}

/* Summary card */
.summary-card {
  background: #fff;
  border: 1px solid #ddeaf5;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(27, 39, 51, 0.04);
  width: 100%;
  max-width: 520px;
  margin-right: auto;
  margin-left: 0;
}
.summary-header {
  font-weight: 600;
  color: #1a1444;
  margin-bottom: 16px;
  font-size: 24px;
  line-height: 36px;
}
.summary-subheader {
  font-weight: 600;
  color: #1a1444;
  margin: 16px 0 12px;
  font-size: 24px;
  line-height: 36px;
}
.summary-item {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #f0f7ff;
  border-radius: 15px;
  padding: 18px;
  margin-bottom: 12px;
}
.summary-item .icon {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0071cf;
  color: #fff;
}
.summary-item .icon i,
.summary-item .icon svg {
  font-size: 24px;
  line-height: 1;
}
.summary-item .icon.order-logo {
  background: transparent;
  border: none;
  box-shadow: none;
}
.summary-item .icon.order-logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}
.summary-item > div {
  flex: 1 1 auto;
  min-width: 0;
}
.summary-title {
  white-space: normal;
  overflow-wrap: anywhere;
}
.summary-meta {
  font-size: 14px;
  color: #7b7f84;
}
.summary-title {
  font-weight: 600;
  color: #1a1444;
  font-size: 16px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 24px;
  border-bottom: 1px solid #ddeaf5;
}
.summary-row:first-of-type {
  padding-top: 0;
}
.summary-label {
  color: #7b7f84;
  font-weight: 400;
  font-size: 16px;
}
.summary-value {
  color: #1a1444;
  font-weight: 500;
  font-size: 16px;
}
.summary-total {
  border-top: none;
  margin-top: 8px;
  padding-top: 12px;
}
.summary-total .summary-label,
.summary-total .summary-value {
  font-size: 22px;
  line-height: 33px;
  font-weight: 600;
}

/* Right column and iframe */
.pay-column {
}
.pay-header {
  font-weight: 700;
  color: #23283b;
  margin-bottom: 12px;
}
.pay-panel {
  background: #fff;
  border: 1px solid #e7ecf3;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(27, 39, 51, 0.04);
  padding: 0;
  overflow: hidden;
}
.pay-iframe-wrap {
  position: relative;
  min-height: 520px;
  padding: 32px 24px 28px;
}
.pay-iframe {
  width: 100%;
  height: calc(70vh - 60px);
  min-height: 460px;
  border: 0;
  display: block;
  background: #f8fafc;
}
.iframe-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 2;
}
.loader {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #e5e7eb;
  border-top-color: var(--checkout-primary, #2a61a4);
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.cancel-wrap {
  margin-top: 20px;
}
.btn-cancel {
  display: block;
  width: 100%;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 600;
  background: var(--checkout-primary, #2a61a4);
  color: #fff;
  border: 0;
  text-align: center;
  text-decoration: none;
}
.btn-cancel:hover {
  filter: brightness(0.95);
  color: #fff;
}
