/* =========================================================================
   MA Product Gallery
   ========================================================================= */

.ma-pg {
  --ma-pg-radius: 16px;
  --ma-pg-thumb-radius: 12px;
  --ma-pg-active: #111;
  --ma-pg-stage-bg: #fff;
  --ma-pg-thumb-bg: #f4f4f5;
  width: 100%;
  margin: 0;
}

.ma-pg,
.ma-pg * {
  box-sizing: border-box;
}

/* --- Główna scena ------------------------------------------------------ */

.ma-pg__stage {
  position: relative;
}

.ma-pg__track {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 10px;
  background: var(--ma-pg-stage-bg);
}

.ma-pg__track::-webkit-scrollbar {
  display: none;
}

.ma-pg__slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: center;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ma-pg-stage-bg);
  overflow: hidden;
  border-radius: var(--ma-pg-radius);
}

.ma-pg__img {
  width: 1000px;
  height: 1000px !important;
  object-fit: cover;
  display: block;
}

/* --- Slajd wideo ------------------------------------------------------- */

.ma-pg__slide--video {
  background: #000;
}

.ma-pg__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.ma-pg__video-poster {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ma-pg__play {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.ma-pg__play:hover {
  transform: scale(1.06);
  background: rgba(0, 0, 0, 0.7);
}

.ma-pg__play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
}

.ma-pg__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Strzałki (tylko desktop) ----------------------------------------- */

.ma-pg__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0 !important;
  border: 0;
  border-radius: 100% !important;
  background-color: #fff;
  color: #111;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  -webkit-user-select: none;
  user-select: none;
}

.ma-pg__arrow svg {
  width: 18px; /* <-- rozmiar strzałki zmieniasz tutaj */
  height: 18px;
  display: block;
}

.ma-pg__arrow--prev {
  left: 2px;
}
.ma-pg__arrow--next {
  right: 2px;
}

.ma-pg__arrow.is-disabled {
  opacity: 0.2;
  pointer-events: none;
}

.ma-pg__arrow:hover {
  opacity: 1;
  background-color: #fff;
  color: #111;
}

.ma-pg__arrow--prev {
  left: 2px;
}

.ma-pg__arrow--next {
  right: 2px;
}

.ma-pg__arrow.is-disabled {
  opacity: 0.2;
  pointer-events: none;
}

/* --- Miniatury --------------------------------------------------------- */

.ma-pg__thumbs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: 2px;
}

.ma-pg__thumbs::-webkit-scrollbar {
  display: none;
}

.ma-pg__thumbs.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.ma-pg__thumb {
  position: relative;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  padding: 0px !important;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--ma-pg-thumb-radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--ma-pg-thumb-bg);
  scroll-snap-align: start;
  transition: border-color 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}

.ma-pg__thumb.is-active {
  border-color: var(--ma-pg-active);
}

.ma-pg__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ma-pg__thumb-video {
  display: block;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: #000;
}

.ma-pg__thumb-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

/* --- Breakpointy ------------------------------------------------------- */

@media (min-width: 769px) {
  .ma-pg__thumb {
    width: 84px;
    height: 84px;
  }
}

@media (max-width: 768px) {
  .ma-pg__arrow {
    display: none;
  }

  .ma-pg__thumb {
    width: 64px;
    height: 64px;
  }
}

/* =========================================================================
   Lightbox
   ========================================================================= */

.ma-pg__img {
  cursor: zoom-in;
}

body.ma-pg-lb-open {
  overflow: hidden;
}

.ma-pg-lb {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ma-pg-lb.is-open {
  opacity: 1;
}

.ma-pg-lb__track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ma-pg-lb__track::-webkit-scrollbar {
  display: none;
}

.ma-pg-lb__track.is-zoomed {
  overflow: hidden;
  scroll-snap-type: none;
  touch-action: none;
}

.ma-pg-lb__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  box-sizing: border-box;
}

.ma-pg-lb__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform 0.15s ease;
  will-change: transform;
  touch-action: pan-x;
  -webkit-user-select: none;
  user-select: none;
}

.ma-pg-lb__img.is-zoomed {
  cursor: zoom-out;
  transition: none; /* płynny pan bez opóźnienia */
  touch-action: none;
}

.ma-pg-lb__close,
.ma-pg-lb__arrow {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}

.ma-pg-lb__close:hover,
.ma-pg-lb__arrow:hover {
  background: rgba(255, 255, 255, 0.22);
}

.ma-pg-lb__close {
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
}

.ma-pg-lb__close svg {
  width: 22px;
  height: 22px;
}

.ma-pg-lb__arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
}

.ma-pg-lb__arrow svg {
  width: 26px;
  height: 26px;
}

.ma-pg-lb__arrow--prev {
  left: 18px;
}

.ma-pg-lb__arrow--next {
  right: 18px;
}

.ma-pg-lb__counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  letter-spacing: 0.04em;
}

@media (max-width: 768px) {
  .ma-pg-lb__arrow {
    width: 42px;
    height: 42px;
  }

  .ma-pg-lb__arrow--prev {
    left: 8px;
  }

  .ma-pg-lb__arrow--next {
    right: 8px;
  }

  .ma-pg-lb__close {
    top: 10px;
    right: 10px;
  }
}
