/* === AFFILIATE COMPARISON TABLES — Core Money Article Component === */

/* Wrapper for mobile horizontal scroll with fade hint */
.bv-comparison-table-wrapper {
  position: relative;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-8) 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.bv-comparison-table-wrapper::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, transparent, var(--color-surface));
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.bv-comparison-table-wrapper:hover::after,
.bv-comparison-table-wrapper:focus-within::after {
  opacity: 1;
}

/* Main Table */
.bv-comparison-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  font-size: var(--text-sm);
  line-height: var(--line-normal);
}

.bv-comparison-table thead {
  background: var(--color-brand);
  color: white;
}

.bv-comparison-table th {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--color-brand-hover);
  white-space: nowrap;
}

.bv-comparison-table th:first-child {
  border-top-left-radius: var(--radius-lg);
  min-width: 200px;
  font-weight: 700;
  text-transform: none;
  font-size: var(--text-sm);
  letter-spacing: normal;
}

.bv-comparison-table th:last-child {
  border-top-right-radius: var(--radius-lg);
}

.bv-comparison-table td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.bv-comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.bv-comparison-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius-lg);
}
.bv-comparison-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius-lg);
}

/* Row Hover — Subtle, functional */
.bv-comparison-table tbody tr {
  transition: background var(--transition-fast);
}
.bv-comparison-table tbody tr:hover {
  background: var(--color-bg);
}

/* Column: Product Name (First Column) */
.bv-comparison-table .col-product {
  font-weight: 600;
  color: var(--color-text);
  min-width: 200px;
}
.bv-comparison-table .col-product .product-brand {
  display: block;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Column: Best For */
.bv-comparison-table .col-best-for {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  max-width: 180px;
}

/* Column: Rated Power — Strikethrough manufacturer claim */
.bv-comparison-table .col-rated {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: line-through;
  text-decoration-color: var(--color-border-strong);
  text-decoration-thickness: 1.5px;
  white-space: nowrap;
}

/* Column: Tested Power — Our measurement, highlighted */
.bv-comparison-table .col-tested {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-success);
  white-space: nowrap;
}
.bv-comparison-table .col-tested::after {
  content: ' tested';
  font-size: var(--text-xs);
  font-weight: 400;
  font-family: var(--font-sans);
  color: var(--color-text-muted);
  margin-left: var(--space-1);
  text-transform: lowercase;
}

/* Column: Weight — Critical for nomads */
.bv-comparison-table .col-weight {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Column: Ports */
.bv-comparison-table .col-ports {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

/* Column: Verdict — Badge */
.bv-comparison-table .col-verdict {
  text-align: center;
  white-space: nowrap;
}

.bv-comparison-table .col-verdict .bv-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  line-height: 1;
  white-space: nowrap;
}

.bv-badge--top { background: #dcfce7; color: #166534; }
.bv-badge--performance { background: #dbeafe; color: #1e40af; }
.bv-badge--lightweight { background: #f3f4f6; color: #374151; }
.bv-badge--value { background: #fef3c7; color: #92400e; }
.bv-badge--premium { background: #ede9fe; color: #5b21b6; }

/* === SPEC TABLE — Individual Product Reviews === */
.bv-spec-table {
  width: 100%;
  max-width: 420px;
  border-collapse: collapse;
  margin: var(--space-6) auto;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.bv-spec-table th {
  width: 45%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-weight: 500;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.bv-spec-table td {
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.bv-spec-table tr:last-child th,
.bv-spec-table tr:last-child td {
  border-bottom: none;
}

.bv-spec-table .spec-highlight {
  color: var(--color-success);
  font-family: var(--font-mono);
  font-size: var(--text-base);
}

/* Mobile: spec table full width */
@media (max-width: 480px) {
  .bv-spec-table { max-width: 100%; }
}

/* === PRICING ROW IN SPEC TABLE === */
.bv-spec-table .spec-price {
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
}

/* === TABLE RESPONSIVE HINTS === */
@media (max-width: 768px) {
  .bv-comparison-table-wrapper {
    margin: var(--space-6) calc(var(--space-4) * -1);
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}