/* ========================================
   SELECTIVE CHECKOUT STYLES
   Mobile cart item selection 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);
}

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

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

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

.cart-item-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4a7c59;
    border-radius: 4px;
    border: 2px solid #4a7c59;
}

/* Cart Item Selection States */
.cart-item.selection-enabled {
    position: relative;
    padding-left: 40px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-radius: 8px;
}

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

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

/* Mobile Specific Styles */
@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;
    }
    
    #selected-count {
        font-size: 13px;
        align-self: flex-end;
    }
    
    .cart-item-selection {
        top: 6px;
        left: 6px;
    }
    
    .cart-item-checkbox {
        width: 18px;
        height: 18px;
    }
    
    .cart-item.selection-enabled {
        padding-left: 35px;
        margin-bottom: 12px;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .select-all-container {
        padding: 10px 12px;
    }
    
    .select-all-container label {
        font-size: 14px;
    }
    
    #selected-count {
        font-size: 12px;
    }
    
    .cart-item-checkbox {
        width: 16px;
        height: 16px;
    }
    
    .cart-item.selection-enabled {
        padding-left: 32px;
    }
}

/* Checkout Button States */
.checkout-btn-mobile:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background-color: #ccc !important;
}

.checkout-btn-mobile:not(:disabled) {
    opacity: 1;
    cursor: pointer;
    background-color: #4a7c59;
}

/* Selection Animation */
.cart-item.selection-enabled {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Checkbox Custom Styling */
.cart-item-checkbox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: white;
    border: 2px solid #4a7c59;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.cart-item-checkbox:checked {
    background-color: #4a7c59;
    border-color: #4a7c59;
}

.cart-item-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.cart-item-checkbox:hover {
    border-color: #3d6b4a;
    box-shadow: 0 0 0 2px rgba(74, 124, 89, 0.2);
}

/* Select All Checkbox Custom Styling */
#select-all-toggle {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: white;
    border: 2px solid #4a7c59;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

#select-all-toggle:checked {
    background-color: #4a7c59;
    border-color: #4a7c59;
}

#select-all-toggle:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

#select-all-toggle:indeterminate {
    background-color: #4a7c59;
    border-color: #4a7c59;
}

#select-all-toggle:indeterminate::after {
    content: '−';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

#select-all-toggle:hover {
    border-color: #3d6b4a;
    box-shadow: 0 0 0 2px rgba(74, 124, 89, 0.2);
}

/* Mobile Total Bar Updates - DISABLED */
/*
.mobile-cart-total-bar {
    background: white;
    border-top: 1px solid #e0e0e0;
*/
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

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

/* Responsive Adjustments */
@media (max-width: 360px) {
    .select-all-container {
        padding: 8px 10px;
    }
    
    .cart-item-checkbox,
    #select-all-toggle {
        width: 14px;
        height: 14px;
    }
    
    .cart-item-checkbox:checked::after,
    #select-all-toggle:checked::after {
        font-size: 10px;
    }
    
    .cart-item.selection-enabled {
        padding-left: 28px;
    }
}