/* Only an explicitly mounted image container may show an overlay. */
.x-opta-badges { display: none; }
.x-opta-badge-anchor > .x-opta-badges.is-mounted {
    display: block; position: absolute; inset: 0; z-index: 8; pointer-events: none;
    margin: 0 !important; padding: 0 !important; width: auto !important; height: auto !important;
    max-width: none !important; text-align: left; overflow: hidden;
}
/* Full-width rails: % widths below are relative to the PRODUCT IMAGE,
 * not a shrink-to-fit corner. Image badges never inherit the text width cap. */
.x-opta-badges .x-opta-badges__corner {
    position: absolute; display: flex; flex-direction: column; align-items: flex-start;
    gap: var(--xb-gap, 6px); width: 100%; max-width: none; left: 0; right: auto;
    margin: 0; padding: 0; pointer-events: none;
}
.x-opta-badges__corner--top-left { top: var(--xb-offset-y,10px); --xb-edge-left: var(--xb-offset-x,10px); --xb-edge-right: 0px; }
.x-opta-badges__corner--top-right { top: var(--xb-offset-y,10px); --xb-edge-left: 0px; --xb-edge-right: var(--xb-offset-x,10px); }
.x-opta-badges__corner--bottom-left { bottom: var(--xb-offset-y,10px); --xb-edge-left: var(--xb-offset-x,10px); --xb-edge-right: 0px; }
.x-opta-badges__corner--bottom-right { bottom: var(--xb-offset-y,10px); --xb-edge-left: 0px; --xb-edge-right: var(--xb-offset-x,10px); }
.x-opta-badges .x-opta-badges__corner--top-right,.x-opta-badges .x-opta-badges__corner--bottom-right { align-items: flex-end; }
.x-opta-badges .x-opta-badges__corner--bottom-left,.x-opta-badges .x-opta-badges__corner--bottom-right { flex-direction: column-reverse; }
.x-opta-badges .x-opta-badges__corner--default {
    top: var(--xb-top,10px); bottom: var(--xb-bottom,auto);
    align-items: var(--xb-align,flex-start); flex-direction: var(--xb-direction,column);
}
.x-opta-badges .x-opta-badge {
    --xb-scale: 1; box-sizing: border-box; display: inline-flex; flex: 0 0 auto;
    align-items: center; justify-content: center; line-height: 1.15;
    max-width: calc(100% - 2 * var(--xb-offset-x,10px));
    margin: 0; margin-left: var(--xb-edge-left,10px); margin-right: var(--xb-edge-right,0px);
    pointer-events: none; text-decoration: none; overflow-wrap: anywhere; white-space: normal;
}
.x-opta-badges .x-opta-badge--size-small { --xb-scale: .85; }
.x-opta-badges .x-opta-badge--size-large { --xb-scale: 1.2; }
.x-opta-badges .x-opta-badge--text {
    width: max-content; max-width: min(var(--xb-max-width,48%), calc(100% - 2 * var(--xb-offset-x,10px)));
    min-height: calc(var(--xb-min-height,25px) * var(--xb-scale));
    padding: calc(var(--xb-padding-y,5px) * var(--xb-scale)) calc(var(--xb-padding-x,9px) * var(--xb-scale));
    border: 0; border-radius: var(--xb-radius,3px); background: var(--xb-bg,var(--xb-default-bg,#62aa34));
    color: var(--xb-fg,var(--xb-default-fg,#fff)); font-size: calc(var(--xb-font-size,11px) * var(--xb-scale));
    font-weight: var(--xb-font-weight,700); font-family: inherit; letter-spacing: normal;
    text-transform: var(--xb-transform,uppercase); text-shadow: none; box-shadow: none; text-align: center;
}
.x-opta-badge--color-opta-green { --xb-bg: var(--xb-opta-green-bg,#62aa34); --xb-fg: var(--xb-opta-green-fg,#fff); }
.x-opta-badge--color-black { --xb-bg: var(--xb-black-bg,#202124); --xb-fg: var(--xb-black-fg,#fff); }
.x-opta-badge--color-red { --xb-bg: var(--xb-red-bg,#c62828); --xb-fg: var(--xb-red-fg,#fff); }
.x-opta-badge--color-blue { --xb-bg: var(--xb-blue-bg,#1565c0); --xb-fg: var(--xb-blue-fg,#fff); }
.x-opta-badge--color-orange { --xb-bg: var(--xb-orange-bg,#e56a00); --xb-fg: var(--xb-orange-fg,#fff); }
.x-opta-badge--color-gold { --xb-bg: var(--xb-gold-bg,#a67c00); --xb-fg: var(--xb-gold-fg,#fff); }
.x-opta-badge--color-gray { --xb-bg: var(--xb-gray-bg,#667085); --xb-fg: var(--xb-gray-fg,#fff); }
.x-opta-badge--color-white { --xb-bg: var(--xb-white-bg,#fff); --xb-fg: var(--xb-white-fg,#202124); }
/* Constrain the OUTER width using the logo's own aspect ratio. Limiting only
 * img height left a wide empty box with a centered tiny logo in beta3. */
.x-opta-badges .x-opta-badge--image {
    width: min(var(--xb-image-override,var(--xb-image-size,64px)), calc(var(--xb-image-height-limit,100000px) * var(--xb-image-ratio,1)), calc((var(--xb-frame-height,100000px) - 2 * var(--xb-offset-y,10px)) * var(--xb-image-ratio,1)));
    background: transparent; padding: 0; border: 0;
}
/* Product-card image rules use high-specificity !important declarations.
 * A badge logo is NOT the main product image: never inherit its padding,
 * cover cropping, 100% stage height, or lazy-loader visibility. Scope the
 * stronger reset only to our mounted logo, not text badges or product photos. */
.x-opta-badges .x-opta-badge__image,
.x-opta-badge-anchor > .x-opta-badges.is-mounted .x-opta-badges__corner .x-opta-badge--image > .x-opta-badge__image {
    position: static !important; inset: auto !important; display: block !important;
    width: 100% !important; height: auto !important; min-width: 0 !important; min-height: 0 !important;
    max-width: 100% !important; max-height: none !important;
    margin: 0 !important; padding: 0 !important; box-sizing: border-box !important;
    object-fit: contain !important; object-position: center !important;
    border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
    visibility: visible !important; opacity: 1 !important; transform: none !important;
}
/* Minimal wrapper only for classic Woo cards with no image container. */
.x-opta-badge-image-frame { display: block; position: relative; }
.x-opta-badge-image-frame > img,.x-opta-badge-image-frame > picture > img { display: block; width: 100%; height: auto; margin: 0 !important; }

/* Intentional hidden automatic badge, including an expired New badge in old HTML. */
.x-opta-badges .x-opta-badge[hidden] { display:none !important; }
.xob-native-hidden { display:none !important; }
/* No broad .badge-container/.badge hiding: other native status labels survive. */
body.xob-theme-replace :is(.product-small,li.product,.product.type-product,[data-x-opta-card]) :is(.onsale,.badge-inner.on-sale,.badge-inner.new-bubble) { display:none !important; }
