/* ================================================================
   THUS ESSENTIALS — track.css
   Order Tracer & Real-Time Transit Hub Styles
   ================================================================ */

.track-page {
  background-color: #0c0c0c;
  color: #f3ede2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.track-page .container {
  width: calc(100% - 32px);
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.track-main {
  flex: 1;
  padding: 130px 0 80px;
}

/* ── Hero Section ── */
.track-hero {
  text-align: center;
  padding: 20px 0 40px;
}

.track-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.track-beacon {
  position: relative;
  width: 8px;
  height: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.track-beacon__dot {
  width: 8px;
  height: 8px;
  background: #34c759;
  border-radius: 50%;
  box-shadow: 0 0 10px #34c759;
  animation: beaconPulse 2s infinite;
}

@keyframes beaconPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.track-kicker {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c8b9a6;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.track-title {
  font-family: var(--serif, 'Cormorant Garamond', serif);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: 16px;
  color: #f7f3ec;
}

.track-title em {
  font-style: italic;
  color: #d1c0aa;
}

.track-subtitle {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 0.95rem;
  color: #9c9489;
  max-width: 580px;
  margin: 0 auto 36px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* ── Search Input Box ── */
.track-search-box {
  max-width: 640px;
  width: 100%;
  margin: 0 auto 20px;
  display: flex;
  gap: 12px;
  background: rgba(26, 26, 26, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}

.track-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 12px;
}

.track-search-icon {
  width: 20px;
  height: 20px;
  color: #888;
}

.track-input-wrap input {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 0.96rem;
  outline: none;
}

.track-input-wrap input::placeholder {
  color: #666;
}

.track-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #c8b9a6;
  color: #111;
  border: none;
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  white-space: nowrap;
}

.track-submit-btn:hover {
  background: #dfd3c3;
  transform: translateY(-1px);
}

/* ── Chips ── */
.track-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: #888;
}

.track-chips__label {
  font-family: var(--sans, 'Inter', sans-serif);
}

.track-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c8b9a6;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.76rem;
  transition: all 0.2s;
}

.track-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

/* ── Results Section ── */
.track-results {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tracer-card {
  background: rgba(22, 22, 22, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
}

/* Header Card */
.tracer-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.tracer-order-tag {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c8b9a6;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 4px;
}

.tracer-customer-name {
  font-family: var(--serif, 'Cormorant Garamond', serif);
  font-size: 1.9rem;
  font-weight: 400;
  margin: 0 0 6px;
  color: #f7f3ec;
}

.tracer-order-meta {
  font-size: 0.84rem;
  color: #8c857b;
  margin: 0;
}

.tracer-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.tracer-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(52, 199, 89, 0.3);
  color: #4cd964;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tracer-status-dot {
  width: 7px;
  height: 7px;
  background: #34c759;
  border-radius: 50%;
}

.tracer-token-badge {
  font-size: 0.82rem;
  color: #9c9489;
}

.tracer-token-badge strong {
  color: #c8b9a6;
  letter-spacing: 0.08em;
}

/* ── Progress Stepper ── */
.tracer-stepper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.tracer-stepper-head h3 {
  font-family: var(--serif, 'Cormorant Garamond', serif);
  font-size: 1.45rem;
  font-weight: 400;
  margin: 0;
}

.tracer-live-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pulse-green {
  width: 6px;
  height: 6px;
  background: #34c759;
  border-radius: 50%;
  animation: beaconPulse 1.5s infinite;
}

.tracer-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  padding: 10px 0 20px;
}

.tracer-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
  flex: 1;
}

.tracer-step__marker {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #1e1e1e;
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 0.9rem;
  font-weight: 600;
  color: #888;
  margin-bottom: 12px;
  transition: all 0.4s ease;
}

.tracer-step__check {
  width: 18px;
  height: 18px;
  display: none;
  stroke: #fff;
}

.tracer-step__content h4 {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: #888;
}

.tracer-step__content p {
  font-size: 0.74rem;
  color: #666;
  margin: 0;
  max-width: 120px;
  line-height: 1.4;
}

