/* Catalogs 0.46.5: the media frame follows the intrinsic aspect ratio of the
   specific photograph. Fixed 3:2 / 4:3 / square frames + contain caused the
   reported letterboxing. --pc-fit-ratio is set from actual image metadata by JS.
   Intentionally limited to coffin/hearse catalog and single records. */
.pc-coffins-catalog-block .pogost-wreath-card__media,
.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__media,
.pogost-hearse-catalog-block .pogost-hearse-card__media,
.pogost-hearse-page .pogost-hearse-related .pogost-hearse-card__media {
    position:relative;
    aspect-ratio:var(--pc-fit-ratio,3/2) !important;
    overflow:hidden;
    padding:0 !important;
}
.pc-coffins-catalog-block .pogost-wreath-card__media > img,
.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__media > img,
.pogost-hearse-catalog-block .pogost-hearse-card__media > img,
.pogost-hearse-page .pogost-hearse-related .pogost-hearse-card__media > img {
    box-sizing:border-box;
    position:absolute; inset:0;
    display:block; width:100%; height:100%;
    min-width:0; min-height:0; max-width:none; max-height:none;
    margin:0 !important; padding:0 !important; border:0;
    aspect-ratio:auto; object-fit:contain !important; object-position:center;
    border-radius:0; transform:none;
}
.pogost-coffin-product-page .pogost-product-main,
.pogost-coffin-product-page .pogost-product-main.is-landscape,
.pogost-coffin-product-page .pogost-product-main.is-portrait,
.pogost-hearse-page .pogost-hearse-main,
.pogost-hearse-page .pogost-hearse-main.is-landscape,
.pogost-hearse-page .pogost-hearse-main.is-portrait {
    box-sizing:border-box;
    aspect-ratio:var(--pc-fit-ratio,3/2) !important;
    min-height:0 !important;
    height:auto !important;
    padding:0 !important;
    overflow:hidden;
}
.pogost-coffin-product-page .pcp-main-open,
.pogost-hearse-page .pogost-hearse-main__open {
    box-sizing:border-box; position:absolute; inset:0;
    width:100%; height:100%; padding:0 !important; margin:0;
}
.pogost-coffin-product-page .pcp-main-open > img,
.pogost-coffin-product-page .pogost-product-main.is-landscape .pcp-main-open > img,
.pogost-hearse-page .pogost-hearse-main__open > img {
    box-sizing:border-box; position:absolute; inset:0;
    width:100%; height:100%; max-width:none; max-height:none;
    margin:0 !important; padding:0 !important; border:0;
    aspect-ratio:auto; object-fit:contain !important; object-position:center;
    border-radius:0;
}
/* Thumbnails follow their own image ratios, so all edges remain visible. */
.pogost-coffin-product-page .pogost-product-thumbs button,
.pogost-hearse-page .pogost-hearse-thumbs button {
    box-sizing:border-box;
    aspect-ratio:var(--pc-fit-ratio,3/2) !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    padding:0 !important;
    overflow:hidden;
}
.pogost-coffin-product-page .pogost-product-thumbs button img,
.pogost-hearse-page .pogost-hearse-thumbs button img {
    box-sizing:border-box; position:absolute; inset:0; display:block;
    width:100%; height:100%; max-width:none; max-height:none;
    margin:0 !important; padding:0 !important; border:0;
    object-fit:contain !important; object-position:center;
    background:transparent; transform:none;
}
/* The fullscreen lightbox is intentionally untouched: it must keep the whole
   image visible even when its viewport aspect differs from the photograph. */
/* Vertical thumbnails can be taller than the historic 90px gallery rail. */
.pogost-coffin-product-page .pogost-product-thumbs {
    max-height:none !important;
}
