/* ===== TRACKING TIMELINE — Estilo Mercado Livre ===== */

.tracking-timeline {
  position: relative;
  padding-left: 32px;
}

.tracking-timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-color);
}

/* ─── Event ─── */
.timeline-event {
  position: relative;
  padding-bottom: var(--sp-6);
  animation: fadeSlideUp 0.4s ease-out both;
}

.timeline-event:last-child { padding-bottom: 0; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.timeline-event:nth-child(1) { animation-delay: 0s; }
.timeline-event:nth-child(2) { animation-delay: 0.1s; }
.timeline-event:nth-child(3) { animation-delay: 0.2s; }
.timeline-event:nth-child(4) { animation-delay: 0.3s; }
.timeline-event:nth-child(5) { animation-delay: 0.4s; }
.timeline-event:nth-child(6) { animation-delay: 0.5s; }

/* ─── Dot ─── */
.timeline-dot {
  position: absolute;
  left: -32px;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  font-size: 14px;
}

.timeline-dot .material-icons-round {
  font-size: 14px;
}

/* Status dot colors */
.timeline-dot.preparando { background: var(--color-muted-soft); color: var(--color-muted); border: 2px solid var(--color-muted); }
.timeline-dot.conferindo { background: var(--color-info-soft); color: var(--color-info); border: 2px solid var(--color-info); }
.timeline-dot.pronto { background: var(--color-cyan-soft); color: var(--color-cyan); border: 2px solid var(--color-cyan); }
.timeline-dot.carregando { background: var(--color-orange-soft); color: var(--color-orange); border: 2px solid var(--color-orange); }
.timeline-dot.em_transito { background: var(--color-purple-soft); color: var(--color-purple); border: 2px solid var(--color-purple); }
.timeline-dot.entregue { background: var(--color-success-soft); color: var(--color-success); border: 2px solid var(--color-success); }
.timeline-dot.parcial { background: var(--color-warning-soft); color: var(--color-warning); border: 2px solid var(--color-warning); }
.timeline-dot.update { background: var(--brand-yellow-soft); color: var(--brand-yellow); border: 2px solid var(--brand-yellow); }

/* Current (last active) dot pulse */
.timeline-event.current .timeline-dot {
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,166,35,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(245,166,35,0); }
}

/* Future (pending) dot */
.timeline-event.future .timeline-dot {
  background: var(--bg-tertiary);
  border: 2px dashed var(--text-muted);
  color: var(--text-muted);
}

.timeline-event.future .timeline-content {
  opacity: 0.5;
}

/* ─── Content ─── */
.timeline-content {
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  margin-left: var(--sp-2);
}

.timeline-title {
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.timeline-description {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-top: var(--sp-1);
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.timeline-meta .material-icons-round {
  font-size: 14px;
}

/* ─── Public Tracking Page ─── */
.tracking-page {
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

.tracking-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--sp-5) var(--sp-6);
  text-align: center;
}

.tracking-header .logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.tracking-header img {
  width: 40px; height: 40px;
}

.tracking-header h1 {
  font-size: var(--fs-xl);
  color: var(--brand-yellow);
}

.tracking-search {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  gap: var(--sp-2);
}

.tracking-search input {
  flex: 1;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-full);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: var(--fs-base);
  outline: none;
}

.tracking-search input:focus { border-color: var(--brand-yellow); }

.tracking-body {
  flex: 1;
  max-width: 700px;
  margin: var(--sp-8) auto;
  padding: 0 var(--sp-6);
  width: 100%;
}

.tracking-status-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
  text-align: center;
}

.tracking-code {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--brand-yellow);
  margin-bottom: var(--sp-2);
}

.tracking-status-text {
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: var(--sp-3);
}

.tracking-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-4);
  text-align: left;
}

.tracking-info-item label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
}

.tracking-info-item span {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-primary);
}

.tracking-timeline-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
}

.tracking-timeline-section h2 {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ─── Not Found ─── */
.tracking-not-found {
  text-align: center;
  padding: var(--sp-10);
  color: var(--text-muted);
}

.tracking-not-found .material-icons-round {
  font-size: 80px;
  opacity: 0.2;
  display: block;
  margin-bottom: var(--sp-4);
}

.tracking-not-found h2 {
  font-size: var(--fs-xl);
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .tracking-body { margin: var(--sp-4) auto; padding: 0 var(--sp-4); }
  .tracking-info-grid { grid-template-columns: repeat(2, 1fr); }
}
