/* ==========================================
   دکمه شناور سبد خرید - استایل کامل
   ========================================== */

:root {
    --floating-cart-bottom: 30px;
    --floating-cart-bottom-mobile: 100px;
    --floating-cart-bottom-small: 100px;
    --back-to-top-bottom: 110px;
    --back-to-top-bottom-mobile: 390px;
    --back-to-top-bottom-small: 370px;
    --toast-bottom-mobile: 400px;
    --toast-bottom-small: 370px;
}

/* دکمه اصلی سبد خرید */
.mvp-floating-cart {
    position: fixed;
    bottom: var(--floating-cart-bottom);
    right: 30px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(78, 70, 229, 0.616);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    border: none;
    text-decoration: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.mvp-floating-cart:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 8px 30px rgba(2, 226, 69, 0.664);
}

.mvp-floating-cart:active {
    transform: scale(0.95);
}

.mvp-floating-cart .cart-icon {
    font-size: 26px;
    transition: transform 0.3s ease;
}

.mvp-floating-cart:hover .cart-icon {
    transform: rotate(-10deg);
}

/* شمارنده سبد خرید */
.mvp-floating-cart .cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5);
    animation: cart-count-pop 0.3s ease;
}

/* انیمیشن شمارنده */
@keyframes cart-count-pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* انیمیشن ریپل */
.mvp-floating-cart::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(150, 4, 155, 0.363);
    animation: cart-ripple 2s infinite;
    pointer-events: none;
}

@keyframes cart-ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* دکمه بازگشت به بالا */
.mvp-back-to-top {
    position: fixed;
    bottom: 110px;
    right: 30px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 9998;
    font-size: 20px;
    opacity: 0;
    pointer-events: none;
}

.mvp-back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.mvp-back-to-top:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-3px);
}

/* ===== استایل‌های موبایل ===== */
@media (max-width: 768px) {
    .mvp-floating-cart {
        bottom: var(--floating-cart-bottom-mobile);
        right: 20px;
        width: 58px;
        height: 58px;
    }
    
    .mvp-floating-cart .cart-icon {
        font-size: 22px;
    }
    
    .mvp-floating-cart .cart-count {
        width: 25px;
        height: 25px;
        font-size: 12px;
        top: -4px;
        right: -4px;
    }
    
    .mvp-back-to-top {
        bottom: var(--back-to-top-bottom-mobile);
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 17px;
    }
    
    .mvp-toast-floating {
        bottom: var(--toast-bottom-mobile);
        padding: 10px 18px;
        font-size: 13px;
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .mvp-floating-cart {
        bottom: var(--floating-cart-bottom-small);
        right: 15px;
        width: 52px;
        height: 52px;
    }
    
    .mvp-floating-cart .cart-icon {
        font-size: 19px;
    }
    
    .mvp-floating-cart .cart-count {
        width: 22px;
        height: 22px;
        font-size: 10px;
        top: -3px;
        right: -3px;
    }
    
    .mvp-back-to-top {
        bottom: var(--back-to-top-bottom-small);
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 15px;
    }
    
    .mvp-toast-floating {
        bottom: var(--toast-bottom-small);
        padding: 8px 14px;
        font-size: 12px;
        max-width: 98%;
    }
}

/* مکان یابی چپ برای زبان‌های راست‌چین */
.rtl .mvp-floating-cart {
    right: auto;
    left: 30px;
}

.rtl .mvp-back-to-top {
    right: auto;
    left: 30px;
}

@media (max-width: 768px) {
    .rtl .mvp-floating-cart {
        left: 20px;
        right: auto;
    }
    
    .rtl .mvp-back-to-top {
        left: 20px;
        right: auto;
    }
}

/* مکان یابی چپ برای زبان‌های راست‌چین */
.rtl .mvp-floating-cart {
    right: auto;
    left: 30px;
}

.rtl .mvp-back-to-top {
    right: auto;
    left: 30px;
}

@media (max-width: 768px) {
    .rtl .mvp-floating-cart {
        left: 20px;
        right: auto;
    }
    
    .rtl .mvp-back-to-top {
        left: 20px;
        right: auto;
    }
}

/* ==========================================
   استایل Toast پیام‌ها
   ========================================== */

.mvp-toast-floating {
    position: fixed;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

.mvp-toast-floating.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mvp-toast-floating.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.mvp-toast-floating.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.mvp-toast-floating.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

@media (max-width: 768px) {
    .mvp-toast-floating {
        bottom: 95px;
        padding: 10px 18px;
        font-size: 13px;
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .mvp-toast-floating {
        bottom: 80px;
        padding: 8px 14px;
        font-size: 12px;
        max-width: 98%;
    }
}