/* Hide Divi's "X Item" text completely */
.et_pb_menu__cart-count {
    font-size: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* Position the cart button relatively so badge can anchor to it */
.et_pb_menu__cart-button {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
}

/*
 * Base badge styles.
 * Desktop: uses calc(50% + offset_y) + translateY(-50%) so the badge
 *          centres on the button's midpoint (which = icon midpoint in Divi nav).
 *          offset_y nudges from that centre — 0 = perfectly centred.
 * Mobile:  button wraps tightly around icon so simple top: offset_y works.
 *          These are overridden per-breakpoint by inline CSS from PHP.
 */
.et_pb_menu__cart-button .dcb-badge {
    position: absolute !important;
    top:       calc(50% + var(--dcb-offset-y, 0px)) !important;
    right:     var(--dcb-offset-x, -10px) !important;
    transform: translateY(-50%) !important;

    min-width:   18px !important;
    height:      18px !important;
    width:       auto !important;
    padding:     0 4px !important;
    border-radius: 999px !important;
    background:  #e02b20 !important;
    color:       #ffffff !important;
    font-size:   11px !important;
    font-weight: 700 !important;
    line-height: 18px !important;
    text-align:  center !important;
    pointer-events: none !important;
    z-index: 9999 !important;
    box-sizing: border-box !important;
    display: inline-block !important;
    transition: transform 0.15s ease !important;
    white-space: nowrap !important;
}

/* Hide when zero */
.et_pb_menu__cart-button .dcb-badge[data-count="0"] {
    display: none !important;
}

/* Bump animation — preserve the translateY(-50%) while scaling */
.et_pb_menu__cart-button .dcb-badge.dcb-bump {
    transform: translateY(-50%) scale(1.4) !important;
}
