/* Byteforge Toolkit - Cart Icon Enhancements */

/* Container adjustments */
#cart-button.cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Ensure SVG scales nicely and animates subtly */
#cart-button .cart-icon,
#cart-button svg {
    display: block;
    width: 20px;
    height: 20px;
    transition: transform .18s ease, color .18s ease, opacity .18s ease;
}

#cart-button:hover .cart-icon,
#cart-button:hover svg {
    transform: translateZ(0) scale(1.05);
}

/* Accessible focus style */
#cart-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 4px;
}

/* Count badge */
#cart-button .cart-count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    /* Prefer theme accent when available; fall back to Byteforge red */
    background: var(--byteforge-cart-badge-bg, var(--qodef-main-color, #950810));
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    will-change: transform;
    pointer-events: none;
}

/* Hide when zero without layout shift */
#cart-button .cart-count-badge[data-cart-count="0"] {
    opacity: 0;
    transform: scale(.8);
}

/* Micro-interaction when updated */
@keyframes byteforge-cart-bump {
    0% { transform: scale(1); }
    35% { transform: scale(1.18); }
    70% { transform: scale(.95); }
    100% { transform: scale(1); }
}

#cart-button .cart-count-badge.is-bumping {
    animation: byteforge-cart-bump .35s ease-in-out;
}
