/* Naprawa układu kafelka w katalogu */
.catalog .part {
  display: flex;
  flex-direction: column;
  background: rgba(20, 20, 20, 0.9);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  box-sizing: border-box;
}

/* Wymuszenie stałego wymiaru slidera i zamknięcie go w kadru */
.part-slider {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background-color: #0a0a0a;
}

.part-slider .slides {
  width: 100%;
  height: 100%;
  position: relative;
}

.part-slider .slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  background-color: #0a0a0a;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.part-slider .slide.active {
  opacity: 1;
}

/* Przyciski nawigacyjne slidera */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s;
}

.slider-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

.prev-btn { left: 8px; }
.next-btn { right: 8px; }

/* Kropki nawigacyjne */
.slider-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 5;
}

.slider-dots .dot {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.slider-dots .dot.active {
  background: #00e5ff;
}

/* Sekcja opisu pod sliderem */
.part-details {
  padding: 15px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #141414;
}

.part-details .part-index {
  font-size: 0.9rem;
  color: #aaa;
  margin: 0;
}

.part-details .part-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.slider-btn, 
.slider-dots .dot {
  z-index: 10 !important;
  pointer-events: auto !important;
}



/* Poprawka wyświetlania zdjęć na telefonach */
@media (max-width: 768px) {
  .part-slider {
    height: 120px; /* Dopasowanie wysokości slidera do wąskiego kafelka */
  }

  .part-slider .slide {
    object-fit: contain; /* Obrazek zmniejsza się tak, aby w całości zmieścić się w kadrze */
    background-color: #000; /* Czarne tło w miejscach, gdzie zdjęcie nie wypełnia kadru */
  }
}