/* ═══════════════════════════════════════════════════════════════════
   NOVISHI Track Order — track-order.css
   Track-order-specific styles only. Shared styles live in main.css,
   components.css, and footer.css.
═══════════════════════════════════════════════════════════════════ */

/* ─── Page Base ───────────────────────────────────────────────────── */
body { background: #f7f8fb; }

/* ─── Hero ────────────────────────────────────────────────────────── */
.track-hero {
  background: #fff;
  border-bottom: 1px solid #e7e7e7;
  padding: 56px 0 48px;
  text-align: center;
}
.track-hero .section-eyebrow { display: block; margin-bottom: 14px; }
.track-hero__title {
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 800;
  color: #111827;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.track-hero__desc {
  font-size: 16.5px;
  color: #4B5563;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── Search Section ──────────────────────────────────────────────── */
.track-search-section {
  padding: 44px 0 0;
}

.track-search-card {
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 22px;
  padding: 36px 40px;
  max-width: 660px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(0,0,0,.05);
}

.track-search-card__head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 28px;
}

.track-search-card__icon {
  width: 52px;
  height: 52px;
  background: #EEF2FF;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #4F46E5;
  flex-shrink: 0;
  margin-top: 2px;
}

.track-search-card__title {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -.02em;
  margin-bottom: 5px;
  line-height: 1.2;
}

.track-search-card__desc {
  font-size: 14.5px;
  color: #6B7280;
  line-height: 1.6;
  margin: 0;
}

/* ─── Form ────────────────────────────────────────────────────────── */
.track-form { display: flex; flex-direction: column; gap: 20px; }

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

.track-field { display: flex; flex-direction: column; gap: 6px; }

.track-field label {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

.track-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.track-input-icon {
  position: absolute;
  left: 14px;
  font-size: 14px;
  color: #9CA3AF;
  pointer-events: none;
  z-index: 1;
}

.track-field input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 42px;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  font-size: 15px;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}
.track-field input::placeholder { color: #B0B7C3; }
.track-field input:focus {
  border-color: #4F46E5;
  box-shadow: 0 0 0 3.5px rgba(79,70,229,.1);
}
.track-field input.track-invalid {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.08);
}

.track-field-err {
  font-size: 12.5px;
  color: #DC2626;
  font-weight: 500;
  min-height: 17px;
  line-height: 1.3;
}

/* ─── Track Button ────────────────────────────────────────────────── */
.track-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 54px;
  padding: 0 32px;
  background: #4F46E5;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  align-self: flex-start;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 6px 24px rgba(79,70,229,.3);
  min-width: 160px;
}
.track-btn:hover:not(:disabled) {
  background: #4338CA;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(79,70,229,.36);
}
.track-btn:active:not(:disabled) { transform: translateY(0); }
.track-btn:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }
.track-btn:focus-visible {
  outline: 3px solid rgba(79,70,229,.45);
  outline-offset: 3px;
}

.track-btn__icon { font-size: 13px; }

.track-spinner {
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tl-spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes tl-spin { to { transform: rotate(360deg); } }

/* ─── Result Section ──────────────────────────────────────────────── */
.track-result-section {
  padding: 28px 0 0;
}

/* ─── Idle State ──────────────────────────────────────────────────── */
.track-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 24px 40px;
  max-width: 440px;
  margin: 0 auto;
}
.track-idle__icon {
  width: 80px;
  height: 80px;
  background: #EEF2FF;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: #4F46E5;
  margin-bottom: 22px;
}
.track-idle h3 {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 10px;
  letter-spacing: -.02em;
}
.track-idle p {
  font-size: 15px;
  color: #6B7280;
  line-height: 1.7;
}

/* ─── Not Found State ─────────────────────────────────────────────── */
.track-notfound {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 24px 36px;
  max-width: 480px;
  margin: 0 auto;
}
.track-notfound__icon {
  width: 72px;
  height: 72px;
  background: #FEF2F2;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #DC2626;
  margin-bottom: 20px;
}
.track-notfound h3 {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 10px;
}
.track-notfound p {
  font-size: 14.5px;
  color: #6B7280;
  line-height: 1.7;
  margin-bottom: 8px;
}
.track-notfound__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 22px;
}
.track-notfound__try-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 46px;
  padding: 0 24px;
  background: #4F46E5;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.track-notfound__try-btn:hover { background: #4338CA; transform: translateY(-1px); }
