/* ============================================================
   AliExpress Tracking — aliexpresstracking.co
   Theme: warm cream / dark brown, orange accent (from logo)
   ============================================================ */

:root {
  --bg: #f6f1e9;
  --bg-soft: #efe7da;
  --surface: #ffffff;
  --ink: #3d2b1a;
  --ink-strong: #33220f;
  --muted: #7c6b57;
  --line: #e5dccd;
  --brand: #53351b;
  --brand-hover: #6a4525;
  --accent: #f5821f;
  --accent-soft: #fdebd9;
  --radius: 14px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px rgba(61, 43, 26, 0.08);
  --font: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body { overflow-x: hidden; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--brand); }

.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

/* ---------- Header / Navbar ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  padding: 18px 0;
}

.nav-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.nav-row .brand-logo { grid-column: 1; justify-self: start; }
.nav-row .nav-pill { grid-column: 2; justify-self: center; }
.nav-row .nav-cta { grid-column: 3; grid-row: 1; justify-self: end; }
.nav-row .nav-toggle { grid-column: 3; grid-row: 1; justify-self: end; }

.brand-logo { flex-shrink: 0; }

.brand-logo img { height: 28px; width: auto; }

@media (max-width: 480px) {
  .brand-logo img { height: 22px; }
}

.nav-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 8px 12px;
  box-shadow: 0 4px 18px rgba(61, 43, 26, 0.07);
}

.nav-indicator {
  position: absolute;
  top: 8px;
  left: 0;
  height: calc(100% - 16px);
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
}

.nav-indicator.ready {
  transition: left 0.55s cubic-bezier(0.4, 0, 0.2, 1), width 0.55s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s;
}

.nav-pill a {
  position: relative;
  z-index: 1;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  transition: color 0.2s;
}

.nav-pill a.active { color: var(--brand); }

.btn {
  display: inline-block;
  white-space: nowrap;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  transition: background 0.2s, transform 0.15s;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover { background: var(--brand-hover); transform: translateY(-1px); }

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover { background: #e07310; transform: translateY(-1px); }

.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--ink);
}

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  padding: 56px 0 44px;
}

.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.12;
  font-weight: 600;
  color: var(--ink-strong);
  letter-spacing: -0.5px;
}

.hero .lede {
  max-width: 600px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* ---------- Tracking widget ---------- */

.track-widget {
  max-width: 640px;
  margin: 34px auto 0;
}

.track-form {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 8px;
  box-shadow: var(--shadow);
}

.track-form input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--ink);
  padding: 10px 18px;
  min-width: 0;
}

.track-form input::placeholder { color: #b3a693; }

.track-form .btn { white-space: nowrap; }

.track-help {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.track-help a { color: var(--brand); }

.track-micro {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.track-result {
  margin-top: 22px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  display: none;
}

.track-result.visible { display: block; }

.track-result h3 { color: var(--ink-strong); margin-bottom: 6px; }

.track-result p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Stat bar ---------- */

.stat-bar {
  margin: 56px auto 0;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  text-align: center;
}

.stat-bar .stat strong {
  display: block;
  font-size: 1.3rem;
  color: var(--brand);
  font-weight: 600;
}

.stat-bar .stat span { color: var(--muted); font-size: 0.9rem; }

/* ---------- Sections ---------- */

.section { padding: 48px 0 8px; }

.section h2 {
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  color: var(--ink-strong);
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: -0.3px;
}

.section h3 {
  font-size: 1.05rem;
  color: var(--ink-strong);
  font-weight: 600;
  margin: 26px 0 8px;
}

.section p { margin-bottom: 14px; }

.section .muted { color: var(--muted); }

/* ---------- Feature grid ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 30px;
}

.feature-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.feature-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}

.feature-card h3 { margin: 0 0 8px; font-size: 1.05rem; }

.feature-card p { color: var(--muted); font-size: 0.93rem; margin: 0; }

/* ---------- Steps ---------- */

.steps { margin-top: 26px; display: grid; gap: 16px; }

.step {
  display: flex;
  gap: 18px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow);
  align-items: flex-start;
}

.step .num {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.step p { margin: 0; color: var(--muted); }

.step strong { color: var(--ink-strong); }

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.93rem;
  min-width: 560px;
}

th, td {
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

th {
  background: var(--brand);
  color: #fff;
  font-weight: 500;
}

tr:last-child td { border-bottom: none; }

tbody tr:nth-child(even) { background: #fbf8f2; }

/* ---------- FAQ ---------- */

.faq-list { margin-top: 26px; display: grid; gap: 12px; }

.faq-item {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 24px;
  font-weight: 600;
  color: var(--ink-strong);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--accent);
  transition: transform 0.2s;
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item .faq-body { padding: 0 24px 18px; color: var(--muted); }

/* ---------- Callout / CTA band ---------- */

.cta-band {
  margin: 64px 0 0;
  background: var(--brand);
  border-radius: 20px;
  padding: 48px 32px;
  text-align: center;
  color: #fff;
}

.cta-band h2 { color: #fff; font-size: 1.4rem; margin-bottom: 10px; font-weight: 600; }

.cta-band p { color: #e8dccb; max-width: 560px; margin: 0 auto 24px; }

/* ---------- Page hero (inner pages) ---------- */

.page-hero {
  text-align: center;
  padding: 56px 0 12px;
}

.page-hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: var(--ink-strong);
  font-weight: 600;
  letter-spacing: -0.4px;
}

.page-hero p {
  max-width: 620px;
  margin: 16px auto 0;
  color: var(--muted);
}

/* ---------- Prose (legal & about pages) ---------- */

.prose {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 0 24px;
}

.prose h2 { font-size: 1.45rem; color: var(--ink-strong); margin: 34px 0 12px; font-weight: 600; }

.prose h3 { font-size: 1.1rem; color: var(--ink-strong); margin: 24px 0 8px; font-weight: 600; }

.prose p, .prose li { color: var(--ink); margin-bottom: 12px; }

.prose ul { padding-left: 22px; margin-bottom: 14px; }

.prose .updated { color: var(--muted); font-size: 0.9rem; }

/* ---------- Blog cards ---------- */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 26px 0 8px;
}

.chip {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 500;
}

.chip.accent { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--brand); }

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 36px 0 24px;
}

.post-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-card .tag {
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.post-card h3 { font-size: 1.05rem; color: var(--ink-strong); font-weight: 600; line-height: 1.4; }

.post-card p { color: var(--muted); font-size: 0.92rem; flex: 1; }

.post-card .read { color: var(--accent); font-weight: 600; font-size: 0.9rem; text-decoration: none; }

/* ---------- Contact form ---------- */

.contact-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  margin: 36px 0 24px;
  align-items: start;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.card h3 { color: var(--ink-strong); margin-bottom: 12px; }

.card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 12px; }

.form-grid { display: grid; gap: 16px; }

.form-grid .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-strong);
  margin-bottom: 6px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--accent); }

