/*
 * AIEO unified badge system — single CSS file owning every product-card
 * badge across archive / PDP / recos / side-cart surfaces.
 *
 * Architecture:
 *   .aieo-badge-stack  Grid container (positioning + ordering)
 *     ├ .aieo-badge--sale          colour tokens via inline style
 *     ├ .aieo-badge--monthly_offer  ↑
 *     ├ .aieo-badge--pro            ↑
 *     ├ .aieo-badge--new            ↑
 *     ├ .aieo-badge--gift           ↑
 *     └ .aieo-badge--free_shipping  ↑
 *
 * Per-surface body classes (emitted by AIEO_DMM_Badges::body_class_filter):
 *   body.aieo-bp-{surface}--{location}   → drives stack positioning
 *   body.aieo-bs-{surface}--{shape}      → drives badge visual shape
 *
 * Locations: top_left | top_right | below_favourite | inline
 * Shapes:    chip (rounded rectangle) | circle (round, icon-only friendly)
 *
 * Cascade hardening:
 *   .aieo-badge starts with `all: revert` so a missing or late-loading
 *   theme stylesheet can never inflate it via inherited font/padding.
 *   :where() keeps specificity at 0,0,0 so theme overrides can win
 *   without the !important arms race that produced the legacy
 *   role-pricing inline-style block.
 *
 * Responsive sizes:
 *   The renderer emits TWO custom properties on each stack —
 *   --aieo-badge-fs-d (desktop) and --aieo-badge-fs-m (mobile). The
 *   active --aieo-badge-fs is var(--aieo-badge-fs-d) by default;
 *   below 600px, the mobile rule swaps it to var(--aieo-badge-fs-m).
 *   Padding/border-radius scale with the active size via calc().
 */

