/**
 * Style dla sliderów produktów opartych na Swiper.js
 */

/* Główny kontener slidera - wszystkie overflowy muszą być visible */
.slider-container {
  overflow: visible !important;
}

.slider-container .row {
  overflow: visible !important;
}

/* Kontener Swipera - nadpisujemy domyślny overflow: hidden z biblioteki */
.product-section .swiper,
.product-swiper {
  width: 100%;
  max-width: 786px; /* Maksymalna szerokość zdjęć */
  height: auto; /* Usunięto stałą wysokość i zastąpiono przez auto */
  aspect-ratio: 3/2; /* Dodano proporcje dla wszystkich rozmiarów ekranu */
  margin: 0 auto; /* Wyśrodkowanie */
  position: relative;
  overflow: visible !important; /* Nadpisujemy domyślne overflow biblioteki */
}

/* Kontener dla slajdów */
.product-swiper .swiper-wrapper {
  overflow: hidden;
  border-radius: 20px; /* Zaokrąglone rogi */
  box-shadow: 0 6px 25px 0 rgba(63, 34, 5, 0.102); /* Cień zgodny z parametrami z obrazka */
}

/* Slajdy */
.product-swiper .swiper-slide {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 20px; /* Zaokrąglone rogi */
  overflow: hidden; /* Zapewnia, że zawartość nie wychodzi poza zaokrąglone rogi */
}

.product-swiper .slide-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 20px; /* Zaokrąglone rogi */
}

/* Kategoria */
.product-swiper .swiper-slide[data-is-category="true"] {
  position: relative;
}

/* Przyciski nawigacji - niestandardowe strzałki */
.product-section .swiper-button-next,
.product-section .swiper-button-prev,
.product-swiper .swiper-button-next,
.product-swiper .swiper-button-prev {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  transition: all 0.3s ease;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10 !important;
  padding: 0;
  border: none;
  box-shadow: 0px 0 24px 2px rgba(63, 34, 5, 0.05);
}

.product-swiper .swiper-button-next::after,
.product-swiper .swiper-button-prev::after {
  display: none; /* Ukrywamy domyślne strzałki Swiper */
}

/* Strzałki dostosowane do krawędzi kontenera - wystawanie poza container */
.product-section .swiper-button-prev {
  left: -30px !important; /* Wymuszone wystawienie poza kontener */
}

.product-section .swiper-button-next {
  right: -30px !important; /* Wymuszone wystawienie poza kontener */
}

.product-section .swiper-button-next:hover,
.product-section .swiper-button-prev:hover,
.product-swiper .swiper-button-next:hover,
.product-swiper .swiper-button-prev:hover {
  color: #fde5cf; /* Jasnobeżowe tło na hover */
  cursor: pointer;
}

.product-swiper .arrow-icon {
  width: 24px;
  height: 24px;
}

/* Ustawienia dla nałożenia na strzałkę */
.product-section .img-col {
  position: relative;
  overflow: visible !important; /* Pozwala na wyświetlanie strzałek poza kontenerem */
}

/* Paginacja (kropki) */
.product-swiper .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background: transparent; /* Puste tło */
  opacity: 1;
  border: 2px solid #3f2205; /* Obramowanie w kolorze brązowym */
  box-sizing: border-box;
  /* Fix dla Safari iOS */
  pointer-events: auto;
  -webkit-appearance: none;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  /* Zwiększam odstęp między kropkami */
  margin: 0 10px !important;
}

/* Specjalny fix dla Safari na iOS */
@supports (-webkit-touch-callout: none) {
  .product-swiper .swiper-pagination-bullet {
    margin: 0 15px !important; /* Jeszcze większy odstęp na iOS */
  }

  .product-swiper .swiper-pagination {
    width: auto !important;
    left: 50% !important;
    transform: translateX(-50%) translateZ(0) !important;
    -webkit-transform: translateX(-50%) translateZ(0) !important;
  }
}

.product-swiper .swiper-pagination-bullet-active {
  width: 20px;
  height: 20px;
  background: #3f2205 !important; /* Wypełnienie kolorem brązowym z !important */
  border: none;
  opacity: 1 !important;
}

/* Pozycja paginacji */
.product-swiper .swiper-pagination {
  bottom: -40px !important; /* Zmieniono wartość z 15px na -30px, aby umieścić paginację pod zdjęciem */
  display: flex;
  align-items: center;
  justify-content: center;
  /* Fix dla Safari iOS */
  z-index: 10;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Responsywność */
@media (max-width: 992px) {
  .product-swiper {
    max-width: 100%; /* Na mniejszych ekranach pełna szerokość kontenera */
  }
}

@media (max-width: 768px) {
  .product-swiper {
    height: auto;
    aspect-ratio: 3/2; /* Zachowanie proporcji na urządzeniach mobilnych */
  }

  /* Na mniejszych ekranach strzałki mogą być nieco mniejsze */
  .product-section .swiper-button-next,
  .product-section .swiper-button-prev,
  .product-swiper .swiper-button-next,
  .product-swiper .swiper-button-prev {
    width: 50px;
    height: 50px;
  }

  /* Strzałki bliżej krawędzi na mniejszych ekranach */
  .product-section .swiper-button-prev {
    left: -25px !important;
  }

  .product-section .swiper-button-next {
    right: -25px !important;
  }
}

@media (max-width: 576px) {
  .product-swiper {
    aspect-ratio: 4/3; /* Zmiana proporcji na mniejszych urządzeniach */
  }

  /* Ukrycie strzałek na bardzo małych ekranach (mobile) */
  .product-section .swiper-button-prev,
  .product-section .swiper-button-next,
  .product-swiper .swiper-button-prev,
  .product-swiper .swiper-button-next {
    display: none !important;
  }
}
