/**
 * ComparatifTable — Styles pour les tableaux comparatifs Pros/Cons
 * Agence Izri.Online
 *
 * Utilise les variables CSS du thème :
 *   --color-surface, --color-bg, --color-text, --color-text-light,
 *   --color-primary, --color-accent, --color-border, --radius-md,
 *   --shadow-sm, --transition-fast
 */

/* ─── Conteneur principal ─────────────────────────────────────────── */

.comparatif-wrapper {
  margin: 2rem 0;
  font-family: var(--font-body);
  color: var(--color-text);
}

.comparatif-title {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  color: var(--color-primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.comparatif-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-border);
}

/* ─── Grille Pros/Cons ────────────────────────────────────────────── */

.proscons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.proscons-column {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 12px);
  padding: 1.25rem;
  transition: transform var(--transition-fast, 0.2s ease),
              box-shadow var(--transition-fast, 0.2s ease);
}

.proscons-column:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.3));
}

.proscons-pros {
  border-left: 3px solid #22c55e;
}

.proscons-cons {
  border-left: 3px solid #ef4444;
}

.proscons-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--color-border-light);
}

.proscons-pros .proscons-header {
  color: #22c55e;
}

.proscons-cons .proscons-header {
  color: #ef4444;
}

.proscons-header .fa-check-circle {
  font-size: 1.15rem;
}

.proscons-header .fa-times-circle {
  font-size: 1.15rem;
}

.proscons-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.proscons-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm, 6px);
  transition: background var(--transition-fast, 0.2s ease),
              transform var(--transition-fast, 0.2s ease);
  font-size: 0.925rem;
  line-height: 1.5;
  color: var(--color-text);
}

.proscons-item:hover {
  transform: translateX(4px);
}

.proscons-item-pro:hover {
  background: rgba(34, 197, 94, 0.06);
}

.proscons-item-con:hover {
  background: rgba(239, 68, 68, 0.06);
}

.proscons-item .fa-check {
  color: #22c55e;
  font-size: 0.875rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.proscons-item .fa-times {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.proscons-item span {
  flex: 1;
}

/* État vide */
.proscons-empty {
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.9rem;
}

/* ─── Tableau comparatif ───────────────────────────────────────────── */

.comparatif-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.comparatif-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
  line-height: 1.5;
}

.comparatif-table thead {
  background: var(--color-bg-alt, #161210);
}

.comparatif-table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.comparatif-table th:not(:first-child) {
  text-align: center;
}

.comparatif-table th:first-child {
  padding-left: 1.25rem;
}

.comparatif-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
  vertical-align: middle;
}

.comparatif-table td:not(:first-child) {
  text-align: center;
}

.comparatif-table td:first-child {
  padding-left: 1.25rem;
}

.comparatif-table tbody tr {
  transition: background var(--transition-fast, 0.2s ease);
}

.comparatif-table tbody tr:hover {
  background: var(--color-surface-hover, #28221E);
}

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

.comparatif-feature {
  font-weight: 500;
  color: var(--color-primary-light, #E8C48A);
}

/* Variante : tableau simple (pas de première colonne en evidence) */
.comparatif-table-simple .comparatif-feature {
  color: var(--color-text);
  font-weight: 400;
}

.comparatif-table-simple th:first-child,
.comparatif-table-simple td:first-child {
  text-align: left;
}

/* ─── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .proscons-grid {
    grid-template-columns: 1fr;
  }

  .proscons-column:hover {
    transform: none;
  }

  /* Tableau responsive : lignes en mode carte */
  .comparatif-table thead {
    display: none;
  }

  .comparatif-table tr {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border-light);
  }

  .comparatif-table tr:last-child {
    border-bottom: none;
  }

  .comparatif-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: none;
    text-align: right !important;
  }

  .comparatif-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-muted);
    text-align: left;
    font-size: 0.85rem;
    padding-right: 1rem;
  }

  .comparatif-table td:first-child {
    padding-left: 0;
  }

  .comparatif-table td.comparatif-feature {
    font-size: 1rem;
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 0.625rem;
    margin-bottom: 0.25rem;
  }

  .comparatif-table td.comparatif-feature::before {
    color: var(--color-primary);
  }
}

@media (max-width: 480px) {
  .comparatif-wrapper {
    margin: 1.5rem 0;
  }

  .proscons-column {
    padding: 1rem;
  }

  .proscons-item {
    font-size: 0.875rem;
    padding: 0.4rem 0.5rem;
  }

  .comparatif-table td {
    font-size: 0.875rem;
    padding: 0.35rem 0;
  }
}
