/* ========== صفحه پیگیری سفارش ========== */
:root {
  --trk-red: #ef394e;
  --trk-red-deep: #d9143a;
  --trk-text: #0c0c0c;
  --trk-muted: #81858b;
  --trk-border: #e0e0e2;
  --trk-bg: #f3f4f6;
  --font: "Yekan Bakh", "YekanBakh", Estedad, Vazirmatn, Tahoma, sans-serif;
}

.track-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--trk-text);
  background: var(--trk-bg);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 1024px) {
  .track-page {
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  }
}

.trk-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(239, 57, 78, 0.14), transparent 55%),
    radial-gradient(700px 380px at 0% 90%, rgba(25, 191, 211, 0.1), transparent 50%),
    linear-gradient(180deg, #fafafa, #f0f1f4);
}
.trk-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  animation: trkOrb 10s ease-in-out infinite alternate;
}
.trk-bg__orb--a {
  width: 240px;
  height: 240px;
  background: rgba(239, 57, 78, 0.22);
  top: -50px;
  right: -40px;
}
.trk-bg__orb--b {
  width: 200px;
  height: 200px;
  background: rgba(25, 191, 211, 0.16);
  bottom: 18%;
  left: -50px;
  animation-delay: -4s;
}
.trk-bg__grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}
@keyframes trkOrb {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(16px, 20px, 0) scale(1.08); }
}

.trk-top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid #f0f0f1;
}
.trk-top__inner {
  height: 58px;
  display: grid;
  grid-template-columns: 42px 1fr 48px;
  align-items: center;
  gap: 8px;
}
.trk-top__back {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--trk-text);
  text-decoration: none;
}
.trk-top__back:hover { background: #f2f3f5; }
.trk-top__back .ti-icon { width: 22px; height: 22px; font-size: 22px; }
.trk-top__title {
  margin: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
}
.trk-top__logo.header__logo {
  width: auto;
  height: auto;
  border-radius: 0;
  justify-self: end;
  line-height: 0;
}
.trk-top__logo .header__logo-sq {
  width: 42px;
  height: 42px;
}

.trk {
  position: relative;
  z-index: 1;
  padding-top: 18px;
  max-width: 640px;
}
.track-page .header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.trk-hero {
  text-align: center;
  padding: 8px 8px 22px;
  animation: trkIn 0.55s cubic-bezier(0.22, 1.15, 0.36, 1) both;
}
.trk-hero__visual {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  animation: trkFloat 3.2s ease-in-out 0.8s infinite;
}
.trk-hero__ring {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(239, 57, 78, 0.28);
  animation: trkRing 2.8s ease-out infinite;
}
.trk-hero__ring--b {
  inset: 4px;
  border-color: rgba(239, 57, 78, 0.16);
  animation-delay: 0.9s;
}
@keyframes trkRing {
  0% { transform: scale(0.72); opacity: 0.85; }
  100% { transform: scale(1.2); opacity: 0; }
}
.trk-hero__icon {
  position: relative;
  z-index: 1;
  width: 84px;
  height: 84px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--trk-red) 0%, var(--trk-red-deep) 100%);
  color: #fff;
  box-shadow:
    0 14px 32px rgba(239, 57, 78, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  animation: trkIconPop 0.65s cubic-bezier(0.22, 1.15, 0.36, 1) both;
}
.trk-hero__icon .ti-icon {
  width: 38px;
  height: 38px;
  font-size: 38px;
  color: #fff;
  background-color: #fff;
}
.trk-hero__dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--trk-red);
  opacity: 0.55;
  animation: trkDot 2.6s ease-in-out infinite;
}
.trk-hero__dot--1 { top: 18px; right: 22px; animation-delay: 0s; }
.trk-hero__dot--2 { bottom: 24px; left: 18px; width: 6px; height: 6px; animation-delay: 0.4s; background: #19bfd3; }
.trk-hero__dot--3 { top: 40px; left: 16px; width: 5px; height: 5px; animation-delay: 0.8s; }
@keyframes trkDot {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50% { transform: translateY(-8px); opacity: 0.9; }
}
@keyframes trkFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.trk-hero h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  animation: trkIn 0.55s 0.08s cubic-bezier(0.22, 1.15, 0.36, 1) both;
}
.trk-hero p {
  margin: 0 auto;
  max-width: 34ch;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.75;
  color: var(--trk-muted);
  animation: trkIn 0.55s 0.14s cubic-bezier(0.22, 1.15, 0.36, 1) both;
}
.trk-hero__route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.trk-hero__route span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffd0d6;
  position: relative;
  animation: trkRoutePulse 1.6s ease-in-out infinite;
}
.trk-hero__route span:nth-child(2) { animation-delay: 0.2s; background: #ff9aa8; }
.trk-hero__route span:nth-child(3) { animation-delay: 0.4s; background: var(--trk-red); }
.trk-hero__route span:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% + 1px);
  width: 10px;
  height: 2px;
  margin-top: -1px;
  background: repeating-linear-gradient(
    90deg,
    #ffc2cb 0 3px,
    transparent 3px 6px
  );
  animation: trkDash 0.9s linear infinite;
}
@keyframes trkRoutePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}
@keyframes trkDash {
  to { background-position: 8px 0; }
}