/* Stepper Connector Lines */
.tracer-step__line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  top: 21px;
  z-index: 1;
  transition: background 0.4s ease;
}

/* Completed & Active states */
.tracer-step.is-completed .tracer-step__marker {
  background: #c8b9a6;
  border-color: #c8b9a6;
  color: #111;
}

.tracer-step.is-completed .tracer-step__num {
  display: none;
}

.tracer-step.is-completed .tracer-step__check {
  display: block;
  stroke: #111;
}

.tracer-step.is-completed .tracer-step__content h4 {
  color: #e5dacd;
}

.tracer-step.is-active .tracer-step__marker {
  background: #34c759;
  border-color: #34c759;
  color: #fff;
  box-shadow: 0 0 20px rgba(52, 199, 89, 0.5);
  animation: activePulse 2s infinite;
}

@keyframes activePulse {
  0%, 100% { box-shadow: 0 0 15px rgba(52, 199, 89, 0.4); }
  50% { box-shadow: 0 0 28px rgba(52, 199, 89, 0.8); }
}

.tracer-step.is-active .tracer-step__content h4 {
  color: #34c759;
}

.tracer-step.is-active .tracer-step__content p {
  color: #a8a095;
}

.tracer-step__line.is-active {
  background: #c8b9a6;
}

.tracer-status-pill.is-cancelled {
  background: rgba(255, 69, 58, 0.1);
  border-color: rgba(255, 69, 58, 0.35);
  color: #ff8a80;
}

.tracer-status-pill.is-cancelled .tracer-status-dot,
.tracer-step.is-cancelled .tracer-step__marker {
  background: #ff453a;
  border-color: #ff453a;
  color: #fff;
  box-shadow: none;
}

.tracer-step.is-cancelled .tracer-step__content h4 {
  color: #ff8a80;
}

/* ── Split Grid ── */
.tracer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}

.tracer-kicker-sm {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #888;
  display: block;
  margin-bottom: 4px;
}

.tracer-arrival-date {
  font-family: var(--serif, 'Cormorant Garamond', serif);
  font-size: 2.2rem;
  font-weight: 300;
  color: #f7f3ec;
  display: block;
  margin-bottom: 6px;
}

.tracer-location-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #c8b9a6;
}

.tracer-courier-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px 20px;
  border-radius: 12px;
  margin: 24px 0;
}

.tracer-courier-left strong {
  font-size: 1rem;
  color: #eee;
  display: block;
}

.tracer-waybill {
  font-size: 0.78rem;
  color: #888;
}

.tracer-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.tracer-wa-btn:hover {
  opacity: 0.9;
}

/* Milestones List */
.tracer-milestones-wrap h4 {
  font-family: var(--serif, 'Cormorant Garamond', serif);
  font-size: 1.3rem;
  font-weight: 400;
  margin: 0 0 16px;
}

.tracer-milestone-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tracer-milestone-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-left: 12px;
  border-left: 2px solid rgba(200, 185, 166, 0.4);
}

.tracer-milestone-time {
  font-size: 0.76rem;
  color: #888;
  white-space: nowrap;
}

.tracer-milestone-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: #ddd;
}

.tracer-milestone-desc {
  font-size: 0.78rem;
  color: #888;
}

/* Package Items Card */
.tracer-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.tracer-items-head h3 {
  font-family: var(--serif, 'Cormorant Garamond', serif);
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0;
}

.tracer-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.tracer-item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tracer-item-img {
  width: 50px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  background: #1e1e1e;
}

.tracer-item-info {
  flex: 1;
}

.tracer-item-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: #eee;
  margin: 0 0 4px;
}

.tracer-item-meta {
  font-size: 0.76rem;
  color: #888;
  margin: 0;
}

.tracer-item-price {
  font-size: 0.88rem;
  font-weight: 600;
  color: #c8b9a6;
}

.tracer-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.1rem;
}

