/**
 * Lot comparison on the site: "Comparar" button (card and lot page), floating bar and comparison page.
 * Colors come from the theme brand (var(--primary)); neutral grays follow the user central.
 */

/* "Comparar" button */
.compare-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.compare-toggle:focus {
  outline: 0;
}

.compare-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.compare-toggle.is-active {
  background: var(--primary);
  color: #fff;
}

/* Over the card photo, bottom right (the badges take the top) */
.compare-toggle--card {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

/* Lot page: next to the visits, bids and enabled counters */
.compare-toggle--inline {
  border-color: var(--primary);
  background: transparent;
  vertical-align: middle;
}

/* Floating bar */
.compare-bar {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  z-index: 1040;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.5rem 0.4rem 1rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  font-size: 0.9rem;
  transform: translateX(-50%);
}

.compare-bar[hidden],
.compare-bar-note[hidden] {
  display: none;
}

.compare-bar-icon {
  color: var(--primary);
}

.compare-bar-count {
  font-weight: 600;
  color: #2d3b39;
  white-space: nowrap;
}

.compare-bar-note {
  color: #6c757d;
  font-size: 0.8rem;
}

.compare-bar .btn {
  border-radius: 999px;
}

.compare-bar .compare-bar-clear {
  color: #6c757d;
}

@media (max-width: 575.98px) {
  .compare-bar {
    left: 0.75rem;
    right: 0.75rem;
    flex-wrap: wrap;
    justify-content: space-between;
    border-radius: 0.75rem;
    transform: none;
  }
}

/* Comparison page */
.compare-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}

.compare-muted {
  color: #6c757d;
  font-size: 0.85rem;
}

.compare-clear {
  margin-left: auto;
  font-size: 0.85rem;
}

.compare-group {
  margin-bottom: 2rem;
}

.compare-group-title {
  margin-bottom: 0.75rem;
  color: var(--primary);
  font-size: 1.15rem;
  font-weight: 700;
}

.compare-group-title small {
  margin-left: 0.5rem;
  color: #6c757d;
  font-size: 0.85rem;
  font-weight: 400;
}

.compare-scroll {
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
  overflow-x: auto;
  border: 1px solid #e8e8e8;
  border-radius: 0.5rem;
  background: #fff;
}

/* Fixed width per lot, so the photos have the same size whatever the number of lots;
   --compare-cols (lots in the table) comes from the view */
.compare-table {
  width: calc(180px + var(--compare-cols, 1) * 260px);
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.compare-table th,
.compare-table td {
  padding: 0.65rem 0.9rem;
  border-top: 1px solid #e8e8e8;
  color: #2d3b39;
  font-size: 0.9rem;
  vertical-align: top;
}

.compare-table thead th {
  border-top: 0;
}

/* First column stays in place while the lots scroll sideways */
.compare-table .compare-label {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 180px;
  background: #f8f9fa;
  color: #6c757d;
  font-weight: 600;
}

.compare-table .compare-lot {
  font-weight: 400;
}

.compare-photo .card-image {
  display: block;
  height: 145px;
  padding-top: 0;
  border-radius: 0.4rem;
  background-color: #f1f1f1;
  background-position: center;
  background-size: cover;
}

.compare-lot-title {
  display: -webkit-box;
  margin: 0.6rem 0 0.25rem;
  overflow: hidden;
  color: #2d3b39;
  font-weight: 700;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.compare-lot-meta,
.compare-sub {
  display: block;
  color: #6c757d;
  font-size: 0.8rem;
}

.compare-remove {
  display: inline-block;
  margin-top: 0.4rem;
  color: #6c757d;
  font-size: 0.8rem;
}

.compare-table td.compare-best {
  color: var(--primary);
  font-weight: 700;
}

.compare-best-tag {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.compare-hint {
  margin: 0.5rem 0 0;
  color: #6c757d;
  font-size: 0.85rem;
}

.compare-empty {
  padding: 2rem 0;
  color: #6c757d;
}

.compare-empty strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--primary);
  font-size: 1.1rem;
}
