/* ============================================
   Arya Exchange – Price Tables (Final + Header Labels)
   ============================================ */

.ptp-all-tables {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 10px 8px;
  box-sizing: border-box;
  font-family: "Vazirmatn", "IRANSansX", "IRANSans", "yekan bakh", system-ui, -apple-system, sans-serif !important;
  direction: rtl;
}

/* ---------- Card ---------- */
.ptp-price-table-wrapper {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ptp-price-table-wrapper:hover {
  border-color: #d1d5db;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

/* Top accent */
.ptp-type-currency { border-top: 3px solid #3b82f6; }
.ptp-type-crypto   { border-top: 3px solid #10b981; }
.ptp-type-online   { border-top: 3px solid #8b5cf6; }

/* ---------- Title ---------- */
.ptp-table-title {
  margin: 0;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #111827;
  text-align: center;
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
  font-family: inherit !important;
  line-height: 1.3;
}

/* ---------- Header ---------- */
.ptp-price-table thead {
  display: block !important;
}

.ptp-price-table thead tr {
  display: flex !important;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  width: 100%;
  box-sizing: border-box;
}

.ptp-price-table thead th {
  font-size: 0.62rem;
  font-weight: 600;
  color: #64748b;
  padding: 0 !important;
  border: none !important;
  text-align: center;
  white-space: nowrap;
}

.ptp-price-table thead th:nth-child(1) {
  display: none !important;
}

.ptp-price-table thead th:nth-child(2) {
  flex: 0 0 22px;
  visibility: hidden;
}

.ptp-price-table thead th:nth-child(3) {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right !important;
  visibility: hidden;
}

.ptp-price-table thead th:nth-child(4) {
  flex: 0 0 auto;
  min-width: 70px;
  text-align: center;
}

.ptp-price-table thead th:nth-child(5) {
  flex: 0 0 auto;
  min-width: 60px;
  text-align: center;
}

/* ---------- Scroll container ---------- */
.ptp-table-scroll {
  width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  flex: 1;
  box-sizing: border-box;
}

/* ---------- Table ---------- */
.ptp-price-table {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  border-collapse: collapse;
  table-layout: fixed !important;
  font-family: inherit !important;
  box-sizing: border-box;
}

/* ---------- Body rows ---------- */
.ptp-price-table tbody tr:not(.ptp-blank-row) {
  display: flex !important;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid #f3f4f6;
  width: 100%;
  box-sizing: border-box;
  transition: background 0.15s ease;
}

.ptp-price-table tbody tr:not(.ptp-blank-row):last-child {
  border-bottom: none;
}

.ptp-price-table tbody tr:not(.ptp-blank-row):hover {
  background: #f8fafc;
}

.ptp-blank-row {
  display: none !important;
}

.ptp-price-table td:nth-child(1) {
  display: none !important;
}

.ptp-price-table td:nth-child(2) {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  padding: 0 !important;
  border: none !important;
}

.ptp-price-table .ptp-logo {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
  display: block;
}

.ptp-price-table td:nth-child(3) {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right !important;
  font-weight: 500;
  font-size: 0.66rem;
  color: #111827;
  padding: 0 !important;
  border: none !important;
  white-space: normal !important;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ptp-price-table td:nth-child(4) {
  flex: 0 0 auto;
  min-width: 70px;
  padding: 0 !important;
  border: none !important;
  text-align: center;
}

.ptp-price-cell {
  font-weight: 700;
  font-size: 0.66rem;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  background: #f0fdf4;
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid #bbf7d0;
  display: inline-block;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ptp-price-cell::before {
  content: none !important;
}

.ptp-price-table td:nth-child(5) {
  flex: 0 0 auto;
  min-width: 60px;
  padding: 0 !important;
  border: none !important;
  text-align: center;
}

.ptp-fee-cell {
  font-weight: 600;
  font-size: 0.63rem;
  color: #334155;
  background: #f8fafc;
  border-radius: 5px;
  padding: 3px 6px !important;
  display: inline-block;
  direction: ltr;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ptp-fee-cell::before {
  content: none !important;
}

.ptp-empty-row {
  display: block;
  width: 100%;
  padding: 12px 8px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.7rem;
  border: none !important;
}

.ptp-table-description {
  padding: 7px 8px 8px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}

.ptp-table-description p {
  margin: 0;
  font-size: 0.62rem;
  line-height: 1.5;
  color: #64748b;
  text-align: center;
}

.ptp-table-description--empty {
  display: none !important;
}

/* ---------- تاریخ آخرین به‌روزرسانی (شورت‌کد) ---------- */
.ptp-update-date {
  display: inline-block;
  font-size: 0.72rem;
  color: #64748b;
  font-family: "Vazirmatn", "IRANSansX", "IRANSans", "yekan bakh", system-ui, sans-serif;
  direction: rtl;
  line-height: 1.4;
}

.ptp-update-date time {
  font-weight: 600;
  color: #334155;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: embed;
}

/* ============================================
   Tablet
   ============================================ */
@media (max-width: 1100px) {
  .ptp-all-tables {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  .ptp-price-table thead tr,
  .ptp-price-table tbody tr:not(.ptp-blank-row) {
    gap: 5px;
    padding: 5px 7px;
  }

  .ptp-price-table td:nth-child(3) {
    font-size: 0.63rem;
  }

  .ptp-price-cell {
    font-size: 0.63rem;
    padding: 2px 5px;
  }

  .ptp-fee-cell {
    font-size: 0.6rem;
    padding: 2px 5px !important;
  }

  .ptp-price-table thead th:nth-child(4) {
    min-width: 65px;
  }

  .ptp-price-table thead th:nth-child(5) {
    min-width: 55px;
  }
}

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 640px) {
  .ptp-all-tables {
    grid-template-columns: 1fr !important;
    gap: 10px;
    padding: 8px 6px;
  }

  .ptp-table-title {
    font-size: 0.85rem;
    padding: 10px 12px;
  }

  .ptp-price-table thead {
    display: none !important;
  }

  .ptp-price-table tbody tr:not(.ptp-blank-row) {
    display: grid !important;
    grid-template-columns: 28px 1fr !important;
    grid-template-areas:
      "logo name"
      "price price"
      "fee fee" !important;
    gap: 6px 8px !important;
    padding: 10px 12px !important;
  }

  .ptp-price-table td:nth-child(2) {
    grid-area: logo !important;
    flex: none !important;
  }

  .ptp-price-table .ptp-logo {
    width: 26px !important;
    height: 26px !important;
  }

  .ptp-price-table td:nth-child(3) {
    grid-area: name !important;
    flex: none !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
  }

  .ptp-price-table td:nth-child(4),
  .ptp-price-table td:nth-child(5) {
    display: flex !important;
    width: 100% !important;
    flex: none !important;
    min-width: 0 !important;
    text-align: right !important;
  }

  .ptp-price-table td:nth-child(4) { grid-area: price !important; }
  .ptp-price-table td:nth-child(5) { grid-area: fee !important; }

  .ptp-price-cell {
    font-size: 0.78rem !important;
    padding: 5px 8px !important;
    width: 100% !important;
    max-width: none !important;
    direction: rtl !important;
    display: flex !important;
    align-items: center;
    gap: 6px;
  }

  .ptp-price-cell::before {
    content: "قیمت" !important;
    font-size: 0.6rem !important;
    font-weight: 500;
    color: #166534;
    background: #dcfce7;
    padding: 1px 5px;
    border-radius: 4px;
  }

  .ptp-fee-cell {
    font-size: 0.74rem !important;
    padding: 5px 8px !important;
    width: 100% !important;
    max-width: none !important;
    direction: rtl !important;
    display: flex !important;
    align-items: center;
    gap: 6px;
  }

  .ptp-fee-cell::before {
    content: "کارمزد" !important;
    font-size: 0.58rem !important;
    font-weight: 500;
    color: #475569;
    background: #e2e8f0;
    padding: 1px 5px;
    border-radius: 4px;
  }

  .ptp-table-description {
    padding: 8px 10px !important;
  }

  .ptp-table-description p {
    font-size: 0.7rem !important;
  }
}
