/* =============================================================================
   My Bookings

   Two levels of navigation: product (flights / hotels) then status. Product
   leads because the two card types answer different questions — a flight card
   is about times and a PNR, a hotel card about dates and a room — and mixing
   them in one list made both harder to scan.

   The flight and hotel cards deliberately share one skeleton (.mb-leg): two
   endpoints with a measured line between them. A traveller learns the shape
   once and reads both.
   ============================================================================= */

.mb-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 4rem;
}

/* ---------- Header ---------- */
.mb-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mb-head h1 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f1b2d;
}

.mb-head p {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
}

.mb-head-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.mb-head-link:hover {
  border-color: #cbd5e1;
  color: #0f1b2d;
}

.mb-head-link svg {
  width: 16px;
  height: 16px;
}

/* ---------- Notices ---------- */
.mb-notice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1.1rem;
  border-radius: 0.7rem;
  font-size: 0.9rem;
}

.mb-notice svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.mb-notice-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b4483a;
}

.mb-notice-ok {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #2f6b4a;
}

/* ---------- Product tabs ----------
   Underline rather than pills: this is the page's primary axis and should read
   as navigation, not as a filter control like the status chips below it. */
.mb-producttabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e8edf4;
}

.mb-producttab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  border: 0;
  background: none;
  color: #64748b;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.mb-producttab::after {
  content: "";
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background-color 0.15s ease;
}

.mb-producttab:hover {
  color: #0f1b2d;
}

.mb-producttab.is-active {
  color: #0f1b2d;
}

.mb-producttab.is-active::after {
  background: #0f1b2d;
}

.mb-producttab svg {
  width: 17px;
  height: 17px;
}

.mb-producttab em {
  min-width: 1.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  text-align: center;
}

.mb-producttab.is-active em {
  background: #0f1b2d;
  color: #fff;
}

/* ---------- Status chips ---------- */
.mb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.mb-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.mb-chip:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.mb-chip.is-active {
  border-color: #0f1b2d;
  background: #0f1b2d;
  color: #fff;
}

.mb-chip em {
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  opacity: 0.7;
}

/* ---------- Card ---------- */
.mb-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mb-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  background: #fff;
  border: 1px solid #e8edf4;
  border-radius: 1rem;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.mb-card:hover {
  border-color: #d6dfeb;
  box-shadow: 0 10px 30px rgba(15, 27, 45, 0.07);
}

/* A cancelled booking stays fully legible — people come back to these to check
   a refund — but is visibly no longer a live trip. */
.mb-card[data-state="cancelled"] {
  background: #fcfcfd;
}

.mb-card[data-state="cancelled"] .mb-leg-code,
.mb-card[data-state="cancelled"] .mb-stay-name {
  color: #64748b;
}

.mb-card-main {
  padding: 1.35rem 1.5rem;
  min-width: 0;
}

.mb-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.85rem;
  padding: 1.35rem 1.5rem;
  border-left: 1px solid #eef2f7;
  background: #fbfcfe;
}

