/* ========================================
   ENHANCED CART SYSTEM STYLES
   Real ecommerce cart functionality
   ======================================== */

/* Select All Container */
.select-all-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.select-all-container:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.select-all-container label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    user-select: none;
}

#selection-count {
    font-size: 14px;
    color: #4a7c59;
    font-weight: 500;
}

/* Enhanced Cart Item Styles */
.cart-item.enhanced {
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-radius: 8px;
    margin-bottom: 12px;
    background: white;
}

.cart-item.enhanced.selected {
    border-color: #4a7c59;
    box-shadow: 0 2px 8px rgba(74, 124, 89, 0.15);
    background-color: #ffffff;
}

.cart-item.enhanced:not(.selected) {
    opacity: 0.6;
    background-color: #f8f9fa;
    border-color: #e0e0e0;
}

/* Cart Item Selection */
.cart-item-selection {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

.cart-item-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4a7c59;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cart-item-checkbox:hover {
    transform: scale(1.1);
}

/* Enhanced Quantity Controls */
.quantity-selector.enhanced-quantity {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 20px;
    padding: 4px;
    gap: 4px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.quantity-selector.enhanced-quantity:hover {
    border-color: #4a7c59;
    box-shadow: 0 0 0 2px rgba(74, 124, 89, 0.1);
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #4a7c59;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #4a7c59;
    color: white;
    transform: scale(1.05);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.enhanced-quantity-input {
    width: 35px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    padding: 0;
}

.enhanced-quantity-input:focus {
    outline: none;
    background: rgba(74, 124, 89, 0.1);
    border-radius: 4px;
}

/* Enhanced Remove Button */
.remove-btn.enhanced-remove-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.remove-btn.enhanced-remove-btn:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-1px);
}

/* Cart Summary Enhancements */
.cart-summary {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    position: sticky;
    top: 20px;
}

.cart-summary h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 2px solid #4a7c59;
    padding-bottom: 10px;
}

/* Mobile Responsive Enhancements */
@media (max-width: 768px) {
    .select-all-container {
        padding: 12px 16px;
        margin-bottom: 16px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .select-all-container > div:first-child {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
    }
    
    .select-all-container label {
        font-size: 15px;
    }
    
    #selection-count {
        font-size: 13px;
        align-self: flex-end;
    }
    
    .cart-item.enhanced {
        padding-left: 45px;
        margin-bottom: 8px;
    }
    
    .cart-item-selection {
        top: 10px;
        left: 10px;
    }
    
    .cart-item-checkbox {
        width: 18px;
        height: 18px;
    }
    
    .quantity-btn {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
    
    .enhanced-quantity-input {
        width: 32px;
        font-size: 12px;
    }
    
    .cart-summary {
        display: none; /* Hidden on mobile, use sticky bar instead */
    }
}

@media (max-width: 480px) {
    .select-all-container {
        padding: 10px 12px;
    }
    
    .cart-item.enhanced {
        padding-left: 40px;
    }
    
    .cart-item-selection {
        top: 8px;
        left: 8px;
    }
    
    .cart-item-checkbox {
        width: 16px;
        height: 16px;
    }
    
    .quantity-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .enhanced-quantity-input {
        width: 30px;
        font-size: 11px;
    }
}

/* Animation for item removal */
.cart-item.removing {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(-100%);
        height: 0;
        padding: 0;
        margin: 0;
    }
}

/* Enhanced Mobile Sticky Bar - DISABLED */
/*
.mobile-cart-total-bar {
    background: white;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: fixed;
    bottom: 70px; /* Above bottom navigation */
    left: 0;
    right: 0;
*/
    z-index: 1001; /* Higher than bottom nav */
    padding: 16px;
}

.cart-total-items {
    font-size: 14px;
    color: #4a7c59;
    font-weight: 600;
}

.cart-total-price {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.cart-total-savings {
    font-size: 12px;
    color: #4caf50;
    font-weight: 500;
}

/* Checkout Button Enhancements */
.checkout-btn-mobile {
    width: 100%;
    background: linear-gradient(135deg, #4a7c59 0%, #3d6b4a 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(74, 124, 89, 0.3);
}

.checkout-btn-mobile:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.4);
}

.checkout-btn-mobile:active:not(:disabled) {
    transform: translateY(0);
}

.checkout-btn-mobile:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

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

.cart-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #4a7c59;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Desktop Enhancements */
@media (min-width: 769px) {
    .cart-item.enhanced {
        padding: 20px;
        margin-bottom: 16px;
    }
    
    .cart-item-selection {
        top: 16px;
        left: 16px;
    }
    
    .quantity-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .enhanced-quantity-input {
        width: 40px;
        font-size: 14px;
    }
}