@keyframes trkIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes trkIconPop {
  0% { transform: scale(0.6) rotate(-8deg); opacity: 0; }
  70% { transform: scale(1.08) rotate(2deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.trk-orders {
  margin-bottom: 14px;
  animation: trkIn 0.55s cubic-bezier(0.22, 1.15, 0.36, 1) 0.16s both;
}
.trk-orders[hidden] { display: none !important; }
.trk-orders__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 4px;
}
.trk-orders__head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}
.trk-orders__head span {
  font-size: 12px;
  font-weight: 700;
  color: var(--trk-muted);
}
.trk-orders__list {
  display: grid;
  gap: 10px;
}

.trk-order {
  position: relative;
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1.5px solid #fff;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  text-align: start;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  animation: trkIn 0.5s cubic-bezier(0.22, 1.15, 0.36, 1) both;
}
.trk-order:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
.trk-order:active { transform: scale(0.99); }
.trk-order.is-active {
  border-color: var(--trk-red);
  box-shadow:
    0 0 0 3px rgba(239, 57, 78, 0.12),
    0 12px 28px rgba(239, 57, 78, 0.1);
  animation: trkSelect 0.35s cubic-bezier(0.22, 1.15, 0.36, 1);
}
@keyframes trkSelect {
  0% { transform: scale(1); }
  40% { transform: scale(0.985); }
  100% { transform: scale(1); }
}
.trk-order__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.trk-order__badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 800;
  background: #fff1f2;
  color: var(--trk-red);
}
.trk-order__badge.is-delivered {
  background: #e8f8ef;
  color: #00a049;
}
.trk-order__badge.is-cancelled {
  background: #f2f3f5;
  color: #81858b;
}
.trk-order__code {
  font-size: 12px;
  font-weight: 800;
  color: var(--trk-muted);
  letter-spacing: 0.05em;
}
.trk-order__thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
}
.trk-order__thumb {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  background: #f5f5f6;
  border: 1px solid #f0f0f1;
  flex-shrink: 0;
}
.trk-order__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.trk-order__more {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #f5f5f6;
  color: var(--trk-muted);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.trk-order__info {
  min-width: 0;
  flex: 1;
}
.trk-order__title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trk-order__meta {
  margin: 0;
  font-size: 11.5px;
  color: var(--trk-muted);
  font-weight: 600;
}
.trk-order__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.trk-order__go {
  margin-inline-start: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff1f2;
  color: var(--trk-red);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.trk-order__go .ti-icon {
  width: 16px;
  height: 16px;
  font-size: 16px;
  transform: scaleX(-1);
}

.trk-card {
  position: relative;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #fff;
  border-radius: 22px;
  padding: 18px 16px 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  margin-bottom: 14px;
  overflow: hidden;
  animation: trkIn 0.55s cubic-bezier(0.22, 1.15, 0.36, 1) 0.08s both;
}
.trk-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  animation: trkShimmer 3.8s ease-in-out 1.2s infinite;
  pointer-events: none;
}
@keyframes trkShimmer {
  0%, 100% { right: -40%; opacity: 0; }
  10% { opacity: 1; }
  45% { right: 120%; opacity: 0.6; }
  46%, 100% { opacity: 0; }
}
.trk-card__head {
  margin-bottom: 14px;
}
.trk-card__head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
}
.trk-card__head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--trk-muted);
  font-weight: 500;
}
.trk-form {
  display: grid;
  gap: 10px;
}
.trk-field {
  display: grid;
  gap: 8px;
}
.trk-field__label {
  font-size: 12.5px;
  font-weight: 700;
  color: #3f4064;
}
.trk-field input {
  width: 100%;
  height: 56px;
  border: 1.5px solid var(--trk-border);
  border-radius: 16px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--trk-text);
  background: #fff;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.trk-field input::placeholder {
  color: #c0c2c5;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 15px;
}
.trk-field input:focus {
  border-color: var(--trk-red);
  box-shadow: 0 0 0 4px rgba(239, 57, 78, 0.12);
}
.trk-field.is-shake {
  animation: trkShake 0.42s ease;
}
@keyframes trkShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.trk-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff1f2;
  color: var(--trk-red);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}
