/* ============================================
   COMPARE — Honest Comparison Table
   ============================================ */

.compare {
  position: relative;
  z-index: 2;
  padding: var(--space-32) var(--space-6);
  overflow: hidden;
}

.compare__inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.compare__header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.compare__header .section-label {
  justify-content: center;
}

.compare__header .section-headline {
  margin-bottom: 0;
}

/* ── Scroll wrapper (mobile) ── */
.compare__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-xl);
}

/* ── Table ── */
.compare__table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  border-spacing: 0;
}

/* ── Column headers ── */
.compare__table thead th {
  padding: var(--space-6) var(--space-8);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.compare__table thead th:first-child {
  width: 28%;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ToothShip column — accented */
.compare__table thead th.col-toothship {
  color: var(--blue-electric);
  position: relative;
}

.compare__table thead th.col-toothship::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue-electric), var(--blue-cyan));
  border-radius: 1px;
}

.compare__table thead th.col-spreadsheet,
.compare__table thead th.col-wms {
  color: var(--text-secondary);
}

/* ── Rows ── */
.compare__table tbody tr {
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--duration-fast) var(--ease-out);
}

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

.compare__table tbody tr:hover {
  background: var(--glass-bg);
}

/* ── Cells ── */
.compare__table tbody td {
  padding: var(--space-6) var(--space-8);
  vertical-align: top;
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* Row label */
.compare__table tbody td:first-child {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ToothShip cell */
.compare__table tbody td.col-toothship {
  color: var(--text-primary);
  font-weight: 500;
  background: rgba(0, 163, 255, 0.04);
  border-left: 1px solid rgba(0, 163, 255, 0.12);
  border-right: 1px solid rgba(0, 163, 255, 0.12);
}

/* Competitor cells */
.compare__table tbody td.col-spreadsheet,
.compare__table tbody td.col-wms {
  color: var(--text-tertiary);
}

/* Last row — no bottom border on accent column */
.compare__table tbody tr:last-child td.col-toothship {
  border-radius: 0 0 0 0;
}

/* Accent column header top cap */
.compare__table thead th.col-toothship {
  background: rgba(0, 163, 255, 0.06);
  border-left: 1px solid rgba(0, 163, 255, 0.12);
  border-right: 1px solid rgba(0, 163, 255, 0.12);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .compare {
    padding: var(--space-20) var(--space-4);
  }

  .compare__scroll {
    border-radius: var(--radius-lg);
  }

  .compare__table thead th,
  .compare__table tbody td {
    padding: var(--space-4) var(--space-5);
  }
}

@media (max-width: 600px) {
  /* Switch to stacked card layout */
  .compare__scroll {
    overflow-x: visible;
  }

  .compare__table,
  .compare__table thead,
  .compare__table tbody,
  .compare__table th,
  .compare__table td,
  .compare__table tr {
    display: block;
    width: 100%;
    min-width: unset;
  }

  /* Hide header row — labels come from ::before */
  .compare__table thead tr {
    display: none;
  }

  /* Each row = a card */
  .compare__table tbody tr {
    margin-bottom: var(--space-5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--glass-bg);
  }

  /* Feature label — card title */
  .compare__table tbody td:first-child {
    background: rgba(0, 163, 255, 0.06);
    border-bottom: 1px solid rgba(0, 163, 255, 0.12);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-primary);
    padding: var(--space-4) var(--space-5);
    white-space: normal;
  }

  /* Value cells */
  .compare__table tbody td {
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--glass-border);
    font-size: var(--text-xs);
    line-height: 1.6;
    border-left: none;
    border-right: none;
    background: none;
  }

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

  /* Column labels via ::before */
  .compare__table tbody td:nth-child(2)::before {
    content: "ToothShip";
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--blue-electric);
    margin-bottom: 4px;
  }

  .compare__table tbody td:nth-child(3)::before {
    content: "Spreadsheets";
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    margin-bottom: 4px;
  }

  .compare__table tbody td:nth-child(4)::before {
    content: "Traditional WMS";
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    margin-bottom: 4px;
  }

  /* ToothShip cell highlight */
  .compare__table tbody td.col-toothship {
    background: rgba(0, 163, 255, 0.04);
    color: var(--text-primary);
  }
}