/* ---------- Status badge ---------- */
.mb-status {
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mb-status--upcoming {
  background: #e7f6ee;
  color: #2f6b4a;
}

.mb-status--completed {
  background: #eef2f7;
  color: #566275;
}

.mb-status--cancelled {
  background: #fdecea;
  color: #b4483a;
}

/* Amber, not green or red: a booking still being confirmed is neither settled
   nor failed, and colouring it either way would mislead. */
.mb-status--pending {
  background: #fdf3e3;
  color: #a56a12;
}

/* ---------- Fare ---------- */
.mb-fare {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  margin-top: auto;
}

.mb-fare span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

.mb-fare b {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f1b2d;
  font-variant-numeric: tabular-nums;
}

/* ---------- Actions ---------- */
.mb-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.mb-card-actions form {
  margin: 0;
}

.mb-hold-note {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #7a5a12;
}

.mb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.mb-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.mb-btn-primary {
  border-color: #0f1b2d;
  background: #0f1b2d;
  color: #fff;
}

.mb-btn-primary:hover {
  border-color: #1c2f4a;
  background: #1c2f4a;
  color: #fff;
}

.mb-btn-danger {
  border-color: #f0d4d0;
  color: #b4483a;
}

.mb-btn-danger:hover {
  border-color: #e3b9b2;
  background: #fdf1ef;
  color: #9a3b2f;
}

/* ---------- Flight header ---------- */
.mb-air-head,
.mb-stay-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.mb-carrier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 0.6rem;
  background: linear-gradient(135deg, #0f1b2d, #33507a);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}

.mb-stay-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 0.6rem;
  background: #eef4ff;
  color: #33507a;
  flex: 0 0 auto;
}

.mb-stay-mark svg {
  width: 20px;
  height: 20px;
}

.mb-air-meta,
.mb-stay-meta {
  min-width: 0;
}

.mb-air-name,
.mb-stay-name {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f1b2d;
}

.mb-air-sub {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

.mb-stay-address {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.mb-stay-address svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.mb-stay-address span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mb-tag {
  padding: 0.1rem 0.45rem;
  border-radius: 0.3rem;
  background: #eef4ff;
  color: #33507a;
  font-size: 0.68rem;
  font-weight: 700;
}

/* ---------- Journey strip (shared by both card types) ---------- */
.mb-leg {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}

.mb-leg-end {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.mb-leg-end--to {
  align-items: flex-end;
  text-align: right;
}

.mb-leg-time {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f1b2d;
  font-variant-numeric: tabular-nums;
}

.mb-leg-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.mb-leg-code {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f1b2d;
}

.mb-leg-city {
  font-size: 0.78rem;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mb-leg-path {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.mb-leg-duration,
.mb-leg-stops {
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
}

.mb-leg-line {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  color: #cbd5e1;
}

.mb-leg-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

/* The connecting rule is drawn on the icon's flanks so it always spans the
   available width without a fixed size. */
.mb-leg-plane {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  color: #33507a;
}

.mb-leg-plane::before,
.mb-leg-plane::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: repeating-linear-gradient(90deg, #cbd5e1 0 4px, transparent 4px 8px);
}

.mb-leg-plane svg {
  width: 15px;
  height: 15px;
  margin: 0 0.35rem;
  transform: rotate(90deg);
}

/* A stay does not travel anywhere, so its icon is not rotated into motion. */
.mb-leg-plane--still svg {
  transform: none;
}

/* ---------- Facts ---------- */
.mb-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr));
  gap: 0.85rem 1.25rem;
  margin: 1.05rem 0 0;
}

.mb-facts > div {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.mb-facts dt {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.mb-facts dd {
  margin: 0;
  font-size: 0.86rem;
  color: #1e293b;
}

.mb-muted {
  color: #94a3b8;
}

/* Monospace so a PNR can be read back over the phone character by character. */
.mb-ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #0f1b2d;
}

/* ---------- Empty states ---------- */
.mb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 3rem 1.5rem;
  border: 1px dashed #dfe6ef;
  border-radius: 1rem;
  background: #fbfcfe;
  text-align: center;
}

.mb-empty-art {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 0.35rem;
  border-radius: 50%;
  background: #eef2f7;
  color: #94a3b8;
}

.mb-empty-art svg {
  width: 24px;
  height: 24px;
}

.mb-empty h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f1b2d;
}

.mb-empty p {
  margin: 0;
  max-width: 42ch;
  font-size: 0.9rem;
  color: #64748b;
}

.mb-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.mb-empty-actions .mb-btn {
  width: auto;
  padding-inline: 1.4rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .mb-card {
    grid-template-columns: 1fr;
  }

  /* The side rail becomes a footer strip: price and status stay together and
     the action buttons go full width, which is what a thumb wants. */
  .mb-card-side {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    border-left: 0;
    border-top: 1px solid #eef2f7;
  }

  .mb-fare {
    align-items: flex-start;
    margin-top: 0;
  }

  .mb-card-actions {
    flex-direction: row;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .mb-shell {
    padding: 1.5rem 0.9rem 3rem;
  }

  .mb-card-main,
  .mb-card-side {
    padding: 1.1rem;
  }

  .mb-leg {
    gap: 0.6rem;
  }

  .mb-leg-time,
  .mb-leg-code {
    font-size: 0.98rem;
  }

  .mb-card-actions {
    flex-direction: column;
  }

  .mb-producttab {
    padding-inline: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mb-card,
  .mb-btn,
  .mb-chip,
  .mb-producttab,
  .mb-producttab::after,
  .mb-head-link {
    transition: none;
  }
}
