/* Product details: original portrait artwork fills the main frame naturally.
   Existing gallery controls stay interactive in a vertical rail on the left. */
.catalog-page .product-detail {
  align-items: start !important;
}
.catalog-page .product-detail > div:first-child {
  --gallery-rail: 72px;
  --gallery-gap: 16px;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding-inline-start: calc(var(--gallery-rail) + var(--gallery-gap));
}
.catalog-page .product-detail .product-main-image {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 1px solid #d7e0d4;
  border-radius: 12px;
  overflow: hidden;
}
.catalog-page .product-detail .product-main-image > img {
  display: block;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain !important;
  transform: none !important;
}
.catalog-page .product-detail .product-main-image > .legacy-product-image {
  height: auto !important;
  aspect-ratio: 210 / 297;
}
.catalog-page .product-detail .photo-thumbnails {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--gallery-rail);
  max-width: var(--gallery-rail);
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.catalog-page .product-detail .photo-thumbnails button {
  box-sizing: border-box;
  display: block;
  flex: 0 0 auto !important;
  width: 100% !important;
  min-width: 0;
  min-height: 0 !important;
  height: auto !important;
  aspect-ratio: 210 / 297;
  padding: 3px;
  overflow: hidden;
}
.catalog-page .product-detail .photo-thumbnails img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain;
}
.catalog-page .product-detail .photo-thumbnails:empty { display: none !important; }
.catalog-page .product-detail > div:first-child:has(> .photo-thumbnails:empty) {
  padding-inline-start: 0;
}
@media (max-width: 600px) {
  .catalog-page .product-detail > div:first-child {
    --gallery-rail: 48px;
    --gallery-gap: 10px;
  }
  .catalog-page .product-detail .photo-thumbnails { gap: 8px; }
  .catalog-page .product-detail .product-main-image { border-radius: 8px; }
}
