/* تنها استایل مشترک قاب تصویر و برچسب فرمت؛ موقعیت برچسب نسبت به خود تصویر است. */
.afz-format-image-frame {
    position: relative;
    display: inline-block;
    flex: 0 1 auto;
    width: fit-content;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    line-height: 0;
    vertical-align: top;
    box-sizing: border-box;
    transition: transform .25s ease;
}

.afz-format-image-frame > img,
.afz-format-image-frame > a > img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center;
    box-sizing: border-box;
}

.afz-format-image-frame > a {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    line-height: 0;
    vertical-align: top;
}

.afz-format-image-frame--single,
.afz-format-image-frame--single > a,
.afz-format-image-frame--single > a > img {
    max-height: 620px;
}

.afz-format-badges {
    position: absolute;
    z-index: 20;
    top: 5px;
    left: 5px;
    right: auto;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 5px;
    max-width: 100%;
    margin: 0;
    padding: 0;
    direction: ltr;
    line-height: 1.2;
    pointer-events: none;
    transform: none;
}

.afz-format-badge {
    display: inline-flex;
    min-height: 23px;
    align-items: center;
    justify-content: center;
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 4px;
    background: var(--afz-format-color, #687582);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: .2px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}

.afz-format-badges--checkout {
    position: static;
    max-width: 100%;
    align-items: center;
    justify-content: center;
    gap: 4px;
    vertical-align: middle;
}

.afz-format-badges--checkout .afz-format-badge {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 11px;
    box-shadow: none;
}

@media (max-width: 767px) {
    .afz-format-badge {
        min-height: 21px;
        padding: 2px 6px;
        font-size: 10px;
    }

    .afz-format-image-frame--single,
    .afz-format-image-frame--single > a,
    .afz-format-image-frame--single > a > img {
        max-height: 422px;
    }
}


/* استایل سبد خرید نیز در همین فایل واحد مدیریت می‌شود. */
#edd_checkout_cart .afz-format-badges--checkout {
    position: static;
    inset: auto;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: auto;
    max-width: 100%;
    direction: ltr;
    vertical-align: middle;
}

#edd_checkout_cart .afz-format-badge {
    min-height: 22px;
    padding: 3px 7px;
    border: 1px solid rgba(70, 82, 94, .22);
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}

@media (max-width: 767px) {
    #edd_checkout_cart .afz-format-badge {
        min-height: 20px;
        padding: 2px 5px;
        font-size: 10px;
    }
}
