/* ============================================================
   افزونه پیگیری onwebs — تم دارک‌مود (سبز و مشکی)
   ساخته‌شده توسط سپهر فتحی
   ============================================================ */
:root{
  --ow-bg:#0a0c0a;
  --ow-surface:#0f130e;       /* پس‌زمینه کارت */
  --ow-surface-soft:#151a13;  /* باکس‌های داخلی */
  --ow-surface-2:#1b2218;     /* اینپوت / هاور */
  --ow-border:#22301c;
  --ow-border-soft:#1c241a;
  --ow-text:#e8f3ea;
  --ow-text-soft:#90a594;
  --ow-primary:#22c55e;
  --ow-primary-2:#16a34a;
  --ow-success:#34d399;
  --ow-danger:#f87171;
  --ow-danger-strong:#ef4444;
  --ow-shadow:0 22px 55px rgba(0,0,0,.55);
  --ow-glow:0 0 24px rgba(34,197,94,.25);
}

.onwebs-tracker-wrap{
  display:grid;
  gap:18px;
  color:var(--ow-text);
}

.onwebs-tracker-form{
  display:flex;
  gap:10px;
  align-items:center;
  padding:16px;
  border:1px solid var(--ow-border);
  border-radius:18px;
  background:linear-gradient(135deg,#0c100b 0%,#11180f 100%);
  box-shadow:var(--ow-shadow);
}

.onwebs-tracker-input{
  flex:1;
  min-height:46px;
  border:1px solid var(--ow-border);
  border-radius:14px;
  padding:0 14px;
  font-size:15px;
  color:var(--ow-text);
  background:var(--ow-surface-2);
  transition:border-color .15s ease, box-shadow .15s ease;
}

.onwebs-tracker-input::placeholder{
  color:var(--ow-text-soft);
}

.onwebs-tracker-input:focus{
  outline:none;
  border-color:var(--ow-primary);
  box-shadow:0 0 0 3px rgba(34,197,94,.2);
}

.onwebs-tracker-button{
  min-height:46px;
  padding:0 22px;
  border:0;
  border-radius:14px;
  background:linear-gradient(135deg,#16a34a 0%,#22c55e 100%);
  color:#04140a;
  font-weight:800;
  cursor:pointer;
  box-shadow:var(--ow-glow);
  transition:transform .12s ease, filter .12s ease;
}

.onwebs-tracker-button:hover{
  filter:brightness(1.08);
}

.onwebs-tracker-button:active{
  transform:translateY(1px);
}

.onwebs-tracker-card{
  border:1px solid var(--ow-border);
  border-radius:22px;
  background:
    radial-gradient(circle at top left,rgba(34,197,94,.06),transparent 40%),
    var(--ow-surface);
  box-shadow:var(--ow-shadow);
  padding:20px;
  color:var(--ow-text);
}

.onwebs-tracker-card.is-cancelled{
  border-color:rgba(239,68,68,.45);
  background:
    radial-gradient(circle at top left,rgba(239,68,68,.08),transparent 42%),
    var(--ow-surface);
}

.otv2-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}

.otv2-order{
  font-size:20px;
  font-weight:800;
  color:var(--ow-text);
}

.otv2-stepline{
  margin-top:6px;
  color:var(--ow-text-soft);
}

.otv2-stepline b{
  color:var(--ow-text);
}

.otv2-badge{
  flex-shrink:0;
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  border:1px solid transparent;
}

.otv2-badge.is-paid{
  background:rgba(34,197,94,.14);
  color:var(--ow-success);
  border-color:rgba(34,197,94,.35);
}

.otv2-badge.is-unpaid{
  background:rgba(239,68,68,.12);
  color:var(--ow-danger);
  border-color:rgba(239,68,68,.3);
}

.otv2-badge.is-cancelled{
  background:rgba(239,68,68,.18);
  color:#fff;
  border-color:var(--ow-danger-strong);
}

.onwebs-tracker-timeline{
  margin:16px 0 18px;
  padding:16px;
  border:1px solid var(--ow-border);
  border-radius:20px;
  background:
    radial-gradient(circle at top right,rgba(34,197,94,.1),transparent 38%),
    linear-gradient(180deg,#0d110c 0%,#11160f 100%);
}

/* حالت لغو شده: قرمز، بدون مرحله */
.onwebs-tracker-timeline.is-cancelled{
  border-color:rgba(239,68,68,.4);
  background:
    radial-gradient(circle at top right,rgba(239,68,68,.12),transparent 40%),
    linear-gradient(180deg,#120d0d 0%,#160f0f 100%);
}

.tl-cancelled{
  display:flex;
  align-items:center;
  gap:14px;
  padding:6px 2px 14px;
}

.tl-cancelled-icon{
  font-size:34px;
  line-height:1;
}

.tl-cancelled-title{
  font-size:18px;
  font-weight:800;
  color:var(--ow-danger);
}

.tl-cancelled-sub{
  margin-top:4px;
  font-size:13px;
  color:var(--ow-text-soft);
}

.tl-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}

.tl-eyebrow{
  font-size:12px;
  font-weight:800;
  color:var(--ow-primary);
  margin-bottom:4px;
}

.tl-current{
  font-size:16px;
  font-weight:800;
  color:var(--ow-text);
}

.tl-progress-badge{
  padding:8px 12px;
  border-radius:999px;
  background:rgba(34,197,94,.12);
  color:var(--ow-success);
  border:1px solid rgba(34,197,94,.3);
  font-size:12px;
  font-weight:800;
}

.tl-track{
  --tl-fill:0;
  --tl-edge:10%;
  position:relative;
  display:grid;
  /* تعداد ستون‌ها به‌صورت inline بر اساس تعداد مراحلِ فعال تنظیم می‌شود */
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:12px;
  padding-top:10px;
}

.timeline-line,
.timeline-progress{
  position:absolute;
  top:19px;
  height:6px;
  border-radius:999px;
}

.timeline-line{
  inset-inline:var(--tl-edge);
  background:#1f2a1c;
}

.timeline-progress{
  inset-inline-start:var(--tl-edge);
  inset-inline-end:auto;
  width:calc((100% - 2 * var(--tl-edge)) * var(--tl-fill));
  background:linear-gradient(90deg,#16a34a 0%,#22c55e 100%);
  box-shadow:0 0 14px rgba(34,197,94,.4);
}

.tl-node{
  position:relative;
  z-index:1;
  text-align:center;
}

.tl-dot-wrap{
  display:flex;
  justify-content:center;
  margin-bottom:12px;
}

.tl-dot{
  --tl-node-color:var(--ow-primary);
  box-sizing:border-box;
  width:24px;
  height:24px;
  border-radius:50%;
  border:5px solid #1f2a1c;
  background:#0c100b;
  box-shadow:0 8px 18px rgba(0,0,0,.5);
}

.tl-node.is-done .tl-dot,
.tl-node.is-active .tl-dot{
  background:var(--tl-node-color);
  border-color:rgba(34,197,94,.35);
  box-shadow:0 0 16px rgba(34,197,94,.45);
}

.tl-node.is-active .tl-dot{
  transform:scale(1.12);
}

.tl-node.is-upcoming{
  opacity:.6;
}

.tl-node.is-upcoming .tl-dot{
  border-color:#222c1e;
  box-shadow:none;
}

.tl-content{
  display:grid;
  gap:6px;
  justify-items:center;
}

.tl-icon{
  font-size:20px;
  line-height:1;
}

.tl-title{
  font-size:14px;
  font-weight:800;
  color:var(--ow-text);
}

.tl-subtitle{
  font-size:12px;
  color:var(--ow-text-soft);
}

.tl-node.is-done .tl-subtitle{
  color:var(--ow-success);
}

.tl-node.is-active .tl-subtitle{
  color:var(--ow-primary);
  font-weight:800;
}

.tl-footer{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-top:16px;
  padding-top:14px;
  border-top:1px dashed var(--ow-border);
  color:var(--ow-text-soft);
  font-size:12px;
}

.onwebs-tracker-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:12px;
  margin-bottom:18px;
}

.onwebs-tracker-box,
.onwebs-tracker-item,
.onwebs-tracker-totals{
  border:1px solid var(--ow-border-soft);
  border-radius:16px;
  background:var(--ow-surface-soft);
}

.onwebs-tracker-box{
  padding:14px;
}

.onwebs-tracker-box .label{
  font-size:12px;
  color:var(--ow-text-soft);
  margin-bottom:6px;
}

.onwebs-tracker-box .value{
  font-weight:800;
  color:var(--ow-text);
  word-break:break-word;
}

.onwebs-tracker-card h4{
  margin:18px 0 10px;
  font-size:15px;
  color:var(--ow-text);
}

.onwebs-tracker-items{
  display:grid;
  gap:10px;
}

.onwebs-tracker-item{
  padding:14px;
}

.item-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:6px;
  font-weight:700;
  color:var(--ow-text);
}

.item-title .qty{
  color:var(--ow-primary);
}

.item-price{
  color:var(--ow-text-soft);
  font-size:13px;
}

.onwebs-tracker-totals{
  padding:12px 14px;
}

.onwebs-tracker-totals .row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 0;
  color:var(--ow-text-soft);
}

