/**
 * IZY Product Featured
 *
 * Listing-type badges and WooCommerce sale badge stacking.
 * Shared layout for product archives, related products, and single galleries.
 */

/* Independent IZY listing badges. */
.izy-listing-badge {
    box-sizing: border-box;
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    padding: .25em .75em;
    border: 1px solid #43454b;
    border-radius: 4px;
    background: #fff;
    color: #43454b;
    font-size: .875em;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.izy-listing-badge__text {
    color: inherit;
}

.izy-listing-badge--featured {
    background: #fff;
    color: #43454b;
}

.izy-listing-badge--premium {
    background: #191919;
    color: #eac985;
}

/* Both WooCommerce image layouts stack their existing badge children. */
:is(
    .wc-block-components-product-image__inner-container,
    .wc-block-product-gallery-large-image__inner-blocks
) {
    position: absolute;
    inset: auto 8px auto auto;
	top: 8px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    width: max-content;
    max-width: calc(100% - 16px);
    padding: 0;
}

/* WooCommerce normally absolutely positions sale badges inside image cards.
 * Reset that at the shared image-container level, including Related Products. */
:is(
    .wc-block-components-product-image__inner-container,
    .wc-block-product-gallery-large-image__inner-blocks
) :is(
    .wc-block-components-product-sale-badge,
    .wp-block-woocommerce-product-sale-badge,
    .izy-listing-badge
) {
    position: static;
    inset: auto;
    float: none;
    margin: 0;
}