@layer aieo-badges {

  /* Positioning context — the LI / product-card wrapper must be
     position:relative so the absolutely-positioned badge stack anchors
     correctly. NOT inside :where() because we want this to actually win
     against the theme default which treats LI as static. */
  ul.products li.product,
  .products .product,
  .wc-block-product-template > li,
  .wp-block-woocommerce-product-template > li,
  .wp-block-post.product,
  .wc-block-grid__product {
    position: relative;
  }

  /* Block cards: the stack sits inside WooCommerce's Product Image block, as
     WooCommerce's own sale badge does (AIEO_DMM_Badge_Renderer::inject_block_card),
     so the corners it anchors to are the picture's, not the card's. The PDP's
     Product Gallery block: inside its large image (inject_pdp_large_image()). */
  .wc-block-components-product-image:has(> .aieo-badge-stack),
  .wc-block-product-gallery-large-image:has(> .aieo-badge-stack) {
    position: relative;
  }

  /* A badge never takes part in the page's stacking (11.3.16, F13; the owner,
     18 Nov 2026: "The badges overlay the menu bar"). The picture a stack sits
     on is a stacking context of its own, so the stack's z-index (2: above
     WooCommerce's large image, which is 1) counts inside the picture only, and
     the sticky header (the theme's z header, 100), its menus, the side cart and
     the dialogs pass over it. Only wrappers that hold a picture and nothing
     that must escape them: the Product Gallery block itself is not one (its
     full-screen <dialog> is opened with `open`, not in the top layer). */
  :where(.wc-block-components-product-image, .wc-block-product-gallery-large-image, .wp-block-woocommerce-product-image-gallery, .woocommerce-product-gallery, .aieo-card-img-wrap, a.woocommerce-LoopProduct-link):has(> .aieo-badge-stack) {
    isolation: isolate;
  }

  /* Stack container — base styling that's placement-agnostic. The
     `position` value is set by the per-LOCATION rules below, NOT
     here, so adding a new location only requires its own selector
     block. The active font-size is wired through the
     `--aieo-badge-fs` variable; default = desktop, mobile media
     query swaps it to the merchant's mobile px below. */
  .aieo-badge-stack {
    z-index: 2; /* inside its picture (above), never the page's: was 4 */
    display: grid;
    gap: 4px;
    pointer-events: none; /* badges don't intercept clicks on the card */
    max-width: calc(100% - 16px);
    --aieo-badge-fs: var(--aieo-badge-fs-d, 11px);
  }

  /* ──────────────────────────────────────────────────────────────────
     LOCATION RULES — where each surface's stack sits.
     Body class = aieo-bp-{surface}--{location}.
     Each rule sets ONLY positioning + flow direction; visual
     styling (shape) lives in the SHAPE RULES section below.
     ────────────────────────────────────────────────────────────────── */

  /* ===== ARCHIVE — top_left / top_right ===== */
  body.aieo-bp-archive--top_left  .aieo-badge-stack[data-surface="archive"],
  body.aieo-bp-archive--top_right .aieo-badge-stack[data-surface="archive"] {
    position: absolute;
    top: 8px;
  }
  body.aieo-bp-archive--top_left  .aieo-badge-stack[data-surface="archive"] { left:  8px; }
  body.aieo-bp-archive--top_right .aieo-badge-stack[data-surface="archive"] { right: 8px; }

  /* Each chip keeps its own width, lined up on its corner (the grid would
     otherwise stretch every chip to the widest one: SALE as wide as MONTHLY OFFER). */
  body.aieo-bp-archive--top_left  .aieo-badge-stack[data-surface="archive"],
  body.aieo-bp-pdp--top_left      .aieo-badge-stack[data-surface="pdp"]     { justify-items: start; }
  body.aieo-bp-archive--top_right .aieo-badge-stack[data-surface="archive"],
  body.aieo-bp-pdp--top_right     .aieo-badge-stack[data-surface="pdp"]     { justify-items: end; }

  /* ===== ARCHIVE — below_favourite =====
     The legacy `aieo-badges-below-fav` body class is kept as an alias
     for back-compat with any custom theme overrides that target it.
     The roosterx-ff theme overrides the heart to top:12px right:24px
     (brand.css ~line 1521), so we mirror those values here:
     right:25px (1px optical offset for the badge shadow), top:56px
     (heart bottom at 12+36=48 + 8px gap). */
  body.aieo-bp-archive--below_favourite .aieo-badge-stack[data-surface="archive"],
  body.aieo-badges-below-fav            .aieo-badge-stack[data-surface="archive"] {
    position: absolute;
    top: 56px;
    left: auto;
    right: 25px;        /* matches roosterx-ff theme heart override */
    gap: 8px;
    justify-items: end;
  }

  /* ===== ARCHIVE — inline (chip flows in normal flow) =====
     In the flow a stack needs no z-index; as a flex or grid item it would
     still take one (and form a stacking context at the page's level). */
  body.aieo-bp-archive--inline .aieo-badge-stack[data-surface="archive"] {
    z-index: auto;
    position: static;
    grid-auto-flow: column;
    justify-content: start;
    margin: 4px 0;
  }

  /* ===== PDP — top_left / top_right =====
     The stack's z-index is the base one, 2, inside its picture's own stacking
     context (above). It was 100 "above WC's PhotoSwipe trigger (99)", which
     put it level with the sticky header (100) and, later in the page, over it
     (11.3.16, F13). The trigger (a classic gallery's magnifier) is in the same
     top right corner, at 99 in the same picture: Rooster One's gallery sheet
     (aieo-pdp-gallery.css, where Rooster One draws the gallery: its classes
     aieo-gl-*) hides it; where WooCommerce's shows, a `top_right` stack sits
     under it (below; 11.3.16, F13b), never beneath it. */
  body.aieo-bp-pdp--top_left  .aieo-badge-stack[data-surface="pdp"],
  body.aieo-bp-pdp--top_right .aieo-badge-stack[data-surface="pdp"] {
    position: absolute;
    top: 8px;
  }
  body.aieo-bp-pdp--top_left  .aieo-badge-stack[data-surface="pdp"] { left:  8px; }
  body.aieo-bp-pdp--top_right .aieo-badge-stack[data-surface="pdp"] {
    /* Where the WC magnifier trigger is hidden (Rooster One's gallery), the
       stack sits at the corner with an EQUAL top/right inset — nudged a little
       down and in from the very corner. */
    top: 16px;
    right: 16px;
  }
  /* WooCommerce's own magnifier (a classic gallery Rooster One does not draw,
     its zoom and lightbox on, a picture): 36px at 1em from the top and the
     right of the gallery (its .5em of its 2em), z-index 99 in the same
     picture. The stack goes under it, 8px apart: in the stack, which sets no
     font size, 1em is the gallery's. The server says so on the stack
     (aieo-badge-stack--magnifier: AIEO_DMM_Badge_Renderer::magnifier_shows()),
     as WooCommerce's script adds the magnifier only after the first paint
     (11.3.16, F13c). */
  body.aieo-bp-pdp--top_right .aieo-badge-stack--magnifier[data-surface="pdp"] {
    top: calc(1em + 44px); /* its 1em and 36px, then 8px */
  }

  /* ===== PDP — inline ===== */
  body.aieo-bp-pdp--inline .aieo-badge-stack[data-surface="pdp"] {
    z-index: auto;
    position: static;
    grid-auto-flow: column;
    justify-content: start;
    margin: 0 0 8px 0;
  }

  /* ===== RECOS — inline (default) =====
     The JS card builder emits the stack INSIDE `.aieo-card-body` for
     this location; the rule below normalises positioning. */
  body.aieo-bp-recos--inline .aieo-badge-stack[data-surface="recos"] {
    z-index: auto;
    position: static;
    grid-auto-flow: column;
    justify-content: start;
    margin: 0 0 4px 0;
  }
  /* ===== RECOS — top_left / top_right =====
     For these locations the JS card builder emits the stack INSIDE
     `.aieo-card-img-wrap` so absolute positioning anchors over the
     image, not the body. */
  body.aieo-bp-recos--top_left  .aieo-badge-stack[data-surface="recos"],
  body.aieo-bp-recos--top_right .aieo-badge-stack[data-surface="recos"] {
    position: absolute;
    top: 8px;
  }
  body.aieo-bp-recos--top_left  .aieo-badge-stack[data-surface="recos"] { left:  8px; }
  body.aieo-bp-recos--top_right .aieo-badge-stack[data-surface="recos"] { right: 8px; }

  /* ===== SIDE CART — inline (default) ===== */
  body.aieo-bp-side_cart--inline .aieo-badge-stack[data-surface="side_cart"] {
    z-index: auto;
    position: static;
    grid-auto-flow: column;
    justify-content: start;
    margin: 0 0 4px 0;
  }
  /* ===== SIDE CART — top_left ===== */
  body.aieo-bp-side_cart--top_left .aieo-badge-stack[data-surface="side_cart"] {
    position: absolute;
    top: 2px;
    left: 2px;
    /* Over a 64 px thumb (the side cart's default since 8 Nov 2026): each chip as wide as its word, in the corner,
       so the product still shows. */
    justify-items: start;
    gap: 2px;
    max-width: calc(100% - 4px);
  }

  /* ──────────────────────────────────────────────────────────────────
     SHAPE RULES — visual style of each badge in the stack.
     Body class = aieo-bs-{surface}--{shape}. Independent from the
     LOCATION RULES above so any (location, shape) combination is
     valid; e.g. `inline + circle` is a row of small round chips.
     ────────────────────────────────────────────────────────────────── */

  /* === SHAPE: chip — default rounded rectangle.
     Padding/border-radius scale with --aieo-badge-fs so a 13px PDP
     chip isn't cramped, a 9px side-cart chip isn't bloated. === */
  body.aieo-bs-archive--chip   .aieo-badge-stack[data-surface="archive"]   .aieo-badge,
  body.aieo-bs-pdp--chip       .aieo-badge-stack[data-surface="pdp"]       .aieo-badge,
  body.aieo-bs-recos--chip     .aieo-badge-stack[data-surface="recos"]     .aieo-badge,
  body.aieo-bs-side_cart--chip .aieo-badge-stack[data-surface="side_cart"] .aieo-badge {
    /* Chip shape inherits all the base .aieo-badge styling defined
       below — explicit width/height undone in case `circle` was
       previously applied via stale body class cache. */
    width: auto;
    height: auto;
    border-radius: var(--wp--custom--rooster--shape--badge, calc(var(--aieo-badge-fs, 11px) * 0.36));
    padding: calc(var(--aieo-badge-fs, 11px) * 0.27) calc(var(--aieo-badge-fs, 11px) * 0.7);
  }

  /* Under the Rooster theme a chip takes the theme's badge corners (its badge
     shape role, 11.3.10: square under the "Chart" corners; the chip's where a
     theme has no badge role), so square and rounded sites stay consistent. */
  html[data-rooster-design="theme"] body.aieo-bs-archive--chip .aieo-badge-stack[data-surface="archive"] .aieo-badge,
  html[data-rooster-design="theme"] body.aieo-bs-pdp--chip     .aieo-badge-stack[data-surface="pdp"]     .aieo-badge {
    border-radius: var(--wp--custom--rooster--shape--badge, var(--wp--custom--rooster--shape--chip, 999px));
  }

  /* === SHAPE: circle — round, icon-or-image friendly.
     Sized as 36×36 by default but scales with --aieo-badge-fs ×
     a multiplier so smaller surfaces (recos at 10px) get smaller
     circles. === */
  body.aieo-bs-archive--circle   .aieo-badge-stack[data-surface="archive"]   .aieo-badge,
  body.aieo-bs-pdp--circle       .aieo-badge-stack[data-surface="pdp"]       .aieo-badge,
  body.aieo-bs-recos--circle     .aieo-badge-stack[data-surface="recos"]     .aieo-badge,
  body.aieo-bs-side_cart--circle .aieo-badge-stack[data-surface="side_cart"] .aieo-badge {
    width:  calc(var(--aieo-badge-fs, 11px) * 3.27); /* 11px → 36px */
    height: calc(var(--aieo-badge-fs, 11px) * 3.27);
    border-radius: 50%;
    padding: 0;
    display: grid;
    place-items: center;
    gap: 1px;
    font-size: calc(var(--aieo-badge-fs, 11px) * 0.82);
    line-height: 1;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: var(--wp--preset--shadow--sm, none);
  }
  body.aieo-bs-archive--circle   .aieo-badge-stack[data-surface="archive"]   .aieo-badge__label,
  body.aieo-bs-archive--circle   .aieo-badge-stack[data-surface="archive"]   .aieo-badge__icon,
  body.aieo-bs-pdp--circle       .aieo-badge-stack[data-surface="pdp"]       .aieo-badge__label,
  body.aieo-bs-pdp--circle       .aieo-badge-stack[data-surface="pdp"]       .aieo-badge__icon,
  body.aieo-bs-recos--circle     .aieo-badge-stack[data-surface="recos"]     .aieo-badge__label,
  body.aieo-bs-recos--circle     .aieo-badge-stack[data-surface="recos"]     .aieo-badge__icon,
  body.aieo-bs-side_cart--circle .aieo-badge-stack[data-surface="side_cart"] .aieo-badge__label,
  body.aieo-bs-side_cart--circle .aieo-badge-stack[data-surface="side_cart"] .aieo-badge__icon {
    line-height: 1;
    display: block;
    white-space: nowrap; /* a circle's one line, as before the labels wrapped (above) */
  }
  body.aieo-bs-archive--circle   .aieo-badge-stack[data-surface="archive"]   .aieo-badge__icon,
  body.aieo-bs-pdp--circle       .aieo-badge-stack[data-surface="pdp"]       .aieo-badge__icon,
  body.aieo-bs-recos--circle     .aieo-badge-stack[data-surface="recos"]     .aieo-badge__icon,
  body.aieo-bs-side_cart--circle .aieo-badge-stack[data-surface="side_cart"] .aieo-badge__icon {
    font-size: calc(var(--aieo-badge-fs, 11px) * 1.05);
  }

  /* ──────────────────────────────────────────────────────────────────
     BASE BADGE STYLE — colour tokens, typography, hover.
     ────────────────────────────────────────────────────────────────── */
  :where(.aieo-badge) {
    all: revert;
    display: inline-flex;
    align-items: center;
    gap: calc(var(--aieo-badge-fs, 11px) * 0.3);
    padding: calc(var(--aieo-badge-fs, 11px) * 0.27) calc(var(--aieo-badge-fs, 11px) * 0.7);
    border-radius: var(--wp--custom--rooster--shape--badge, calc(var(--aieo-badge-fs, 11px) * 0.36));
    font-size: var(--aieo-badge-fs, 11px);
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: auto;
    /* The renderer always sets both (AIEO_DMM_Badge_Renderer::colour()); without it, the theme's badge role. */
    background: var(--aieo-badge-bg, var(--wp--custom--rooster--badge--background, var(--wp--preset--color--contrast, CanvasText)));
    color: var(--aieo-badge-fg, var(--wp--custom--rooster--badge--color, var(--wp--preset--color--bg, var(--wp--preset--color--base, Canvas))));
    box-shadow: var(--wp--preset--shadow--sm, none);
  }

  :where(.aieo-badge__icon) {
    font-size: calc(var(--aieo-badge-fs, 11px) * 1.1);
    line-height: 1;
  }

  :where(.aieo-badge__label) {
    line-height: 1.2;
  }

  /* A Lucide icon painted by the icon span itself, in the badge's text colour (one node, no SVG inside: C7). */
  .aieo-badge__icon--mask {
    display: inline-block;
    flex: none;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask: var(--aieo-badge-icon) center / contain no-repeat;
    mask: var(--aieo-badge-icon) center / contain no-repeat;
  }
  @media (forced-colors: active) {
    .aieo-badge__icon--mask { forced-color-adjust: none; background-color: CanvasText; }
  }

  /* A badge never leaves its picture: the stack is the picture's width less its inset (UI review, 28 Oct 2026), and on
     a picture narrower than a label (a tight grid's card, the phone's list view, the side cart's suggestion column) the
     label wraps inside its chip, never cut with an ellipsis (rooster-admin-d1, 22 Nov 2026: «MONTHLY OF…» at 800). A
     circle keeps its one line (below). */
  .aieo-badge-stack > .aieo-badge {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  .aieo-badge-stack > .aieo-badge > .aieo-badge__label {
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
    text-wrap: balance;
  }
  /* The corner stacks are one column as wide as the stack, so a long chip shrinks instead of widening it. */
  body.aieo-bp-archive--top_left  .aieo-badge-stack[data-surface="archive"],
  body.aieo-bp-archive--top_right .aieo-badge-stack[data-surface="archive"],
  body.aieo-bp-pdp--top_left      .aieo-badge-stack[data-surface="pdp"],
  body.aieo-bp-pdp--top_right     .aieo-badge-stack[data-surface="pdp"],
  .aieo-sc-reco-item .aieo-badge-stack[data-surface="side_cart"] {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Family-specific overrides for text-transform/case, since some labels
     (Greek "ΠΡΟΣΦΟΡΑ ΤΟΥ ΜΗΝΑ", "+ Free gift", "Free shipping") look better mixed-case. */
  :where(.aieo-badge--gift, .aieo-badge--free_shipping, .aieo-badge--monthly_offer) {
    text-transform: none;
    letter-spacing: 0;
  }

  /* PDP gallery anchoring — the gallery wrapper needs position:relative
     so absolutely-positioned stacks resolve correctly. Same pattern the
     legacy role-pricing inline CSS used; keeping it scoped + at zero
     specificity so theme styles can override if needed. */
  :where(.wp-block-woocommerce-product-image-gallery,
         .wp-block-woocommerce-product-gallery,
         .woocommerce div.product div.images) {
    position: relative;
  }

  /* Hover slight lift to suggest interactivity for tooltipped badges. */
  :where(.aieo-badge[title]:hover) {
    filter: brightness(1.05);
  }

  /* ──────────────────────────────────────────────────────────────────
     IMAGE OVERRIDE — when a family has icon_image set, the renderer
     adds .has-icon-image to the badge and emits a single <img>
     instead of icon/label spans. The image fills the badge's box
     (whatever shape it is) via object-fit: cover; the bg/fg colour
     tokens become invisible (the image IS the badge).
     ────────────────────────────────────────────────────────────────── */
  .aieo-badge.has-icon-image {
    background: transparent;
    box-shadow: var(--wp--preset--shadow--sm, none);
    padding: 0;
    overflow: hidden;
  }
  .aieo-badge.has-icon-image > .aieo-badge__image {
    display: block;
    width:  100%;
    height: 100%;
    object-fit: cover;
  }
  /* When a chip-shaped badge gets an image, lock its dimensions to a
     square so the image doesn't stretch to fit the previous text
     content's width. Same scaling formula the circle shape uses. */
  body.aieo-bs-archive--chip   .aieo-badge-stack[data-surface="archive"]   .aieo-badge.has-icon-image,
  body.aieo-bs-pdp--chip       .aieo-badge-stack[data-surface="pdp"]       .aieo-badge.has-icon-image,
  body.aieo-bs-recos--chip     .aieo-badge-stack[data-surface="recos"]     .aieo-badge.has-icon-image,
  body.aieo-bs-side_cart--chip .aieo-badge-stack[data-surface="side_cart"] .aieo-badge.has-icon-image {
    width:  calc(var(--aieo-badge-fs, 11px) * 3.27);
    height: calc(var(--aieo-badge-fs, 11px) * 3.27);
  }

  /* Suppress WC's native onsale flash when our SALE family is enabled —
     only when the badge stack is present, so other themes' badge usage
     isn't broken on pages without our renderer. */
  li.product:has(.aieo-badge-stack .aieo-badge--sale) > .onsale,
  li.product:has(.aieo-badge-stack .aieo-badge--sale) .onsale {
    display: none;
  }

  /* Mobile breakpoint — switches the active --aieo-badge-fs from the
     desktop variable to the mobile variable so the renderer's
     `--aieo-badge-fs-m` value drives padding / border-radius / font
     once below 600px. Falls back to desktop when no mobile value is
     set (so old saved options without a mobile column don't crash). */
  @media (max-width: 600px) {
    .aieo-badge-stack {
      --aieo-badge-fs: var(--aieo-badge-fs-m, var(--aieo-badge-fs-d, 11px));
      gap: 3px;
    }
  }

} /* @layer aieo-badges */

/* =========================================================================
   SIDE-CART RECOMMENDATION CARDS — force top-right circles over the thumbnail
   so they match the archive/PDP badges (the rest). The `side_cart` surface
   only exposes inline/top_left chips, and the reco card builder emits the
   stack inside `.aieo-card-body` (a sibling of the image wrap). These rules
   are deliberately UN-LAYERED so they beat the `@layer aieo-badges`
   `body.aieo-bp/bs-side_cart--*` rules without an !important / specificity
   arms race. The stack is anchored to the (now-relative) `.aieo-card`, whose
   image fills the top — so top:6/right:6 lands over the thumbnail's corner.
   ========================================================================= */
.aieo-sc-reco-item .aieo-card { position: relative; }
.aieo-sc-reco-item .aieo-card .aieo-badge-stack[data-surface="side_cart"] {
    position: absolute;
    inset: 6px 6px auto auto;   /* top right bottom left */
    margin: 0;
    z-index: 2;                 /* the base one (11.3.16, F13): inside the drawer, over the thumbnail (was 5) */
    grid-auto-flow: row;        /* stack the badges one UNDER the other (was column) */
    justify-items: end;
    gap: 4px;
}
/* The badges themselves are the surface's chips, as on the shop's cards, with their text inside
   (theme brief, 28 Oct 2026). They were fixed circles here: an icon fitted, but a SALE label
   was cut away and MONTHLY OFFER spilled out of it. */
.aieo-sc-reco-item .aieo-card .aieo-badge-stack[data-surface="side_cart"] .aieo-badge {
    white-space: nowrap;
    box-shadow: var(--wp--preset--shadow--sm, none);
}
.aieo-sc-reco-item .aieo-card .aieo-badge-stack[data-surface="side_cart"] .aieo-badge__label,
.aieo-sc-reco-item .aieo-card .aieo-badge-stack[data-surface="side_cart"] .aieo-badge__icon {
    line-height: 1;
    display: block;
}
.aieo-sc-reco-item .aieo-card .aieo-badge-stack[data-surface="side_cart"] .aieo-badge__icon {
    font-size: calc(var(--aieo-badge-fs, 10px) * 0.85);
}

/* A card's badges are short, one line each (11.3.16, F21; the designer, 18 Nov 2026: "a short badge on one line … If a
   label is ever longer, it ends with "…" instead of running under the heart"): the stack keeps clear of the heart in the
   picture's top corner. In the list view the picture is small, so the badges sit on its bottom edge and the heart keeps
   the top: they never meet, so there the stack takes the picture's width less its edges (the designer's 100% - 16px). */
body.aieo-bp-archive--top_left  .aieo-badge-stack[data-surface="archive"],
body.aieo-bp-archive--top_right .aieo-badge-stack[data-surface="archive"] {
    max-width: calc(100% - 64px);
}
body .rooster-products--list .aieo-badge-stack[data-surface="archive"] {
    top: auto;
    bottom: 8px;
    max-width: calc(100% - 16px);
}
