/* Zmieniono wszystkie nazwy klas z dodaniem prefiksu "gallery-" */
.gallery-container {
  max-width: 1730px;
  margin: 0 auto;
  background: #fff;
  padding: 46px;
  margin-bottom: 4rem;
}

.gallery-header {
  margin-bottom: 40px;
}

.gallery-header h1 {
  font-size: 48px;
  font-weight: 400;
  color: #1c1917;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.gallery-header p {
  font-size: 16px;
  color: #57534e;
  line-height: 1.6;
  max-width: 600px;
}

.gallery-wrapper {
  position: relative;
  margin-top: -2.5rem;
}

.gallery-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
  margin-bottom: 3rem;
}

.gallery-pagination {
  font-size: 18px;
  color: #000;
  font-weight: 300;
  letter-spacing: 0.05em;
}

.gallery-progress-bar {
  flex: 1;
  height: 2px;
  background-color: #e7e5e4;
  position: relative;
  max-width: 400px;
}

.gallery-progress-fill {
  height: 100%;
  background-color: #1c1917;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 33.33%;
}

.gallery-nav-buttons {
  display: flex;
  gap: 12px;
}

.gallery-nav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

/*.gallery-nav-btn:hover:not(:disabled) {
  background: #f5f5f4;
  border-color: #a8a29e;
}

.gallery-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.gallery-nav-btn svg {
  width: 20px;
  height: 20px;
  stroke: #1c1917;
  stroke-width: 2;
}*/

.gallery-dot-navigation {
  display: none;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #d6d3d1;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-dot.active {
  width: 24px;
  border-radius: 4px;
  background-color: #1c1917;
}

.gallery-slider-container {
  width: 100%;
  max-width: 1632px;
  height: 400px;
  overflow: hidden;
  position: relative;
  background: white;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.gallery-slider-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

.gallery-slide-page {
  min-width: 100%;
  display: flex;
  height: 100%;
}

.gallery-slide-image {
  height: 400px;
  object-fit: cover;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  -webkit-user-drag: none;
  user-drag: none;
}

@media (max-width: 1280px) {
  .gallery-progress-bar {
       max-width: 200px;
   }
 }  

/* Desktop: 5 obrazków widocznych, dynamiczna szerokość */
@media (min-width: 1024px) {
  .gallery-wrapper {
    margin-top: 0;
  }
  .gallery-slide-image.large {
    width: calc((100% - 48px) * 0.4);
  }

  .gallery-slide-image.small {
    width: calc((100% - 48px) * 0.15);
  }

  .gallery-slide-page {
    gap: 12px;
  }

  .gallery-header h1 {
    font-size: 48px;
  }

  .gallery-header p {
    font-size: 16px;

  }
}

/* Mobile: jeden obrazek na całą szerokość, kropki nawigacji */
@media (max-width: 1023px) {
  .gallery-wrapper {
    margin-top: 0;
  }
  .gallery-container {
  padding: 0;
  }
  .gallery-controls {
    display: none;
  }

  .gallery-dot-navigation {
    display: flex;
  }

  .gallery-slider-container {
    height: 300px;
    overflow-x: hidden;
  }

  /* Przebudowa layoutu na mobile dla płynnego swipe */
  .gallery-slider-track {
    display: flex;
    flex-direction: row;
    /* Uwzględnienie paddingu body (16px z każdej strony = 32px total) przy obliczaniu szerokości */
    width: calc(15 * (100vw - 32px)); /* 15 obrazków * szerokość viewport minus padding */
    transition: none; /* Wyłączenie transition podczas draggingu */
  }

  .gallery-slider-track.transitioning {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .gallery-slide-page {
    display: contents; /* Rozpakowanie stron aby obrazki były obok siebie */
  }

  .gallery-slide-image {
    /* Szerokość obrazka to viewport minus padding body (16px * 2 = 32px) */
    width: calc(100vw - 24px);
    min-width: calc(100vw - 26px);
    max-width: calc(100vw - 260px);
    height: 300px;
    flex-shrink: 0;
    display: block !important;
    position: static !important;
    object-fit: cover; /* zmiana object-fit na cover i dodanie object-position dla prawidłowego wycentrowania */
    object-position: center;
    background-color: #f5f5f4;
  }

}
