/* Cart Buttons Fix - Ensure buttons are clickable */

/* Quantity buttons styling and functionality */
.cart-item-quantity button {
    width: 30px !important;
    height: 30px !important;
    border: 1px solid #ddd !important;
    background: white !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: bold !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
    position: relative !important;
    pointer-events: auto !important;
}

.cart-item-quantity button:hover {
    background: #f5f5f5 !important;
    border-color: #4a7c59 !important;
    color: #4a7c59 !important;
}

.cart-item-quantity button:active {
    background: #4a7c59 !important;
    color: white !important;
    transform: scale(0.95) !important;
}

.cart-item-quantity button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background: #f0f0f0 !important;
}

/* Remove button styling */
.btn-remove {
    padding: 6px 12px !important;
    background: #d32f2f !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    transition: all 0.2s ease !important;
    pointer-events: auto !important;
}

.btn-remove:hover {
    background: #b71c1c !important;
    transform: translateY(-1px) !important;
}

.btn-remove:active {
    transform: translateY(0) !important;
}

/* Ensure cart item containers don't interfere */
.cart-item {
    position: relative !important;
    z-index: 1 !important;
}

.cart-item-quantity {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    z-index: 10 !important;
    position: relative !important;
}

/* Quantity display */
.cart-item-quantity span {
    min-width: 30px !important;
    text-align: center !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    user-select: none !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .cart-item-quantity button {
        width: 35px !important;
        height: 35px !important;
        font-size: 18px !important;
    }
    
    .cart-item-quantity {
        gap: 8px !important;
    }
    
    .btn-remove {
        padding: 8px 12px !important;
        font-size: 11px !important;
    }
}

/* Ensure no overlapping elements */
.cart-item * {
    pointer-events: auto !important;
}

/* Loading state */
.cart-item-quantity button.loading {
    opacity: 0.6 !important;
    cursor: wait !important;
}

.cart-item-quantity button.loading::after {
    content: '' !important;
    width: 12px !important;
    height: 12px !important;
    border: 2px solid #ccc !important;
    border-top: 2px solid #4a7c59 !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
    position: absolute !important;
}

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

/* Desktop specific fixes */
@media (min-width: 769px) {
    .cart-item-quantity button {
        width: 35px !important;
        height: 35px !important;
        font-size: 18px !important;
        font-weight: bold !important;
        border: 2px solid #ddd !important;
        background: white !important;
        color: #333 !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        z-index: 100 !important;
        position: relative !important;
        pointer-events: auto !important;
        user-select: none !important;
    }
    
    .cart-item-quantity button:hover {
        background: #4a7c59 !important;
        color: white !important;
        border-color: #4a7c59 !important;
        transform: scale(1.05) !important;
    }
    
    .cart-item-quantity button:active {
        transform: scale(0.95) !important;
        background: #3d6b4a !important;
    }
    
    .cart-item-quantity button:focus {
        outline: 2px solid #4a7c59 !important;
        outline-offset: 2px !important;
    }
    
    /* Ensure cart item doesn't interfere */
    .cart-item {
        position: relative !important;
        z-index: 1 !important;
    }
    
    .cart-item-quantity {
        z-index: 10 !important;
        position: relative !important;
    }
    
    /* Remove button desktop styling */
    .btn-remove {
        padding: 8px 16px !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        z-index: 100 !important;
        position: relative !important;
        pointer-events: auto !important;
    }
    
    .btn-remove:hover {
        background: #b71c1c !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
    }
    
    /* Specific styling for + button */
    .cart-item-quantity button:last-child,
    .cart-item-quantity button[onclick*="+"],
    .cart-item-quantity button:contains("+") {
        background: #e8f5e8 !important;
        border-color: #4a7c59 !important;
        color: #4a7c59 !important;
        font-weight: 900 !important;
    }
    
    .cart-item-quantity button:last-child:hover,
    .cart-item-quantity button[onclick*="+"]:hover {
        background: #4a7c59 !important;
        color: white !important;
        transform: scale(1.1) !important;
    }
}