/* Niepołomicki Bartnik – jasna, mobilna galeria popup, z zachowaniem strony w tle. */
#nb-product-lightbox[hidden] { display: none !important; }
body.nb-product-lightbox-open { overflow: hidden !important; }
body.nb-product-lightbox-open .pswp,
body.nb-product-lightbox-open .mfp-wrap,
body.nb-product-lightbox-open .fancybox-container { pointer-events: none !important; visibility: hidden !important; }

#nb-product-lightbox {
  position: fixed !important;
  z-index: 2147483600 !important;
  inset: 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  box-sizing: border-box;
  isolation: isolate;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
#nb-product-lightbox *, #nb-product-lightbox *::before, #nb-product-lightbox *::after { box-sizing: border-box; }
#nb-product-lightbox .nb-product-lightbox__backdrop {
  position: absolute; inset: 0; z-index: -1;
  background: rgba(16, 29, 24, .58) !important; /* Strona pozostaje widoczna, a nie czarna. */
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
}
#nb-product-lightbox .nb-product-lightbox__panel {
  width: min(1040px, 94vw);
  max-width: 100%;
  max-height: min(900px, calc(100dvh - 24px));
  display: flex; flex-direction: column;
  min-height: 0;
  background: #fffdf7;
  color: #17372e;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 22px 75px rgba(0,0,0,.27);
  outline: none;
}
#nb-product-lightbox .nb-product-lightbox__header {
  min-height: 58px; display: flex; align-items: center; gap: 16px;
  padding: 9px 14px 9px 22px;
  border-bottom: 1px solid rgba(20,50,39,.09);
}
#nb-product-lightbox .nb-product-lightbox__label { font-size: 14px; font-weight: 650; line-height: 1.35; }
#nb-product-lightbox .nb-product-lightbox__counter { font-size: 13px; margin-left: auto; color: #66776d; white-space: nowrap; font-variant-numeric: tabular-nums; }
#nb-product-lightbox button { -webkit-appearance: none; appearance: none; cursor: pointer; box-shadow: none; text-transform: none; font-family: inherit; transition: background .14s ease, color .14s ease, border-color .14s ease; }
#nb-product-lightbox button:focus-visible { outline: 3px solid #b88a31 !important; outline-offset: 2px; }
#nb-product-lightbox .nb-product-lightbox__close {
  flex: 0 0 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid #e1e5de; border-radius: 50%; background: #fff; color: #17372e;
  padding: 0; margin-left: 4px;
}
#nb-product-lightbox .nb-product-lightbox__close:hover { background: #f3f0e8; }
#nb-product-lightbox svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#nb-product-lightbox .nb-product-lightbox__stage {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: min(65dvh, 700px); min-height: min(230px, 35dvh);
  background: #fff; overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}
#nb-product-lightbox .nb-product-lightbox__photo {
  display: block; width: auto; height: auto; max-width: calc(100% - 108px);
  max-height: 100%; min-height: 0; object-fit: contain;
  margin: auto; cursor: zoom-in; box-shadow: none; border: 0;
  -webkit-user-drag: none;
  transform-origin: center center;
  transition: transform .18s ease;
}
#nb-product-lightbox .nb-product-lightbox__stage.is-zoomed .nb-product-lightbox__photo {
  transform: scale(1.65); cursor: zoom-out;
}
#nb-product-lightbox .nb-product-lightbox__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  display: grid; place-items: center;
  width: 49px; height: 49px; border-radius: 50%;
  background: rgba(255,253,247,.97); color: #17372e;
  border: 1px solid rgba(23,55,46,.14); padding: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
