/* === TBPrinting – Lightbox Final (Optimized) === */

/* 💣 Vypni nový block lightbox */
.wc-block-product-gallery-dialog {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ✨ Styl miniatur */
.wc-block-product-gallery-thumbnails__thumbnail {
  border: 2px solid #fff !important;
  border-radius: 8px !important;
  transition: all 0.25s ease !important;
  background: rgba(255, 255, 255, 0.03);
}
.wc-block-product-gallery-thumbnails__thumbnail:hover {
  border-color: #0693e3 !important;
  box-shadow: 0 0 14px #0693e3 !important;
  transform: scale(1.05);
}

/* 🧱 Krajní miniatury */
.wc-block-product-gallery-thumbnails__thumbnail:first-child { margin-left: 8px !important; }
.wc-block-product-gallery-thumbnails__thumbnail:last-child { margin-right: 8px !important; }

/* 🖼️ Stará galerie – neviditelná, ale aktivní */
.woocommerce-product-gallery {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  visibility: visible !important;
}

/* ⚫ Pozadí lightboxu */
.pswp__bg {
  background: #000 !important;
  transition: opacity 0.3s ease-in-out !important;
}
.pswp--open .pswp__bg {
  opacity: 1 !important;
}

/* 🎬 Fade efekt pro obrázek */
.pswp__item img {
  transition: opacity 0.25s ease-in-out !important;
}
.pswp--open .pswp__item img {
  opacity: 1 !important;
}

/* 🧹 Schovej fullscreen + share */
.pswp__button--fs,
.pswp__button--share {
  display: none !important;
}

/* === TBPrinting – skrytí šipek v nové WC Blocks galerii === */
.wc-block-next-previous-buttons__button {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* === TBPrinting – zarovnání thumbnail okrajů, odstranění clippingu === */
.wc-block-product-gallery-thumbnails__scrollable {
  overflow-x: auto !important;
  overflow-y: hidden !important; /* ✅ zabrání vertikálnímu posunu */
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  padding: 10px 12px !important;
  margin: 0 -10px !important;
  scroll-padding: 12px !important;
  display: flex !important;
  justify-content: start !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.wc-block-product-gallery-thumbnails__scrollable::-webkit-scrollbar {
  display: none !important;
}

/* Jemné vyrovnání okrajů */
.wc-block-product-gallery-thumbnails__thumbnail:first-child {
  margin-left: 8px !important;
}
.wc-block-product-gallery-thumbnails__thumbnail:last-child {
  margin-right: 14px !important;
}

/* === TBPrinting – vypnutí nativního kurzoru v galerii === */
.wc-block-product-gallery-thumbnails__scrollable,
.wc-block-product-gallery-thumbnails__thumbnail,
.wc-block-product-gallery-thumbnails__thumbnail img,
.wc-block-product-gallery-large-image img {
  cursor: none !important;
}

/* === ✅ TBPrinting – fix layout jump při zavření lightboxu === */

/* 🧩 Zamez pluginům manipulovat s overflow */
html,
body {
  overflow-x: hidden !important; /* ✅ fix pro horizontální scrollbar */
  overflow-y: auto !important;   /* ✅ nechá přirozený scrolling */
  padding-right: 0 !important;
  margin: 0 !important;
  height: auto !important;
  min-height: 100vh !important;
}

/* Když je lightbox otevřený – neblokuj scroll */
html.pswp--open,
body.pswp--open,
html.pswp-open,
body.pswp-open {
  overflow-y: hidden !important; /* ✅ zabrání skákání při lightboxu */
  padding-right: 0 !important;
}

/* Sticky header nesmí poskakovat */
.wp-block-main-header-container.is-position-sticky {
  transition: none !important;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* === TBPrinting – styl miniatur galerie s větší mezerou u aktivního obrázku === */
.wc-block-product-gallery-thumbnails__thumbnail {
  border-radius: 6px;
  overflow: hidden;
  padding: 2px;
  background: transparent;
  box-sizing: border-box;
}

/* Základní vzhled obrázků */
.wc-block-product-gallery-thumbnails__thumbnail img {
  border-radius: 4px;
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.25s ease, opacity 0.25s ease, padding 0.25s ease;
}

/* Hover efekt – jemný */
.wc-block-product-gallery-thumbnails__thumbnail:hover img {
  transform: scale(1.02);
  opacity: 0.95;
}

/* Aktivní obrázek – větší mezera kolem + outline */
.wc-block-product-gallery-thumbnails__thumbnail__image--is-active {
  outline: 2px solid #0693e3;
  border-radius: 6px;
  outline-offset: 3px;
  padding: 3px;
  box-sizing: border-box;
}

/* === 🧱 TBPrinting – schovej tlačítko Přidat do košíku u produktu === */
.wp-block-add-to-cart-form {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* === 🚧 Fix: ghost scrollbar z vrstvy headeru / wp-site-blocks === */

/* resetuj „compositing layer“ z WordPress wrapperu */
.wp-site-blocks {
  transform: none !important;
  overflow: visible !important;
  contain: none !important;
  position: relative !important;
  height: auto !important;
}

/* oprav sticky header – nechte ho scrollovat v hlavním toku stránky */
.wp-block-main-header-container.is-position-sticky {
  will-change: auto !important;
  backface-visibility: visible !important;
  transform: none !important;
  overflow: visible !important;
}

/* ✅ html/body fix: zobrazuj pouze systémový scrollbar */
html {
  overflow-y: scroll !important;  /* zobraz systémový scrollbar */
  overflow-x: hidden !important;  /* zamez horizontálnímu */
  height: auto !important;
}

body {
  overflow: visible !important;   /* tělo se chová normálně */
  height: auto !important;
  min-height: 100vh !important;
}

.pswp__button--close {
    pointer-events: none !important;
}
