/* Cart Popup Styles */
.cart-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: none;
    overflow: hidden;
    flex-direction: column;
}

.cart-popup.show {
    display: flex;
    animation: popupSlideIn 0.3s ease-out;
}

.cart-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

.cart-popup-overlay.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.cart-popup-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    flex-shrink: 0;
}

.cart-popup-header h5 {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.cart-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cart-close-btn:hover {
    background: #e9ecef;
    color: #333;
}

.cart-popup-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.cart-popup-footer {
    padding: 20px;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #f8f9fa;
    flex-shrink: 0;
}

/* Animations */
@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cart-popup {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .cart-popup-header,
    .cart-popup-footer {
        padding: 15px;
    }
    
    .cart-popup-body {
        padding: 15px;
        max-height: none;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .cart-popup-footer {
        flex-direction: column;
    }
    
    .cart-popup-footer .btn {
        width: 100%;
        margin-bottom: 5px;
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    
    /* Cart item mobile adjustments */
    .cart-item {
        padding: 10px 0;
    }
    
    .cart-item img {
        width: 50px;
        height: 50px;
    }
    
    .cart-item-details h6 {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .cart-item-details small {
        font-size: 0.8rem;
    }
    
    .quantity-controls {
        gap: 0.25rem;
    }
    
    .quantity-controls button {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .quantity-controls input {
        width: 40px;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .cart-popup {
        width: 98%;
        max-height: 98vh;
        margin: 5px;
    }
    
    .cart-popup-header h5 {
        font-size: 1rem;
    }
    
    .cart-popup-body {
        padding: 10px;
    }
    
    .cart-popup-header,
    .cart-popup-footer {
        padding: 10px;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cart-item img {
        width: 40px;
        height: 40px;
    }
    
    .cart-item-details {
        width: 100%;
    }
    
    .cart-item-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

/* Cart Items Styling */
.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

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

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #007bff;
    font-weight: 500;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.quantity-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #e9ecef;
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 5px;
}

.remove-item-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.remove-item-btn:hover {
    background: #c82333;
}