/* ─── Page wrapper ───────────────────────────────────────────────────────── */
.compare-page {
  padding: var(--sp-10) 0 var(--sp-20);
}

.compare-heading {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-black);
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-8);
  color: var(--c-text);
  line-height: var(--lh-tight);
}

.compare-root {
  min-height: 200px;
}

/* ─── Table wrapper — horizontal scroll on mobile ────────────────────────── */
.compare-table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  /* Clip the table border-radius and shadow */
  box-shadow: var(--shadow-sm);
  background: var(--c-surface);
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}

.compare-table-wrap::-webkit-scrollbar { height: 5px; }
.compare-table-wrap::-webkit-scrollbar-track { background: transparent; }
.compare-table-wrap::-webkit-scrollbar-thumb {
  background: var(--c-border-strong);
  border-radius: 3px;
}

/* ─── Table ──────────────────────────────────────────────────────────────── */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  min-width: 560px;
}

/* ─── Column widths ──────────────────────────────────────────────────────── */
.compare-table__label-col {
  width: 180px;
  min-width: 140px;
}

.compare-table__bike-col {
  min-width: 200px;
}

/* ─── Label cells ────────────────────────────────────────────────────────── */
.compare-table__label {
  padding: var(--sp-4) var(--sp-5) var(--sp-4) var(--sp-5);
  color: var(--c-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  /* Sticky so labels remain visible on horizontal scroll */
  position: sticky;
  left: 0;
  background: var(--c-surface);
  z-index: 2;
}

/* When the row has a differs highlight, the sticky label also gets it */
.row-differs .compare-table__label {
  background: rgba(230, 57, 70, .04);
}

.row-same .compare-table__label {
  background: var(--c-surface);
}

/* ─── Value cells ────────────────────────────────────────────────────────── */
.compare-table__cell {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
  background: var(--c-surface);
  transition: background var(--t-fast);
}

/* Alternating row shading — applied on even tbody rows */
.compare-table tbody tr:nth-child(even) .compare-table__cell {
  background: var(--c-surface-2);
}

/* ─── First row (photos) — no top border ─────────────────────────────────── */
.compare-table thead tr th,
.compare-table tbody tr:first-child .compare-table__cell,
.compare-table tbody tr:first-child .compare-table__label {
  border-top: none;
}

/* Photo row image */
.compare-table tbody tr:first-child .compare-table__cell {
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  vertical-align: top;
}

/* ─── Row states ─────────────────────────────────────────────────────────── */

/* Differing values — very subtle red tint, draws the eye */
.row-differs .compare-table__cell {
  background: rgba(230, 57, 70, .06) !important;
}

/* Same values — fade out to reduce visual noise */
.row-same .compare-table__cell {
  color: var(--c-muted-light);
  background: var(--c-surface) !important;
}

/* Row hover highlight — helps readability when scanning across columns */
.compare-table tbody tr:hover .compare-table__cell,
.compare-table tbody tr:hover .compare-table__label {
  background: var(--c-surface-2) !important;
}
.compare-table tbody tr:hover .compare-table__label {
  background: var(--c-surface-2) !important;
}

/* ─── Thead header row ───────────────────────────────────────────────────── */
.compare-table thead th {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 2px solid var(--c-border);
  background: var(--c-surface);
  vertical-align: bottom;
}

.compare-table thead th:first-child {
  /* Label column sticky header */
  position: sticky;
  left: 0;
  z-index: 3;
}

/* ─── Remove column button ───────────────────────────────────────────────── */
.compare-col-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-3);
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: 14px;
  line-height: 1;
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    color var(--t-fast),
    transform var(--t-fast);
}

.compare-col-remove:hover {
  background: rgba(212, 48, 48, .10);
  border-color: var(--c-danger);
  color: var(--c-danger);
  transform: scale(1.08);
}

/* ─── Alert banner ───────────────────────────────────────────────────────── */
.alert-warning {
  background: rgba(232, 160, 32, .10);
  border-left: 3px solid var(--c-warning);
  color: var(--c-text-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
  margin-bottom: var(--sp-5);
}

/* ─── CTA row ────────────────────────────────────────────────────────────── */
.compare-table tbody tr:last-child .compare-table__cell {
  border-bottom: none;
  padding: var(--sp-5);
}

/* ─── Mobile responsiveness notes ───────────────────────────────────────────
   The .compare-table-wrap handles horizontal scroll.
   The .compare-table__label sticky positioning ensures the label column
   remains readable as the user scrolls right on small screens.
   min-width: 560px on the table forces the horizontal scroll to activate
   rather than allowing the columns to become unreadably narrow.
──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .compare-page { padding: var(--sp-6) 0 var(--sp-16); }
  .compare-heading { font-size: var(--fs-xl); margin-bottom: var(--sp-6); }
  .compare-table { min-width: 480px; }
  .compare-table__label-col { width: 120px; min-width: 100px; }
}