/* Public order tracking page – layout from reference; colors aligned with app (#667eea) */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #FFF;
  min-height: 100vh;
  color: #333;
}

.track-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px;
}

.hidden {
  display: none !important;
}

/* ----- Lookup section ----- */
.track-lookup {
  background: #fff;
  border-radius: 8px;
  padding: 32px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.track-lookup-title {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.track-lookup-subtitle {
  font-size: 15px;
  color: #666;
  margin-bottom: 24px;
}

.track-lookup-form {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.track-lookup-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
}

.track-lookup-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.track-lookup-btn {
  background: #667eea;
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.track-lookup-btn:hover {
  background: #5568d3;
}

.track-lookup-hint {
  font-size: 13px;
  color: #888;
}

/* ----- Result: header bar ----- */
.track-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  background: #667eea;
  color: #fff;
  padding: 20px 24px;
  border-radius: 8px 8px 0 0;
}

.track-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.track-order-label {
  font-size: 13px;
  opacity: 0.95;
}

.track-status {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* The current stage in plain words, directly under the stage name. Inherits
   the header's white on #667eea; matches .track-order-label's treatment. */
.track-status-desc {
  font-size: 14px;
  line-height: 1.45;
  opacity: 0.95;
  max-width: 52ch;
}

.track-status-desc:empty {
  display: none;
}

/* ----- Info note ----- */
.track-info {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 20px;
  background: #e8f0fe;
  border-left: 4px solid #5568d3;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #1a1a2e;
}

.track-info-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #5568d3;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
}

.track-info-text {
  flex: 1;
}

/* ----- Timeline ----- */
.track-timeline {
  background: #fff;
  padding: 24px 24px 24px 48px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

.track-result .track-info {
  border-radius: 0 0 8px 8px;
  margin-bottom: 0;
}

.track-stage {
  display: flex;
  gap: 20px;
  position: relative;
  padding-bottom: 28px;
}

.track-stage:last-child {
  padding-bottom: 0;
}

.track-stage:last-child .track-stage-marker::after {
  display: none;
}

.track-stage-marker {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

.track-stage-marker::after {
  content: '';
  position: absolute;
  left: 9px;
  top: 24px;
  bottom: -28px;
  width: 2px;
  background: #e0e0e0;
}

.track-stage--completed .track-stage-marker {
  background: #22c55e;
  border: none;
}

.track-stage--completed .track-stage-marker::after {
  background: #22c55e;
}

.track-stage--current .track-stage-marker {
  background: transparent;
  border: 3px solid #f59e0b;
  box-sizing: border-box;
}

.track-stage--current .track-stage-marker::after {
  background: #e0e0e0;
}

.track-stage--current .track-stage-title {
  color: #f59e0b;
  font-weight: 700;
}

.track-stage--pending .track-stage-marker {
  background: transparent;
  border: 2px solid #c4c4c4;
}

.track-stage--pending .track-stage-title {
  color: #6b7280;
  font-weight: 700;
}

.track-stage-content {
  flex: 1;
  min-width: 0;
}

.track-stage-date {
  display: block;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}

.track-stage-title {
  font-size: 16px;
  color: #333;
  margin-bottom: 4px;
}

.track-stage-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.45;
}

.track-stage-tracking {
  font-size: 14px;
  color: #666;
  line-height: 1.45;
  margin-top: 6px;
}

.track-stage-tracking a {
  color: #667eea;
  text-decoration: none;
}

.track-stage-tracking a:hover {
  text-decoration: underline;
}

.track-stage-tracking--unavailable {
  color: #888;
  font-style: italic;
}

/* ----- Error ----- */
.track-error {
  background: #fff;
  border-radius: 8px;
  padding: 32px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.track-error-title {
  font-size: 20px;
  color: #333;
  margin-bottom: 8px;
}

.track-error-message {
  font-size: 15px;
  color: #666;
  margin-bottom: 20px;
}

.track-error-btn {
  background: #667eea;
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 15px;
  border-radius: 6px;
  cursor: pointer;
}

.track-error-btn:hover {
  background: #5568d3;
}

/* ----- Loading ----- */
.track-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.track-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e0e0e0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: track-spin 0.8s linear infinite;
}

.track-loading p {
  font-size: 15px;
  color: #666;
}

@keyframes track-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
  .track-timeline {
    padding-left: 40px;
  }
}
