/* B-03: sellers upload photos of any shape and never crop them. Every place
   on the site puts the photo in a frame of fixed shape and picks how it sits
   in it (public/js/shopora-pics.js marks the frames):

     .pic-fit   whole photo, blurred copy of it behind (product cards)
     .pic-fill  photo covers the frame, cut from the centre or the focal point
                (stores, Largest Discounts, banners, stories)
     .pic-full  whole photo at its own shape on light grey (store page, item page)

   Frame shapes: .pic-square 1:1, .pic-wide 16:9, .pic-tall 3:4. The frame
   holds its shape before the photo loads (grey box), so the page never jumps. */

.pic-frame {
    position: relative !important;
    display: block !important;
    overflow: hidden !important;
    height: auto !important;
    max-height: none !important;
    background: #ececec;
    isolation: isolate;
}
/* Badges drawn over a picture stay on top of it. */
.pic-frame > :not(img),
.list-card-image > .member-plan,
.list-card-image > .discount-price { z-index: 2; }
.pic-square { aspect-ratio: 1 / 1 !important; }
.pic-wide   { aspect-ratio: 16 / 9 !important; }
.pic-tall   { aspect-ratio: 3 / 4 !important; }

.pic-frame > img.pic-img {
    position: absolute !important;
    top: 0; left: 0;
    z-index: 1;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    opacity: 0;
    transition: opacity .2s ease, transform .5s ease;
}
.pic-frame.pic-loaded > img.pic-img { opacity: 1; }

.pic-fit > img.pic-img  { object-fit: contain !important; object-position: center !important; }
.pic-fill > img.pic-img { object-fit: cover !important; object-position: var(--pic-focus, 50% 50%) !important; }

/* Fit: the empty sides show a soft blurred copy of the same photo. */
.pic-fit::before {
    content: "";
    position: absolute;
    top: -20px; right: -20px; bottom: -20px; left: -20px;
    background-image: var(--pic-bg);
    background-size: cover;
    background-position: center;
    filter: blur(16px);
    opacity: 0;
    transition: opacity .2s ease;
}
.pic-fit.pic-loaded::before { opacity: .9; }

/* Full: detail pages show everything, never stretched. */
.pic-full {
    background: #F5F5F5 !important;
}
.pic-full > img.pic-img-full {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
}
.pic-full-main {
    height: auto !important;
}
.pic-full-main > img.pic-img-full {
    height: auto !important;
    max-height: 420px !important;
}
@media (max-width: 767px) {
    .pic-full-main > img.pic-img-full { max-height: 320px !important; }
}