.onwebs-tracker-totals .row span:last-child{
  color:var(--ow-text);
  font-weight:600;
}

.onwebs-tracker-totals .row + .row{
  border-top:1px dashed var(--ow-border);
}

.onwebs-tracker-totals .row.total{
  font-weight:800;
  color:var(--ow-text);
}

.onwebs-tracker-totals .row.total span:last-child{
  color:var(--ow-primary);
  font-weight:800;
}

.onwebs-tracker-alert{
  padding:12px 14px;
  border-radius:14px;
  font-weight:700;
}

.onwebs-tracker-error{
  background:rgba(239,68,68,.12);
  color:var(--ow-danger);
  border:1px solid rgba(239,68,68,.3);
}

/* WooCommerce price markup داخل کارت دارک */
.onwebs-tracker-card .woocommerce-Price-amount,
.onwebs-tracker-card .amount{
  color:inherit;
}

@media (max-width: 820px){
  .onwebs-tracker-form,
  .otv2-head,
  .tl-header,
  .tl-footer{
    flex-direction:column;
  }

  .onwebs-tracker-form{
    align-items:stretch;
  }

  .onwebs-tracker-button{
    width:100%;
  }

  .onwebs-tracker-grid{
    grid-template-columns:1fr;
  }

  /* در موبایل تایم‌لاین عمودی می‌شود؛ تعداد ستون‌های inline را override می‌کنیم */
  .tl-track{
    grid-template-columns:1fr !important;
    gap:16px;
    padding-top:0;
  }

  .timeline-line,
  .timeline-progress{
    top:0;
    inset-inline:auto;
    inset-inline-start:19px;
    width:6px;
    height:calc(100% - 24px);
  }

  .timeline-progress{
    width:6px;
    height:calc((100% - 24px) * var(--tl-fill));
    max-height:100%;
    background:linear-gradient(180deg,#16a34a 0%,#22c55e 100%);
  }

  .tl-node{
    display:grid;
    grid-template-columns:40px 1fr;
    align-items:center;
    text-align:start;
    gap:10px;
  }

  .tl-dot-wrap{
    margin-bottom:0;
  }

  .tl-content{
    justify-items:start;
  }
}
