.wc-pil-image-wrap {
    position: relative !important;
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.wc-pil-label-stack {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    max-width: calc(100% - 16px);
    pointer-events: none;
    user-select: none;
}

.wc-pil-label-stack.wc-pil-pos-top-right,
.wc-pil-label-stack.wc-pil-pos-bottom-right {
    align-items: flex-end;
}

.wc-pil-label-stack.wc-pil-pos-bottom-left,
.wc-pil-label-stack.wc-pil-pos-bottom-right {
    flex-direction: column-reverse;
}

.wc-pil-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    max-width: 100%;
    line-height: 1.1;
    letter-spacing: .02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

/* Classic single-product gallery. */
.woocommerce div.product div.images .woocommerce-product-gallery__image {
    position: relative;
}

.woocommerce div.product div.images .woocommerce-product-gallery__image > .wc-pil-label-stack {
    position: absolute;
}

/* Product-level labels on the single product page. They intentionally sit
   outside the gallery so shoppers understand the label belongs to the product. */
.wc-pil-product-labels {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0 0 10px;
    box-sizing: border-box;
}

.wc-pil-product-labels .wc-pil-product-label {
    position: relative;
    flex: 0 0 auto;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}
