﻿/* =============================================
   TRACK ORDER PAGE CSS - PREMIUM DARK THEME
   ============================================= */

.to-main {
  min-height: 80vh;
  background: var(--body-bg);
  padding-bottom: 80px;
}

/* Hero Section */
.to-hero {
  background: radial-gradient(circle at top, var(--bg-surface) 0%, var(--bg-base) 100%);
  color: var(--text-primary);
  text-align: center;
  padding: 64px 24px 56px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.to-hero::before {
  content: '';
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: var(--gold-glow-lg);
  filter: blur(120px);
  border-radius: 50%;
  pointer-events: none;
}

.to-hero-icon {
  width: 76px;
  height: 76px;
  background: rgba(245, 194, 0, 0.08);
  border: 1px solid rgba(245, 194, 0, 0.2);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 0 rgba(245,194,0,0.1);
  }
  50% {
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 20px 4px rgba(245,194,0,0.2);
  }
}

.to-hero-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--gold);
}

.to-hero h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(32px, 6vw, 54px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 14px;
  color: #fff;
  text-transform: uppercase;
}

.to-hero p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Search Section */
.to-search-section {
  max-width: 640px;
  margin: -32px auto 0;
  padding: 0 16px;
  position: relative;
  z-index: 10;
}

.to-search-card {
  background: var(--bg-surface);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: var(--shadow-xl), 0 0 40px rgba(0,0,0,0.6);
  border: 1px solid var(--border-color);
}

.to-search-form {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

.to-input-wrap {
  position: relative;
  flex: 1;
}

.to-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
  transition: var(--transition);
}

.to-input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  font-size: 15px;
  color: #fff;
  background: var(--bg-input);
  transition: var(--transition);
  font-family: inherit;
  outline: none;
}

.to-input:focus {
  border-color: var(--gold);
  background: var(--bg-elevated);
  box-shadow: 0 0 16px var(--gold-glow);
}

.to-input:focus + .to-input-icon {
  stroke: var(--gold);
}

.to-track-btn {
  width: 100%;
  padding: 16px 28px;
  background: var(--gold);
  color: #080808;
  border: none;
  border-radius: 14px;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--spring);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-btn);
}

.to-track-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover);
  background: #ffd000;
}

.to-track-btn:active {
  transform: translateY(1px);
}

.to-track-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.to-search-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 14px;
  text-align: center;
  opacity: 0.8;
}

@media (min-width: 480px) {
  .to-search-form {
    flex-direction: row;
  }
  .to-track-btn {
    width: auto;
    min-width: 150px;
  }
}

/* Error State */
.to-error {
  max-width: 480px;
  margin: 64px auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeInUp 0.4s ease;
}

