/* ===== Compare View (Table) ===== */
.view-compare { background: transparent; }
.view-compare table { width: 100%; border-collapse: collapse; border-spacing: 0; }
.view-compare thead th { position: sticky; top: 0; background: var(--bg-elev); z-index: 2; }

.view-compare th,
.view-compare td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}

.view-compare tbody tr:nth-child(even) td { background: rgba(0, 0, 0, .02); }

.view-compare th.sort { cursor: pointer; user-select: none; }
.view-compare th.sort .dir { opacity: .55; font-size: 12px; margin-left: 6px; }

.view-compare th.num,
.view-compare td.num { text-align: right; }

.view-compare td small { display: block; color: var(--muted); margin-top: 2px; }
.view-compare td .tags { display: flex; gap: 6px; flex-wrap: wrap; }

.view-compare caption {
  caption-side: top;
  text-align: left;
  margin-bottom: 6px;
  color: var(--muted);
}

/* Hover highlight */
.view-compare table td:hover,
.view-compare table th:hover { position: relative; z-index: 9; }
.view-compare table td:hover::after,
.view-compare table th:hover::after {
  content: "";
  position: absolute;
  inset: -1px;
  outline: 2px solid rgba(0, 180, 131, .35);
  pointer-events: none;
  border-radius: 6px;
  z-index: 10;
}

/* Model cell (image + name) */
.view-compare .model-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.view-compare .model-thumb {
  width: 80px;
  height: 60px;
  min-width: 80px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line, #ddd);
  flex-shrink: 0;
}
.view-compare .model-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.view-compare .model-link {
  color: var(--ink, #111);
  text-decoration: none;
}
.view-compare .model-link:hover {
  text-decoration: underline;
  color: var(--purple, #7858EA);
}

/* Datasheet & Offer links */
.view-compare .datasheet-link,
.view-compare .offer-link {
  font-size: 0.85em;
  color: var(--purple, #7858EA);
  text-decoration: none;
}
.view-compare .datasheet-link:hover,
.view-compare .offer-link:hover {
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 720px) {
  .view-compare { overflow-x: auto; }
  .view-compare .hide-sm { display: none; }
  .view-compare th,
  .view-compare td { font-size: 14px; }
}

/* Constrain pill size in table to prevent text wrapping */
.view-compare .pill {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}