/* ===================================
 * Cart Animation & Effects Styles
 * =================================== */

.cart-link {
    position: relative;
    transition: all 0.3s ease;
}

.cart-link.cart-bounce {
    animation: cartBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes cartBounce {
    0% {
        transform: scale(1) translateY(0);
    }

    10% {
        transform: scale(0.9) translateY(0);
    }

    20% {
        transform: scale(1.15) translateY(-8px);
    }

    35% {
        transform: scale(1.1) translateY(-12px);
    }

    50% {
        transform: scale(1.12) translateY(-10px);
    }

    70% {
        transform: scale(1.05) translateY(-3px);
    }

    100% {
        transform: scale(1) translateY(0);
    }
}

/* تأثير شريط التحميل في أعلى الصفحة */
.cart-added-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #ff8c42, #ff6b35);
    z-index: 9999;
    animation: cartIndicator 0.8s ease-in-out;
}

@keyframes cartIndicator {
    0% {
        width: 0;
        opacity: 1;
    }

    50% {
        width: 100%;
        opacity: 1;
    }

    100% {
        width: 100%;
        opacity: 0;
    }
}



@keyframes checkmarkBounce {
    0% {
        transform: scale(0) rotate(-45deg);
    }

    50% {
        transform: scale(1.2) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

/* التمويج على عداد السلة */
.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ff8c42;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.3s ease;
    z-index: 1;
}

.cart-count.pulse {
    animation: countPulse 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    background: #ff6b35;
}

@keyframes countPulse {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.5);
    }

    50% {
        transform: scale(1.3);
    }

    75% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
    }
}

/* حركة منتج الإضافة */
.product-add-animation {
    animation: productAdd 0.6s ease-out forwards;
}

@keyframes productAdd {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-100px);
    }
}

/* زر الإضافة - تأثير عند الضغط */
.add-to-cart-btn:active,
.add-to-cart-luxury:active {
    transform: scale(0.95);
}

.add-to-cart-btn,
.add-to-cart-luxury {
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn::after,
.add-to-cart-luxury::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.add-to-cart-btn.ripple::after,
.add-to-cart-luxury.ripple::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}


/* تأثير الصرخة الصغيرة */
@keyframes miniCelebration {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

.cart-celebrating {
    animation: miniCelebration 0.5s ease-in-out;
}

/* تأثير الخط البرتقالي المتحرك */
@keyframes orangeLine {
    0% {
        transform: scaleX(0);
        opacity: 1;
    }

    100% {
        transform: scaleX(1);
        opacity: 0;
    }
}

.cart-line-animation {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff8c42, #ff6b35, transparent);
    animation: orangeLine 0.8s ease-out;
    pointer-events: none;
    z-index: 9998;
}

/* تأثير التلويح للمنتج (تحريك خفيف) */
.product-added-wave {
    animation: wave 0.5s ease-in-out;
}

@keyframes wave {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    50% {
        transform: translateX(3px);
    }

    75% {
        transform: translateX(-2px);
    }
}


/* منع النقر المزدوج أثناء المعالجة */
.add-to-cart-luxury.processing {
    opacity: 0.7;
    pointer-events: none;
    cursor: not-allowed;
}

/* إخفاء النماذج أثناء المعالجة */
form[data-processed="true"] .add-to-cart-luxury {
    opacity: 0.7;
    pointer-events: none;
    cursor: not-allowed;
}