/* =============================================================
 * Miniature compare button (listing, grid + list view)
 * Icon + "Porównaj" label inside a subtle-bordered pill — mirrors the
 * "Pojedynczy zakup" tab styling used elsewhere on the listing/PDP.
 * ============================================================= */

.lm-compare-icon {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #01305C;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
}
.lm-compare-icon:hover,
.lm-compare-icon:focus {
  border-color: #1F5FB8;
  color: #1F5FB8;
  outline: none;
}
.lm-compare-icon.is-active {
  border-color: #1F5FB8;
  background: #1F5FB8;
  color: #fff;
}
.lm-compare-icon.is-active:hover,
.lm-compare-icon.is-active:focus {
  border-color: #01305C;
  background: #01305C;
  color: #fff;
}
.lm-compare-icon .material-icons {
  font-size: 18px;
  line-height: 1;
}
.lm-compare-icon__label {
  white-space: nowrap;
}

/* =============================================================
 * PDP compare button (text + icon, uses Bootstrap .btn shape)
 * ============================================================= */

.lm-compare-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.5rem 0;
}
.lm-compare-btn.is-active {
  background: #1F5FB8;
  border-color: #1F5FB8;
  color: #fff;
}
.lm-compare-btn .material-icons {
  font-size: 18px;
  line-height: 1;
}

/* =============================================================
 * Floating compare bar
 * ============================================================= */

.lm-compare-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #e9ecef;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  z-index: 1040;
}
.lm-compare-bar[hidden] {
  display: none;
}

/* Keep the customer-service / supervisor widget (and its image) in front of
   the floating compare bar. The widget ships z-index:100 from the theme, the
   compare bar sits at 1040, so without this the widget disappears behind the
   bar whenever the comparison list has items. 1045 keeps it above the bar but
   below the Bootstrap modal layer (1050) so the customer-service modal still
   stacks correctly on top. */
.customer-service-widget {
  z-index: 1045;
}
.lm-compare-bar__inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Slots row — each slot takes equal width based on max */
.lm-compare-bar__slots {
  display: grid;
  flex: 1 1 auto;
  gap: 0.5rem;
  grid-template-columns: repeat(var(--lm-compare-slot-count, 3), minmax(0, 1fr));
}
.lm-compare-bar--max-3 .lm-compare-bar__slots { --lm-compare-slot-count: 3; }
.lm-compare-bar--max-4 .lm-compare-bar__slots { --lm-compare-slot-count: 4; }
.lm-compare-bar--max-2 .lm-compare-bar__slots { --lm-compare-slot-count: 2; }

.lm-compare-bar__slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 3px;
}
.lm-compare-bar__slot--empty {
  background: #fff;
  border-style: dashed;
  color: #adb5bd;
  justify-content: center;
}

.lm-compare-bar__slot-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 auto;
  text-decoration: none;
  color: #212529;
}
.lm-compare-bar__slot-link:hover {
  color: #1F5FB8;
  text-decoration: none;
}
.lm-compare-bar__slot-image {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border-radius: 3px;
}
.lm-compare-bar__slot-image--placeholder {
  background: #e9ecef;
}
.lm-compare-bar__slot-name {
  font-size: 0.85rem;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
}
.lm-compare-bar__slot-remove {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  padding: 0.15rem;
  cursor: pointer;
  color: #6c757d;
  line-height: 1;
}
.lm-compare-bar__slot-remove:hover { color: #dc3545; }
.lm-compare-bar__slot-remove .material-icons { font-size: 16px; }

.lm-compare-bar__slot-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}
.lm-compare-bar__slot-placeholder .material-icons { font-size: 18px; }

/* Hide placeholder text on small viewports — keep just the dashed slot + plus icon */
@media (max-width: 768px) {
  .lm-compare-bar__slot-placeholder-text { display: none; }
  .lm-compare-bar__slot-name { font-size: 0.75rem; -webkit-line-clamp: 1; }
  .lm-compare-bar__slot-image { width: 36px; height: 36px; }
}

.lm-compare-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
}
.lm-compare-bar__count {
  font-weight: 600;
  font-size: 0.9rem;
  color: #212529;
  white-space: nowrap;
}
.lm-compare-bar__clear {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0.25rem;
  color: #6c757d;
}
.lm-compare-bar__clear:hover { color: #dc3545; }

/* On small screens stack actions below slots so each fits */
@media (max-width: 576px) {
  .lm-compare-bar__inner {
    flex-direction: column;
    gap: 0.5rem;
  }
  .lm-compare-bar__actions { justify-content: flex-end; }
}
