/* ═══════════════════════════════════════════════════════════════════
   EMOJI BURST - انفجار إيموجي حسب التصنيف
   ═══════════════════════════════════════════════════════════════════ */

.emoji-particle {
    position: fixed;
    font-size: 1.3rem;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    animation: emojiBurst 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes emojiBurst {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.3);
    }

    50% {
        opacity: 1;
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx) * 1.2), calc(-50% + var(--ty) * 1.5)) scale(0.6);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   CART FX PARTICLES - تأثيرات إضافة للسلة (20 نوع)
   ═══════════════════════════════════════════════════════════════════ */

.cart-fx-particle {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
}

/* 2: فقاعات صاعدة */
.fx-bubble-rise {
    font-size: 1.2rem;
    animation: fxBubbleRise 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fxBubbleRise {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.4);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, calc(-50% - 40px)) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, calc(-50% - 80px)) scale(0.7);
    }
}

/* 3: دوامة راقصة */
.fx-spiral {
    font-size: 1.2rem;
    animation: fxSpiral 0.8s ease-out forwards;
}

@keyframes fxSpiral {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(0deg) translateX(0);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(180deg) translateX(30px);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(360deg) translateX(50px) scale(0.5);
    }
}

/* 4: نبض متوهج */
.fx-glow-pulse {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid var(--primary, #d97706);
    animation: fxGlowPulse 0.6s ease-out forwards;
}

@keyframes fxGlowPulse {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.3);
        box-shadow: 0 0 10px var(--primary, #d97706);
    }

    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(2.5);
        box-shadow: 0 0 25px var(--primary, #d97706);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(4);
        box-shadow: 0 0 0 transparent;
    }
}

/* 5: مطر النجوم */
.fx-star-rain {
    font-size: 1rem;
    animation: fxStarRain 0.8s ease-in forwards;
}

@keyframes fxStarRain {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }

    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 70px)) scale(0.4);
    }
}

/* 6: موجة دائرية */
.fx-ripple {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid var(--primary, #d97706);
    animation: fxRipple 0.7s ease-out forwards;
}

@keyframes fxRipple {
    0% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(0.5);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(4);
    }
}

/* 7: قصاصات احتفال */
.fx-confetti {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: fxConfetti 0.8s ease-out forwards;
}

@keyframes fxConfetti {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: translate(calc(-50% + var(--tx) * 0.7), calc(-50% + var(--ty) * 0.7)) scale(1) rotate(var(--rot));
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty) + 20px)) scale(0.5) rotate(var(--rot));
    }
}

/* 8: شرارة ألعاب نارية */
.fx-firework {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    animation: fxFirework 0.6s ease-out forwards;
}

@keyframes fxFirework {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }

    40% {
        opacity: 1;
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx) * 1.3), calc(-50% + var(--ty) * 1.3)) scale(0.2);
    }
}

/* 9: قلوب طائرة */
.fx-hearts {
    font-size: 1.1rem;
    animation: fxHearts 1s ease-out forwards;
}

@keyframes fxHearts {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.3);
    }

    30% {
        opacity: 1;
        transform: translate(-50%, calc(-50% - 20px)) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, calc(-50% - 70px)) scale(0.6);
    }
}

/* 10: أوراق متساقطة */
.fx-leaves {
    font-size: 1.1rem;
    animation: fxLeaves 1.1s ease-in forwards;
}

@keyframes fxLeaves {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
    }

    30% {
        opacity: 1;
        transform: translate(calc(-50% + var(--sway) * 0.3), calc(-50% + 15px)) scale(1) rotate(30deg);
    }

    60% {
        opacity: 0.8;
        transform: translate(calc(-50% - var(--sway) * 0.3), calc(-50% + 40px)) scale(0.9) rotate(-20deg);
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--sway)), calc(-50% + 70px)) scale(0.6) rotate(45deg);
    }
}

/* 11: رقصة الثلج */
.fx-snow {
    font-size: 1rem;
    animation: fxSnow 1.2s ease-in forwards;
}

