/* Card ribbons (catalog redesign WP-C, 2026-09-28, staging). One calm label per card (card-ribbons.php):
   a flat tag in the photo's top-right (inline-start) corner. The info "i" owns the top-left corner and the
   variant stickers the bottom-right one. Static: no motion. */

html body ul.products > li.product .b2b-ribbon {
    position: absolute;
    z-index: 4;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    height: 24px;
    max-width: calc(100% - 42px); /* the "i" 44px target reaches 38px into the photo from its left edge */
    margin: 0;
    padding: 0 10px;
    border-radius: 0 0 0 8px;      /* flush with the photo's corner (the photo link clips anything outside it) */
    background: #DF1A81;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    pointer-events: none;
}

html body ul.products > li.product .b2b-ribbon .b2b-ribbon__t {
    font: inherit;          /* the theme sizes spans inside card links (18px) */
    line-height: 16px;      /* room for an emoji in owner deal texts ("🎁 מעל 1728₪") without growing the tag */
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
}

html body ul.products > li.product .b2b-ribbon--new {
    background: #1C1B1F;
    color: #fff;
}

html body ul.products > li.product .b2b-ribbon--back {
    background: #1E7B34;
    color: #fff;
}

html body ul.products > li.product .b2b-ribbon--best {
    background: #fff;
    color: #5F5F5F;
    box-shadow: inset 0 0 0 1px #DADADA;
}

/* The deal is shown once, as the label above: the deals-manager's rotated ribbon is not repeated on cards. */
html body ul.products > li.product .wcdm-deal-ribbon {
    display: none !important;
}

@media (max-width: 767px) {
    html body ul.products:not(.b2b-list) > li.product .b2b-ribbon {
        height: 22px;
        padding: 0 8px;
    }

    /* Phones show the short "עודכן בסל" confirmation in the same corner: the label steps aside meanwhile. */
    html body ul.products:not(.b2b-list) > li.product.b2b-updated .b2b-ribbon {
        opacity: 0;
    }
}

/* List rows (small 72-80px photo): a tiny corner label on the photo. */
html body ul.products.b2b-list > li.product .b2b-ribbon {
    height: 18px;
    max-width: 100%;
    padding: 0 4px;
    border-radius: 0 0 0 6px;
    font-size: 11px;
}

/* a long label (e.g. "סטנד מתנה מעל ₪1,728") may take a second line on the narrow list photo instead of being cut */
html body ul.products.b2b-list > li.product .b2b-ribbon,
html body ul.products.b2b-list > li.product .b2b-ribbon .b2b-ribbon__t {
    height: auto !important;
    min-height: 18px;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.25 !important;
    text-align: center;
}

/* Fallback: the WooCommerce / Astra sale flash is removed on cards server-side (card-ribbons.php); never a second label. */
html body ul.products > li.product .onsale {
    display: none !important;
}

/* ---------- The other labels on the photo take the same tag shape (one label system) ---------- */

/* Out of stock ("אזל מהמלאי", b2b-badge--oos from functions.php): the same corner tag, calm light grey (spec §5).
   The class .b2b-badge is also a toolbar count badge in catalog-filters.css (inset-inline-end: -4px), which stretched
   this pill across the photo under the "i"; every offset is pinned here. */
html body ul.products:not(.b2b-list) > li.product.type-product .b2b-badge.b2b-badge--oos.b2b-badge--oos.b2b-badge--oos {
    position: absolute;
    z-index: 4;
    top: 0;
    right: 0;
    bottom: auto;
    left: auto;
    inset-inline-end: auto;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    height: 24px;
    max-width: calc(100% - 42px);
    margin: 0;
    padding: 0 10px;
    border-radius: 0 0 0 8px;
    background: #F1F0EC;
    color: #5F5F5F;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    white-space: nowrap;
    pointer-events: none;
}

/* Owner promo badge (YITH "מוצר חם", "חדש!", "מתכוננים לחג", "כשר לפסח"; the pipeline keeps at most one): its own
   hue, calmed to a light tint with dark text of the same hue, in the tag shape. YITH and style.css size these with
   !important, hence the repeated class. */
html body ul.products:not(.b2b-list) > li.product.type-product .yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge {
    position: absolute !important;
    z-index: 4 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    left: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    height: 24px !important;
    max-width: calc(100% - 42px) !important;
    margin: 0 !important;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 0 0 0 8px !important;
    background: #F1F0EC !important;
    background: color-mix(in srgb, var(--badge-primary-color, #BDBDBD) 22%, #fff) !important;
    color: #5F5F5F !important;
    color: color-mix(in srgb, var(--badge-primary-color, #5F5F5F) 35%, #1C1B1F) !important;
    box-shadow: none !important;
    transform: none !important;
    overflow: hidden !important;
    pointer-events: none;
}

html body ul.products:not(.b2b-list) > li.product.type-product .yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge :is(.yith-wcbm-badge__wrap, .yith-wcbm-css-text, .yith-wcbm-badge-text, p, span) {
    position: static !important;
    display: inline !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    color: inherit !important;
    font-family: 'Noto Sans Hebrew', sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 16px !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    transform: none !important;
}

html body ul.products:not(.b2b-list) > li.product.type-product .yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge :is(.yith-wcbm-css-s1, .yith-wcbm-css-s2, svg),
html body ul.products:not(.b2b-list) > li.product.type-product .yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge::before,
html body ul.products:not(.b2b-list) > li.product.type-product .yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge::after {
    display: none !important;
}

@media (max-width: 767px) {
    html body ul.products:not(.b2b-list) > li.product.type-product .b2b-badge.b2b-badge--oos.b2b-badge--oos.b2b-badge--oos {
        height: 22px;
        padding: 0 8px;
    }

    html body ul.products:not(.b2b-list) > li.product.type-product .yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge.yith-wcbm-badge {
        height: 22px !important;
        padding: 0 8px !important;
    }
}
