/* AE Badges — front-end */

/* ── Shop / archive loop ─────────────────────────────────── */
/* WooCommerce wraps the thumbnail in .woocommerce-product-gallery or
   simply outputs it inside li.product. Position relative is needed
   on the image wrapper so our absolute badges sit over the image. */

ul.products li.product,
.products li.product {
    position: relative;
}

/* ── Single product gallery ──────────────────────────────── */
.woocommerce-product-gallery,
.woocommerce-product-gallery__wrapper {
    position: relative;
}

/* ── Badge container ─────────────────────────────────────── */
.aeb-badges {
    position: absolute;
    /* Stack below the WooCommerce sale badge.
       WooCommerce outputs .onsale at top:0 / left:0 (or right:0).
       We offset down so our badges clear the sale badge height (~28px).
       Adjust this value if your theme's sale badge is taller/shorter. */
    top: 34px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 9;          /* below WC sale badge (z-index ~10) */
    pointer-events: none;
}

/* ── Individual badge ────────────────────────────────────── */
.aeb-badge {
    display: inline-block;
    padding: 3px 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ── Inline context (cart / quote form) ──────────────────── */
.aeb-badges--inline {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    pointer-events: auto;
}

/* ── If product has NO sale badge, start from top ───────────
   We target this with a has() check where supported; otherwise
   the 34px offset gives a small gap which is acceptable.        */
li.product:not(:has(.onsale)) .aeb-badges,
.woocommerce-product-gallery:not(:has(.onsale)) .aeb-badges {
    top: 8px;
}
