:root {
  --ink: #312c2b;
  --muted: #746d69;
  --paper: #fffdf9;
  --line: #e8dfd4;
  --accent: #a63f5f;
  --good: #3d7b4d;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f7f3ee;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
}

.tracking {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 32px 16px 24px;
}

.tracking-loading {
  padding: 60px 0;
  color: var(--muted);
  text-align: center;
}

.order,
.not-found,
.my-orders {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.my-orders {
  margin-top: 16px;
}

.order-store {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.order-store img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.order-store small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.order-store a {
  color: var(--ink);
  font: 600 18px "Playfair Display", serif;
  text-decoration: none;
}

h1 {
  margin: 22px 0 6px;
  font: 600 32px "Playfair Display", serif;
}

.order-headline {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

/* Vertical status steps: filled dots for reached steps, a ring for the current one. */
.timeline {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  padding: 0 0 18px 30px;
  color: var(--muted);
}

.timeline li::before {
  position: absolute;
  top: 2px;
  left: 0;
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #fff;
  content: "";
}

.timeline li:not(:last-child)::after {
  position: absolute;
  top: 18px;
  left: 7px;
  bottom: 0;
  width: 2px;
  background: var(--line);
  content: "";
}

.timeline li.done {
  color: var(--ink);
}

.timeline li.done::before {
  border-color: var(--accent);
  background: var(--accent);
}

.timeline li.done:not(:last-child)::after {
  background: var(--accent);
}

.timeline li.current::before {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}

.timeline li.cancelled::before {
  border-color: #b3261e;
  background: #b3261e;
}

.timeline b,
.timeline small {
  display: block;
}

.timeline small {
  margin-top: 2px;
  font-size: 11px;
}

.order-lines {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.order-lines h2,
.my-orders h2 {
  margin: 0 0 10px;
  font: 600 18px "Playfair Display", serif;
}

.order-lines ul,
.my-orders ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 14px;
}

.order-lines li small {
  color: var(--muted);
}

.order-total {
  display: flex;
  justify-content: space-between;
  margin: 10px 0 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.order-total b {
  font: 600 22px "Playfair Display", serif;
}

.order-delivery {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.order-actions a {
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.order-actions a.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.not-found h1 {
  margin-top: 0;
  font-size: 26px;
}

.not-found p,
.my-orders-note {
  color: var(--muted);
}

.my-orders li a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 12px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.my-orders li span,
.my-orders li small {
  color: var(--muted);
  font-size: 12px;
}

.tracking-footer {
  padding: 10px 0 30px;
  text-align: center;
}

.tracking-footer img {
  height: 34px;
  opacity: 0.8;
}

@media (max-width: 480px) {
  .order,
  .not-found,
  .my-orders {
    padding: 20px;
  }

  .order-actions a {
    flex: 1;
    text-align: center;
  }

  .my-orders li a {
    grid-template-columns: 1fr auto;
  }

  .my-orders li span {
    grid-column: 1;
  }
}

.tracking-footer p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.tracking-footer p a {
  color: inherit;
}

/* "Cómo pagar": shown once the store confirms the order. */
.payment {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.payment h2 {
  margin: 0 0 10px;
  font: 600 18px "Playfair Display", serif;
}

.payment-pending p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.pay-method {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.pay-method span {
  color: var(--muted);
}

.pay-method a {
  color: var(--accent);
  font-weight: 700;
}

.clabe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--ink) !important;
}

.clabe code {
  font: 600 15px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}

.clabe button {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font: 700 11px "DM Sans", sans-serif;
  cursor: pointer;
}

.pay-instructions {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.proof-button {
  display: inline-block;
  padding: 11px 16px;
  border: 1px solid #25d366;
  border-radius: 4px;
  color: #128c4b;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

/* Discount line in the order summary. */
.discount-line b { color: #2f6f4f; }