.to-error-icon {
  font-size: 64px;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

.to-error h3 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.to-error p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

/* Result Area */
.to-result {
  max-width: 640px;
  margin: 36px auto 0;
  padding: 0 16px;
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards Base */
.to-order-card,
.to-product-card,
.to-address-card,
.to-progress-section,
.to-timeline-section,
.to-truck-section,
.to-delivered-section {
  background: var(--bg-surface);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

/* Order Header Card */
.to-order-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.to-order-id-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.to-order-label {
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.to-order-id {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

/* Status Badge */
.to-status-badge {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.to-stage-0 { background: rgba(255,167,38,0.1); color: #ffa726; border: 1px solid rgba(255,167,38,0.25); }
.to-stage-1 { background: rgba(102,187,106,0.1); color: #66bb6a; border: 1px solid rgba(102,187,106,0.25); }
.to-stage-2 { background: rgba(66,165,245,0.1); color: #42a5f5; border: 1px solid rgba(66,165,245,0.25); }
.to-stage-3 { background: rgba(239,83,80,0.1); color: #ef5350; border: 1px solid rgba(239,83,80,0.25); }
.to-stage-4 { background: rgba(171,71,188,0.1); color: #ab47bc; border: 1px solid rgba(171,71,188,0.25); }
.to-stage-5 { background: rgba(38,166,154,0.1); color: #26a69a; border: 1px solid rgba(38,166,154,0.25); }
.to-stage-6 { background: rgba(255,202,40,0.1); color: #ffca28; border: 1px solid rgba(255,202,40,0.25); }
.to-stage-7 { background: rgba(102,187,106,0.15); color: #66bb6a; border: 1px solid rgba(102,187,106,0.3); }

.to-order-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.to-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.to-meta-label {
  font-family: 'Syne', sans-serif;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.to-meta-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Product Card */
.to-product-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.to-product-img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.to-product-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.to-product-name {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}

.to-product-variants {
  font-size: 12px;
  color: var(--text-secondary);
}

.to-product-price {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 900;
  color: var(--gold);
}

/* Address Card */
.to-address-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.to-address-icon {
  width: 44px;
  height: 44px;
  background: rgba(255,68,68,0.08);
  border: 1px solid rgba(255,68,68,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.to-address-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--red);
}

.to-address-label {
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.to-address-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  line-height: 1.6;
}

/* Progress Section */
.to-progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.to-progress-bar {
  flex: 1;
  height: 12px;
  background: var(--bg-elevated);
  border-radius: 100px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.to-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: 100px;
  transition: width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.to-progress-pct {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 900;
  color: var(--green);
  min-width: 48px;
  text-align: right;
}

/* Timeline Section */
.to-timeline-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.to-timeline {
  display: flex;
  flex-direction: column;
}

.to-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  padding-bottom: 28px;
}

.to-timeline-item:last-child {
  padding-bottom: 0;
}

.to-tl-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  z-index: 1;
  color: var(--text-secondary);
  transition: var(--transition);
}

.to-timeline-item.done .to-tl-dot {
  background: rgba(0,214,143,0.1);
  border-color: var(--green);
  color: var(--green);
}

.to-timeline-item.current .to-tl-dot {
  background: var(--gold);
  border-color: var(--gold);
  color: #080808;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(245,194,0,0.4); }
  70% { box-shadow: 0 0 0 8px rgba(245,194,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,194,0,0); }
}

.to-tl-line {
  position: absolute;
  left: 18px;
  top: 38px;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
  z-index: 0;
}

.to-timeline-item.done .to-tl-line {
  background: var(--green);
}

.to-timeline-item:last-child .to-tl-line {
  display: none;
}

.to-tl-content {
  flex: 1;
  padding-top: 8px;
}

.to-tl-title {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.to-timeline-item.done .to-tl-title {
  color: #fff;
}

.to-timeline-item.current .to-tl-title {
  color: var(--gold);
}

.to-tl-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.to-timeline-item.done .to-tl-desc {
  color: var(--text-secondary);
}

.to-tl-time {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  margin-top: 6px;
}

/* Truck Animation */
.to-truck-section {
  background: linear-gradient(135deg, rgba(0,214,143,0.04), rgba(245,194,0,0.02));
  border-color: rgba(255,255,255,0.06);
  text-align: center;
  padding: 28px 24px;
}

.to-truck-road {
  position: relative;
  height: 60px;
  margin-bottom: 14px;
  overflow: hidden;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.to-truck {
  position: absolute;
  font-size: 40px;
  animation: driveAcross 4s ease-in-out infinite;
  top: 6px;
}

.to-road-line {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--green) 0, var(--green) 30px, transparent 30px, transparent 50px);
  animation: roadMove 0.8s linear infinite;
  opacity: 0.6;
}

@keyframes driveAcross {
  0%   { left: -10%; }
  100% { left: 100%; }
}

@keyframes roadMove {
  0%   { background-position: 0 0; }
  100% { background-position: 50px 0; }
}

.to-truck-msg {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Delivered Section */
.to-delivered-section {
  background: linear-gradient(135deg, rgba(0,214,143,0.08), rgba(0,214,143,0.02));
  border-color: rgba(0,214,143,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 24px;
  gap: 16px;
}

.to-delivered-check {
  width: 80px;
  height: 80px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #080808;
  font-weight: 900;
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 32px rgba(0,214,143,0.4);
}

@keyframes scaleIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.to-delivered-section h3 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
}

.to-delivered-section p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 340px;
  line-height: 1.6;
}

.to-shop-again-btn {
  display: inline-block;
  padding: 14px 36px;
  background: var(--gold);
  color: #080808;
  border-radius: 12px;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: var(--spring);
  text-decoration: none;
  box-shadow: var(--shadow-btn);
}

.to-shop-again-btn:hover {
  background: #ffd000;
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover);
}

/* Retry Button */
.to-retry-btn {
  padding: 14px 32px;
  background: transparent;
  border: 1.5px solid var(--text-primary);
  color: #fff;
  border-radius: 12px;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
}

.to-retry-btn:hover {
  background: #fff;
  color: #080808;
}

/* Orders List Area */
.to-orders-list {
  max-width: 640px;
  margin: 36px auto 0;
  padding: 0 16px;
  animation: fadeInUp 0.4s ease;
}

.to-orders-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
  color: #fff;
  text-transform: uppercase;
}

.to-mini-order-card {
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--spring);
  border: 1.5px solid var(--border-color);
}

.to-mini-order-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 16px var(--gold-glow);
}

.to-mini-order-card strong {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.to-mini-order-card small {
  font-size: 12px;
  color: var(--text-secondary);
}
