/* Responsive data views: cards (mobile) + scrollable tables (tablet/desktop) */

.bn-responsive-data {
  width: 100%;
}

.bn-data-cards,
.bn-user-ads__cards {
  display: none;
  gap: 12px;
}

.bn-data-card,
.bn-user-ads__card {
  display: block;
  padding: 14px 16px;
  border: 1px solid #292522;
  border-radius: 12px;
  background: var(--bn-surface, #1c1712);
  color: #fff;
}

.bn-data-card.is-own,
.bn-user-ads__card.is-own {
  border-color: rgba(236, 196, 108, 0.35);
}

.bn-data-card__head,
.bn-user-ads__card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.bn-data-card__who {
  min-width: 0;
}

.bn-data-card__title,
.bn-user-ads__card-pair {
  display: block;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  word-break: break-word;
}

.bn-user-ads__card-pair.bn-coin-pair {
  display: inline-flex;
}

.bn-data-card__rate strong {
  display: block;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.bn-data-card__label,
.bn-data-card__field > span,
.bn-user-ads__card-field span {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7e8fa0;
  margin-bottom: 2px;
}

.bn-data-card__grid,
.bn-user-ads__card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-bottom: 12px;
}

.bn-data-card__field strong,
.bn-data-card__field em,
.bn-user-ads__card-field strong,
.bn-user-ads__card-field em {
  display: block;
  font-style: normal;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #e7e5e4;
  word-break: break-word;
}

.bn-user-ads__card-field--full strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.bn-user-ads__card-field .badge {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  align-self: flex-start;
}

.bn-data-card__actions,
.bn-user-ads__card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bn-data-card__actions .btn,
.bn-user-ads__card-actions .btn {
  flex: 1 1 auto;
  min-width: min(100%, 8rem);
}

.bn-data-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: #a8a29e;
  font-size: 0.875rem;
}

.bn-data-table-wrap,
.bn-user-ads__table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Generic horizontal-scroll hint, applied by initScrollFade() in
   bitnnock-custom.js to any matched region (data tables via
   .bn-table-scroll, the pill-shaped account sub-nav via .pw-user-nav, the
   mobile dashboard KPI carousel via .p2p-dash__metrics, ...).
   Classes are toggled from real scroll position, only while there's
   actually more content in that direction, so short content never looks
   "cut off" and a fully-scrolled region never stays faded. */
.bn-scroll-fade {
  transition: mask-image 0.15s ease, -webkit-mask-image 0.15s ease;
}

.bn-scroll-fade.has-scroll-right {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
}

.bn-scroll-fade.has-scroll-left {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent 100%);
}

.bn-scroll-fade.has-scroll-left.has-scroll-right {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}

.bn-table-scroll > .table,
.bn-table-scroll > table,
.bn-table-scroll .custom--table {
  width: 100%;
  margin-bottom: 0;
  border-collapse: collapse;
}

.bn-table-scroll .custom--table thead th,
.bn-table-scroll table thead th {
  white-space: nowrap;
  vertical-align: middle;
}

.bn-table-scroll .custom--table tbody td,
.bn-table-scroll table tbody td {
  white-space: nowrap;
  vertical-align: middle;
}

.bn-ads-cell--payment {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bn-ads-cell--rate,
.bn-user-ads__mono {
  font-variant-numeric: tabular-nums;
}

.bn-market-ads__table { min-width: 720px; }

.bn-responsive-data .bn-market-ads__table [data-label]::before {
  display: none !important;
  content: none !important;
}

.bn-responsive-data .bn-market-ads__table [data-label] {
  position: static;
}

.bn-market-ads__table thead th,
.bn-market-ads__table tbody td {
  vertical-align: middle;
}

.bn-market-ads__table thead th:last-child,
.bn-market-ads__table tbody td.bn-market-ads__action {
  width: 1%;
  text-align: center;
}

.bn-market-ads__action .p2p-dash__btn,
.bn-market-ads__action .btn--base,
.bn-data-card__actions .p2p-dash__btn--primary,
.bn-data-card__actions .p2p-dash__btn--sm,
.bn-profile-ads .bn-trd-table-wrap .p2p-dash__btn--primary,
.bn-profile-ads .bn-data-card__actions .p2p-dash__btn--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  min-height: 34px;
  background: linear-gradient(135deg, #ecc46c, #f1dc9d) !important;
  border: 1px solid #ecc46c !important;
  color: #000 !important;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none !important;
}
.bn-profile-ads .custom--table { min-width: 580px; }
.bn-trd-list-table { min-width: 880px; }
.bn-user-ads__grid-table { min-width: 920px; }
.wlfi-table-wrap.bn-table-scroll .custom--table { min-width: 640px; }

/* Mobile + tablet: cards (matches p2p-dash list pages at ≤991px) */
@media (max-width: 991px) {
  .bn-responsive-data .bn-data-cards,
  .bn-responsive-data .bn-user-ads__cards {
    display: grid;
  }

  .bn-responsive-data .bn-data-table-wrap,
  .bn-responsive-data .bn-user-ads__table {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .bn-data-card__grid,
  .bn-user-ads__card-grid {
    grid-template-columns: 1fr;
  }
}

/* Desktop: full tables */
@media (min-width: 992px) {
  .bn-responsive-data .bn-data-cards,
  .bn-responsive-data .bn-user-ads__cards {
    display: none !important;
  }

  .bn-responsive-data .bn-data-table-wrap,
  .bn-responsive-data .bn-user-ads__table {
    display: block !important;
  }

  /* Homepage embed tables use fixed layout — no forced min-width scroll */
  .bn-marketplace-ads--embed .bn-market-ads__table {
    min-width: 0;
    width: 100%;
  }
}

/* Prevent legacy stacked-table mode from breaking layout */
@media (max-width: 991px) {
  body.pw-app-site .bn-table-scroll thead,
  body.pw-app .bn-table-scroll thead {
    display: table-header-group !important;
  }

  body.pw-app-site .bn-table-scroll tbody tr,
  body.pw-app .bn-table-scroll tbody tr {
    display: table-row !important;
  }

  body.pw-app-site .bn-table-scroll tr th,
  body.pw-app-site .bn-table-scroll tr td,
  body.pw-app .bn-table-scroll tr th,
  body.pw-app .bn-table-scroll tr td {
    display: table-cell !important;
    padding-left: inherit !important;
    text-align: left !important;
  }
}

/* Trade list mobile cards */
.trd-list-cards {
  display: none;
  gap: 12px;
}

.trd-list-card {
  padding: 14px 16px;
  border: 1px solid #292522;
  border-radius: 12px;
  background: rgba(19, 16, 13, 0.95);
}

.trd-list-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.trd-list-card__user {
  font-weight: 700;
  color: #fff;
}

.trd-list-card__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.trd-list-card__field span {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7e8fa0;
  margin-bottom: 2px;
}

.trd-list-card__field strong {
  display: block;
  font-size: 0.8125rem;
  color: #e7e5e4;
  word-break: break-word;
}

.trd-list-card__actions {
  display: flex;
  gap: 8px;
}

.trd-list-card__actions .btn {
  flex: 1;
}

@media (max-width: 991px) {
  .trd-list-responsive .trd-list-cards {
    display: grid;
  }

  .trd-list-responsive .trd-list-table-wrap {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .trd-list-card__grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 992px) {
  .trd-list-responsive .trd-list-cards {
    display: none !important;
  }

  .trd-list-responsive .trd-list-table-wrap {
    display: block !important;
  }
}