#nb-product-lightbox .nb-product-lightbox__arrow:hover { background: #f5e8c4; border-color: #d6bb79; }
#nb-product-lightbox .nb-product-lightbox__arrow--prev { left: 15px; }
#nb-product-lightbox .nb-product-lightbox__arrow--next { right: 15px; }
#nb-product-lightbox .nb-product-lightbox__arrow[hidden] { display: none !important; }
#nb-product-lightbox .nb-product-lightbox__toolbar {
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  min-height: 49px; padding: 6px 20px;
  border-top: 1px solid rgba(20,50,39,.07);
}
#nb-product-lightbox .nb-product-lightbox__tip { color: #6a756d; font-size: 12px; }
#nb-product-lightbox .nb-product-lightbox__zoom {
  display: inline-flex; justify-content: center; align-items: center; gap: 7px;
  color: #17372e; background: transparent; border: 1px solid #e2e5df;
  border-radius: 30px; font-size: 12px; padding: 7px 11px;
  line-height: 1.25; margin-left: auto;
}
#nb-product-lightbox .nb-product-lightbox__zoom:hover { background: #f4ecd7; }
#nb-product-lightbox .nb-product-lightbox__zoom[aria-pressed="true"] { background: #eae5d8; }
#nb-product-lightbox .nb-product-lightbox__thumbs {
  display: flex; justify-content: center; gap: 10px; align-items: center;
  padding: 10px 16px 14px; min-height: 82px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  border-top: 1px solid rgba(20,50,39,.07);
}
#nb-product-lightbox .nb-product-lightbox__thumbs[hidden] { display: none !important; }
#nb-product-lightbox .nb-product-lightbox__thumb {
  flex: 0 0 61px; width: 61px; height: 61px;
  display: grid; align-items: center; justify-content: center;
  padding: 3px; border: 2px solid transparent; background: #fff;
  border-radius: 8px; scroll-snap-align: center; overflow: hidden;
}
#nb-product-lightbox .nb-product-lightbox__thumb[aria-current="true"] { border-color: #b48c35; }
#nb-product-lightbox .nb-product-lightbox__thumb img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 700px) {
  #nb-product-lightbox { padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  #nb-product-lightbox .nb-product-lightbox__panel { width: 100%; border-radius: 12px; max-height: calc(100dvh - 16px); }
  #nb-product-lightbox .nb-product-lightbox__header { min-height: 54px; padding: 8px 9px 8px 15px; }
  #nb-product-lightbox .nb-product-lightbox__label { font-size: 13px; }
  #nb-product-lightbox .nb-product-lightbox__stage { height: min(64dvh, 620px); min-height: min(240px, 40dvh); }
  #nb-product-lightbox .nb-product-lightbox__photo { max-width: calc(100% - 28px); }
  #nb-product-lightbox .nb-product-lightbox__arrow { width: 43px; height: 43px; background: rgba(255,253,247,.91); }
  #nb-product-lightbox .nb-product-lightbox__arrow--prev { left: 7px; }
  #nb-product-lightbox .nb-product-lightbox__arrow--next { right: 7px; }
  #nb-product-lightbox .nb-product-lightbox__toolbar { padding: 6px 12px; min-height: 44px; }
  #nb-product-lightbox .nb-product-lightbox__tip { font-size: 11px; }
  #nb-product-lightbox .nb-product-lightbox__zoom { font-size: 11px; }
  #nb-product-lightbox .nb-product-lightbox__thumbs { min-height: 72px; padding: 8px 10px 10px; justify-content: flex-start; }
  #nb-product-lightbox .nb-product-lightbox__thumb { flex-basis: 54px; width: 54px; height: 54px; }
}
@media (max-width: 380px) {
  #nb-product-lightbox .nb-product-lightbox__tip { display: none; }
  #nb-product-lightbox .nb-product-lightbox__zoom { margin-left: auto; }
}
@media (max-height: 570px) and (orientation: landscape) {
  #nb-product-lightbox .nb-product-lightbox__stage { height: 52dvh; min-height: 90px; }
  #nb-product-lightbox .nb-product-lightbox__header { min-height: 42px; }
  #nb-product-lightbox .nb-product-lightbox__thumbs { min-height: 60px; padding-top: 4px; padding-bottom: 4px; }
  #nb-product-lightbox .nb-product-lightbox__thumb { width: 45px; height: 45px; flex-basis: 45px; }
}
@media (prefers-reduced-motion: reduce) { #nb-product-lightbox *, #nb-product-lightbox *::before, #nb-product-lightbox *::after { transition: none !important; animation: none !important; } }

/* Łagodny fallback, jeśli motyw otworzy galerię w natywnym PhotoSwipe. */
body.single-product .pswp__bg { background: rgba(16, 29, 24, .60) !important; }
@media(max-width: 700px) {
  body.single-product .pswp__button--arrow--left,
  body.single-product .pswp__button--arrow--right { display: block !important; }
}