.form-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--muted);
}

.form-consent input { margin-top: 4px; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 80px;
  background: #2e2013;
  color: #cbbfae;
  padding: 56px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}

.footer-grid h4 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.footer-grid ul { list-style: none; }

.footer-grid li { margin-bottom: 9px; }

.footer-grid a {
  color: #cbbfae;
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-grid a:hover { color: var(--accent); }

.footer-brand img {
  height: 34px;
  width: auto;
  margin-bottom: 16px;
  filter: brightness(0) invert(1);
}

.footer-brand p { font-size: 0.88rem; line-height: 1.7; }

.footer-bottom {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid #46351f;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-bottom a { color: #cbbfae; text-decoration: none; }

.footer-bottom a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .feature-grid, .post-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-bar { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-pill {
    display: none;
    position: absolute;
    top: 74px;
    left: 4%;
    right: 4%;
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow);
  }
  .nav-pill.open { display: flex; }
  .nav-pill a { text-align: center; }
  .nav-pill a.active { background: var(--accent-soft); }
  .nav-indicator { display: none; }
  .nav-cta { display: none; }
}

@media (max-width: 680px) {
  .feature-grid, .post-grid { grid-template-columns: 1fr; }
  .track-form { flex-direction: column; border-radius: var(--radius); }
  .track-form .btn { width: 100%; }
  .form-grid .two-col { grid-template-columns: 1fr; }
  .cta-band { padding: 36px 20px; }
  .stat-bar { padding: 20px 16px; gap: 14px; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- Tracking result timeline ---------- */

.track-loading { color: var(--muted); font-size: 0.95rem; margin: 0; }

.track-card + .track-card {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.track-eta {
  color: var(--ink-strong) !important;
  font-size: 0.9rem !important;
  margin: 8px 0 0 !important;
}

.track-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.track-meta span {
  background: var(--accent-soft);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

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

.timeline li {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
}

/* Connector line between scans, stopping at the last one. */
.timeline li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.timeline .dot {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line);
  margin-top: 5px;
  position: relative;
  z-index: 1;
}

.timeline li.current .dot { background: var(--accent); }

.timeline .event-status {
  margin: 0;
  color: var(--ink-strong);
  font-size: 0.95rem;
  font-weight: 500;
}

.timeline li.current .event-status { font-weight: 600; }

.timeline .event-meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.track-pickup {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: var(--brand) !important;
  line-height: 1.5;
}

.timeline .event-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--bg);
  border-left: 3px solid var(--accent-soft);
  padding: 7px 12px;
  border-radius: 0 8px 8px 0;
}