@keyframes fxSnow {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }

    25% {
        opacity: 1;
        transform: translate(calc(-50% + var(--drift) * 0.5), calc(-50% + 20px)) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translate(calc(-50% - var(--drift) * 0.3), calc(-50% + 40px)) scale(0.9);
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--drift)), calc(-50% + 75px)) scale(0.5);
    }
}

/* 12: وميض نيون */
.fx-neon-flash {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary, #d97706);
    animation: fxNeonFlash 0.4s ease-out forwards;
}

@keyframes fxNeonFlash {
    0% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(0.5);
        box-shadow: 0 0 20px var(--primary, #d97706), 0 0 40px var(--primary, #d97706);
    }

    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(2);
        box-shadow: 0 0 30px var(--primary, #d97706), 0 0 60px var(--primary, #d97706);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(3);
    }
}

.fx-neon-line {
    width: 2px;
    height: 25px;
    background: var(--primary, #d97706);
    transform-origin: center center;
    animation: fxNeonLine 0.4s ease-out forwards;
}

@keyframes fxNeonLine {
    0% {
        opacity: 0.8;
        transform: translate(-50%, -50%) rotate(var(--rot)) scaleY(0.3);
    }

    30% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--rot)) scaleY(1.5);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--rot)) scaleY(2.5);
    }
}

/* 13: أشكال هندسية */
.fx-geometric {
    font-size: 1rem;
    animation: fxGeometric 0.7s ease-out forwards;
}

@keyframes fxGeometric {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: translate(calc(-50% + var(--tx) * 0.7), calc(-50% + var(--ty) * 0.7)) scale(1.1) rotate(var(--rot));
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.4) rotate(var(--rot));
    }
}

/* 14: سحابة دخان */
.fx-smoke {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(120, 113, 108, 0.4);
    animation: fxSmoke 0.9s ease-out forwards;
}

@keyframes fxSmoke {
    0% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(0.5);
    }

    40% {
        opacity: 0.5;
        transform: translate(calc(-50% + 5px), calc(-50% - 25px)) scale(1.5);
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% - 5px), calc(-50% - 55px)) scale(2.5);
    }
}

/* 15: ارتداد متناثر */
.fx-bounce-scatter {
    font-size: 1.2rem;
    animation: fxBounceScatter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fxBounceScatter {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.3);
    }

    30% {
        opacity: 1;
        transform: translate(calc(-50% + var(--tx) * 0.5), calc(-50% - 50px)) scale(1.1);
    }

    60% {
        opacity: 0.8;
        transform: translate(calc(-50% + var(--tx) * 0.8), calc(-50% - 10px)) scale(0.9);
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx)), calc(-50% + 20px)) scale(0.4);
    }
}

/* 16: جذب مغناطيسي */
.fx-magnetic {
    font-size: 1.1rem;
    animation: fxMagnetic 0.6s ease-in forwards;
}

@keyframes fxMagnetic {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    70% {
        opacity: 0.8;
        transform: translate(calc(-50% + var(--tx) * 0.8), calc(-50% + var(--ty) * 0.8)) scale(0.7);
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.2);
    }
}

/* 17: تفكك بكسلي */
.fx-pixel {
    width: 8px;
    height: 8px;
    border-radius: 1px;
    animation: fxPixel 0.7s ease-out forwards;
}

@keyframes fxPixel {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translate(calc(-50% + var(--tx) * 0.6), calc(-50% + var(--ty) * 0.6)) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.3);
    }
}

/* 18: ارتداد مطاطي */
.fx-elastic {
    font-size: 1.2rem;
    animation: fxElastic 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes fxElastic {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scaleY(0.3) scaleX(1.3);
    }

    25% {
        opacity: 1;
        transform: translate(-50%, calc(-50% - 50px)) scaleY(1.4) scaleX(0.7);
    }

    50% {
        opacity: 0.9;
        transform: translate(-50%, calc(-50% - 25px)) scaleY(0.9) scaleX(1.1);
    }

    75% {
        opacity: 0.5;
        transform: translate(-50%, calc(-50% - 40px)) scaleY(1.1) scaleX(0.9);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, calc(-50% - 60px)) scale(0.5);
    }
}

