/* =========================================
   استایل‌های عمومی (بدون تغییر)
   ========================================= */
#razban-order-tracker-wrapper {
  max-width: 650px;
  margin: 40px auto;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid #eef0f2;
  font-family: inherit;
  direction: rtl;
  line-height: 1.6;
}
#razban-order-tracker-wrapper .rot-tracking-result {
  animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rot-form-group {
  margin-bottom: 20px;
}
.rot-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}
.rot-form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 14px;
  transition: border 0.3s;
}
.rot-form-group input:focus {
  border-color: #007cba;
  outline: none;
}

#razban-order-tracker-wrapper button.button {
  width: 100%;
  padding: 12px;
  background: #007cba;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.3s;
}
#razban-order-tracker-wrapper button.button:hover {
  background: #006ba1;
  opacity: 0.9;
}
#razban-order-tracker-wrapper button:disabled {
  background: #ccc;
  cursor: not-allowed;
}
#rot-new-search-btn {
  background: #f0f0f1 !important;
  color: #333 !important;
  border: 1px solid #ccc !important;
  margin-top: 10px;
}
#rot-new-search-btn:hover {
  background: #e1e1e1 !important;
}

.rot-message {
  margin-top: 15px;
  font-size: 14px;
  text-align: center;
  font-weight: 500;
}
.rot-message.error {
  color: #d63638;
}
.rot-message.success {
  color: #00a32a;
}

.rot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #f0f0f1;
  padding-bottom: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.rot-header h3 {
  margin: 0;
  font-size: 18px;
  color: #333;
}
.rot-date {
  color: #777;
  font-size: 14px;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  margin-right: 10px;
  display: inline-block;
}
.status-completed {
  background: #e7f8ee;
  color: #0a6c31;
}
.status-processing {
  background: #fff8e5;
  color: #8a6d3b;
}
.status-cancelled,
.status-failed {
  background: #ffebee;
  color: #c62828;
}
.status-on-hold {
  background: #f8f8f8;
  color: #777;
}

.rot-details-grid {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.rot-box {
  flex: 1;
  min-width: 240px;
  background: #f9f9fa;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #eee;
}
.rot-box h4,
.rot-shipping-info h4 {
  margin-top: 0;
  color: #007cba;
  border-bottom: 1px dashed #ddd;
  padding-bottom: 8px;
  font-size: 15px;
  margin-bottom: 12px;
}
.rot-box p {
  margin: 6px 0;
  font-size: 14px;
  color: #555;
}
.rot-box strong {
  color: #333;
}

.rot-shipping-info {
  margin-bottom: 20px;
  background: #f9f9fa;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #eee;
}

.rot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.rot-row:last-child {
  border-bottom: none;
}
.rot-label {
  font-weight: bold;
  color: #555;
  margin-left: 15px;
  flex-shrink: 0;
}
.rot-value {
  color: #333;
  text-align: left;
  direction: ltr;
  word-break: break-word;
}
.rot-empty-msg {
  color: #999;
  font-style: italic;
  text-align: center;
}

.rot-tracking-link {
  display: inline-block;
  color: #fff;
  background: #007cba;
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 13px;
  margin-top: 2px;
}
.rot-tracking-link:hover {
  background: #005a87;
}
.rot-download-link {
  color: #007cba;
  text-decoration: none;
  font-weight: bold;
  border-bottom: 1px dashed #007cba;
  font-size: 13px;
}
.rot-download-link:hover {
  border-bottom: 1px solid #007cba;
}

.rot-actions {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 480px) {
  #razban-order-tracker-wrapper {
    padding: 20px;
    margin: 20px 10px;
  }
  .rot-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .rot-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  .rot-value {
    text-align: right;
    direction: rtl;
    width: 100%;
  }
}

/* =========================================
   استایل پرینت (بهبود یافته)
   ========================================= */
@media print {
  body * {
    visibility: hidden;
    height: 0;
    overflow: hidden;
  }

  #razban-order-tracker-wrapper,
  #razban-order-tracker-wrapper * {
    visibility: visible;
    height: auto;
    overflow: visible;
  }

  #razban-order-tracker-wrapper {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important; /* وسط چین افقی */
    padding: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
    z-index: 999999 !important;
    font-family: inherit !important; /* ارث بری فونت */
  }

  /* وسط چین کردن محتوا در صورت نیاز */
  .rot-tracking-result {
    text-align: center;
  }
  .rot-header,
  .rot-row {
    justify-content: center; /* آیتم‌ها در وسط */
  }
  .rot-details-grid {
    justify-content: center;
  }

  .no-print,
  #rot-search-form,
  #rot-otp-form,
  .rot-actions {
    display: none !important;
  }

  .rot-box,
  .rot-shipping-info {
    background: none !important;
    border: 1px solid #000 !important;
    margin-bottom: 10px !important;
    page-break-inside: avoid; /* جلوگیری از شکستن باکس در دو صفحه */
  }

  .rot-tracking-link,
  .status-badge {
    background: none !important;
    color: #000 !important;
    border: 1px solid #000 !important;
  }

  a {
    text-decoration: none !important;
    color: #000 !important;
  }
}
