/* =============================================================================
   Public shipment tracking (/tracking, /tracking/{number}) and the portal's
   tracking view. Owned by the tracking module. Design comp: tracking page.
   Result components size themselves from their container (portal column vs page).
   ============================================================================= */

/* ---------------------------------------------------------------- hero + search */
.trk-hero { position: relative; overflow: hidden; isolation: isolate; background: #0a2b58; color: #fff; }
.trk-hero-media { position: absolute; top: 0; right: 0; z-index: -2; width: 77%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.trk-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #0a2b58 0%, #0a2b58 22%, rgba(10, 43, 88, .88) 34%, rgba(10, 43, 88, .45) 48%, rgba(10, 43, 88, 0) 62%); }
.trk-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; z-index: -1; background: linear-gradient(0deg, rgba(4, 29, 61, .35), rgba(4, 29, 61, 0)); pointer-events: none; }
.trk-hero-inner { padding-top: 62px; padding-bottom: 34px; }
.trk-hero-eyebrow { font-size: .95rem; letter-spacing: .05em; margin-bottom: 10px; }
.trk-hero-title { color: #fff; font-size: clamp(2.05rem, 4vw, 3.6rem); line-height: 1.06; letter-spacing: -.005em; margin: 0 0 20px; max-width: 14em; }
.trk-hero-text { color: #e7eef8; font-size: clamp(1rem, 1.25vw, 1.125rem); line-height: 1.5; max-width: 470px; margin: 0 0 26px; }

.trk-search { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; max-width: 875px; padding: 11px 11px 11px 0; background: #fff; border-radius: 10px; box-shadow: 0 14px 34px rgba(4, 29, 61, .28); color: var(--ink); }
.trk-search-icon { display: grid; place-items: center; color: var(--navy-800); }
.trk-search-icon .icon { width: 30px; height: 30px; stroke-width: 1.6; }
.trk-search-input { width: 100%; min-width: 0; height: 57px; padding: 0 18px; border: 1.5px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); font-size: 1.02rem; letter-spacing: .01em; }
.trk-search-input::placeholder { color: var(--muted); opacity: 1; }
.trk-search-input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(30, 111, 232, .2); }
.trk-search-input[aria-invalid="true"] { border-color: var(--red-500); }
.trk-search-btn { height: 59px; min-width: 227px; padding: 0 26px; border-radius: 8px; font-size: 1.05rem; gap: 12px; }
.trk-search-btn .icon { width: 1.25em; height: 1.25em; stroke-width: 2.2; }
.trk-search-msg { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 2px 20px; color: var(--red-600); font-size: .93rem; font-weight: 600; }
.trk-search-msg .icon { margin-top: 2px; }

/* ---------------------------------------------------------------- how it works (landing / not found) */
.trk-how { background: var(--bg); padding: clamp(36px, 5vw, 60px) 0 clamp(44px, 6vw, 72px); }
.trk-how-title { font-size: clamp(1.35rem, 2vw, 1.7rem); margin-bottom: 20px; }
.trk-how-list { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trk-how-item { display: flex; gap: 16px; align-items: flex-start; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.trk-how-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--blue-50); color: var(--navy-800); flex: none; }
.trk-how-icon .icon { width: 24px; height: 24px; }
.trk-how-item h3 { font-size: 1.02rem; margin: 2px 0 6px; }
.trk-how-num { color: var(--gold-text); }
.trk-how-item p { margin: 0; font-size: .92rem; color: var(--text); }
.trk-how-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; font-size: .9rem; color: var(--muted); }
.trk-how-note .icon { margin-top: 3px; color: var(--blue-600); }
.trk-how-account { margin: 0; font-size: .92rem; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }

/* ---------------------------------------------------------------- result layout */
.trk-result-section { background: var(--bg); padding: 22px 0 30px; }
.trk-wrap { width: 100%; max-width: calc(var(--container) + 56px + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.trk-panel { background: #fff; border: 1px solid #e6edf6; border-radius: 12px; box-shadow: 0 2px 10px rgba(8, 41, 78, .04); padding: 20px 28px 28px; }
.trk-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: .95rem; font-weight: 500; color: var(--navy-800); text-decoration: none; }
.trk-back:hover { color: var(--blue-600); text-decoration: underline; }
.trk-sample { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 14px; padding: 8px 14px; border: 1px dashed #e0a93a; border-radius: 8px; background: #fff4dc; color: #7a4705; font-size: .88rem; text-align: center; }

.trk-result { container: trk / inline-size; }

/* top row: status + number | mini map + current/next */
.trk-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 706px); gap: 24px; align-items: stretch; }
.trk-id { padding-top: 10px; }
.badge.trk-pill { gap: 10px; padding: 7px 18px 7px 8px; font-size: 1.05rem; font-weight: 600; }
.badge.trk-pill .icon { width: 24px; height: 24px; padding: 5px; border-radius: 50%; background: var(--badge); color: #fff; stroke-width: 2.4; }
.badge.trk-pill-sm { gap: 7px; padding: 4px 12px 4px 5px; font-size: .84rem; }
.badge.trk-pill-sm .icon { width: 19px; height: 19px; padding: 4px; }
.trk-number { margin: 18px 0 8px; font-size: clamp(1.6rem, 2.4vw, 2.15rem); font-weight: 700; letter-spacing: .005em; color: var(--ink); overflow-wrap: anywhere; }
.trk-updated { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--text); font-size: .98rem; }
.trk-updated .icon { width: 1.15em; height: 1.15em; color: var(--ink); }

.trk-glance { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 258px; min-height: 196px; border: 1px solid #dfe8f3; border-radius: 10px; background: #e9f2fb; overflow: hidden; }
.trk-glance.no-map { grid-template-columns: minmax(0, 1fr); background: #fff; }
.trk-glance-map { position: relative; min-height: 196px; }
.trk-glance-map .route-map { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.trk-glance-panel { margin: 10px; padding: 14px 14px; background: #fff; border: 1px solid #e3eaf4; border-radius: 8px; display: grid; align-content: space-evenly; gap: 16px; }
.trk-glance.no-map .trk-glance-panel { margin: 0; border: 0; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.trk-glance-item dt { font-size: .84rem; color: var(--muted); margin-bottom: 8px; }
.trk-glance-item dd { margin: 0; display: flex; gap: 9px; align-items: flex-start; font-size: .84rem; font-weight: 600; color: var(--ink); line-height: 1.4; }
.trk-glance-item dd .icon { width: 1.45em; height: 1.45em; flex: none; margin-top: -2px; color: var(--navy-800); }

/* info strip */
.trk-strip { display: grid; grid-template-columns: repeat(5, minmax(0, auto)); justify-content: space-between; margin: 26px 0 0; padding: 18px 28px; border: 1px solid #e3eaf4; border-radius: 10px; background: #fff; }
.trk-strip-item { position: relative; padding: 2px 34px 2px 56px; min-width: 0; }
.trk-strip-item + .trk-strip-item { border-left: 1px solid #e3eaf4; padding-left: 90px; }
.trk-strip-item:first-child { padding-left: 56px; }
.trk-strip-item:last-child { padding-right: 0; }
.trk-strip-icon { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--navy-800); }
.trk-strip-item + .trk-strip-item .trk-strip-icon { left: 34px; }
.trk-strip-icon .icon { width: 32px; height: 32px; stroke-width: 1.6; }
.trk-strip dt { font-size: .88rem; color: var(--text); margin-bottom: 3px; }
.trk-strip dd { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ink); white-space: nowrap; }

/* two columns */
.trk-cols { display: grid; grid-template-columns: minmax(0, 41fr) minmax(0, 59fr); gap: 21px; margin-top: 22px; align-items: start; }
.trk-col { display: grid; gap: 21px; min-width: 0; }
.trk-card { border-color: #e3eaf4; border-radius: 10px; box-shadow: 0 1px 3px rgba(8, 41, 78, .04); padding: 18px 20px 20px; }
.trk-card-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 12px; }
.trk-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.trk-card-head .trk-card-title { margin: 0; }

/* summary */
.trk-dl .dl-row { grid-template-columns: minmax(0, 46%) minmax(0, 1fr); padding: 13px 0; min-height: 48px; align-items: center; font-size: .95rem; border-bottom-color: #edf1f7; }
.trk-dl .dl-row:first-child { border-top: 1px solid #edf1f7; }
.trk-dl .dl-row:last-child { border-bottom: 1px solid #edf1f7; }
.trk-dl dt { gap: 22px; color: var(--ink); }
.trk-dl dt .icon { width: 1.3em; height: 1.3em; color: var(--navy-800); stroke-width: 1.7; }
.trk-dl dd { color: var(--ink); }
.trk-note { display: flex; gap: 14px; align-items: flex-start; margin-top: 24px; padding: 20px 22px; border: 1px solid #cfe2f8; border-radius: 8px; background: #eaf3fd; color: #1f4a8a; font-size: .95rem; line-height: 1.6; }
.trk-note p { margin: 0; }
.trk-note p + p { margin-top: 6px; }
.trk-note-icon { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--blue-600); color: #fff; margin-top: 1px; }
.trk-note-icon .icon { width: 15px; height: 15px; stroke-width: 2.4; }
.trk-note-warning { background: var(--amber-50); border-color: #f5d79c; color: #6d4004; }
.trk-note-warning .trk-note-icon { background: var(--amber-600); }
.trk-note-success { background: var(--green-50); border-color: #b8e6cc; color: #145c35; }
.trk-note-success .trk-note-icon { background: var(--green-600); }
.trk-note-neutral { background: #f1f4f8; border-color: #dbe2ec; color: #334155; }
.trk-note-neutral .trk-note-icon { background: #5b6b83; }
.trk-note-was { color: inherit; opacity: .85; }

/* map card */
.trk-map-card { padding-bottom: 10px; }
.trk-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 0; padding: 0; font-size: .82rem; color: var(--navy-700); }
.trk-legend li { display: inline-flex; align-items: center; gap: 8px; }
.trk-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.trk-dot-origin { background: #1f9d57; }
.trk-dot-current { background: #1e6fe8; }
.trk-dot-destination { background: #0b2a5b; }
.trk-map { margin: 0 -12px; }
.trk-map .route-map { aspect-ratio: 2.2; border-radius: 8px; }
.trk-map-compact { display: none; }
.trk-map-compact .route-map { aspect-ratio: 1.45; }

/* history */
.trk-timeline { list-style: none; margin: 0; padding: 0; }
.trk-step { --step: var(--blue-500); position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; column-gap: 20px; padding: 14px 0; min-height: 66px; }
.trk-step + .trk-step { border-top: 1px solid #eef2f7; }
.trk-step::before { content: ""; position: absolute; left: 12px; top: 40px; bottom: -14px; width: 2px; background: #d9e2ee; }
.trk-step:last-child::before { display: none; }
.trk-step.is-done::before { background: #7fcca2; }
.trk-step-marker { position: relative; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; margin-top: 2px; }
.trk-step-marker .icon { width: 15px; height: 15px; stroke-width: 2.6; }
.trk-step.is-done .trk-step-marker { background: var(--green-500); color: #fff; }
.trk-step.is-current .trk-step-marker { background: var(--step); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--step) 18%, transparent); }
.trk-step.is-current .trk-step-marker .icon { stroke-width: 2.2; }
.trk-step.is-upcoming .trk-step-marker { background: #fff; border: 5px solid #cad5e3; }
.trk-step-title { margin: 0 0 2px; font-weight: 600; font-size: .98rem; color: var(--ink); line-height: 1.35; }
.trk-step.is-upcoming .trk-step-title { font-weight: 500; }
.trk-step-loc { margin: 0; font-size: .86rem; color: var(--muted); }
.trk-step-time { margin: 0; text-align: right; font-size: .86rem; line-height: 1.5; color: var(--muted); white-space: nowrap; }
.trk-step-time time span { display: block; }
.trk-empty { margin: 0; color: var(--muted); }

/* ---------------------------------------------------------------- responsive (container) */
@container trk (max-width: 1060px) {
  .trk-top { grid-template-columns: minmax(0, 1fr); }
  .trk-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 0; padding: 18px 20px; }
  .trk-strip-item, .trk-strip-item + .trk-strip-item, .trk-strip-item:first-child { padding: 2px 16px 2px 50px; border-left: 0; }
  .trk-strip-item + .trk-strip-item .trk-strip-icon { left: 0; }
  .trk-strip dd { white-space: normal; }
}
@container trk (max-width: 940px) {
  .trk-cols { grid-template-columns: minmax(0, 1fr); }
}
@container trk (max-width: 560px) {
  .trk-glance { grid-template-columns: minmax(0, 1fr); min-height: 0; background: #fff; }
  .trk-glance-panel { margin: 0; border: 0; border-radius: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 14px 16px; }
  .trk-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
  .trk-strip-item, .trk-strip-item + .trk-strip-item, .trk-strip-item:first-child { padding: 2px 8px 2px 42px; }
  .trk-strip-item:last-child { grid-column: 1 / -1; }
  .trk-strip-icon .icon { width: 28px; height: 28px; }
  .trk-strip dd { font-size: .95rem; }
  .trk-dl .dl-row { grid-template-columns: minmax(0, 50%) minmax(0, 1fr); font-size: .9rem; }
  .trk-dl dt { gap: 12px; }
  .trk-step { column-gap: 14px; }
  .trk-map { margin: 0 -6px; }
  .trk-map-wide { display: none; }
  .trk-map-compact { display: block; }
  .trk-glance-map { display: none; }
}

/* ---------------------------------------------------------------- responsive (viewport: hero + page chrome) */
@media (max-width: 1100px) {
  .trk-hero-media { width: 100%; object-position: 70% 50%; }
  .trk-hero::before { background: linear-gradient(90deg, rgba(10, 43, 88, .96) 0%, rgba(10, 43, 88, .86) 45%, rgba(10, 43, 88, .35) 100%); }
}
@media (max-width: 900px) {
  .trk-how-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .trk-hero-inner { padding-top: 36px; padding-bottom: 26px; }
  .trk-hero::before { background: linear-gradient(180deg, rgba(10, 43, 88, .95) 0%, rgba(10, 43, 88, .88) 60%, rgba(10, 43, 88, .8) 100%); }
  .trk-hero-text { margin-bottom: 20px; }
  .trk-search { grid-template-columns: 52px minmax(0, 1fr); padding: 10px 10px 10px 0; row-gap: 10px; }
  .trk-search-icon .icon { width: 26px; height: 26px; }
  .trk-search-input { height: 54px; font-size: 1rem; padding: 0 14px; }
  .trk-search-btn { grid-column: 1 / -1; margin-left: 10px; width: calc(100% - 10px); min-width: 0; height: 54px; }
  .trk-search-msg { margin-left: 12px; }
  .trk-result-section { padding: 14px 0 22px; }
  .trk-wrap { padding: 0 12px; }
  .trk-panel { padding: 16px 14px 18px; border-radius: 10px; }
  .trk-card { padding: 16px 14px; }
}
