/* sztukator.eu – galeria karty produktu, wersja 20261109 (działa tylko gdy JS doda .sg-on) */
@media (min-width: 768px) {
  html body .product_card .product-gallery.sg-on .grid-gallery { position: relative; }
  html body .product_card .product-gallery.sg-on .grid-gallery > .text-center { display: none !important; } /* „Pokaż więcej zdjęć” */
  html body .product_card .product-gallery.sg-on .grid-gallery .product-card-gallery-wrapper {
    position: relative; display: block !important; width: 100%;
    aspect-ratio: 1 / 1; max-height: max(380px, calc(100vh - 230px));
    border: 1px solid #ddd; border-radius: 12px; background: #fff; overflow: hidden;
    touch-action: pan-y; user-select: none;
  }
  html body .product_card .product-gallery.sg-on .grid-gallery .product-card-gallery-wrapper > figure.product-card-img {
    position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; max-height: none !important;
    margin: 0 !important; border: 0 !important; border-radius: 0 !important;
    display: flex !important; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s; cursor: zoom-in;
  }
  html body .product_card .product-gallery.sg-on .grid-gallery .product-card-gallery-wrapper > figure.product-card-img.sg-active {
    opacity: 1; visibility: visible; z-index: 1; transition: opacity .25s ease;
  }
  html body .product_card .product-gallery.sg-on .grid-gallery .product-card-gallery-wrapper > figure.product-card-img img {
    position: static !important; width: 100% !important; height: 100% !important; max-width: 100%; max-height: 100%;
    object-fit: contain !important; border: 0 !important; border-radius: 0 !important; padding: 16px; box-sizing: border-box;
  }
  html body .product_card .product-gallery.sg-on .grid-gallery .product-card-gallery-wrapper > figure .icon-refresh { display: none !important; }
  html body .product_card .product-gallery.sg-on .grid-gallery .product-card-gallery-wrapper > .product-status { position: absolute; z-index: 3; top: 12px; left: 12px; }

  /* strzałki */
  .product-gallery.sg-on .sg-nav {
    position: absolute; z-index: 4; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0;
    background: rgba(255,255,255,.92); box-shadow: 0 1px 6px rgba(0,0,0,.18);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    opacity: .85; transition: opacity .15s, box-shadow .15s;
  }
  .product-gallery.sg-on .sg-nav:hover, .product-gallery.sg-on .sg-nav:focus-visible { opacity: 1; box-shadow: 0 2px 10px rgba(0,0,0,.28); }
  .product-gallery.sg-on .sg-nav:focus-visible { outline: 2px solid #222; outline-offset: 2px; }
  .product-gallery.sg-on .sg-prev { left: 12px; } .product-gallery.sg-on .sg-next { right: 12px; }
  .product-gallery.sg-on .sg-nav svg { width: 22px; height: 22px; fill: none; stroke: #222; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

  /* licznik i lupa */
  .product-gallery.sg-on .grid-gallery .sg-counter {
    position: absolute; z-index: 4; right: 12px; bottom: 12px; padding: 4px 10px; border-radius: 14px;
    background: rgba(34,34,34,.78); color: #fff; font-size: 13px; line-height: 18px; letter-spacing: .02em; pointer-events: none;
  }
  .product-gallery.sg-on .sg-zoom { position: absolute; z-index: 4; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,.9); box-shadow: 0 1px 4px rgba(0,0,0,.15); display: flex; align-items: center; justify-content: center; pointer-events: none; }
  .product-gallery.sg-on .sg-zoom svg { width: 18px; height: 18px; fill: none; stroke: #222; stroke-width: 1.8; stroke-linecap: round; }

  /* pasek miniatur – jeden rząd, przewijany */
  .product-gallery.sg-on .sg-thumbs {
    display: flex; gap: 8px; margin-top: 10px; padding: 2px 2px 6px; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: #bbb transparent; -webkit-overflow-scrolling: touch;
  }
  .product-gallery.sg-on .sg-thumbs::-webkit-scrollbar { height: 6px; }
  .product-gallery.sg-on .sg-thumbs::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
  .product-gallery.sg-on .sg-thumb {
    flex: 0 0 72px; width: 72px; height: 72px; padding: 3px; border: 1px solid #ddd; border-radius: 8px; background: #fff;
    cursor: pointer; scroll-snap-align: start; transition: border-color .15s;
  }
  .product-gallery.sg-on .sg-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 5px; }
  .product-gallery.sg-on .sg-thumb:hover { border-color: #888; }
  .product-gallery.sg-on .sg-thumb.is-active { border: 2px solid #222; padding: 2px; }
  .product-gallery.sg-on .sg-thumb:focus-visible { outline: 2px solid #222; outline-offset: 2px; }
  .product-gallery.sg-single .sg-counter { display: none; }
}
/* telefon: licznik na karuzeli motywu */
@media (max-width: 767.98px) {
  .product-gallery .main-gallery { position: relative; }
  .product-gallery .sg-counter-mobile {
    position: absolute; z-index: 5; right: 12px; top: 12px; padding: 3px 9px; border-radius: 12px;
    background: rgba(34,34,34,.75); color: #fff; font-size: 12px; line-height: 16px; pointer-events: none;
  }
}
@media (prefers-reduced-motion: reduce) { .product-gallery.sg-on figure.product-card-img { transition: none !important; } }
