/* ============================================================
 * ab24-compare.css — Compare UI
 * ============================================================ */

/* Card compare button styled via .ab-card-action in ab24-auto.css — nothing here */

/* Floating Action Button — bottom-right */
.ab-cmp-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 900;
  display: inline-flex; align-items: stretch;
  background: var(--ab-blue, #0f5eff);
  border-radius: 100px;
  box-shadow: 0 8px 24px rgba(15,94,255,0.35);
  overflow: hidden;
  animation: abCmpFabIn 0.25s ease-out;
}
.ab-cmp-fab[hidden] { display: none; }

@keyframes abCmpFabIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.ab-cmp-fab__main {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px 12px 16px;
  color: #fff; font-weight: 600; font-size: 14px;
  transition: background var(--ab-dur, 0.15s) ease;
}
.ab-cmp-fab__main:hover { background: rgba(255,255,255,0.1); color: #fff; }
.ab-cmp-fab__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  background: rgba(255,255,255,0.25);
  border-radius: 100px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0;
}

.ab-cmp-fab__clear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; padding: 0; border: 0;
  background: transparent; color: #fff; cursor: pointer;
  border-left: 1px solid rgba(255,255,255,0.2);
  transition: background var(--ab-dur, 0.15s) ease;
}
.ab-cmp-fab__clear:hover { background: rgba(255,255,255,0.15); }

@media (max-width: 575px) {
  .ab-cmp-fab { bottom: 16px; right: 16px; left: 16px; justify-content: space-between; }
  .ab-cmp-fab__main { flex: 1; }
}

/* ─────────────────────────────────────────────
 *  Compare page (/confronto/)
 * ───────────────────────────────────────────── */
.ab-cmp-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 24px;
}

.ab-cmp-card {
  background: var(--ab-surface, #fff);
  border: 1px solid var(--ab-line, #e5e7eb);
  border-radius: var(--ab-radius, 10px);
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
}
.ab-cmp-card__media {
  aspect-ratio: 4/3; background: var(--ab-bg-2, #f5f5f5);
  position: relative;
}
.ab-cmp-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ab-cmp-card__remove {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border: 0; padding: 0;
  background: rgba(15,25,35,0.7); color: #fff;
  border-radius: 100px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease;
}
.ab-cmp-card__remove:hover { background: #e63946; }
.ab-cmp-card__body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.ab-cmp-card__title {
  font-size: 14px; font-weight: 500; color: var(--ab-ink-2); margin: 0;
  line-height: 1.3;
}
.ab-cmp-card__title strong { color: var(--ab-ink); font-weight: 700; }
.ab-cmp-card__equip { font-size: 12px; color: var(--ab-ink-3); }
.ab-cmp-card__price {
  font-size: 18px; font-weight: 700; color: var(--ab-blue);
  margin-top: 4px;
}
.ab-cmp-card__cta {
  display: inline-block; margin-top: 8px; padding: 7px 0;
  font-size: 13px; font-weight: 600; color: var(--ab-blue);
  border-top: 1px solid var(--ab-line); text-align: center;
}

/* Spec comparison table */
.ab-cmp-table {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  background: var(--ab-surface, #fff);
  border: 1px solid var(--ab-line, #e5e7eb);
  border-radius: var(--ab-radius, 10px);
  overflow: hidden;
  font-size: 13.5px;
}
/* Override any global zebra-striping inherited from base CSS */
.ab-cmp-table tbody tr,
.ab-cmp-table tbody tr:nth-child(even),
.ab-cmp-table tbody tr:nth-child(odd) { background: transparent; }

.ab-cmp-table th, .ab-cmp-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--ab-line, #e5e7eb);
  text-align: left; vertical-align: middle;
  background: transparent;
}
.ab-cmp-table tr:last-child th, .ab-cmp-table tr:last-child td { border-bottom: 0; }
.ab-cmp-table th {
  background: var(--ab-bg-2, #f9fafb);
  font-weight: 600; color: var(--ab-ink-3);
  width: 180px; min-width: 180px;
  border-right: 1px solid var(--ab-line, #e5e7eb);
}
.ab-cmp-table td { color: var(--ab-ink); }
.ab-cmp-table td.is-best { color: var(--ab-blue); font-weight: 700; }

/* Row highlighting — only when values differ */
.ab-cmp-table td.is-diff { background: rgba(15,94,255,0.07); }
.ab-cmp-table tr:hover td:not(.is-diff) { background: rgba(0,0,0,0.02); }
.ab-cmp-table tr:hover td.is-diff { background: rgba(15,94,255,0.12); }
.ab-cmp-table tr:hover th { background: var(--ab-bg-2, #f9fafb); }

/* Mobile: horizontal scroll table */
.ab-cmp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--ab-radius, 10px);
  margin-bottom: 24px;
}

@media (max-width: 767px) {
  .ab-cmp-table th { width: 130px; min-width: 130px; font-size: 12px; padding: 9px 10px; }
  .ab-cmp-table td { font-size: 12.5px; padding: 9px 10px; white-space: nowrap; }
}
