/* ═══════════════════════════════════════════════════════════════
   PROPERTY COMPARISON TOOL — compare.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Compare button on cards ──────────────────────────────────── */
.vesta-compare-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.92);
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.vesta-compare-btn i { font-size: 0.85rem; color: var(--primary-color); }
.vesta-compare-btn:hover,
.vesta-compare-btn.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}
.vesta-compare-btn.active i { color: #fff; }

/* ── Compare Bar (bottom of screen) ──────────────────────────── */
#vesta-compare-bar {
  position: fixed;
  bottom: -120px;
  left: 0; right: 0;
  z-index: 9990;
  background: #fff;
  border-top: 2px solid var(--primary-color);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.12);
  padding: 16px 24px;
  transition: bottom 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
#vesta-compare-bar.is-visible { bottom: 0; }

.vcb-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.vcb-slots {
  display: flex;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
}
.vcb-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 6px 12px 6px 8px;
  min-width: 160px;
  max-width: 220px;
}
.vcb-slot img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.vcb-slot-title { font-size: 0.82rem; font-weight: 600; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.vcb-remove {
  background: none; border: none; cursor: pointer;
  color: #9ca3af; font-size: 0.85rem; padding: 2px;
  transition: color 0.15s;
}
.vcb-remove:hover { color: #ef4444; }
.vcb-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.vcb-btn-primary {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: opacity 0.2s, transform 0.2s;
}
.vcb-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.vcb-btn-primary:not(:disabled):hover { opacity: 0.9; transform: translateY(-1px); }
.vcb-btn-ghost {
  background: none;
  color: #6b7280;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all 0.2s;
}
.vcb-btn-ghost:hover { border-color: #ef4444; color: #ef4444; }

/* ── Compare Modal ────────────────────────────────────────────── */
#vesta-compare-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
#vesta-compare-modal.is-open { display: flex; }
.vcm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.vcm-dialog {
  position: relative;
  background: #fff;
  border-radius: 20px;
  width: min(95vw, 860px);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  animation: vcmIn 0.3s cubic-bezier(0.34,1.3,0.64,1);
}
@keyframes vcmIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.vcm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid #f3f4f6;
}
.vcm-header h2 { font-size: 1.2rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.vcm-header h2 i { color: var(--primary-color); }
.vcm-close {
  background: #f3f4f6; border: none; width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.vcm-close:hover { background: #e5e7eb; }
.vcm-body { padding: 24px 28px; overflow-y: auto; }

/* ── Comparison Table ─────────────────────────────────────────── */
.vcm-table { width: 100%; border-collapse: collapse; }
.vcm-table th, .vcm-table td {
  padding: 14px 16px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.92rem;
}
.vcm-table th {
  background: #f9fafb;
  font-weight: 700;
  vertical-align: top;
}
.vcm-table th img {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}
.vcm-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: #6b7280;
  background: #f9fafb;
  white-space: nowrap;
}
.vcm-table td:first-child i { margin-right: 6px; color: var(--primary-color); }
.vcm-prop-title { font-size: 0.85rem; font-weight: 700; color: #111827; }
.vcm-highlight { font-weight: 700; color: var(--primary-color); font-size: 1.05rem; }
.vcm-table tr:last-child td, .vcm-table tr:last-child th { border-bottom: none; }

/* ── Toast ────────────────────────────────────────────────────── */
#vesta-compare-toast {
  position: fixed;
  bottom: 140px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111827;
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 99998;
  white-space: nowrap;
}
#vesta-compare-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Dark Mode ────────────────────────────────────────────────── */
body.dark-mode #vesta-compare-bar { background: #1f2937; border-top-color: var(--primary-color); }
body.dark-mode .vcb-slot { background: #374151; border-color: #4b5563; }
body.dark-mode .vcm-dialog { background: #1f2937; }
body.dark-mode .vcm-table th,
body.dark-mode .vcm-table td:first-child { background: #111827; color: #d1d5db; }
body.dark-mode .vcm-table td { border-color: #374151; color: #e5e7eb; }
body.dark-mode .vcm-header { border-color: #374151; }
body.dark-mode .vcm-close { background: #374151; color: #e5e7eb; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .vcb-slot { min-width: 130px; }
  .vcm-table { font-size: 0.82rem; }
}