.tracer-total-row strong {
  font-family: var(--serif, 'Cormorant Garamond', serif);
  font-size: 1.6rem;
  color: #f7f3ec;
}

.tracer-share-row {
  margin-top: 14px;
}

.tracer-copy-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 500;
  transition: background 0.2s;
}

.tracer-copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Error Card */
.tracer-error-card {
  text-align: center;
  padding: 60px 20px;
  background: rgba(22, 22, 22, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  margin-top: 30px;
}

.tracer-error-card svg {
  color: #ff453a;
  margin-bottom: 16px;
}

.tracer-error-card h3 {
  font-family: var(--serif, 'Cormorant Garamond', serif);
  font-size: 1.8rem;
  margin: 0 0 8px;
}

.tracer-error-card p {
  color: #888;
  margin: 0;
}

/* Responsive */
@media (max-width: 840px) {
  .track-main {
    padding-top: 105px;
  }

  .track-search-box {
    flex-direction: column;
    align-items: stretch;
    max-width: 100%;
  }

  .track-input-wrap {
    min-height: 48px;
  }

  .tracer-stepper {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .tracer-step {
    flex-direction: row;
    gap: 16px;
    text-align: left;
  }

  .tracer-step__marker {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .tracer-step__line {
    display: none;
  }

  .tracer-grid {
    grid-template-columns: 1fr;
  }

  .tracer-header-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .tracer-header-right {
    align-items: flex-start;
  }

  .tracer-stepper-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .tracer-courier-box,
  .tracer-items-head,
  .tracer-total-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .tracer-item-row {
    align-items: flex-start;
  }

  .tracer-item-price {
    align-self: flex-end;
  }
}

@media (max-width: 520px) {
  .track-page {
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
  }

  .track-page .track-main,
  .track-page .track-hero,
  .track-page .track-results,
  .track-page .tracer-card {
    max-width: 100%;
    box-sizing: border-box;
  }

  .track-page .track-main {
    width: 100vw;
    overflow-x: clip;
  }

  .track-page .container {
    width: calc(100vw - 56px) !important;
    max-width: calc(100vw - 56px) !important;
    margin-left: 28px !important;
    margin-right: 28px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .track-main {
    padding-bottom: 56px;
  }

  .track-hero__badge {
    justify-content: center;
    padding-inline: 10px;
    white-space: normal;
  }

  .track-title {
    font-size: 2.35rem;
  }

  .track-submit-btn,
  .tracer-copy-btn,
  .tracer-wa-btn {
    width: 100%;
    justify-content: center;
  }

  .track-subtitle,
  .track-hint {
    max-width: 320px;
  }

  .tracer-card {
    padding: 22px 18px;
    border-radius: 14px;
  }

  .tracer-token-badge,
  .tracer-order-meta,
  .tracer-waybill,
  .tracer-item-meta {
    overflow-wrap: anywhere;
  }

  .tracer-status-pill,
  .tracer-payment-badge {
    max-width: 100%;
    white-space: normal;
  }

  .tracer-arrival-date,
  .tracer-total-row strong {
    font-size: 1.65rem;
  }
}

.tracer-id-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.tracer-payment-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(52, 199, 89, 0.1);
  border: 1px solid rgba(52, 199, 89, 0.25);
  color: #4cd964;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.track-hint {
  max-width: 640px;
  margin: 0 auto;
  font-size: 0.78rem;
  color: #777;
  text-align: center;
}

/* ── Custom Cursor on Dark Track Page ── */
.track-page .cursor {
  background: #c8b9a6;
  box-shadow: 0 0 12px rgba(200, 185, 166, 0.6);
  opacity: 0;
  transition: opacity 0.25s ease, width 0.3s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
}

.track-page .cursor.expanded {
  background: rgba(200, 185, 166, 0.14);
  border: 1px solid rgba(200, 185, 166, 0.5);
  box-shadow: 0 0 24px rgba(200, 185, 166, 0.25);
}

.track-page .cursor-label {
  color: #f7f3ec;
  font-weight: 600;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
}