.track-notfound__help-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 46px;
  padding: 0 24px;
  background: #fff;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  border: 1.5px solid #E5E7EB;
  transition: border-color .2s, color .2s;
}
.track-notfound__help-link:hover { border-color: #4F46E5; color: #4F46E5; }

/* ─── Order Result ────────────────────────────────────────────────── */
.track-order-result {
  animation: tl-fadein .3s ease forwards;
}
@keyframes tl-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Order header card */
.track-order-header {
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 20px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.track-order-id {
  font-size: 13px;
  font-weight: 700;
  color: #4F46E5;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.track-order-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -.03em;
  margin-bottom: 6px;
}

.track-order-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.track-order-date {
  font-size: 14px;
  color: #6B7280;
  display: flex;
  align-items: center;
  gap: 6px;
}
.track-order-date i { color: #9CA3AF; font-size: 12px; }

/* ─── Status Badges ───────────────────────────────────────────────── */
.track-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .1px;
  white-space: nowrap;
}
.track-status-badge i { font-size: 11px; }

.track-status--pending    { background: #F3F4F6; color: #4B5563; }
.track-status--confirmed  { background: #DBEAFE; color: #1D4ED8; }
.track-status--processing { background: #EDE9FE; color: #6D28D9; }
.track-status--shipped    { background: #E0F2FE; color: #0369A1; }
.track-status--in_transit { background: #FEF3C7; color: #92400E; }
.track-status--delivered  { background: #DCFCE7; color: #166534; }
.track-status--cancelled  { background: #FEE2E2; color: #991B1B; }
.track-status--refunded   { background: #FEF9C3; color: #854D0E; }

/* ─── Timeline Card ───────────────────────────────────────────────── */
.track-timeline-card {
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 16px;
}

.track-timeline-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 28px;
}

/* Cancelled / refunded banner */
.track-status-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 500;
}
.track-status-banner--cancelled { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.track-status-banner--refunded  { background: #FFFBEB; color: #854D0E; border: 1px solid #FDE68A; }
.track-status-banner i { font-size: 18px; flex-shrink: 0; }

/* ─── Horizontal Timeline (desktop) ──────────────────────────────── */
.track-tl-inner {
  display: flex;
  align-items: flex-start;
  position: relative;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.track-tl-inner::-webkit-scrollbar { display: none; }

.track-tl-stage {
  flex: 1;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  text-align: center;
}

/* Connector line between stages */
.track-tl-stage:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 19px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 2px;
  background: #E5E7EB;
  z-index: 0;
  transition: background .3s;
}
.track-tl-stage.completed:not(:last-child)::after {
  background: #4F46E5;
}

/* Stage dot */
.track-tl-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #E5E7EB;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #D1D5DB;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  transition: border-color .25s, background .25s, color .25s, box-shadow .25s;
}

.track-tl-stage.completed .track-tl-dot {
  background: #4F46E5;
  border-color: #4F46E5;
  color: #fff;
  box-shadow: 0 2px 10px rgba(79,70,229,.28);
}

.track-tl-stage.current .track-tl-dot {
  border-color: #4F46E5;
  border-width: 2.5px;
  color: #4F46E5;
  box-shadow: 0 0 0 5px rgba(79,70,229,.12);
}

/* Pulse on current stage dot */
.track-tl-stage.current .track-tl-dot::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(79,70,229,.25);
  animation: tl-pulse 2s ease infinite;
}

@keyframes tl-pulse {
  0%   { transform: scale(1);   opacity: 1; }
  70%  { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}

.track-tl-stage.future .track-tl-dot {
  background: #F9FAFB;
  border-color: #E5E7EB;
  color: #D1D5DB;
}

.track-tl-label {
  font-size: 12px;
  font-weight: 600;
  color: #9CA3AF;
  margin-top: 10px;
  line-height: 1.3;
  max-width: 80px;
}
.track-tl-stage.completed .track-tl-label { color: #4F46E5; }
.track-tl-stage.current   .track-tl-label { color: #111827; font-weight: 700; }

/* ─── Details Grid ────────────────────────────────────────────────── */
.track-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.track-details-card {
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 18px;
  padding: 24px;
}

.track-details-card h3 {
  font-size: 12px;
  font-weight: 700;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-bottom: 14px;
}

/* Shipping card */
.track-shipping-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.track-shipping-name {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}
.track-shipping-addr {
  font-size: 14px;
  color: #4B5563;
  line-height: 1.6;
}

/* Tracking number card */
.track-number-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.track-number-val {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
  letter-spacing: .3px;
  word-break: break-all;
}
.track-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  background: #EEF2FF;
  color: #4F46E5;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background .2s, color .2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.track-copy-btn:hover { background: #E0E7FF; }
.track-copy-btn:focus-visible { outline: 2px solid #4F46E5; outline-offset: 2px; }
.track-copy-btn.copied {
  background: #DCFCE7;
  color: #16A34A;
}

.track-carrier-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: #4F46E5;
  margin-top: 10px;
  transition: color .2s;
}
.track-carrier-link:hover { color: #3730A3; }
.track-carrier-link i { font-size: 11px; }

.track-no-number {
  font-size: 14px;
  color: #9CA3AF;
  font-style: italic;
  line-height: 1.5;
}

/* Delivery card */
.track-delivery-date {
  font-size: 17px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}
.track-delivery-note {
  font-size: 12.5px;
  color: #9CA3AF;
  line-height: 1.5;
}
.track-no-estimate {
  font-size: 14px;
  color: #9CA3AF;
  font-style: italic;
  line-height: 1.5;
}

/* ─── Order Summary Card ──────────────────────────────────────────── */
.track-summary-card {
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 20px;
  padding: 28px 32px;
  margin-bottom: 16px;
}

.track-summary-card h3 {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #F3F4F6;
}

.track-summary-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #F3F4F6;
}
.track-summary-item:last-of-type { border-bottom: none; }

.track-summary-img-wrap {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid #E5E7EB;
  background: #F9FAFB;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.track-summary-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.track-summary-img-ph { font-size: 22px; }

.track-summary-copy {
  flex: 1;
  min-width: 0;
}
.track-summary-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.track-summary-opts {
  font-size: 12.5px;
  color: #6B7280;
  line-height: 1.4;
}
.track-summary-qty-price {
  text-align: right;
  flex-shrink: 0;
}
.track-summary-price {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  display: block;
}
.track-summary-qty {
  font-size: 12.5px;
  color: #9CA3AF;
  display: block;
  margin-top: 2px;
}

/* Totals */
.track-summary-totals {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #E5E7EB;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.track-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #6B7280;
}
.track-totals-row strong { color: #111827; font-weight: 600; }
.track-totals-row.total {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  padding-top: 10px;
  border-top: 2px solid #111827;
  margin-top: 4px;
}
.track-totals-row.total strong { font-weight: 800; font-size: 18px; }
.track-free-shipping { color: #16A34A; font-weight: 600; }

/* ─── Need Help Section ───────────────────────────────────────────── */
.track-support-section {
  padding: 44px 0 80px;
}

.track-support-card {
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 22px;
  padding: 32px 40px;
  max-width: 740px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.track-support-card__icon {
  width: 56px;
  height: 56px;
  background: #EEF2FF;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #4F46E5;
  flex-shrink: 0;
}

.track-support-card__body {
  flex: 1;
  min-width: 0;
}
.track-support-card__body h2 {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -.02em;
  margin-bottom: 4px;
}
.track-support-card__body p {
  font-size: 14.5px;
  color: #6B7280;
  margin: 0;
}

.track-support-card__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
/* Resize shared buttons to fit the card */
.track-support-card__actions .btn-primary,
.track-support-card__actions .btn-outline {
  height: 48px;
  padding: 0 22px;
  font-size: 14px;
  border-radius: 12px;
}

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .track-search-card {
    padding: 28px 24px;
    border-radius: 18px;
  }
  .track-details-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .track-hero { padding: 44px 0 36px; }
  .track-search-section { padding: 32px 0 0; }
  .track-form-fields { grid-template-columns: 1fr; gap: 14px; }
  .track-btn { align-self: stretch; width: 100%; }

  /* Vertical timeline on mobile */
  .track-tl-inner {
    flex-direction: column;
    gap: 0;
    overflow-x: visible;
  }
  .track-tl-stage {
    flex-direction: row;
    align-items: flex-start;
    flex: none;
    text-align: left;
    min-width: 0;
    padding-bottom: 28px;
    padding-left: 0;
  }
  .track-tl-stage:last-child { padding-bottom: 0; }

  /* Vertical connector on the left side */
  .track-tl-stage:not(:last-child)::after {
    top: 40px;
    left: 19px;
    right: auto;
    width: 2px;
    height: calc(100% - 14px);
  }

  .track-tl-dot { flex-shrink: 0; }

  .track-tl-label {
    margin-top: 0;
    margin-left: 16px;
    max-width: none;
    padding-top: 10px;
    font-size: 14px;
  }

  .track-tl-stage.completed .track-tl-label,
  .track-tl-stage.current   .track-tl-label {
    font-size: 14px;
  }

  .track-details-grid {
    grid-template-columns: 1fr;
  }

  .track-order-header {
    padding: 22px 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .track-summary-card {
    padding: 22px 20px;
  }

  .track-support-card {
    padding: 24px 22px;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
  .track-support-card__actions {
    width: 100%;
  }
  .track-support-card__actions .btn-primary,
  .track-support-card__actions .btn-outline {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .track-hero__title { font-size: 28px; }
  .track-search-card__head { gap: 14px; }
  .track-search-card__title { font-size: 18px; }
  .track-timeline-card { padding: 22px 18px; }
  .track-details-card { padding: 20px 18px; }
  .track-notfound__actions { flex-direction: column; align-items: stretch; }
  .track-notfound__try-btn,
  .track-notfound__help-link { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .track-tl-stage.current .track-tl-dot::before { animation: none; }
  .track-spinner { animation: none; }
  .track-order-result { animation: none; }
  .track-btn,
  .track-copy-btn,
  .track-tl-dot { transition: none; }
}
