.product-item,
.product-item-info,
.product.media,
.sh-pdp-gallery {
    position: relative;
}

.haroone-product-labels {
    display: contents;
}

.haroone-product-label-stack {
    --hpl-offset: 12px;
    position: absolute;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: max-content;
    max-width: calc(100% - 24px);
    overflow: hidden;
    pointer-events: none;
}

.haroone-product-label-stack--top-left { top: var(--hpl-offset); left: var(--hpl-offset); }
.haroone-product-label-stack--top-right { top: var(--hpl-offset); right: var(--hpl-offset); align-items: flex-end; }
.haroone-product-label-stack--bottom-left { bottom: var(--hpl-offset); left: var(--hpl-offset); flex-direction: column-reverse; }
.haroone-product-label-stack--bottom-right { right: var(--hpl-offset); bottom: var(--hpl-offset); flex-direction: column-reverse; align-items: flex-end; }

.haroone-product-label {
    display: inline-flex;
    align-items: center;
    width: max-content;
    min-height: 28px;
    padding: 5px 11px;
    overflow: hidden;
    color: var(--hpl-color);
    background: var(--hpl-bg);
    border: 1px solid var(--hpl-border);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: .02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.haroone-product-label--pill { border-radius: 999px; }
.haroone-product-label--rounded { border-radius: 6px; }
.haroone-product-label--square { border-radius: 0; }
.haroone-product-label--ribbon { border-radius: 2px 999px 999px 2px; padding-right: 16px; }

.haroone-product-labels--pdp .haroone-product-label-stack {
    --hpl-offset: 24px;
}

@media (max-width: 767px) {
    .haroone-product-label-stack { --hpl-offset: 8px; gap: 4px; }
    .haroone-product-label { min-height: 24px; padding: 4px 8px; font-size: 11px; }
    .haroone-product-labels--pdp .haroone-product-label-stack { --hpl-offset: 12px; }
}
