/* ====================================================================
   Wigmorean Commerce — Cart UX
   Persistent corner cart widget + Add-to-Cart button states
   ==================================================================== */

/* ── Cart widget (fixed corner badge) ────────────────────────────────── */
.wig-cart-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99990;
    background: var( --wig-cart-widget-bg, #1a1a1a );
    color: var( --wig-cart-widget-color, #ffffff );
    border-radius: 999px;
    box-shadow: 0 6px 24px rgba( 0, 0, 0, 0.22 );
    transition: transform .22s ease, opacity .22s ease;
    will-change: transform;
    font-family: inherit;
}

.wig-cart-widget--hidden {
    opacity: 0;
    transform: translateY( 10px ) scale( .85 );
    pointer-events: none;
}

.wig-cart-widget--bump {
    animation: wig-cart-bump .42s ease;
}

@keyframes wig-cart-bump {
    0%   { transform: scale( 1 ); }
    40%  { transform: scale( 1.14 ); }
    100% { transform: scale( 1 ); }
}

.wig-cart-widget__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
}

.wig-cart-widget__link:hover,
.wig-cart-widget__link:focus {
    color: inherit;
    text-decoration: none;
    outline: 0;
}

.wig-cart-widget__icon {
    font-size: 20px;
    line-height: 1;
}

.wig-cart-widget__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    background: var( --wig-cart-widget-count-bg, #c5973b );
    color: var( --wig-cart-widget-count-color, #ffffff );
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.wig-cart-widget__total {
    font-variant-numeric: tabular-nums;
    opacity: .92;
}

/* Mobile: tuck closer to the corner, slightly smaller */
@media ( max-width: 520px ) {
    .wig-cart-widget {
        right: 12px;
        bottom: 12px;
    }
    .wig-cart-widget__link {
        padding: 10px 16px;
        font-size: 14px;
        gap: 8px;
    }
}

/* ── Add-to-Cart button states ───────────────────────────────────────── */
.wig-add-to-cart {
    transition: background-color .15s ease, border-color .15s ease, opacity .15s ease;
}

.wig-add-to-cart--busy {
    opacity: .7;
    cursor: wait;
}

.wig-add-to-cart--added {
    background: var( --wig-success, #2e7d32 ) !important;
    border-color: var( --wig-success, #2e7d32 ) !important;
    color: #ffffff !important;
}

.wig-add-to-cart--error {
    background: var( --wig-error, #c62828 ) !important;
    border-color: var( --wig-error, #c62828 ) !important;
    color: #ffffff !important;
}
