/* Extracted page styles: customer Order Tracking & Payments (home/orders.html).
   Everything is namespaced `.ord-*` so it never collides with the `.timeline-*`
   and `.history-*` rules in profile.css / motolectron.css. */
body {
  background-color: #050505;
}

/* Class rules below set display: flex/grid, which would beat the browser's
   default [hidden] { display: none } — keep the attribute authoritative. */
.ord-tabs[hidden],
.ord-card[hidden],
.ord-details[hidden],
.ord-empty-filter[hidden] {
  display: none;
}

.ord-muted {
  color: #8a8a93;
  font-size: 0.78rem;
}

/* ---------- Status filter tabs ---------- */
.ord-tabs {
  display: flex;
  gap: 6px;
  margin: -12px 0 18px;
  padding-bottom: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ord-tabs::-webkit-scrollbar {
  display: none;
}

.ord-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 7px 13px;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  background: #0f0f0f;
  color: #9a9aa3;
  font: 600 0.78rem 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.ord-tab:hover {
  color: #fff;
  border-color: #444;
}

.ord-tab.is-active {
  color: #fff;
  background: #1b1b1b;
  border-color: var(--moto-red, #ff1f1f);
}

.ord-tab-count {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #262626;
  color: #ccc;
  font-size: 0.68rem;
  text-align: center;
}

.ord-tab-count.is-alert {
  background: var(--moto-red, #ff1f1f);
  color: #fff;
}

/* ---------- Order card ---------- */
.ord-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ord-card {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 16px 18px;
  transition: border-color 0.2s;
}

.ord-card:hover {
  border-color: #3a3a3a;
}

.ord-head {
  display: flex;
  justify-content: space-between;
  /* The status pill sits level with the two-line code/placed block. */
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ord-head > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ord-code {
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

/* Status pill — colour is the first thing the eye should catch. */
.ord-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.ord-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.ord-pill.is-amber { color: #ffd18a; background: rgba(255, 178, 0, 0.12); border-color: rgba(255, 178, 0, 0.3); }
.ord-pill.is-red   { color: #ff8186; background: rgba(255, 76, 76, 0.13); border-color: rgba(255, 76, 76, 0.35); }
.ord-pill.is-blue  { color: #7cc4ff; background: rgba(59, 130, 246, 0.14); border-color: rgba(59, 130, 246, 0.35); }
.ord-pill.is-green { color: #4ade80; background: rgba(34, 197, 94, 0.16); border-color: rgba(74, 222, 128, 0.35); }
.ord-pill.is-grey  { color: #9ca3af; background: rgba(156, 163, 175, 0.14); border-color: rgba(156, 163, 175, 0.3); }

/* One sentence: what is happening / what the customer must do next. */
.ord-headline {
  margin: 0 0 12px;
  padding: 10px 13px;
  border-left: 3px solid currentColor;
  border-radius: 0 8px 8px 0;
  background: #161616;
  color: #e6e6e6;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.45;
}

.ord-headline.is-amber { border-color: #ffb300; }
.ord-headline.is-red   { border-color: #ff4c4c; }
.ord-headline.is-blue  { border-color: #3b82f6; }
.ord-headline.is-green { border-color: #22c55e; }
.ord-headline.is-grey  { border-color: #6b7280; color: #b3b3b3; }

.ord-note {
  margin: -6px 0 12px;
  color: #ff9aa0;
  font-size: 0.78rem;
}

/* ---------- Pickup schedule (date, reschedule, more time) ---------- */
.ord-pickup {
  display: grid;
  gap: 6px;
  margin: -4px 0 14px;
  padding: 10px 13px;
  border: 1px solid #262626;
  border-radius: 8px;
  background: #0d0d0d;
  font-size: 0.82rem;
  color: #cfcfcf;
}

.ord-pickup-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.ord-pickup-line strong {
  color: #fff;
}

.ord-pickup-line.is-note {
  color: #ffd18a;
}

.ord-link {
  padding: 0;
  border: 0;
  background: none;
  color: #ff6268;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ord-link:hover {
  color: #fff;
}

.ord-inline-form {
  display: grid;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px dashed #2a2a2a;
}

.ord-inline-form[hidden] {
  display: none;
}

.ord-inline-form input[type="date"],
.ord-inline-form textarea {
  width: 100%;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #111;
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  color-scheme: dark;
}

.ord-inline-form input[type="date"] {
  max-width: 220px;
}

.ord-inline-form textarea {
  resize: vertical;
}

.ord-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ord-btn--small {
  padding: 7px 12px;
  font-size: 0.76rem;
}

.ord-inline-status {
  margin: 0;
  min-height: 1em;
  font-size: 0.76rem;
  color: #8a8a93;
}

.ord-inline-status.is-error {
  color: #ff8186;
}

/* ---------- Progress stepper ---------- */
.ord-steps {
  display: flex;
  list-style: none;
  margin: 4px 0 16px;
  padding: 0;
}

.ord-step {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 4px;
}

/* Connector line drawn behind the dots. */
.ord-step::before {
  content: '';
  position: absolute;
  top: 7px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: #2e2e2e;
}

.ord-step:first-child::before {
  display: none;
}

.ord-step.is-done::before,
.ord-step.is-active::before {
  background: var(--moto-red, #ff1f1f);
}

.ord-step-dot {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2e2e2e;
  border: 3px solid #111;
  box-sizing: border-box;
  margin-bottom: 7px;
}

.ord-step.is-done .ord-step-dot,
.ord-step.is-active .ord-step-dot {
  background: var(--moto-red, #ff1f1f);
}

.ord-step.is-active .ord-step-dot {
  box-shadow: 0 0 0 3px var(--moto-red-glow, rgba(255, 31, 31, 0.28));
}

.ord-step-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #666;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}

.ord-step.is-done .ord-step-label {
  color: #ccc;
}

.ord-step.is-active .ord-step-label {
  color: #fff;
}

.ord-step-label small {
  color: #ffd18a;
  font-size: 0.66rem;
  font-weight: 600;
}

/* ---------- Items ---------- */
.ord-items {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #232323;
  border-bottom: 1px solid #232323;
}

.ord-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.ord-item + .ord-item {
  border-top: 1px solid #1c1c1c;
}

.ord-item-img {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #1c1c1c;
  object-fit: cover;
}

.ord-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ord-item-name {
  color: #f1f1f1;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ord-item-total {
  color: #fff;
  font-size: 0.86rem;
  white-space: nowrap;
}

/* ---------- Money row ---------- */
.ord-money {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.ord-money > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #262626;
  border-radius: 8px;
  background: #0d0d0d;
}

.ord-money span {
  color: #8a8a93;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ord-money strong {
  color: #fff;
  font-size: 1rem;
}

.ord-money strong.is-due {
  color: #ff6268;
}

.ord-money .is-paid {
  color: #4ade80;
}

.ord-money small {
  color: #ffd18a;
  font-size: 0.7rem;
}

/* ---------- Actions ---------- */
.ord-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ord-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--moto-red, #ff1f1f);
  border-radius: 6px;
  background: var(--moto-red, #ff1f1f);
  color: #fff;
  font: 700 0.8rem 'Inter', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.ord-btn:hover {
  background: #cc0000;
  border-color: #cc0000;
  color: #fff;
}

.ord-btn--outline {
  background: transparent;
  border-color: #3a3a3a;
  color: #ddd;
}

.ord-btn--outline:hover {
  background: transparent;
  border-color: var(--moto-red, #ff1f1f);
  color: #fff;
}

/* ---------- Collapsible details ---------- */
.ord-details {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #232323;
  color: #bbb;
  font-size: 0.8rem;
}

.ord-details h4 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ord-details p {
  margin: 0 0 4px;
  line-height: 1.45;
}

.ord-bill {
  display: grid;
  gap: 5px;
  margin: 0 0 8px;
}

.ord-bill > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ord-bill dt {
  color: #9a9aa3;
  font-weight: 400;
}

.ord-bill dd {
  margin: 0;
  color: #eee;
  white-space: nowrap;
}

.ord-bill .ord-bill-total {
  padding-top: 6px;
  border-top: 1px solid #2a2a2a;
  font-weight: 700;
}

.ord-bill .ord-bill-total dt,
.ord-bill .ord-bill-total dd {
  color: #fff;
}

.ord-payments {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.ord-payments li strong {
  color: #eee;
}

.ord-payments .is-approved { color: #4ade80; }
.ord-payments .is-pending  { color: #ffd18a; }
.ord-payments .is-rejected { color: #ff8186; }

/* ---------- Empty states ---------- */
.ord-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 16px;
  border: 1px dashed #2e2e2e;
  border-radius: 10px;
  color: #8a8a93;
  text-align: center;
}

.ord-empty svg {
  color: var(--moto-red, #ff1f1f);
  margin-bottom: 4px;
}

.ord-empty h3 {
  margin: 0;
  color: #fff;
  font-size: 1rem;
}

.ord-empty p {
  margin: 0 0 8px;
  font-size: 0.85rem;
}

.ord-empty-filter {
  padding: 28px 0;
  color: #8a8a93;
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .ord-card {
    padding: 14px;
  }

  .ord-steps {
    flex-direction: column;
    gap: 0;
    margin-bottom: 14px;
  }

  .ord-step {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    padding: 0 0 12px;
    text-align: left;
  }

  .ord-step::before {
    top: 16px;
    left: 7px;
    width: 2px;
    height: 100%;
  }

  .ord-step:last-child::before {
    display: none;
  }

  .ord-step:first-child::before {
    display: block;
  }

  /* On mobile the line below a step is "done" only when the next step is reached. */
  .ord-step::before {
    background: #2e2e2e;
  }

  .ord-step.is-done::before {
    background: var(--moto-red, #ff1f1f);
  }

  .ord-step.is-active::before {
    background: #2e2e2e;
  }

  .ord-step-dot {
    margin: 0;
    flex-shrink: 0;
  }

  .ord-money {
    grid-template-columns: 1fr;
  }

  .ord-money > div {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .ord-details {
    grid-template-columns: 1fr;
  }

  .ord-actions .ord-btn {
    flex: 1;
  }
}

/* Courier quote and proof-of-delivery links (adviser, 4th consultation). */
.ord-proof-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 10px 0 0;
}
.ord-proof-link {
  color: #ff4d4d;
  font-weight: 700;
  text-decoration: underline;
}
html[data-theme="light"] .ord-proof-link { color: #c81e1e; }
