/* Shopping Cart Styles */

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    line-height: 1;
}

/* Cart Button */
.cart-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.cart-sidebar.show {
    visibility: visible;
    opacity: 1;
}

.cart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.cart-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.cart-sidebar.show .cart-content {
    transform: translateX(0);
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.cart-close:hover {
    background: #f8f9fa;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-cart-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Cart Items */
.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

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

.cart-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-price {
    font-weight: 600;
    color: #28a745;
    margin: 0.25rem 0;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.cart-qty {
    min-width: 30px;
    text-align: center;
    font-weight: 500;
}

/* Cart Total */
.cart-total {
    margin-bottom: 1rem;
}

.total-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: #28a745;
    text-align: center;
}

/* Cart Actions */
.cart-actions {
    display: flex;
    gap: 0.5rem;
}

.cart-actions .btn {
    flex: 1;
}

/* Add to Cart Button */
.add-to-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.add-to-cart-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.add-to-cart-btn.added {
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-weight: 500;
}

.cart-notification.show {
    transform: translateX(0);
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .cart-content {
        max-width: 100%;
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .cart-item-controls {
        flex-wrap: wrap;
    }
    
    .cart-notification {
        left: 20px;
        right: 20px;
        transform: translateY(-100%);
    }
    
    .cart-notification.show {
        transform: translateY(0);
    }
}

/* Utility classes for cart integration */
.position-relative {
    position: relative !important;
}

/* Cart button hover effects */
.btn:hover .cart-badge {
    transform: scale(1.1);
}

/* Loading states */
.cart-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.cart-item-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
