/* ============================================================
   Universal product checkout flow stepper
   (flight / bus / visa — hotel later)
   ============================================================ */

.mtp-flow-stepper {
  --mtp-flow-accent: #0057AD;
  --mtp-flow-muted: #64748b;
  --mtp-flow-line-done: #0057AD;
  --mtp-flow-line-todo: #e2e8f4;
  --mtp-flow-border: #2196f3;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto 16px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--mtp-flow-border);
  border-radius: 10px;
  box-sizing: border-box;
}

.mtp-flow-stepper__inner {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 20px;
  box-sizing: border-box;
}

.mtp-flow-stepper__track {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 0;
}

.mtp-flow-stepper__item {
  display: flex;
  align-items: flex-start;
  flex: 1 1 0;
  min-width: 0;
}

.mtp-flow-stepper__item:last-child {
  flex: 0 1 auto;
}

.mtp-flow-stepper__step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--mtp-flow-muted);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  line-height: 1.25;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: default;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
}

a.mtp-flow-stepper__step {
  cursor: pointer;
}

a.mtp-flow-stepper__step:hover,
a.mtp-flow-stepper__step:focus-visible {
  color: var(--mtp-flow-accent);
  text-decoration: none;
}

a.mtp-flow-stepper__step:hover .mtp-flow-stepper__icon,
a.mtp-flow-stepper__step:focus-visible .mtp-flow-stepper__icon {
  border-color: var(--mtp-flow-accent);
  color: var(--mtp-flow-accent);
}

.mtp-flow-stepper__item.is-completed .mtp-flow-stepper__step,
.mtp-flow-stepper__item.is-current .mtp-flow-stepper__step {
  color: var(--mtp-flow-accent);
  font-weight: 500;
}

.mtp-flow-stepper__icon {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-sizing: border-box;
  color: inherit;
  margin-top: 1px;
}

.mtp-flow-stepper__item.is-completed .mtp-flow-stepper__icon,
.mtp-flow-stepper__item.is-current .mtp-flow-stepper__icon {
  border-color: var(--mtp-flow-accent);
  color: var(--mtp-flow-accent);
}

.mtp-flow-stepper__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}

.mtp-flow-stepper__label {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mtp-flow-stepper__desc {
  display: none;
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
  line-height: 1.3;
  white-space: normal;
  overflow: hidden;
  max-width: 100%;
}

.mtp-flow-stepper__item.is-current .mtp-flow-stepper__desc {
  color: #fb8a74;
}

/* Desktop connectors: grow to fill the gap between step icons */
.mtp-flow-stepper__line {
  flex: 1 1 auto;
  align-self: flex-start;
  width: auto;
  min-width: 16px;
  height: 1px;
  margin: 13px 12px 0;
  background: var(--mtp-flow-line-todo);
}

.mtp-flow-stepper__line.is-done {
  background: var(--mtp-flow-line-done);
}

/* When nested in the old passenger chrome wrapper, avoid double card chrome */
.passenger-page-top:has(> .mtp-flow-stepper) {
  border: none !important;
  background: transparent !important;
  overflow: visible !important;
  padding: 0 !important;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
}

.passenger-page-top > .mtp-flow-stepper {
  margin-bottom: 0;
}

/* Payment / visa / bus confirm pages: sit flush in their own column */
.mtp-pay-page .mtp-flow-stepper,
.mtp-visa-page .mtp-flow-stepper,
.mtp-bus-results .mtp-flow-stepper,
.mtp-bus-confirm .mtp-flow-stepper {
  max-width: none;
}

.mtp-pay-page__inner > .mtp-flow-stepper {
  margin-bottom: 1rem;
}

/* Desktop: show short descriptions under labels */
@media (min-width: 1200px) {
  .mtp-flow-stepper__desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

/* Tablet / mobile */
@media (max-width: 991.98px) {
  .mtp-flow-stepper {
    margin-bottom: 12px;
    border-radius: 12px;
  }

  .mtp-flow-stepper__inner {
    padding: 12px 14px;
  }

  .mtp-flow-stepper__track {
    width: 100%;
    align-items: center;
  }

  .mtp-flow-stepper__item {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
  }

  .mtp-flow-stepper__step {
    gap: 4px;
    font-size: 11px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .mtp-flow-stepper__icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 12px;
    margin-top: 0;
  }

  .mtp-flow-stepper__text {
    align-items: center;
  }

  .mtp-flow-stepper__desc {
    display: none !important;
  }

  .mtp-flow-stepper__line {
    display: none;
  }

  /* Only the current step keeps its label on small screens */
  .mtp-flow-stepper__item:not(.is-current) .mtp-flow-stepper__label {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .mtp-flow-stepper__inner {
    padding: 10px 10px;
  }

  .mtp-flow-stepper__icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
  }
}
