/* ============================================================
   ТЕХПРОМ — TABLES STYLESHEET
   ============================================================ */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  margin: 24px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  background: var(--color-white);
}

thead tr {
  background: var(--color-table-head);
  color: white;
}

thead th {
  padding: 13px 16px;
  text-align: left;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: var(--color-table-alt);
}

tbody tr {
  transition: background .12s ease;
}

tbody tr:hover {
  background: #e8eef8;
}

td {
  padding: 12px 16px;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

/* Article badge */
.td-article {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: var(--color-primary);
  font-size: .82rem;
  background: var(--color-surface);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}

/* Availability badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.badge--green { background: #d1fae5; color: #065f46; }
.badge--yellow { background: #fef3c7; color: #92400e; }
.badge--red { background: #fee2e2; color: #991b1b; }

/* Dimensions cell */
.td-dims {
  color: var(--color-text-muted);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}

/* Brand cell */
.td-brand {
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--color-graphite);
}

/* Price cell */
.td-price {
  font-weight: 700;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Action link */
.td-action a {
  color: var(--color-accent);
  font-weight: 600;
  font-size: .8rem;
  text-decoration: underline;
  transition: color .15s ease;
}
.td-action a:hover { color: var(--color-primary); }

/* Sort headers */
th.sortable {
  cursor: pointer;
  user-select: none;
}
th.sortable:hover { background: var(--color-primary-mid); }
th.sortable::after { content: ' ⇅'; opacity: .5; font-size: .7rem; }
th.sort-asc::after { content: ' ↑'; opacity: 1; }
th.sort-desc::after { content: ' ↓'; opacity: 1; }

/* Comparison table */
.table-compare thead th:first-child { background: var(--color-graphite); }
.table-compare td:first-child {
  font-weight: 600;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Responsive */
@media (max-width: 600px) {
  td, th { padding: 10px 12px; }
  thead th { font-size: .72rem; }
  td { font-size: .82rem; }
}
