/* ========== CART POPUP - SLIDE DOWN ========== */
.cart-popup {
    position: fixed;
    top: 100px;
    left: 50%;
    right: auto;
    transform: translate(-50%, -32px);
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    border-bottom: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 1.5rem 1.5rem 1.2rem 1.5rem;
    min-height: 120px;
    max-width: 420px;
    width: 95vw;
    margin-top: 0;
    box-shadow: 0 12px 32px rgba(79,70,229,0.15), 0 2px 8px rgba(0,0,0,0.07);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1500;
    backdrop-filter: blur(12px);
    border-top: 4px solid #6366f1;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cart-popup.active {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
    animation: cart-popup-bounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cart-popup-bounce {
    0% {
        transform: translate(-50%, -32px);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, 5px);
    }
    100% {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.cart-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(255, 255, 255, 0.95) 100%);
    z-index: -1;
}

.cart-popup-container {
    max-width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1.2rem;
    background: none;
    box-shadow: none;
    padding: 0;
    flex: 1;
}

.cart-popup-left {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-popup-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: flex-end;
    min-width: 180px;
}

.cart-summary {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #4f46e5;
    margin-bottom: 0.5rem;
}
.cart-total-label {
    color: #374151;
    font-size: 1rem;
    font-weight: 500;
}
.cart-total-value {
    color: #10b981;
    font-size: 1.2rem;
    font-weight: 700;
}
.cart-item-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-height: 60px;
    padding: 0.7rem 0.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(102,126,234,0.07);
}
.cart-item-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-height: 60px;
    padding: 0.7rem 0.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(102,126,234,0.07);
}

.cart-popup h4 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    padding-bottom: 0.75rem;
}

.cart-popup h4::before {
    content: '🛒';
    font-size: 1.3rem;
}

.cart-items {
    flex: 1;
    color: #6b7280;
    font-size: 0.95rem;
    text-align: center;
    padding: 0.75rem 1rem;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.cart-items p {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 500;
}

.cart-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
    margin-top: 1.2rem;
    justify-content: space-between;
}

.btn-checkout {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    padding: 0.7rem 1.4rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    font-size: 0.95rem;
    white-space: nowrap;
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-checkout:hover {
    background: linear-gradient(135deg, #4338ca, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-checkout::after {
    content: '→';
    font-size: 1.1rem;
    margin-left: 0.2rem;
}

.cart-close {
    background: rgba(243, 244, 246, 0.8);
    color: #4b5563;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    flex-shrink: 0;
}
.cart-close:hover {
    background: #e5e7eb;
    color: #374151;
    transform: translateY(-2px);
}

/* Animasi slide down dari bawah header */
@keyframes slideDownFromHeader {
    from {
        transform: translate(-50%, 32px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideUpToHeader {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }
    to {
        transform: translate(-50%, 32px);
        opacity: 0;
    }
}

.cart-popup.slide-in {
    animation: slideDownFromHeader 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.cart-popup.slide-out {
    animation: slideUpToHeader 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Dark mode for cart popup */
[data-theme="dark"] .cart-popup {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    border-bottom-color: #334155;
    border-top-color: #6366f1;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .cart-popup::before {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(30, 41, 59, 0.95) 100%);
}

[data-theme="dark"] .cart-popup h4 {
    color: #f1f5f9;
}

[data-theme="dark"] .cart-popup-container {
    background: none;
}

[data-theme="dark"] .cart-items {
    background-color: rgba(51, 65, 85, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #cbd5e1;
}

[data-theme="dark"] .cart-items p {
    color: #e2e8f0;
}

[data-theme="dark"] .btn-checkout {
    background: linear-gradient(135deg, #4338ca, #6366f1);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #4338ca, #7c3aed);
}

[data-theme="dark"] .cart-close {
    background: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .cart-close:hover {
    background: #475569;
    color: #f1f5f9;
}

/* Responsive design untuk cart popup */
@media (max-width: 768px) {
    .cart-popup {
        padding: 1.2rem 1rem;
        top: 60px;
        transform: translateY(-20px);
    }
    
    .cart-popup-container {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
    }
    
    .cart-popup h4 {
        font-size: 1.1rem;
    }
    
    .cart-items {
        padding: 0;
    }
    
    .cart-actions {
        width: 100%;
        justify-content: center;
        gap: 1rem;
    }
    
    .btn-checkout {
        flex: 1;
        max-width: 180px;
    }
    
    @keyframes slideDownFromHeader {
        from {
            transform: translateY(-20px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    @keyframes slideUpToHeader {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(-20px);
            opacity: 0;
        }
    }
}

@media (max-width: 480px) {
    .cart-popup {
        padding: 1rem;
        top: 60px;
        transform: translateY(-20px);
    }
    
    .cart-popup h4 {
        font-size: 1rem;
    }
    
    .cart-popup h4::before {
        font-size: 1.1rem;
    }
    
    .btn-checkout {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .cart-close {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    @keyframes slideDownFromHeader {
        from {
            transform: translateY(-20px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    @keyframes slideUpToHeader {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(-20px);
            opacity: 0;
        }
    }
}