/* ============================================================
   COMPARE.CSS — Floating compare bar + comparison modal
   ============================================================ */

/* ── Floating bottom bar ─────────────────────────── */
.compare-bar {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9990;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 16px;
  padding: 10px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  opacity: 0;
}

.compare-bar--visible {
  display: flex;
}

.compare-bar__chips {
  display: flex;
  gap: 8px;
}

.compare-bar__chip {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border, #e5e5e5);
  flex-shrink: 0;
}

.compare-bar__chip-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare-bar__chip-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: var(--accent, #e63329);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.compare-bar__btn {
  padding: 8px 20px;
  background: var(--text, #111);
  color: var(--bg, #f5f4f0);
  border: none;
  border-radius: 10px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.compare-bar__btn:hover {
  background: var(--accent, #e63329);
  color: #fff;
}

.compare-bar__clear {
  padding: 6px 12px;
  background: none;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 8px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.75rem;
  color: var(--muted, #888);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.compare-bar__clear:hover {
  border-color: var(--accent, #e63329);
  color: var(--accent, #e63329);
}

/* ── Compare toggle on gallery cards ──────────────── */
.print-card__compare {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--card-bg, #fff);
  color: var(--text, #111);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease, color 0.15s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 3;
}

.print-card:hover .print-card__compare {
  opacity: 1;
  transform: translateY(0);
}

.print-card__compare--active {
  background: var(--accent, #e63329) !important;
  color: #fff !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.print-card__compare:hover {
  background: var(--accent, #e63329);
  color: #fff;
}

/* ── Comparison modal ──────────────────────────────── */
.compare-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.compare-modal__inner {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.compare-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border, #e5e5e5);
}

.compare-modal__title {
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: 1.8rem;
  color: var(--text, #111);
}

.compare-modal__close {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 1.5rem;
  color: var(--muted, #888);
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-modal__close:hover {
  background: var(--bg, #f5f4f0);
  color: var(--text, #111);
}

.compare-modal__body {
  padding: 1.5rem 2rem 2rem;
  overflow-x: auto;
}

.compare-modal__table {
  width: 100%;
  border-collapse: collapse;
}

.compare-modal__table th,
.compare-modal__table td {
  padding: 0.75rem 1rem;
  text-align: center;
  vertical-align: top;
}

.compare-modal__label-col {
  text-align: left !important;
  width: 130px;
}

.compare-modal__product-col {
  min-width: 180px;
}

.compare-modal__product-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.compare-modal__product-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border, #e5e5e5);
}

.compare-modal__product-name {
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: 1.2rem;
  color: var(--text, #111);
}

.compare-modal__product-price {
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: 1.1rem;
  color: var(--accent, #e63329);
}

.compare-modal__row {
  border-top: 1px solid var(--border, #e5e5e5);
}

.compare-modal__spec-label {
  text-align: left !important;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #888);
}

.compare-modal__spec-value {
  font-size: 0.9rem;
  color: var(--text, #111);
}

/* Responsive */
@media (max-width: 600px) {
  .compare-bar {
    bottom: 1rem;
    padding: 8px 12px;
    gap: 8px;
    border-radius: 12px;
  }

  .compare-bar__chip {
    width: 36px;
    height: 36px;
  }

  .compare-modal {
    padding: 1rem;
  }

  .compare-modal__inner {
    max-height: 90vh;
  }

  .compare-modal__header {
    padding: 1rem 1.25rem;
  }

  .compare-modal__body {
    padding: 1rem;
  }

  .compare-modal__product-img {
    width: 80px;
    height: 80px;
  }
}

/* Dark mode */
[data-theme="dark"] .compare-bar {
  background: var(--card-bg);
  border-color: var(--border);
}

[data-theme="dark"] .compare-modal__inner {
  background: var(--card-bg);
}

[data-theme="dark"] .compare-modal__close:hover {
  background: rgba(255,255,255,0.06);
}