.trk-error[hidden] { display: none !important; }
.trk-submit {
  position: relative;
  height: 52px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--trk-red) 0%, var(--trk-red-deep) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(239, 57, 78, 0.28);
  transition: transform 0.15s ease, filter 0.18s ease;
  overflow: hidden;
}
.trk-submit:active { transform: scale(0.98); }
.trk-submit.is-loading {
  pointer-events: none;
  filter: saturate(0.9);
}
.trk-submit.is-loading .trk-submit__text { opacity: 0; }
.trk-submit__spin {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  opacity: 0;
}
.trk-submit.is-loading .trk-submit__spin {
  opacity: 1;
  animation: trkSpin 0.7s linear infinite;
}
@keyframes trkSpin {
  to { transform: rotate(360deg); }
}
.trk-guest {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--trk-muted);
  font-weight: 600;
}
.trk-guest[hidden] { display: none !important; }
.trk-guest a {
  color: var(--trk-red);
  font-weight: 800;
  text-decoration: none;
}

.trk-result {
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(24px) scale(0.94);
  filter: blur(4px);
  transition:
    opacity 0.4s ease,
    transform 0.5s cubic-bezier(0.22, 1.15, 0.36, 1),
    filter 0.4s ease;
}
.trk-result.is-show {
  opacity: 1;
  transform: none;
  filter: none;
}
.trk-result[hidden] { display: none !important; }

.trk-detail {
  background: #fff;
  border: 1px solid #fff;
  border-radius: 22px;
  padding: 18px 16px 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}
