/* Uncode Category Ribbons for WooCommerce */
.ucr-ribbon-host,
.tmb-woocommerce .t-entry-visual-cont,
.tmb-woocommerce .t-entry-visual,
li.product,
.product .woocommerce-loop-product__link,
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
    position: relative;
}

.ucr-ribbon-host {
    overflow: hidden;
    display: block;
    isolation: isolate;
}

.ucr-ribbon {
    --ucr-ribbon-bg: #e1251b;
    --ucr-ribbon-color: #ffffff;
    position: absolute;
    z-index: 60;
    top: 18px;
    left: -52px;
    width: 188px;
    height: 30px;
    transform: rotate(-45deg);
    transform-origin: center;
    background: var(--ucr-ribbon-bg);
    color: var(--ucr-ribbon-color);
    text-align: center;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 22px;
}



.ucr-ribbon span {
    display: block;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    line-height: 1;
    transform: translate(0, 0.5px);
}



.ucr-ribbon--php {
    top: 18px;
    left: -52px;
}


@media (max-width: 569px) {
    .ucr-ribbon {
        top: 14px;
        left: -55px;
        width: 180px;
        height: 28px;
        font-size: 10px;
        padding: 0 20px;
    }
}


/* Sécurité : anciennes versions / cache Uncode peuvent laisser un bandeau PHP au niveau .t-inside.
   On le masque car il est hors de l'image produit. */
.tmb-woocommerce .t-inside > .ucr-ribbon--php {
    display: none !important;
}

/* Ajustement du centrage du texte dans le bandeau */


/* Bandeau sur la galerie image de la fiche produit */
.woocommerce-product-gallery .ucr-ribbon-host,
.uncode-single-product-gallery .ucr-ribbon-host {
    position: relative !important;
    overflow: hidden !important;
    display: block;
}

.woocommerce-product-gallery .ucr-ribbon--single,
.uncode-single-product-gallery .ucr-ribbon--single {
    top: 16px;
    left: -50px;
}


/* V1.0.5 — centrage optique du libellé dans le bandeau */
.ucr-ribbon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 188px !important;
    height: 30px !important;
    top: 18px !important;
    left: -52px !important;
    padding: 0 22px !important;
    font-size: 10.5px !important;
    letter-spacing: 0.025em !important;
    line-height: 1 !important;
}

.ucr-ribbon > span {
    width: 100% !important;
    padding: 0 !important;
    text-align: center !important;
    line-height: 1 !important;
    transform: translateY(0.5px) !important;
}


/* V1.0.6 — garder le badge WooCommerce "Promo" en bas, y compris sur mobile.
   Uncode / WooCommerce peut le remonter en haut sur petits écrans ; on force sa position
   en bas à gauche pour éviter qu'il passe devant le bandeau catégorie. */
.tmb-woocommerce .ucr-ribbon-host .onsale,
.tmb-woocommerce .t-entry-visual-cont .onsale,
.tmb-woocommerce .t-entry-visual .onsale,
.woocommerce ul.products li.product .onsale {
    position: absolute !important;
    top: auto !important;
    right: auto !important;
    bottom: 18px !important;
    left: 18px !important;
    z-index: 50 !important;
}

@media (max-width: 959px) {
    .tmb-woocommerce .ucr-ribbon-host .onsale,
    .tmb-woocommerce .t-entry-visual-cont .onsale,
    .tmb-woocommerce .t-entry-visual .onsale,
    .woocommerce ul.products li.product .onsale {
        top: auto !important;
        right: auto !important;
        bottom: 14px !important;
        left: 14px !important;
        z-index: 50 !important;
        transform: none !important;
    }

    .tmb-woocommerce .ucr-ribbon,
    .woocommerce-product-gallery .ucr-ribbon,
    .uncode-single-product-gallery .ucr-ribbon {
        z-index: 60 !important;
    }
}
