/* Loading state for add to cart button */
.single_add_to_cart_button.loading {
    position: relative;
    pointer-events: none;
    opacity: 1 !important;
}

.single_add_to_cart_button::after{
    display: none !important;
}

/* Hide button text when using spinner or dots */
.single_add_to_cart_button.loading[data-animation="spinner"],
.single_add_to_cart_button.loading[data-animation="dots"] {
    color: transparent !important;
}

/* Spinner Animation */
.single_add_to_cart_button.loading .bebanstore-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: bebanstore-spin 0.8s linear infinite;
    position: absolute;
    inset: 0;
    margin: auto;
    z-index: 2;
}

/* Dots Animation */
.single_add_to_cart_button.loading .bebanstore-dots {
    display: inline-block;
    width: 30px;
    aspect-ratio: 4;
    --_g: no-repeat radial-gradient(circle closest-side, #fff 90%, #0000);
    background: 
        var(--_g) 0%   50%,
        var(--_g) 50%  50%,
        var(--_g) 100% 50%;
    background-size: calc(100%/3) 100%;
    animation: bebanstore-dots 1s infinite linear;
    position: absolute;
    inset: 0;
    margin: auto;
    z-index: 2;
}

/* Success message styling */
.bebanstore-ajax-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: #4CAF50;
    color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 999999;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.bebanstore-ajax-message.show {
    opacity: 1;
    transform: translateY(0);
}

.bebanstore-ajax-message.error {
    background: #f44336;
}

/* RTL Support */
.rtl .bebanstore-ajax-message {
    right: auto;
    left: 20px;
}

/* Animations */
@keyframes bebanstore-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes bebanstore-dots {
    33% {
        background-size: calc(100%/3) 0%  ,calc(100%/3) 100%,calc(100%/3) 100%;
    }
    50% {
        background-size: calc(100%/3) 100%,calc(100%/3) 0%  ,calc(100%/3) 100%;
    }
    66% {
        background-size: calc(100%/3) 100%,calc(100%/3) 100%,calc(100%/3) 0%  ;
    }
}

/* Cart Popup */
.bebanstore-cart-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.bebanstore-cart-popup-content {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: bebanstore-popupFadeIn 0.3s ease;
}

.bebanstore-cart-popup-close {
    position: absolute;
    top: 16px;
    left: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    background: transparent !important;
}

.bebanstore-cart-popup-close:hover,
.bebanstore-cart-popup-close:active,
.bebanstore-cart-popup-close:focus {
    background: transparent !important;
}

.bebanstore-cart-popup-close svg {
    display: block;
}

.bebanstore-cart-popup-title {
    font-size: 16px;
    margin: 0 0 15px;
    text-align: right;
    font-weight: 600;
    color: #3B813D;
}

.bebanstore-cart-popup-divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 15px 0;
}

.bebanstore-cart-popup-product {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bebanstore-cart-popup-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.bebanstore-cart-popup-details {
    flex: 1;
}

.bebanstore-cart-popup-product-title {
    font-size: 14px;
    margin: 0 0 10px;
    color: #666;
    font-weight: 600;
}

.bebanstore-cart-popup-product-price {
    font-size: 14px;
    color: #333;
    text-decoration: none;
}

.bebanstore-cart-popup-product-price del {
    font-size: 13px;
    color: #888;
}

.bebanstore-cart-popup-product-price ins {
    text-decoration: none;
}

.bebanstore-cart-popup-product-variations {
    margin: 5px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bebanstore-cart-popup-product-variation {
    display: inline-flex;
    align-items: center;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 100px;
    font-size: 12px;
    color: #666;
}

.bebanstore-cart-popup-product-variation-name {
    color: #999;
    margin-left: 4px;
}

.bebanstore-cart-popup-product-variation-value {
    color: #333;
    font-weight: 500;
}

.bebanstore-cart-popup-button {
    display: block;
    text-align: center;
    background: #EF4055;
    padding: 10.5px 24px;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.2s;
    min-width: 100px;
    position: relative;
    margin-top: 16px;
    text-decoration: none;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
}

@keyframes bebanstore-popupFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 480px) {
    .bebanstore-cart-popup-content {
        width: 95%;
        padding: 15px;
    }
    .bebanstore-cart-popup-image {
        width: 60px;
        height: 60px;
    }
}