.trk-detail__timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 16px;
  padding: 12px 8px;
  border-radius: 16px;
  background: #f8f8f9;
}
.trk-detail__node {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  position: relative;
  opacity: 0.4;
  transform: translateY(6px);
}
.trk-result.is-show .trk-detail__node {
  animation: trkNodeIn 0.45s cubic-bezier(0.22, 1.15, 0.36, 1) forwards;
}
.trk-result.is-show .trk-detail__node:nth-child(1) { animation-delay: 0.12s; }
.trk-result.is-show .trk-detail__node:nth-child(2) { animation-delay: 0.24s; }
.trk-result.is-show .trk-detail__node:nth-child(3) { animation-delay: 0.36s; }
@keyframes trkNodeIn {
  to { opacity: 1; transform: none; }
}
.trk-detail__node i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8e8ea;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: #81858b;
  position: relative;
  z-index: 1;
}
.trk-detail__node em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #81858b;
}
.trk-detail__node.is-done i,
.trk-detail__node.is-current i {
  background: var(--trk-red);
  color: #fff;
  box-shadow: 0 6px 14px rgba(239, 57, 78, 0.28);
}
.trk-detail__node.is-current i {
  animation: trkNodePulse 1.4s ease-in-out infinite;
}
.trk-detail__node.is-done em,
.trk-detail__node.is-current em {
  color: var(--trk-text);
}
@keyframes trkNodePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 57, 78, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(239, 57, 78, 0); }
}
.trk-detail__node:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 13px;
  left: -52%;
  width: 100%;
  height: 2px;
  background: #e4e5e9;
  z-index: 0;
}
.trk-detail__node.is-done:not(:last-child)::after,
.trk-detail__node.is-current:not(:last-child)::after {
  background: linear-gradient(90deg, var(--trk-red), #ff8a98);
}
.trk-detail__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.trk-detail__badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 99px;
  background: #fff1f2;
  color: var(--trk-red);
  font-size: 12px;
  font-weight: 800;
}
.trk-detail__badge.is-delivered {
  background: #e8f8ef;
  color: #00a049;
}
.trk-detail__badge.is-cancelled {
  background: #f2f3f5;
  color: #81858b;
}
.trk-detail__code {
  font-size: 13px;
  font-weight: 800;
  color: var(--trk-muted);
  letter-spacing: 0.06em;
}
.trk-detail__step {
  display: block;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 900;
}
.trk-detail__bar {
  height: 9px;
  border-radius: 99px;
  background: #f0f0f1;
  overflow: hidden;
  margin-bottom: 16px;
}
.trk-detail__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--trk-red), #ff7a8a);
  transform-origin: right center;
  animation: trkBar 0.85s cubic-bezier(0.22, 1.15, 0.36, 1) both;
}
@keyframes trkBar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.trk-detail__meta {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.trk-detail__meta li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
  opacity: 0;
  transform: translateX(-8px);
}
.trk-result.is-show .trk-detail__meta li {
  animation: trkMetaIn 0.4s cubic-bezier(0.22, 1.15, 0.36, 1) forwards;
}
.trk-result.is-show .trk-detail__meta li:nth-child(1) { animation-delay: 0.2s; }
.trk-result.is-show .trk-detail__meta li:nth-child(2) { animation-delay: 0.28s; }
.trk-result.is-show .trk-detail__meta li:nth-child(3) { animation-delay: 0.36s; }
.trk-result.is-show .trk-detail__meta li:nth-child(4) { animation-delay: 0.44s; }
@keyframes trkMetaIn {
  to { opacity: 1; transform: none; }
}
.trk-detail__meta li:last-child { border-bottom: 0; }
.trk-detail__meta span { color: var(--trk-muted); }
.trk-detail__meta strong { font-weight: 700; text-align: left; }

.trk-detail__items {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.trk-detail__item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: #f8f8f9;
}
.trk-detail__item img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
}
.trk-detail__item strong {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.55;
  margin-bottom: 2px;
}
.trk-detail__item span {
  font-size: 11.5px;
  color: var(--trk-muted);
  font-weight: 600;
}
.trk-detail__again {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: #f5f5f6;
  color: #232933;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .trk-hero,
  .trk-hero__visual,
  .trk-hero__icon,
  .trk-hero__ring,
  .trk-hero__dot,
  .trk-hero__route span,
  .trk-orders,
  .trk-order,
  .trk-card,
  .trk-card::before,
  .trk-result,
  .trk-detail__bar span,
  .trk-detail__node,
  .trk-detail__meta li,
  .trk-bg__orb {
    animation: none !important;
    transition: none !important;
  }
}
