.single-product div.product {
  display: grid !important;
  grid-template-columns: 500px 1fr !important;
  gap: 48px !important;
  align-items: start !important;
  padding-top: 24px;
}
.single-product div.product .woocommerce-product-gallery {
  grid-column: 1 !important;
  grid-row: 1 !important;
  position: sticky !important;
  top: 140px !important;
  align-self: start !important;
  width: 500px !important;
  max-width: 500px !important;
}
.single-product div.product .summary.entry-summary {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  min-width: 300px !important;
  width: 100% !important;
}
@media (max-width: 900px) {
  .single-product div.product { grid-template-columns: 1fr !important; }
  .single-product div.product .woocommerce-product-gallery { width: 100% !important; max-width: 100% !important; position: static !important; }
}

.single-product div.product .woocommerce-product-gallery {
  position: static !important;
  top: auto !important;
}

/* FINAL FIX: Изключи sticky напълно, related да са под всичко */
.single-product .woocommerce-product-gallery {
  position: relative !important;
  top: auto !important;
  align-self: start !important;
}
.single-product div.product {
  position: relative !important;
}
.related.products,
.upsells.products {
  position: relative !important;
  z-index: 10 !important;
  background: var(--bg) !important;
  padding-top: 24px !important;
  margin-top: 24px !important;
  clear: both !important;
  display: block !important;
  width: 100% !important;
  grid-column: 1 / -1 !important;
}

/* Скрий празния първи li от WC subcategories */
ul.products li.product-category:empty,
ul.products li.product:not([class*="post-"]) {
  display: none !important;
}

ul.products::before,
ul.products::after {
  display: none !important;
  content: none !important;
}
