/*
 * ps_productcard – galeria na stronie produktu. Bariera jak w karcie (:not(#pcz) + all: revert, bez SVG),
 * do środka tylko zmienne --pg-*. Przewijanie natywne (scroll-snap) – działa palcem bez skryptu.
 */
.pgal:not(#pcz) {
  all: revert;
  --pg-gap: 10px;
  box-sizing: border-box;
  display: grid;
  gap: var(--pg-gap);
  width: 100%;
  min-width: 0;
  margin: 0 0 16px;
  padding: 0;
  font: 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #1f2937;
  container: pgal / inline-size;
}
.pgal:not(#pcz) *:not(svg, svg *), .pgal:not(#pcz) *::before, .pgal:not(#pcz) *::after { all: revert; box-sizing: border-box; }
.pgal:not(#pcz) svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* zdjęcie główne */
.pgal:not(#pcz) .pgal-main { position: relative; min-width: 0; border-radius: var(--pg-r, 12px); overflow: hidden; background: var(--pg-bg, #fff); }
.pgal:not(#pcz) .pgal-track { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior-x: contain; outline: none; }
.pgal:not(#pcz) .pgal-track::-webkit-scrollbar { display: none; }
.pgal:not(#pcz) .pgal-track:focus-visible { box-shadow: inset 0 0 0 3px rgba(91, 91, 214, .55); }
.pgal:not(#pcz) .pgal-slide { position: relative; display: block; flex: 0 0 100%; margin: 0; scroll-snap-align: center; scroll-snap-stop: always; aspect-ratio: var(--pg-ratio, 1/1); overflow: hidden; }
/* obraz wypełnia kadr bezwzględnie – „zawartość w całości” działa niezależnie od wysokości pliku */
.pgal:not(#pcz) .pgal-slide img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; object-fit: var(--pg-fit, contain); transition: transform .15s ease-out; transform-origin: 50% 50%; }
.pgal:not(#pcz).has-zoom .pgal-slide { cursor: zoom-in; }
.pgal:not(#pcz) .pgal-slide.is-zoom img { transform: scale(2.2); }

/* przyciski na zdjęciu */
.pgal:not(#pcz) .pgal-nav, .pgal:not(#pcz) .pgal-full { position: absolute; z-index: 2; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #1f2937; box-shadow: 0 2px 10px rgba(17, 24, 39, .18); cursor: pointer; transition: opacity .2s, transform .15s; }
.pgal:not(#pcz) .pgal-nav { top: 50%; transform: translateY(-50%); opacity: 0; }
.pgal:not(#pcz) .pgal-nav.is-prev { left: 10px; }
.pgal:not(#pcz) .pgal-nav.is-next { right: 10px; }
.pgal:not(#pcz) .pgal-main:hover .pgal-nav, .pgal:not(#pcz) .pgal-nav:focus-visible { opacity: 1; }
.pgal:not(#pcz) .pgal-nav:disabled { opacity: 0 !important; pointer-events: none; }
.pgal:not(#pcz) .pgal-full { right: 10px; bottom: 10px; width: 38px; height: 38px; }
.pgal:not(#pcz) .pgal-full svg { width: 18px; height: 18px; }
.pgal:not(#pcz) .pgal-nav:focus-visible, .pgal:not(#pcz) .pgal-full:focus-visible, .pgal:not(#pcz) .pgal-thumb:focus-visible, .pgal:not(#pcz) .pgal-dot:focus-visible { outline: 3px solid rgba(91, 91, 214, .55); outline-offset: 2px; }
.pgal:not(#pcz) .pgal-count { position: absolute; left: 12px; bottom: 12px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: rgba(17, 24, 39, .66); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; pointer-events: none; }
.pgal:not(#pcz) .pgal-badges { position: absolute; left: 12px; top: 12px; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; }
.pgal:not(#pcz) .pgal-badge { padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 800; line-height: 1; color: #fff; background: var(--pg-sale, #e02424); }
.pgal:not(#pcz) .pgal-badge.is-new { background: var(--pg-new, #5b5bd6); }
.pgal:not(#pcz) .pgal-badge.is-deal { background: #111827; }

/* miniatury */
.pgal:not(#pcz) .pgal-thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding: 2px; }
.pgal:not(#pcz) .pgal-thumb { flex: 0 0 var(--pg-thumb, 72px); width: var(--pg-thumb, 72px); height: var(--pg-thumb, 72px); padding: 3px; border: 2px solid transparent; border-radius: 10px; background: var(--pg-bg, #fff); cursor: pointer; opacity: .7; transition: opacity .15s, border-color .15s; }
.pgal:not(#pcz) .pgal-thumb:hover { opacity: 1; }
.pgal:not(#pcz) .pgal-thumb.is-on { border-color: #5b5bd6; opacity: 1; }
/* ramka podglądu – jeden znacznik przesuwany płynnie między miniaturkami */
.pgal:not(#pcz) .pgal-thumbs.has-ind { position: relative; }
.pgal:not(#pcz) .pgal-thumbs.has-ind .pgal-thumb.is-on { border-color: transparent; }
.pgal:not(#pcz) .pgal-thumb-ind { position: absolute; left: 0; top: 0; z-index: 1; box-sizing: border-box; border: 2px solid #5b5bd6; border-radius: 10px; box-shadow: 0 2px 10px -2px rgba(91, 91, 214, .45); pointer-events: none; opacity: 0; transition: transform .32s cubic-bezier(.22, .7, .2, 1), width .32s, height .32s, opacity .2s; }
.pgal:not(#pcz) .pgal-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
/* miniatury z boku – na szerokiej kolumnie */
@container pgal (min-width: 460px) {
  .pgal--side:not(#pcz) { grid-template-columns: calc(var(--pg-thumb, 72px) + 10px) minmax(0, 1fr); }
  .pgal--side:not(#pcz) .pgal-thumbs { grid-row: 1; grid-column: 1; flex-direction: column; overflow-x: hidden; overflow-y: auto; max-height: 100%; }
  .pgal--side:not(#pcz) .pgal-main { grid-column: 2; }
}
/* kropki */
.pgal:not(#pcz) .pgal-dots { display: flex; justify-content: center; gap: 8px; }
.pgal:not(#pcz) .pgal-dot { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: #d1d5db; cursor: pointer; transition: width .2s, background .2s; }
.pgal:not(#pcz) .pgal-dot.is-on { width: 24px; border-radius: 99px; background: #5b5bd6; }
/* siatka 2 kolumny / pion – wszystkie zdjęcia od razu */
.pgal--grid:not(#pcz) .pgal-track { display: grid; grid-template-columns: 1fr 1fr; gap: var(--pg-gap); overflow: visible; }
.pgal--grid:not(#pcz) .pgal-slide:first-child { grid-column: 1 / -1; }
.pgal--stack:not(#pcz) .pgal-track { display: grid; gap: var(--pg-gap); overflow: visible; }
.pgal--grid:not(#pcz) .pgal-main, .pgal--stack:not(#pcz) .pgal-main { background: none; overflow: visible; }
.pgal--grid:not(#pcz) .pgal-slide, .pgal--stack:not(#pcz) .pgal-slide { background: var(--pg-bg, #fff); border-radius: var(--pg-r, 12px); }
@container pgal (max-width: 420px) {
  .pgal--grid:not(#pcz) .pgal-track, .pgal--stack:not(#pcz) .pgal-track { display: flex; overflow-x: auto; gap: 0; }
  .pgal--grid:not(#pcz) .pgal-slide, .pgal--stack:not(#pcz) .pgal-slide { border-radius: 0; }
}

/* pełny ekran (dialog tworzony przez gallery.js): przyciemniona, półprzezroczysta warstwa nad stroną, podpis, przejścia */
.pgal-lb { position: fixed; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; overflow: hidden; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.pgal-lb::backdrop { background: rgba(14, 16, 26, .78); -webkit-backdrop-filter: blur(6px) saturate(.9); backdrop-filter: blur(6px) saturate(.9); }
.pgal-lb .pgal-lb-stage { position: absolute; inset: 56px 72px 74px; touch-action: none; user-select: none; }
.pgal-lb figure { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; overflow: hidden; }
.pgal-lb figure[hidden] { display: none; }
.pgal-lb img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 24px 70px -20px rgba(0, 0, 0, .65); background: #fff; cursor: zoom-in; transform-origin: 50% 50%; transition: transform .25s cubic-bezier(.2, .8, .2, 1); -webkit-user-drag: none; }
.pgal-lb figure.is-zoom img { cursor: grab; }
.pgal-lb figure.is-zoom.is-pan img { cursor: grabbing; transition: none; }
.pgal-lb button { position: fixed; z-index: 2; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; transition: background .15s, opacity .2s; }
.pgal-lb button:hover { background: rgba(255, 255, 255, .26); }
.pgal-lb button:focus-visible { outline: 3px solid rgba(255, 255, 255, .6); outline-offset: 2px; }
.pgal-lb button:disabled { opacity: .25; cursor: default; }
.pgal-lb button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pgal-lb .is-close { top: 12px; right: 12px; }
.pgal-lb .is-zoom-btn { top: 12px; right: 66px; }
.pgal-lb .is-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.pgal-lb .is-next { right: 14px; top: 50%; transform: translateY(-50%); }
.pgal-lb .pgal-lb-count { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); font-weight: 600; font-variant-numeric: tabular-nums; opacity: .85; }
.pgal-lb .pgal-lb-cap { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: min(900px, calc(100vw - 32px)); padding: 7px 14px; border-radius: 999px; background: rgba(0, 0, 0, .38); text-align: center; font-size: 14.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pgal-lb .pgal-lb-cap:empty { display: none; }
@media (max-width: 640px) {
  .pgal-lb .pgal-lb-stage { inset: 52px 8px 60px; }
  .pgal-lb .is-prev, .pgal-lb .is-next { top: auto; bottom: 10px; transform: none; width: 40px; height: 40px; }
  .pgal-lb .pgal-lb-cap { bottom: 64px; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .pgal:not(#pcz) .pgal-track { scroll-behavior: auto; }
  .pgal:not(#pcz) *:not(.pgal-thumb-ind) { transition: none !important; }
}

/* etykiety (Kompozytor sklepu › Etykiety) na dużym zdjęciu – 9 punktów */
.pgal:not(#pcz) .pgal-lbls { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 6px; padding: 12px; pointer-events: none; max-width: 100%; }
.pgal:not(#pcz) .pgal-lbls > * { pointer-events: auto; }
.pgal:not(#pcz) .pgal-lbls[data-pos^="t"] { top: 0; }
.pgal:not(#pcz) .pgal-lbls[data-pos^="b"] { bottom: 0; }
.pgal:not(#pcz) .pgal-lbls[data-pos="l"], .pgal:not(#pcz) .pgal-lbls[data-pos="c"], .pgal:not(#pcz) .pgal-lbls[data-pos="r"] { top: 50%; transform: translateY(-50%); }
.pgal:not(#pcz) .pgal-lbls[data-pos$="l"], .pgal:not(#pcz) .pgal-lbls[data-pos="l"] { left: 0; align-items: flex-start; }
.pgal:not(#pcz) .pgal-lbls[data-pos$="r"], .pgal:not(#pcz) .pgal-lbls[data-pos="r"] { right: 0; align-items: flex-end; }
.pgal:not(#pcz) .pgal-lbls[data-pos="t"], .pgal:not(#pcz) .pgal-lbls[data-pos="b"], .pgal:not(#pcz) .pgal-lbls[data-pos="c"] { left: 50%; transform: translateX(-50%); align-items: center; }
.pgal:not(#pcz) .pgal-lbls[data-pos="c"] { transform: translate(-50%, -50%); }
.pgal:not(#pcz) .pc-lbl { display: inline-flex; align-items: center; justify-content: center; gap: .35em; max-width: 100%; padding: var(--l-py, 5px) var(--l-px, 9px); font-family: inherit; font-size: calc(var(--l-fs, 12px) * 1.15); font-weight: var(--l-fw, 700); line-height: 1.1; letter-spacing: var(--l-ls, normal); text-transform: var(--l-tt, none); color: var(--l-c, #fff); background: var(--l-bg, #5b5bd6); background-image: var(--l-bgi, none); border: var(--l-bd, 0); border-radius: var(--l-r, 999px); box-shadow: var(--l-sh, none); rotate: var(--l-rot, 0deg); white-space: nowrap; text-decoration: none; }
.pgal:not(#pcz) .pc-lbl .pc-ic { width: 1.15em; height: 1.15em; fill: currentColor; stroke: none; }
.pgal:not(#pcz) .pc-lbl.is-rect, .pgal:not(#pcz) .pc-lbl.is-ribbon { border-radius: var(--l-r, 5px); }
.pgal:not(#pcz) .pc-lbl.is-tag { border-radius: var(--l-r, 4px 999px 999px 4px); }
.pgal:not(#pcz) .pc-lbl.is-circle { width: 4.2em; height: 4.2em; padding: 0 .3em; border-radius: var(--l-r, 50%); white-space: normal; text-align: center; line-height: 1; }
.pgal:not(#pcz) .pc-lbl.is-plain { background: none; padding: 0; box-shadow: none; }
.pgal:not(#pcz) .pc-lbl.is-image { padding: 0; background: none; border: 0; box-shadow: none; border-radius: 0; }
.pgal:not(#pcz) .pc-lbl.is-image img { display: block; width: calc(var(--l-iw, 64px) * 1.3); height: auto; }
@media (max-width: 767px) { .pgal:not(#pcz) .pc-lbl.is-only-desktop { display: none; } }
@media (min-width: 768px) { .pgal:not(#pcz) .pc-lbl.is-only-mobile { display: none; } }