/* 19: أقواس هلالية */
.fx-crescent {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary, #d97706);
    border-right-color: var(--primary, #d97706);
    animation: fxCrescent 0.7s ease-out forwards;
}

@keyframes fxCrescent {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--rot)) scale(0.3);
    }

    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) rotate(calc(var(--rot) + 180deg)) scale(2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(calc(var(--rot) + 360deg)) scale(3);
    }
}

/* 20: صاعقة برق */
.fx-lightning-flash {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(250, 204, 21, 0.5);
    animation: fxLightningFlash 0.3s ease-out forwards;
}

@keyframes fxLightningFlash {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }

    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(3);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(4);
    }
}

.fx-lightning-bolt {
    font-size: 1.8rem;
    animation: fxLightningBolt 0.5s ease-out forwards;
}

@keyframes fxLightningBolt {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.3);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, calc(-50% + 25px)) scale(1.3);
    }

    50% {
        opacity: 0.8;
        transform: translate(-50%, calc(-50% + 25px)) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 25px)) scale(0.5);
    }
}

/* احترام prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {

    .cart-fx-particle,
    .emoji-particle {
        animation-duration: 0.01s !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   FLYING ITEM - العنصر الطائر
   ═══════════════════════════════════════════════════════════════════ */

.flying-item {
    position: fixed;
    z-index: 9999;
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════
   FLOATING CART BAR - شريط السلة العائم
   ═══════════════════════════════════════════════════════════════════ */

.floating-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--modal-bg);
    padding: 14px 20px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(100%);
    transition: transform var(--transition-normal) var(--easing-smooth);
    z-index: 999;
    border-top: 1px solid var(--bg-soft);
}

.floating-cart-bar.visible {
    transform: translateY(0);
}

.floating-cart-bar.force-hidden {
    display: none !important;
}

.floating-cart-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.floating-cart-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.floating-cart-total {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.floating-cart-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-normal) var(--easing-smooth);
    box-shadow: var(--shadow-glow);
}

.floating-cart-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 24px rgba(217, 119, 6, 0.3);
}

.floating-cart-btn:active {
    transform: scale(0.98);
}

/* ═══════════════════════════════════════════════════════════════════
   MODALS - النوافذ المنبثقة
   ═══════════════════════════════════════════════════════════════════ */

.cart-modal,
.checkout-modal,
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity var(--transition-normal) var(--easing-smooth),
        visibility var(--transition-normal);
    /* إزالة الأنماط الافتراضية لعنصر dialog */
    border: none;
    padding: 0;
    margin: 0;
    max-width: 100%;
    max-height: 100%;
}

.cart-modal::backdrop,
.checkout-modal::backdrop,
.success-modal::backdrop {
    background: transparent;
}

.cart-modal.active,
.checkout-modal.active,
.success-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cart-content,
.checkout-content {
    background: var(--modal-bg);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px;
    padding-top: 32px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform var(--transition-slow) var(--easing-bounce);
    position: relative;
}

.cart-modal.active .cart-content,
.checkout-modal.active .checkout-content {
    transform: translateY(0);
}

/* Handle للسحب */
.cart-content::before,
.checkout-content::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--bg-soft);
    border-radius: 2px;
}

.success-content {
    background: var(--modal-bg);
    border-radius: var(--radius-lg);
    padding: 40px 28px;
    text-align: center;
    width: 90%;
    max-width: 380px;
    margin: auto;
    transform: scale(0.9);
    opacity: 0;
    transition:
        transform var(--transition-normal) var(--easing-bounce),
        opacity var(--transition-normal);
}

.success-modal.active .success-content {
    transform: scale(1);
    opacity: 1;
}

/* Header للـ Modal */
.cart-header,
.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--bg-soft);
}

.cart-header h3,
.checkout-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.close-cart,
.close-checkout {
    background: var(--bg-soft);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-normal) var(--easing-smooth);
}

