/* Bandeau catégorie : absolute en haut à droite par défaut. */
.product-flags:has(.badge-am-category) {
    left: 10px;
    right: 10px;
    width: auto;
}

.product-flags:has(.badge-am-category) .product-flag.badge-am-category {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    margin: 0;
    background: #000;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.product-flags:has(.badge-am-category) .product-flag:not(.badge-am-category) {
    position: relative;
    z-index: 1;
}

#product .pdp-main-img .product-flags:has(.badge-am-category) .product-flag.badge-am-category {
    top: 0;
    left: auto;
}

#product .pdp-main-img .product-flags:has(.badge-am-category) .product-flag:not(.badge-am-category) {
    top: auto;
    left: auto;
}

/* Autres badges : BF en haut à gauche, sans absolute */
@media (min-width: 1025px) and (max-width: 1120px) {
    .product-flags:has(.badge-am-category):has(.product-flag:not(.badge-am-category)) .product-flag.badge-am-category {
        position: static;
        order: -1;
        align-self: flex-start;
        margin-left: 0;
    }
}

@media (max-width: 400px) {
    .product-flags:has(.badge-am-category):has(.product-flag:not(.badge-am-category)) .product-flag.badge-am-category {
        position: static;
        order: -1;
        align-self: flex-start;
        margin-left: 0;
    }
}
