/* Floating Cart Widget */
#ew-floating-cart {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #f68b1e;
    /* Jumia Orange */
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(246, 139, 30, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

#ew-floating-cart.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

#ew-floating-cart:hover {
    transform: scale(1.1);
}

#ew-floating-cart .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

#ew-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    /* Red badge */
    color: white;
    font-size: 13px;
    font-weight: bold;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Animations */
@keyframes pulse-cart {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

#ew-floating-cart.pulse {
    animation: pulse-cart 0.4s ease;
}

/* Toast Notifications */
.ew-toast {
    position: fixed;
    bottom: 90px;
    right: 20px;
    /* Aligned with cart */
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    font-weight: 500;
}

.ew-toast-success {
    background: #10B981;
    /* Green */
}

.ew-toast-warning {
    background: #F59E0B;
    /* Orange/Yellow */
    color: #fff;
}

.ew-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    #ew-floating-cart {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }

    .ew-toast {
        left: 20px;
        right: 20px;
        bottom: 80px;
        text-align: center;
    }
}

/* =========================================
   CART SIDEBAR DRAWER (Panier Latéral)
   ========================================= */

/* Overlay */
.ew-cart-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ew-cart-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Container */
.ew-cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #ffffff;
    z-index: 999101;
    transition: right 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
}

.ew-cart-sidebar.open {
    right: 0;
}

/* Header */
.ew-cart-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.ew-cart-sidebar-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ew-cart-sidebar-header .dashicons {
    color: #10B981;
}

.ew-cart-sidebar-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s;
}

.ew-cart-sidebar-close:hover {
    color: #EF4444;
}

/* Body / Items */
.ew-cart-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ew-cart-sidebar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    text-align: center;
}

.ew-cart-sidebar-empty .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    color: #e5e7eb;
}

/* Quantity Controls in Sidebar */
.ew-quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 20px;
}

.ew-quantity-controls button {
    background: none;
    border: none;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: #4b5563 !important;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.ew-quantity-controls .ew-qty-plus {
    color: #10B981 !important;
}

.ew-quantity-controls .ew-qty-minus:hover,
.ew-quantity-controls .ew-qty-plus:hover {
    transform: scale(1.2);
}

.ew-quantity-controls .ew-qty-value {
    font-size: 13px;
    font-weight: 700;
    min-width: 15px;
    text-align: center;
    color: #1f2937;
}

/* Footer / Actions */
.ew-cart-sidebar-footer {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.ew-cart-sidebar-summary {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.ew-cart-sidebar-total-price {
    color: #10B981;
}

.ew-cart-sidebar-checkout-btn {
    width: 100%;
    background: #10B981;
    color: #ffffff;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.ew-cart-sidebar-checkout-btn:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .ew-cart-sidebar {
        width: 100%;
        right: -100%;
    }
}