.close-cart:hover,
.close-checkout:hover {
    background: var(--bg-main);
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* عناصر السلة */
.cart-items {
    min-height: 80px;
}

.empty-cart {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.cart-item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--bg-soft);
    transition: all var(--transition-normal);
}

/* صورة مصغرة في السلة */
.cart-item-thumb {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-muted);
}

.cart-item-thumb-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.cart-item .item-details {
    flex: 1;
    min-width: 0;
}

.cart-item .item-controls {
    flex-shrink: 0;
}

.cart-item.removing {
    opacity: 0;
    transform: translateX(100%);
}

.item-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.item-details p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.qty-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--bg-soft);
    background: white;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast) var(--easing-smooth);
    color: var(--text-secondary);
}

.qty-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.qty-btn:active {
    transform: scale(0.9);
}

.item-qty {
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Footer السلة */
.cart-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--bg-soft);
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.checkout-btn,
.confirm-btn {
    width: 100%;
    padding: 16px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal) var(--easing-smooth);
    box-shadow: var(--shadow-glow);
    font-family: inherit;
}

.checkout-btn:hover,
.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(217, 119, 6, 0.35);
}

.checkout-btn:active,
.confirm-btn:active {
    transform: translateY(0);
}

.checkout-btn:disabled,
.confirm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}


/* ═══════════════════════════════════════════════════════════════════
   LAST ORDER - الطلب السابق
   ═══════════════════════════════════════════════════════════════════ */

/* أزرار السلة */
.cart-actions {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.last-order-btn {
    width: 100%;
    padding: 14px;
    background: var(--bg-soft);
    color: var(--text-primary);
    border: 2px solid var(--bg-soft);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal) var(--easing-smooth);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.last-order-btn:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.last-order-btn:active {
    transform: scale(0.98);
}

.last-order-btn i {
    font-size: 1.1rem;
}

/* Modal الطلب السابق */
.last-order-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    border: none;
}

.last-order-modal.active {
    display: flex;
}

.last-order-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 450px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s var(--easing-smooth);
}

.last-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--bg-soft);
}

.last-order-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.last-order-header h3 i {
    color: var(--primary);
}

.close-last-order {
    background: var(--bg-soft);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-normal) var(--easing-smooth);
}

.close-last-order:hover {
    background: var(--bg-main);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.last-order-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.loading-last-order,
.no-last-order {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.no-last-order i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-last-order p {
    margin-top: 8px;
    font-size: 0.9rem;
}

/* عناصر الطلب السابق */
.last-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--bg-soft);
}

.last-order-item:last-child {
    border-bottom: none;
}

.last-order-item-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.last-order-item-details p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.last-order-item-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}

/* Footer الطلب السابق */
.last-order-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--bg-soft);
    background: var(--bg-soft);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.last-order-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.submit-last-order-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal) var(--easing-smooth);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-last-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(16, 185, 129, 0.4);
}

.submit-last-order-btn:active {
    transform: translateY(0);
}

.submit-last-order-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.submit-last-order-btn i {
    font-size: 1.2rem;
}

/* معلومات إضافية عن الطلب السابق */
.last-order-info {
    background: var(--primary-soft);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--primary-dark);
}

.last-order-info i {
    font-size: 1.1rem;
}

