/*
 * Initial loading state for deferred button
 * It starts completely invisible and scaled down.
 */
#emc-floating-cart-button.is-loading {
    opacity: 0;
    transform: scale(0.8);
    visibility: hidden;
}

/*
 * Floating Cart Button Styles
 */
#emc-floating-cart-button {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9998;
    width: 60px;
    height: 60px;
    background-color: #f5853b;
    color: #ffffff;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* --- THIS IS THE KEY CHANGE --- */
    /* Set the default state and the transition for opacity and transform */
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

/*
 * This class will be added by JavaScript to make the button visible.
 */
#emc-floating-cart-button.is-visible {
    opacity: 1;
    transform: scale(1);
}


#emc-floating-cart-button:hover {
    transform: scale(1.1) !important; /* Add !important to override the .is-visible transform */
}

.emc-cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #d83131;
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    border-radius: 50%;
    padding: 5px;
    min-width: 22px;
    min-height: 22px;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* State for when the cart/modal is open */
#emc-floating-cart-button.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}


/* Mini-Cart Item Remove Button ("X") */
.widget_shopping_cart_content .emc-remove-item,
.woocommerce-mini-cart .remove_from_cart_button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 20px;
    font-weight: bold;
    color: #999;
    text-decoration: none;
    line-height: 1;
    border: 1px solid #ddd;
    border-radius: 50%;
    margin-left: 10px;
    transition: all 0.2s ease;
    background: #fff;
    padding: 0;
}

.widget_shopping_cart_content .emc-remove-item:hover,
.woocommerce-mini-cart .remove_from_cart_button:hover {
    color: #d83131;
    border-color: #d83131;
    transform: scale(1.1);
    background: #fff;
}

/* Loading state for the mini-cart */
.widget_shopping_cart .blockUI.blockOverlay {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    background: #fff !important;
    opacity: 0.6 !important;
}