/* === track-package.css === */
/* Order tracking: /track-package (find an order) and /suivi/<id>/<token>/
 * (one order). Everything is scoped under .trk, and form controls use two
 * classes: 02-base and 07-forms style input/button with selectors that beat
 * a single page class. */

.trk {
  --trk-brand: #192a56;
  --trk-muted: #6b7280;
  --trk-line: #e5e7eb;
  --trk-bg: #f6f7fb;
  --trk-ok: #1f9d55;
  max-width: 1040px;
  margin: 24px auto 56px;
  padding: 0 16px;
  color: #1f2937;
}
.trk--narrow { max-width: 560px; }

/* .trk-head is a <header>: 02-base pads every header 34px top and bottom. */
.trk .trk-head { margin: 0 0 18px; padding: 0; }
.trk .trk-title { font-size: 1.6rem; line-height: 1.25; margin: 0 0 6px; color: var(--trk-brand); }
.trk-sub { margin: 0; color: var(--trk-muted); font-size: .95rem; }

.trk-card {
  background: #fff;
  border: 1px solid var(--trk-line);
  border-radius: 12px;
  padding: 20px;
  margin: 0 0 16px;
}
.trk .trk-h2 { font-size: 1rem; margin: 0 0 12px; color: #111827; }
.trk-k { color: var(--trk-muted); font-size: .85rem; }
.trk-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; margin-inline-start: 6px; }

/* Timeline */
.trk-steps {
  display: flex;
  list-style: none;
  margin: 4px 0 16px;
  padding: 0;
  counter-reset: none;
}
.trk-step {
  flex: 1;
  position: relative;
  text-align: center;
  font-size: .85rem;
  color: var(--trk-muted);
}
.trk-step::before { /* connector to the previous step */
  content: "";
  position: absolute;
  top: 14px;
  inset-inline-end: 50%;
  width: 100%;
  height: 3px;
  background: var(--trk-line);
  z-index: 0;
}
.trk-step:first-child::before { display: none; }
.trk-step.is-done::before, .trk-step.is-current::before { background: var(--trk-brand); }
.trk-dot {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--trk-line);
  font-weight: 700;
  font-size: .85rem;
  color: var(--trk-muted);
}
.trk-step.is-done .trk-dot { background: var(--trk-brand); border-color: var(--trk-brand); color: #fff; }
.trk-step.is-current .trk-dot { border-color: var(--trk-brand); color: var(--trk-brand); box-shadow: 0 0 0 4px rgba(25, 42, 86, .12); }
.trk-step.is-done, .trk-step.is-current { color: #111827; font-weight: 600; }
.trk-step-label { display: block; margin-top: 6px; }

.trk-msg {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--trk-bg);
  font-size: .95rem;
}
.trk-status--delivered .trk-msg { background: #e8f6ee; color: #14532d; }
.trk-status--out_for_delivery .trk-msg { background: #fff6e0; color: #6b4b00; }
.trk-status--canceled .trk-msg, .trk-status--returned .trk-msg { background: #fdecea; color: #8a1c1c; }

/* Parcel, driver, review */
.trk-parcel, .trk-driver, .trk-review {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--trk-line);
}
.trk-driver .trk-k { flex-basis: 100%; }
.trk-driver strong { flex: 1; }
.trk-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  background: #eef0f6;
  color: var(--trk-brand);
}
.trk-badge--delivered { background: #e8f6ee; color: #14532d; }
.trk-badge--out_for_delivery { background: #fff1cc; color: #6b4b00; }
.trk-badge--returned { background: #fdecea; color: #8a1c1c; }
.trk-review span { flex: 1; min-width: 200px; }
.trk-note { margin: 12px 0 0; font-size: .9rem; }

/* Items and totals */
.trk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.trk-side .trk-card:last-child { margin-bottom: 0; }
.trk-items { list-style: none; margin: 0; padding: 0; }
.trk-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--trk-line);
}
.trk-item img { width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--trk-line); border-radius: 8px; background: #fff; flex: none; }
.trk-item-name { flex: 1; min-width: 0; font-size: .92rem; overflow-wrap: anywhere; }
.trk-item-name a { color: inherit; text-decoration: none; }
.trk-item-name a:hover { text-decoration: underline; }
.trk-item-name .trk-k { display: block; margin-top: 2px; }
.trk-item-price { white-space: nowrap; font-size: .92rem; }
.trk-totals { margin: 12px 0 0; }
.trk-totals div { display: flex; justify-content: space-between; padding: 4px 0; font-size: .92rem; }
.trk-totals dt, .trk-totals dd { margin: 0; }
.trk-totals .trk-total { font-weight: 700; font-size: 1.05rem; color: var(--trk-brand); border-top: 1px solid var(--trk-line); margin-top: 6px; padding-top: 10px; }
.trk-addr { margin: 0; line-height: 1.6; font-size: .92rem; }
.trk-help { display: flex; flex-direction: column; gap: 8px; }

/* Buttons and forms */
.trk .trk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  margin: 0;
  padding: 11px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--trk-brand);
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.trk .trk-btn:hover { filter: brightness(1.12); }
.trk .trk-btn--block { width: 100%; padding: 14px 18px; }
.trk .trk-btn--ghost { background: #fff; color: var(--trk-brand); border: 1px solid var(--trk-line); }
.trk .trk-btn--wa { background: var(--trk-ok); }

.trk-form { display: flex; flex-direction: column; gap: 14px; }
.trk-field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; }
.trk .trk-form input {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  box-sizing: border-box;
}
.trk .trk-form input:focus { outline: 2px solid var(--trk-brand); outline-offset: 1px; border-color: var(--trk-brand); }
.trk-form--inline { flex-direction: row; margin-top: 12px; }
.trk-form--inline input { flex: 1; }

.trk-carrier summary { cursor: pointer; font-weight: 600; color: var(--trk-brand); }
.trk-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fdecea;
  color: #8a1c1c;
  font-size: .95rem;
}

@media (max-width: 760px) {
  .trk-grid { grid-template-columns: 1fr; }
  .trk .trk-title { font-size: 1.35rem; }
  .trk-card { padding: 16px; }
  .trk-step { font-size: .75rem; }
  .trk-form--inline { flex-direction: column; }
}