/* تجاوب للموبايل */
@media (max-width: 480px) {
    .cart-actions {
        gap: 10px;
    }

    .last-order-btn {
        padding: 12px;
        font-size: 0.95rem;
    }

    .last-order-content {
        max-height: 90vh;
    }

    .last-order-header,
    .last-order-body,
    .last-order-footer {
        padding: 16px 20px;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   QUANTITY MODAL - نافذة إدخال الكمية مباشرة
   ═══════════════════════════════════════════════════════════════════════════ */

.qty-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.qty-modal.active {
    opacity: 1;
    visibility: visible;
}

.qty-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.qty-modal-content {
    position: relative;
    background: white;
    padding: 28px;
    border-radius: 20px;
    min-width: 280px;
    max-width: 90vw;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.2s ease;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.qty-modal.active .qty-modal-content {
    transform: scale(1);
}

.qty-modal-content h4 {
    margin: 0 0 20px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.qty-modal-content input {
    width: 100%;
    padding: 18px;
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    border: 2px solid var(--bg-soft);
    border-radius: 14px;
    background: var(--bg-main);
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.qty-modal-content input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.qty-modal-btns {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.qty-modal-btns button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.qty-modal-btns .cancel-btn {
    background: var(--bg-soft);
    color: var(--text-secondary);
}

.qty-modal-btns .cancel-btn:hover {
    background: #e7e5e4;
}

.qty-modal-btns .confirm-btn {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

.qty-modal-btns .confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.3);
}

/* جعل الكمية قابلة للنقر */
.item-qty.clickable {
    cursor: pointer;
    padding: 8px 16px;
    background: var(--primary-soft);
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    min-width: 50px;
    display: inline-block;
}

.item-qty.clickable:hover {
    background: var(--primary-glow);
    border-color: var(--primary-light);
}

.item-qty.clickable:active {
    transform: scale(0.95);
}

.item-qty.clickable:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}


/* ═══════════════════════════════════════════════════════════════════
   🧩 Addons Modal - نافذة الإضافات
   ═══════════════════════════════════════════════════════════════════ */

.addons-modal {
    padding: 0;
    border: none;
    border-radius: var(--radius-lg, 24px);
    width: 92%;
    max-width: 440px;
    max-height: 85vh;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    background: var(--bg-card, #fff);
    overflow: hidden;
    animation: addonsModalIn 0.3s var(--easing-smooth, ease);
    margin: auto;
}

.addons-modal::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

@keyframes addonsModalIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.addons-content {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.addons-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.addons-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #1c1917);
    margin: 0;
}

.close-addons {
    background: #f3f4f6;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary, #57534e);
    transition: all 0.2s;
}

.close-addons:hover {
    background: #e5e7eb;
    color: var(--danger, #ef4444);
}

.addons-list {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.addon-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius, 16px);
    border: 2px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s var(--easing-smooth, ease);
    position: relative;
}

.addon-item:hover {
    border-color: #e5e7eb;
    background: #fafaf9;
}

.addon-item:has(:checked) {
    border-color: var(--primary, #d97706);
    background: var(--primary-soft, #fef3c7);
}

.addon-item .addon-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.addon-item-img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f5f5f4;
}

.addon-item-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: #f5f5f4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.addon-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.addon-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #1c1917);
}

.addon-item-price {
    font-size: 0.85rem;
    color: var(--primary, #d97706);
    font-weight: 600;
}

.addon-checkmark {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    color: transparent;
    font-size: 0.75rem;
}

.addon-item:has(:checked) .addon-checkmark {
    background: var(--primary, #d97706);
    border-color: var(--primary, #d97706);
    color: #fff;
}

.addons-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

.addons-footer-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.addons-no-extras-btn {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.addons-no-extras-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.4);
    background: #b91c1c;
}

.addons-no-extras-btn:active {
    transform: translateY(0);
}

.addons-total {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary, #1c1917);
}

#addonsTotalPrice {
    color: var(--primary, #d97706);
    font-size: 1.15rem;
}

.addons-confirm-btn {
    background: var(--gradient, linear-gradient(135deg, #d97706, #f59e0b));
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.addons-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.4);
}

.addons-confirm-btn:active {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════
   🧩 Cart Addon Tags - وسوم الإضافات في السلة
   ═══════════════════════════════════════════════════════════════════ */

.cart-addons-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    margin-bottom: 2px;
}

.cart-addon-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--primary-soft, #fef3c7);
    color: var(--primary-dark, #b45309);
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Responsive - Addons */
@media (max-width: 480px) {
    .addons-modal {
        width: 96%;
        max-height: 90vh;
        border-radius: 20px;
    }

    .addon-item-img,
    .addon-item-placeholder {
        width: 44px;
        height: 44px;
    }
}
