/* Shared sticky compare tray — used on selector, home, products listing. */

.sel-compare-bar,
.kaiwei-compare-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--cp-line, #d7e4ea);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -10px 30px rgba(18, 47, 62, .12);
  backdrop-filter: blur(8px);
}
.sel-compare-bar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.sel-compare-bar-meta { min-width: 0; flex: 1 1 280px; }
.sel-compare-bar-meta strong {
  display: block; margin-bottom: 8px; color: var(--cp-ink, #12303e); font-size: 14.5px; letter-spacing: .02em;
}
.sel-compare-chips {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch;
}
.sel-bar-chip {
  display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
  max-width: 220px; padding: 6px 8px 6px 6px;
  border: 1px solid var(--cp-line, #d7e4ea); border-radius: 8px; background: #f7fbfc;
}
.sel-bar-chip img {
  width: 40px; height: 28px; object-fit: cover; border-radius: 4px; background: #eef4f5;
}
.sel-bar-chip span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--cp-ink, #12303e); font-size: 14px; font-weight: 600;
}
.sel-bar-remove {
  flex: 0 0 auto; width: 24px; height: 24px; border: 0; border-radius: 4px;
  background: transparent; color: #5f7d89; font-size: 18px; line-height: 1; cursor: pointer;
}
.sel-bar-remove:hover { background: #e8f2f5; color: var(--brand-dark, var(--c-brand-dark)); }
.sel-compare-bar-actions {
  display: flex; align-items: center; gap: 12px; flex: 0 0 auto;
}
.sel-compare-bar-actions .button:disabled,
.sel-compare-bar-actions .button.primary:disabled { opacity: .5; cursor: not-allowed; }
.sel-compare-bar .sel-reset,
.kaiwei-compare-bar .sel-reset {
  color: var(--brand-dark, var(--c-brand-dark)); font-size: 14px; font-weight: 700;
  background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.kaiwei-compare-limit {
  margin: 8px auto 0; max-width: 1100px; padding: 0 20px;
  color: #6a4b12; font-size: 14px; font-weight: 600;
}
body.has-compare-bar { padding-bottom: 96px; }

.product-item-compare-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 12px; border: 1px solid var(--brand, var(--c-brand-dark)); border-radius: 6px;
  background: var(--c-white); color: var(--brand-dark, var(--c-brand-dark));
  font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.product-item-compare-btn:hover {
  background: #eef8fa;
}
.product-item-compare-btn.is-in-compare {
  background: #eef8fa; border-color: var(--brand-dark, var(--c-brand-dark));
}
.product-item-footer {
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .sel-compare-bar-actions { width: 100%; }
  .sel-compare-bar-actions .button.primary { flex: 1 1 auto; }
  body.has-compare-bar { padding-bottom: 128px; }
  .product-item-compare-btn { width: 100%; }
}
