/* ===================== TOKENS ===================== */
:root {
  --red: #e01f26;
  --red-dark: #b3181d;
  --navy: #1b2a5b;
  --ink: #14161a;
  --black: #0a0a0a;
  --white: #ffffff;
  --header-bg: #f4f5f7;
  --grey-text: #4a4f57;
  --grey-line: #e2e4e8;
  --focus: #e01f26;
  --radius: 12px;
  --container: 1200px;
  --font-body: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: "Anton", Impact, "Arial Narrow", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: none; }

/* ===================== HEADER ===================== */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--grey-line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo { height: 52px; width: auto; display: block; }

.brand-fallback {
  display: none;
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: 1px;
  color: var(--red);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-link {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 6px 0;
  transition: color .2s ease;
}

.nav-link:hover { color: var(--red); }

.nav-link.active {
  color: var(--red);
  font-weight: 600;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--red);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
}

/* ===================== CLIENT AREA ===================== */
.client-area {
  background: #eef0f4;
  padding: 56px 0 72px;
  min-height: 52vh;
}

/* ---- Track panel (black-header card) ---- */
.track-panel {
  max-width: 860px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(16, 20, 30, .12);
}

.track-panel-head {
  background: var(--black);
  color: var(--white);
  text-align: center;
  padding: 40px 24px 34px;
}

.track-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1;
  letter-spacing: 1px;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.track-sub {
  font-size: clamp(14px, 1.6vw, 17px);
  color: #cfd2d8;
  margin: 0 auto;
  max-width: 520px;
}

.track-panel-body { padding: 30px 32px 34px; }

.track-form {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.track-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f6f7f9;
  border: 1px solid #d9dce2;
  border-radius: 12px;
  padding: 4px 16px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.track-box:focus-within {
  background: var(--white);
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(20, 22, 26, .08);
}

.track-icon { color: #9aa0aa; flex-shrink: 0; }

.track-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  padding: 16px 0;
}

.track-input::placeholder { color: #9aa0aa; }

.track-btn {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 12px;
  padding: 0 40px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
  flex-shrink: 0;
}

.track-btn:hover { background: var(--red-dark); }
.track-btn:active { transform: translateY(1px); }

.track-message {
  font-size: 14px;
  margin: 14px 0 0;
}
.track-message.err { color: var(--red); }

/* ---- Results ---- */
.track-results {
  max-width: 860px;
  margin: 26px auto 0;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(16, 20, 30, .08);
  padding: 30px 32px 34px;
}

.result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--grey-line);
}

.result-summary-main { display: flex; flex-direction: column; gap: 2px; }

.result-label {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #8a909a;
}

.result-awb {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .5px;
}

.result-status {
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 30px;
  white-space: nowrap;
}
.status-delivered { background: #e4f6ea; color: #1a8f4c; }
.status-transit   { background: #e7f0fe; color: #1565d8; }
.status-pending   { background: #fff4e0; color: #b8730a; }
.status-exception { background: #fdeaea; color: var(--red); }

.result-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--grey-line);
}

.result-meta > div { display: flex; flex-direction: column; gap: 4px; }

.meta-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #8a909a;
}
.meta-value { font-size: 15.5px; font-weight: 600; color: var(--ink); }

.timeline-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin: 26px 0 18px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-item {
  position: relative;
  padding: 0 0 24px 30px;
  border-left: 2px solid var(--grey-line);
}
.timeline-item:last-child { padding-bottom: 0; border-left-color: transparent; }

.timeline-dot {
  position: absolute;
  left: -8px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c7ccd4;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 1px var(--grey-line);
}
.timeline-item.is-latest .timeline-dot { background: var(--red); box-shadow: 0 0 0 1px var(--red); }

.timeline-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.timeline-activity { font-weight: 600; color: var(--ink); font-size: 15px; }
.timeline-when { font-size: 13px; color: #8a909a; white-space: nowrap; }
.timeline-location { font-size: 13.5px; color: var(--grey-text); }

.result-empty { text-align: center; padding: 20px 0; }
.result-empty h2 { font-size: 20px; margin: 0 0 8px; color: var(--ink); }
.result-empty p { color: var(--grey-text); margin: 0 auto; max-width: 460px; }
.result-empty a { color: var(--red); font-weight: 600; }

/* ===================== FOOTER ===================== */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--grey-line);
  padding: 70px 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr;
  gap: 48px;
}

.footer-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin: 0 0 18px;
  color: var(--ink);
}

.footer-text {
  margin: 0;
  color: var(--grey-text);
  font-size: 16px;
  line-height: 1.7;
}

.footer-text a { transition: color .2s ease; }
.footer-text a:hover { color: var(--red); }

/* Newsletter */
.newsletter { display: flex; flex-direction: column; align-items: flex-start; }

.newsletter-label {
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 10px;
}

.newsletter-input {
  width: 100%;
  max-width: 380px;
  padding: 15px 18px;
  border: 1px solid #cfd2d8;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.newsletter-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(20, 22, 26, .08);
}

.newsletter-btn {
  margin-top: 18px;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: 30px;
  padding: 15px 40px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
}

.newsletter-btn:hover { background: #262a30; }
.newsletter-btn:active { transform: translateY(1px); }

.newsletter-msg {
  font-size: 14px;
  margin: 14px 0 0;
  min-height: 18px;
}
.newsletter-msg.ok { color: #1a8f4c; }
.newsletter-msg.err { color: var(--red); }

.footer-bottom {
  margin-top: 60px;
  border-top: 1px solid var(--grey-line);
  padding: 22px 0;
}

.footer-bottom p {
  margin: 0;
  text-align: center;
  color: #8a909a;
  font-size: 14px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .main-nav {
    position: absolute;
    top: 84px;
    left: 0;
    right: 0;
    background: var(--header-bg);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 16px;
    border-bottom: 1px solid var(--grey-line);
    box-shadow: 0 12px 20px rgba(0, 0, 0, .06);
    display: none;
  }

  .main-nav.open { display: flex; }

  .main-nav .nav-link {
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--grey-line);
    font-size: 16px;
  }
  .main-nav .nav-link:last-child { border-bottom: none; }
  .nav-link.active::after { display: none; }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .result-meta { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .track-form { flex-direction: column; }
  .track-btn { padding: 15px 0; width: 100%; }
}

@media (max-width: 520px) {
  .container { padding: 0 18px; }
  .client-area { padding: 40px 0 56px; }
  .track-panel-body { padding: 24px 20px 28px; }
  .track-results { padding: 24px 20px 28px; }
  .track-input { font-size: 15px; }
  .result-meta { grid-template-columns: 1fr 1fr; gap: 14px; }
}
