/* Catalogue images show the entire item. Editorial room photography keeps its own crop. */
.sf-featured-media, .sf-ranked-media, .product-image, .gallery-main,
.gallery-thumb, .sf-hero-product-image { position: relative; overflow: hidden; }
.sf-featured-media > img, .sf-ranked-media > img, .product-image img,
.gallery-main > img, .gallery-thumb > img, .sf-hero-product-image > img {
  width: 100%; height: 100%; object-fit: contain !important;
  padding: clamp(6px, 1vw, 14px); transform: none !important; transition: none !important;
}
.gallery-main { align-self: start; min-height: 0; }
#page-detail .gallery-main > img { padding: 0 !important; object-fit: cover !important; }
.gallery-thumb > img, .sf-hero-product-image > img { padding: 4px; }
/* JS positions the original image so only a verified blank outer margin falls outside the frame. */
img.th-image-fitted {
  position: absolute !important; max-width: none !important; max-height: none !important;
  width: var(--th-image-width) !important; height: var(--th-image-height) !important;
  left: var(--th-image-left) !important; top: var(--th-image-top) !important;
  padding: 0 !important; object-fit: fill !important; transform: none !important;
}
.gallery-original {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  min-height: 36px; padding: 8px 13px; border: 1px solid #dedede;
  border-radius: 24px; background: #fff; color: #111;
  font-size: 12px; font-weight: 600; text-decoration: none;
}
.gallery-original:hover { border-color: #111; }
.gallery-original:focus-visible { outline: 2px solid #0058a3; outline-offset: 3px; }
@media (max-width: 1023px) {
  #page-detail .gallery-main > img:not(.th-image-fitted) { padding: 0 !important; }
  #page-detail .gallery-counter { left: 12px; right: auto; bottom: 12px; }
  .detail-mobile-media { gap: 6px; flex-wrap: wrap; padding-inline: 12px; }
  .detail-mobile-media button { padding-inline: 12px; }
  .gallery-original { min-height: 44px; padding: 10px; }
}
