/* Comparison Matrix Styles */

.compare-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--bg-card-border);
}

.compare-header-title h1 {
  font-size: 1.75rem;
  font-family: var(--font-mono);
  margin-bottom: 0.25rem;
}

.compare-header-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.compare-table-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-lg);
  position: relative;
  margin-bottom: 2rem;
}

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 650px;
}

.compare-table th,
.compare-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--bg-card-border);
  border-right: 1px solid var(--bg-card-border);
  font-size: 0.9rem;
}

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

.compare-table th:last-child,
.compare-table td:last-child {
  border-right: none;
}

/* Sticky First Column for Mobile and Scroll Ergonomics */
.compare-table .sticky-prop-col {
  position: sticky;
  left: 0;
  background-color: var(--bg-surface);
  z-index: 5;
  width: 240px;
  min-width: 200px;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.25);
}

.compare-header-row th {
  background-color: var(--bg-surface);
  vertical-align: top;
}

.compare-material-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.compare-mat-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
}

.compare-mat-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.compare-mat-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
}

.compare-mat-remove {
  background: transparent;
  border: 1px solid var(--bg-card-border);
  color: var(--text-dim);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
  align-self: flex-start;
}

.compare-mat-remove:hover {
  border-color: var(--accent-danger);
  color: var(--accent-danger);
}

.section-divider-row th {
  background-color: rgba(56, 189, 248, 0.08);
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.6rem 1.25rem;
}

/* Empty or Error state */
.compare-empty {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--bg-card-border);
  border-radius: var(--radius-lg);
}

@media (max-width: 767px) {
  .compare-page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .compare-table .sticky-prop-col {
    width: 160px;
    min-width: 140px;
    font-size: 0.82rem;
    padding: 0.75rem;
  }
  .compare-table td {
    padding: 0.75rem;
    font-size: 0.82rem;
  }
}
